/* ABOUTME: Base styles using Open Props */
/* ABOUTME: Defines semantic CSS variables for theming */

@import "https://unpkg.com/open-props";
@import "https://unpkg.com/open-props/colors-hsl";

/* Fonts - Fraunces for headings (warm serif), Source Sans for body */
@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Source+Sans+3:wght@400;500;600&display=swap");

:root {
    /* Colors - using open-props HSL for composability */
    --color-primary: hsl(var(--pink-3-hsl) / 30%);
    --color-primary-hover: hsl(var(--pink-3-hsl) / 69%);
    --color-secondary: hsl(var(--green-8-hsl) / 70%);
    --color-accent: hsl(var(--orange-4-hsl));
    --color-background: hsl(var(--yellow-3-hsl) / 20%);
    --color-surface: var(--gray-0);
    --color-surface-alt: hsl(var(--sand-2-hsl) / 50%);
    --color-text: var(--stone-9);
    --color-text-muted: var(--stone-6);
    --color-border: var(--stone-3);
    --color-link: var(--blue-7);
    --color-link-hover: var(--blue-9);
    --color-success: var(--green-7);
    --color-error: var(--red-6);
    --color-highlight: hsl(var(--yellow-3-hsl) / 69%);

    /* Spacing - mapping to open-props sizes */
    --space-xs: var(--size-1);
    --space-sm: var(--size-2);
    --space-md: var(--size-3);
    --space-lg: var(--size-5);
    --space-xl: var(--size-7);

    /* Layout widths - rem-based for UI layouts (not reading widths) */
    --max-width-content: 56rem;
    --max-width-narrow: 36rem;

    /* Typography */
    --font-heading: "Fraunces", Georgia, serif;
    --font-body: "Source Sans 3", system-ui, sans-serif;

    /* Border radius - subtle rounding */
    --radius-sm: var(--radius-1);
    --radius-md: var(--radius-2);
    --radius-lg: var(--radius-2);
    --radius-pill: var(--radius-round);

    /* Shadows - using open-props with custom color tint */
    --shadow-sm: var(--shadow-1);
    --shadow-md: var(--shadow-3);
    --shadow-lg: var(--shadow-5);

    /* Easing */
    --ease-out: var(--ease-out-3);
    --ease-in-out: var(--ease-in-out-2);
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-primary: var(--orange-5);
        --color-primary-hover: var(--orange-4);
        --color-secondary: var(--green-5);
        --color-accent: var(--orange-5);
        --color-background: var(--stone-11);
        --color-surface: var(--stone-10);
        --color-surface-alt: var(--stone-9);
        --color-text: var(--stone-1);
        --color-text-muted: var(--stone-5);
        --color-border: var(--stone-8);
        --color-link: var(--orange-5);
        --color-link-hover: var(--orange-4);
        --color-success: var(--green-5);
        --color-error: var(--red-5);
    }
}

body {
    font-family: var(--font-body);
    background: var(--color-background);
    color: var(--color-text);
    line-height: var(--font-lineheight-3);
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-6);
    line-height: var(--font-lineheight-1);
    color: var(--color-text);
}

h1 {
    font-size: var(--font-size-5);
    margin-bottom: var(--space-lg);
}

h2 {
    font-size: var(--font-size-4);
    margin-bottom: var(--space-md);
}

.container {
    max-width: var(--max-width-content);
    margin-inline: auto;
    padding-inline: var(--space-lg);
    padding-block: var(--space-md);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container--narrow {
    max-width: var(--max-width-narrow);
}

/* Content wrapper for forms and focused content within full-width container */
.content-narrow {
    max-inline-size: var(--max-width-narrow);
}

/* Links */
a {
    color: var(--color-link);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--color-link-hover);
}

mark {
    background-color: var(--color-highlight);
    padding: 0.125rem 0.25rem;
    border-radius: var(--radius-sm);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--size-2) var(--size-4);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: var(--font-size-1);
    font-weight: var(--font-weight-6);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    text-decoration: none;
}

.btn--primary {
    background: var(--color-primary);
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
    background: var(--color-primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn--secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn--secondary:hover {
    background: var(--color-surface-alt);
    border-color: var(--color-text-muted);
}

.btn--danger {
    background: var(--color-error);
    color: white;
}

.btn--danger:hover {
    filter: brightness(0.9);
}

.btn--small {
    padding: var(--size-1) var(--size-2);
    font-size: var(--font-size-0);
}

.btn--icon {
    padding: var(--size-2);
    border-radius: var(--radius-sm);
}

/* Forms */
.form-group {
    margin-bottom: var(--size-4);
}

.form-group label {
    display: block;
    margin-bottom: var(--size-1);
    font-weight: var(--font-weight-5);
    font-size: var(--font-size-1);
    color: var(--color-text);
}

input[type="text"],
input[type="url"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: var(--size-2) var(--size-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: var(--font-size-1);
    transition:
        border-color 0.15s var(--ease-out),
        box-shadow 0.15s var(--ease-out);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(196, 112, 75, 0.15);
}

input::placeholder,
textarea::placeholder {
    color: var(--color-text-muted);
    opacity: 0.7;
}

/* Checkbox styling */
input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: var(--color-primary);
    margin-right: 0.5rem;
    vertical-align: middle;
}

.form-hint {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin-top: 0.375rem;
    line-height: 1.5;
}

/* Cards */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--size-4);
    box-shadow: var(--shadow-sm);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: var(--space-xl);
}

.header__logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header__logo::before {
    content: "";
    display: inline-block;
    width: 28px;
    height: 28px;
    background: url("/public/logo.svg") no-repeat center / contain;
}

.header__logo:hover {
    color: var(--color-primary);
}

.header__nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header__nav a {
    font-weight: 500;
    font-size: 0.9375rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

th,
td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

th {
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    background: var(--color-surface-alt);
}

tbody tr:last-child td {
    border-bottom: none;
}

.td--action {
    width: 1%;
    white-space: nowrap;
    text-align: center;
}

.remove-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    cursor: pointer;
}

.remove-link:hover {
    color: var(--color-error);
}

.remove-link input:checked + * {
    color: var(--color-error);
}

.tr--new {
    background: var(--color-surface-alt);
}

.tr--new td {
    border-bottom: none;
}

/* Textarea */
textarea {
    min-height: 6rem;
    resize: vertical;
}

/* Public URL display */
.public-url {
    margin-bottom: 1.5rem;
    background: var(--color-surface-alt);
    border-color: var(--color-accent);
}

.public-url__row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

.public-url__input {
    flex: 1;
    font-family: monospace;
    font-size: 0.875rem;
}

/* ========================================
   Dashboard Styles
   ======================================== */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.dashboard-header h1 {
    margin-bottom: 0.25rem;
}

.dashboard-subtitle {
    color: var(--color-text-muted);
    font-size: 1.0625rem;
    margin: 0;
}

/* Link List Cards */
.list-grid {
    display: grid;
    gap: 1rem;
}

.list-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--size-4) var(--size-5);
    display: flex;
    align-items: center;
    gap: var(--size-4);
    transition: all 0.2s var(--ease-out);
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
}

.list-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.list-card__icon {
    width: var(--size-9);
    height: var(--size-9);
    border-radius: var(--radius-md);
    background: linear-gradient(
        135deg,
        var(--color-accent) 0%,
        var(--color-primary) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    font-weight: var(--font-weight-7);
    font-size: var(--font-size-3);
    font-family: var(--font-heading);
}

.list-card__content {
    flex: 1;
    min-width: 0;
}

.list-card__name {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--color-text);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.list-card__meta {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.list-card__badge {
    display: inline-flex;
    align-items: center;
    gap: var(--size-1);
    padding: var(--size-1) var(--size-2);
    border-radius: var(--radius-pill);
    font-size: var(--font-size-00);
    font-weight: var(--font-weight-5);
    text-transform: uppercase;
    letter-spacing: var(--font-letterspacing-2);
}

.list-card__badge--public {
    background: hsl(var(--green-7-hsl) / 15%);
    color: var(--color-success);
}

.list-card__badge--private {
    background: hsl(var(--stone-6-hsl) / 15%);
    color: var(--color-text-muted);
}

.list-card__arrow {
    color: var(--color-text-muted);
    transition: transform 0.2s var(--ease-out);
}

.list-card:hover .list-card__arrow {
    transform: translateX(4px);
    color: var(--color-primary);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: var(--size-10) var(--size-6);
    background: var(--color-surface);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
}

.empty-state__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    background: var(--color-surface-alt);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.empty-state h2 {
    font-family: var(--font-heading);
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    max-width: 28ch;
    margin-inline: auto;
}

.empty-state--compact {
    padding: 1.5rem;
    border-width: 1px;
    border-style: dashed;
}

.empty-state--compact p {
    margin-bottom: 0;
    max-width: none;
}

/* Dashboard sections */
.dashboard-section {
    margin-bottom: 2.5rem;
}

.dashboard-section:last-child {
    margin-bottom: 0;
}

.dashboard-section .section-header {
    margin-bottom: 1rem;
}

.dashboard-section .section-header h2 {
    font-size: 1.25rem;
}

/* Ring icon variant */
.list-card__icon--ring {
    border-radius: 50%;
}

/* Page intro for dashboard */
.page-intro {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.page-intro h1 {
    margin-bottom: 0.5rem;
}

.page-intro p {
    color: var(--color-text-muted);
    font-size: 1.0625rem;
    margin: 0;
}

.page-intro__actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Actions row */
.actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.list-count {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
}

/* ========================================
   Home Page
   ======================================== */

.hero {
    text-align: center;
    padding: 3rem 0 4rem;
    max-width: 36rem;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.75rem;
    margin-bottom: 1rem;
}

.hero__subtitle {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.hero__actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Use Cases Section */
.use-cases {
    margin-top: var(--size-7);
    display: grid;
    gap: 1.25rem;
}

.use-cases h2 {
    text-align: center;
    margin-bottom: 0.75rem;
}

.use-case {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition:
        box-shadow 0.2s var(--ease-out),
        transform 0.2s var(--ease-out);
}

.use-case:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.use-case__icon {
    font-size: 1.5rem;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    background: var(--color-surface-alt);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

.use-case__content {
    align-self: start;
}

.use-case__content h3 {
    font-size: 1.125rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
}

.use-case__content p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.why-pds {
    text-align: center;
    max-width: 36rem;
    margin-inline: auto;
    margin-top: 3rem;
}

.why-pds p {
    color: var(--color-text-muted);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.why-pds p:last-child {
    margin-bottom: 0;
}

.home-section {
    margin-top: 3rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    margin-bottom: 0;
}

/* ========================================
   Explore Page
   ======================================== */

.explore-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.explore-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    transition: all 0.15s ease;
}

.explore-tab:hover {
    color: var(--color-text);
    border-color: var(--color-text-muted);
}

.explore-tab--active {
    color: var(--color-text);
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.explore-tab--active:hover {
    border-color: var(--color-primary);
}

.explore-tab__count {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.explore-tab--active .explore-tab__count {
    background: rgba(0, 0, 0, 0.15);
}

.explore-stats {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.pagination__info {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.pagination__links {
    display: flex;
    gap: 0.5rem;
}

/* ========================================
   Link Cards (Public List View)
   ======================================== */

.list-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.list-description {
    color: var(--color-text-muted);
    font-size: 1.0625rem;
    margin: 0.5rem 0;
}

.list-author {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    margin: 0;
}

.list-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.link-cards {
    display: grid;
    gap: 1rem;
}

.link-card {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
}

.link-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.link-card__image {
    width: 100%;
    aspect-ratio: 1.91 / 1;
    overflow: hidden;
    background: var(--color-surface-alt);
}

.link-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.link-card__content {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.link-card__title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.0625rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.3;
}

.link-card__favicon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border-radius: 2px;
}

.link-card__description {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-card__url {
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    opacity: 0.8;
}

/* Grid layout for cards with images */
@media (min-width: 640px) {
    .link-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .link-card--has-image {
        grid-column: span 1;
    }

    /* Cards without images can span full width for better text display */
    .link-card:not(.link-card--has-image) {
        flex-direction: row;
        align-items: center;
    }

    .link-card:not(.link-card--has-image) .link-card__content {
        padding: 1rem 1.25rem;
    }
}

/* Embed page styles */
.embed-options {
    margin-bottom: var(--space-lg);
}

.embed-options h2 {
    font-size: 1rem;
    margin-bottom: var(--space-sm);
}

.option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
}

.option-row label {
    font-weight: 500;
}

.option-row select {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 0.9375rem;
}

.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
}

.checkbox-row:last-child {
    border-bottom: none;
}

.checkbox-row input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
}

.checkbox-row span {
    font-weight: 500;
}

.checkbox-row small {
    flex-basis: 100%;
    margin-left: 1.75rem;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.embed-preview {
    margin-bottom: var(--space-lg);
}

.embed-preview h2 {
    font-size: 1rem;
    margin-bottom: var(--space-sm);
}

#preview-container {
    background: #faf7f2;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
}

.embed-code h2 {
    font-size: 1rem;
    margin-bottom: var(--space-xs);
}

.embed-code p {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    margin-bottom: var(--space-sm);
}

.code-block {
    position: relative;
    background: hsl(var(--blue-3-hsl) / 50%);
    color: var(--color-text);
    border-radius: 8px;
    overflow: hidden;
}

.code-block pre {
    padding: 1rem;
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
}

.code-block .btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

.subtitle {
    color: var(--color-text-muted);
    font-size: 1.0625rem;
    margin-top: -0.5rem;
    margin-bottom: var(--space-lg);
}

/* Danger zone */
.divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: var(--space-xl) 0;
}

.danger-zone {
    margin-top: var(--space-lg);
}

.danger-zone summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--color-error);
    padding: 0.5rem 0;
}

.danger-zone summary:hover {
    text-decoration: underline;
}

.danger-zone p {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    margin: 0.5rem 0 1rem;
}

.form-actions {
    margin-top: var(--space-lg);
}

/* Styling guide */
.styling-guide {
    margin: var(--space-lg) 0;
}

.styling-guide summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem 0;
}

.styling-guide summary:hover {
    color: var(--color-primary);
}

.styling-guide h3 {
    font-size: 0.9375rem;
    margin: 1.25rem 0 0.5rem;
    font-family: var(--font-body);
}

.styling-guide p {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.styling-guide code {
    background: var(--color-surface-alt);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.code-example {
    background: hsl(var(--blue-3-hsl) / 50%);
    color: var(--color-text);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
    overflow-x: auto;
    margin: 0.5rem 0 1rem;
}

/* ========================================
   Footer
   ======================================== */

main {
    flex: 1;
}

.footer {
    margin-top: 3rem;
    padding: 2rem 0;
    border-top: 1px solid var(--color-border);
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.footer p {
    margin: 0.25rem 0;
}

.footer a {
    color: var(--color-text-muted);
}

.footer a:hover {
    color: var(--color-primary);
}

/* ========================================
   About Page
   ======================================== */

.about-content {
    max-width: 36rem;
    margin: 0 auto;
}

.about-content h1 {
    text-align: center;
    margin-bottom: 2rem;
}

.about-content p {
    font-size: 1.0625rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.about-content p:last-child {
    margin-bottom: 0;
}

.about-highlight {
    background: var(--color-surface-alt);
    border-left: 3px solid var(--color-primary);
    padding: 1rem 1.25rem;
    border-radius: 0 8px 8px 0;
    margin: 1.5rem 0;
    font-style: italic;
}

/* ========================================
   User Profile Page
   ======================================== */

.profile-header {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--color-surface-alt);
}

.profile-avatar--placeholder {
    background: linear-gradient(
        135deg,
        var(--color-accent),
        var(--color-primary)
    );
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-size: 1.75rem;
    margin: 0 0 0.25rem;
    line-height: 1.2;
}

.profile-handle {
    color: var(--color-text-muted);
    font-size: 1rem;
    margin: 0 0 0.75rem;
}

.profile-bio {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
}

.profile-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.profile-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--color-link);
    padding: 0.25rem 0.625rem;
    background: var(--color-surface-alt);
    border-radius: 9999px;
    transition: background 0.15s ease;
}

.profile-link:hover {
    background: var(--color-border);
}

.profile-link--bsky::before {
    content: "🦋";
    font-size: 0.75rem;
}

@media (max-width: 480px) {
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-links {
        justify-content: center;
    }
}

/* ========================================
   Public Webring Page
   ======================================== */

.webring-page {
    max-width: 36rem;
    margin: 0 auto;
}

.webring-header {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.webring-badge {
    flex-shrink: 0;
}

.webring-badge__button {
    display: block;
    border: 3px solid var(--color-surface);
    box-shadow:
        0 2px 8px rgba(45, 42, 38, 0.15),
        0 0 0 1px var(--color-border);
    border-radius: 4px;
    image-rendering: pixelated;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.webring-badge__button:hover {
    transform: scale(1.05) rotate(-1deg);
    box-shadow:
        0 4px 16px rgba(45, 42, 38, 0.2),
        0 0 0 1px var(--color-primary);
}

.webring-badge__placeholder {
    width: 88px;
    height: 31px;
    background: linear-gradient(
        135deg,
        var(--color-surface-alt),
        var(--color-surface)
    );
    border: 2px dashed var(--color-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.webring-header__text {
    flex: 1;
    min-width: 0;
}

.webring-header__text h1 {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
    line-height: 1.2;
}

.webring-header__desc {
    color: var(--color-text-muted);
    font-size: 1rem;
    margin: 0 0 0.5rem;
    line-height: 1.5;
}

.webring-header__author {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin: 0;
}

/* Ring Visual - decorative element */
.webring-ring-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0 1.5rem;
    margin-bottom: 0.5rem;
}

.webring-ring-visual__label {
    background: var(--color-surface-alt);
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 9999px;
}

/* Member Cards */
.webring-members {
    position: relative;
}

.webring-members__track {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.webring-member {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.webring-member:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
    background: var(--color-surface);
}

.webring-member__index {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        135deg,
        var(--color-accent),
        var(--color-primary)
    );
    color: var(--color-text);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.875rem;
    border-radius: 50%;
}

.webring-member__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.webring-member__name {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.0625rem;
    color: var(--color-text);
    line-height: 1.3;
}

.webring-member__desc {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.webring-member__url {
    color: var(--color-text-muted);
    font-size: 0.75rem;
    opacity: 0.7;
}

.webring-member__arrow {
    flex-shrink: 0;
    color: var(--color-text-muted);
    font-size: 1.25rem;
    transition:
        transform 0.2s ease,
        color 0.2s ease;
}

.webring-member:hover .webring-member__arrow {
    transform: translateX(4px);
    color: var(--color-primary);
}

/* Connector between members */
.webring-connector {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0;
    position: relative;
}

.webring-connector::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: repeating-linear-gradient(
        to bottom,
        var(--color-border) 0px,
        var(--color-border) 4px,
        transparent 4px,
        transparent 8px
    );
}

.webring-connector span {
    position: relative;
    z-index: 1;
    background: var(--color-background);
    padding: 0.25rem;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    opacity: 0.6;
}

/* Loop indicator */
.webring-loop {
    display: flex;
    justify-content: center;
    padding: 1rem 0;
    margin-top: 0.5rem;
}

.webring-loop span {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    background: var(--color-surface-alt);
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-style: italic;
}

/* Footer */
.webring-footer {
    text-align: center;
    margin-top: 2rem;
}

.webring-footer__link {
    font-weight: 500;
    font-size: 0.9375rem;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .webring-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .webring-header__text h1 {
        font-size: 1.5rem;
    }

    .webring-member {
        padding: 0.875rem 1rem;
    }

    .webring-member__index {
        width: 28px;
        height: 28px;
        font-size: 0.8125rem;
    }
}

/* CSS Reference */
.css-reference {
    margin-top: var(--space-sm);
    font-size: 0.875rem;
}

.css-reference summary {
    cursor: pointer;
    color: var(--color-text-muted);
    user-select: none;
}

.css-reference summary:hover {
    color: var(--color-text);
}

.css-reference__content {
    margin-top: var(--space-sm);
    padding: var(--space-md);
    background: var(--color-surface-alt);
    border-radius: var(--radius-2);
}

.css-reference__content h4 {
    margin: var(--space-md) 0 var(--space-xs) 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.css-reference__content h4:first-child {
    margin-top: 0;
}

.css-reference__content code {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    margin: 0.125rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-1);
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 0.75rem;
}
