:root {
    --retro-bg: #fdfbf7; 
    --retro-dark: #1c1917; 
    --retro-light: #ffffff;
    --retro-accent: #059669; 
    --retro-signal: #1d4ed8;
    --retro-warning: #facc15;
    --surface-paper: #f7f4ec;
    --surface-panel: #ffffff;
    --surface-inset: #f4efe3;
    --ambient-shadow: 0 14px 32px rgba(28, 25, 23, 0.12);
    --hard-shadow-sm: 3px 3px 0px var(--retro-dark);
    --hard-shadow-md: 5px 5px 0px var(--retro-dark);
    --hard-shadow-lg: 7px 7px 0px var(--retro-dark);
    --radius-tight: 2px;
    --grid-gap-1: 4px;
    --grid-gap-2: 8px;
    --grid-gap-3: 12px;
    --grid-gap-4: 16px;
    --grid-gap-6: 24px;
    --grid-gap-8: 32px;
    --grid-gap-12: 48px;
}

.site-wrap {
    box-sizing: border-box;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
    padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
    max-width: min(118rem, calc(100vw - 2.5rem));
}

@media (min-width: 1536px) {
    .site-wrap {
        padding-left: max(2rem, env(safe-area-inset-left, 0px));
        padding-right: max(2rem, env(safe-area-inset-right, 0px));
        max-width: min(128rem, calc(100vw - 5rem));
    }
}

body {
    background: var(--retro-bg);
    color: var(--retro-dark);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.14;
    background-image:
        linear-gradient(rgba(28, 25, 23, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(28, 25, 23, 0.02) 1px, transparent 1px);
    background-size: 20px 20px;
    mix-blend-mode: multiply;
}

::-webkit-scrollbar { width: 0px; background: transparent; }

.retro-panel {
    background-color: var(--surface-panel);
    border: 2px solid var(--retro-dark);
    box-shadow: var(--hard-shadow-lg), var(--ambient-shadow);
    border-radius: var(--radius-tight);
    cursor: default;
}

.retro-inset {
    background-color: var(--surface-inset);
    border: 2px solid var(--retro-dark);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 4px 4px 0 rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-tight);
    cursor: default;
}

.retro-button {
    position: relative;
    background: #f6f3eb;
    color: var(--retro-dark);
    border: 2px solid var(--retro-dark);
    border-radius: var(--radius-tight);
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out, color 0.15s ease-out;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    text-decoration: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    /* Top accent bar + inset paper highlight + deeper drop than flat copy panels */
    box-shadow:
        inset 0 3px 0 0 var(--retro-accent),
        inset 0 5px 0 0 rgba(255, 255, 255, 0.55),
        var(--hard-shadow-md),
        3px 5px 0 rgba(28, 25, 23, 0.06),
        var(--ambient-shadow);
}

.retro-button:hover {
    transform: translate(-1px, -1px);
    box-shadow:
        inset 0 3px 0 0 var(--retro-accent),
        inset 0 5px 0 0 rgba(255, 255, 255, 0.75),
        6px 6px 0px var(--retro-dark),
        0 0 0 1px rgba(5, 150, 105, 0.42),
        var(--ambient-shadow);
    color: var(--retro-accent);
}

.retro-button:active {
    transform: translate(2px, 2px);
    box-shadow:
        inset 0 3px 0 0 rgba(5, 150, 105, 0.55),
        inset 0 5px 0 0 rgba(255, 255, 255, 0.35),
        1px 1px 0 var(--retro-dark);
}

.retro-button[aria-current="page"] {
    color: var(--retro-accent);
    box-shadow:
        inset 0 3px 0 0 var(--retro-accent),
        inset 0 5px 0 0 rgba(255, 255, 255, 0.55),
        2px 2px 0 var(--retro-dark),
        var(--ambient-shadow);
}

/* Slightly flatter shadow when paired with tactile-button (mail row, etc.) */
.retro-button.tactile-button {
    box-shadow:
        inset 0 3px 0 0 var(--retro-accent),
        inset 0 5px 0 0 rgba(255, 255, 255, 0.55),
        var(--hard-shadow-sm),
        2px 4px 0 rgba(28, 25, 23, 0.06),
        var(--ambient-shadow);
}

.retro-button.tactile-button:hover {
    box-shadow:
        inset 0 3px 0 0 var(--retro-accent),
        inset 0 5px 0 0 rgba(255, 255, 255, 0.75),
        6px 6px 0px var(--retro-dark),
        0 0 0 1px rgba(5, 150, 105, 0.42),
        var(--ambient-shadow);
}

/* Non-clickable labels (badges) — keep brutalist but clearly not a control */
.retro-tag {
    display: inline-flex;
    align-items: center;
    border: 1px dashed rgba(28, 25, 23, 0.42);
    background: #faf9f6;
    color: #57534e;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 10px;
    line-height: 1.2;
    padding: 0.35rem 0.55rem;
    box-shadow: none;
    cursor: default;
    user-select: none;
}

.retro-tag--lg {
    font-size: 11px;
    letter-spacing: 0.16em;
    padding: 0.4rem 0.65rem;
}

.retro-icon {
    width: 40px;
    height: 40px;
    background: var(--retro-light);
    border: 2px solid var(--retro-dark);
    box-shadow: var(--hard-shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
}

.font-serif-heading {
    font-family: Georgia, Cambria, "Times New Roman", Times, serif;
}

.text-metallic-green {
    color: var(--retro-accent);
}

.surface-card {
    background: var(--surface-panel);
    border: 2px solid var(--retro-dark);
    box-shadow: var(--hard-shadow-md), var(--ambient-shadow);
    border-radius: var(--radius-tight);
    cursor: default;
}

/* If a link is styled like a card, treat it as a primary control (not a static panel) */
a[href].surface-card {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow:
        inset 0 3px 0 0 var(--retro-accent),
        inset 0 5px 0 0 rgba(255, 255, 255, 0.55),
        var(--hard-shadow-md),
        3px 5px 0 rgba(28, 25, 23, 0.06),
        var(--ambient-shadow);
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out, color 0.15s ease-out;
}

a[href].surface-card:hover {
    transform: translate(-1px, -1px);
    box-shadow:
        inset 0 3px 0 0 var(--retro-accent),
        inset 0 5px 0 0 rgba(255, 255, 255, 0.75),
        6px 6px 0px var(--retro-dark),
        0 0 0 1px rgba(5, 150, 105, 0.42),
        var(--ambient-shadow);
    color: var(--retro-accent);
}

a[href].surface-card:active {
    transform: translate(2px, 2px);
    box-shadow:
        inset 0 3px 0 0 rgba(5, 150, 105, 0.55),
        inset 0 5px 0 0 rgba(255, 255, 255, 0.35),
        1px 1px 0 var(--retro-dark);
}

.surface-inset {
    background: var(--surface-inset);
    border: 2px solid var(--retro-dark);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), inset 4px 4px 0 rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-tight);
    cursor: default;
}

.tactile-button {
    background: #f6f3eb;
    border: 2px solid var(--retro-dark);
    box-shadow:
        inset 0 2px 0 0 var(--retro-accent),
        inset 0 4px 0 0 rgba(255, 255, 255, 0.55),
        var(--hard-shadow-sm),
        2px 4px 0 rgba(28, 25, 23, 0.06),
        var(--ambient-shadow);
}

/* Small controls that use tactile-button without retro-button (e.g. prompt chips) */
button.tactile-button:not(.retro-button),
a.tactile-button:not(.retro-button) {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out, color 0.15s ease-out;
    box-shadow:
        inset 0 2px 0 0 var(--retro-accent),
        inset 0 4px 0 0 rgba(255, 255, 255, 0.55),
        var(--hard-shadow-sm),
        2px 4px 0 rgba(28, 25, 23, 0.06),
        var(--ambient-shadow);
}

button.tactile-button:not(.retro-button):hover,
a.tactile-button:not(.retro-button):hover {
    transform: translate(-1px, -1px);
    box-shadow:
        inset 0 2px 0 0 var(--retro-accent),
        inset 0 4px 0 0 rgba(255, 255, 255, 0.75),
        5px 5px 0px var(--retro-dark),
        0 0 0 1px rgba(5, 150, 105, 0.38),
        var(--ambient-shadow);
    color: var(--retro-accent);
}

button.tactile-button:not(.retro-button):active,
a.tactile-button:not(.retro-button):active {
    transform: translate(1px, 1px);
    box-shadow:
        inset 0 2px 0 0 rgba(5, 150, 105, 0.55),
        inset 0 4px 0 0 rgba(255, 255, 255, 0.35),
        1px 1px 0 var(--retro-dark);
}

.hci-kicker {
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 900;
    font-size: 10px;
    color: #4b5563;
}

.body-readable {
    max-width: 68ch;
    line-height: 1.72;
}

.section-shell {
    padding: var(--grid-gap-6);
    border: 2px solid var(--retro-dark);
    box-shadow: var(--hard-shadow-md), var(--ambient-shadow);
    background: #f7f4ec;
    cursor: default;
}

.section-title {
    font-size: clamp(1.4rem, 2.3vw, 2rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 3px solid var(--retro-dark);
    padding-bottom: 8px;
    margin-bottom: 20px;
}

.divider-rule {
    height: 2px;
    width: 100%;
    background: repeating-linear-gradient(
        90deg,
        var(--retro-dark) 0 22px,
        transparent 22px 30px
    );
    opacity: 0.55;
}

.focus-ring:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--retro-signal);
    outline-offset: 3px;
}

.motion-safe {
    transition: transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}

/* Click targets: pointer; text links get underline affordance below (not big bordered buttons). */
:where(button, [role="button"], input[type="button"], input[type="submit"], summary) {
    cursor: pointer;
}

:where(button, [role="button"], input[type="button"], input[type="submit"], summary):not(.retro-button):not(.tactile-button):hover {
    filter: brightness(1.02);
}

:where(button, [role="button"], input[type="button"], input[type="submit"], summary):active {
    transform: translateY(1px);
}

/* In-page text links: clearly different from bordered panels / primary buttons */
.site-wrap a[href]:not(.retro-button):not([class*="underline"]) {
    text-decoration: underline dotted;
    text-decoration-color: rgba(28, 25, 23, 0.38);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 0.2em;
    transition: color 0.12s ease, text-decoration-color 0.12s ease, text-decoration-style 0.12s ease;
}

.site-wrap a[href]:not(.retro-button):not([class*="underline"]):hover {
    text-decoration-style: solid;
    text-decoration-color: var(--retro-accent);
    color: var(--retro-accent);
}

@media (min-width: 1280px) {
    .desktop-rhythm {
        row-gap: 56px;
    }

    .hero-title-balance {
        letter-spacing: -0.04em;
        line-height: 0.94;
    }

    .hero-copy-balance {
        max-width: 66ch;
    }

    .card-grid-balance {
        gap: 28px;
    }
}

@media (min-width: 1536px) {
    .desktop-rhythm {
        row-gap: 64px;
    }

    .hero-copy-balance {
        max-width: 70ch;
    }

    .card-grid-balance {
        gap: 32px;
    }
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-in { animation: fadeIn 0.4s ease-out forwards; }

.moments-photo-grid {
    margin-top: 0.75rem;
}
.moments-photo-grid--1 .moments-thumb {
    aspect-ratio: 4 / 3;
    max-height: min(70vh, 28rem);
}
.moments-photo-grid--1 .moments-thumb img {
    max-height: min(70vh, 28rem);
    object-fit: cover;
}
.moments-thumb {
    aspect-ratio: 1 / 1;
}
.moments-text {
    word-break: break-word;
}

.stash-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.stash-filter-btn {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0.45rem 0.85rem;
    border: 2px solid #1c1917;
    background: #fff;
    color: #374151;
    box-shadow: 3px 3px 0 #1c1917;
    transition: transform 0.12s ease, background 0.12s ease;
}
.stash-filter-btn:hover {
    transform: translate(-1px, -1px);
}
.stash-filter-btn.is-active {
    background: #d1fae5;
    color: #065f46;
}
.stash-kind-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border: 2px solid #1c1917;
    background: #fef3c7;
    color: #92400e;
}
.stash-kind-badge--photo { background: #dbeafe; color: #1e40af; }
.stash-kind-badge--video { background: #fce7f3; color: #9d174d; }
.stash-kind-badge--article { background: #e0e7ff; color: #3730a3; }
.stash-kind-badge--note { background: #fef3c7; color: #92400e; }
.stash-video-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    margin-top: 0.75rem;
    border: 2px solid #1c1917;
    box-shadow: 4px 4px 0 #1c1917;
    background: #111827;
}
.stash-video-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.stash-video-wrap--native {
    padding-bottom: 0;
    height: auto;
    min-height: 12rem;
}
.stash-video-native {
    display: block;
    width: 100%;
    max-height: min(70vh, 32rem);
    background: #111827;
}
.stash-pdf-wrap {
    margin-top: 1rem;
}
.stash-pdf-frame {
    width: 100%;
    height: min(75vh, 42rem);
    border: 2px solid #1c1917;
    box-shadow: 4px 4px 0 #1c1917;
    background: #fff;
}
.stash-card-title {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 900;
    font-size: 1.15rem;
    line-height: 1.25;
    color: #111827;
}
.stash-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.stash-card-link:hover .stash-card,
.stash-card-link:focus-visible .stash-card {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #1c1917;
}
.stash-card-link .stash-card {
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    position: relative;
}
.stash-open-hint {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #059669;
}
.stash-card-link:hover .stash-open-hint {
    color: #047857;
}
.stash-list-thumb {
    position: relative;
}
.stash-list-thumb-count {
    position: absolute;
    bottom: 0.35rem;
    right: 0.35rem;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.15rem 0.4rem;
    background: rgba(255, 255, 255, 0.92);
    border: 2px solid #1c1917;
}
.stash-permalink-bar input:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px #059669;
}
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Home: corner “_” → stash (must sit above sticky aside / private gallery) */
.stash-corner-link {
    position: fixed;
    right: max(1.25rem, env(safe-area-inset-right, 0px));
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    z-index: 60;
    font-size: 1.75rem;
    line-height: 1;
    font-weight: 900;
    color: #6b7280;
    text-decoration: none;
    opacity: 0.65;
    transition: opacity 0.15s ease, color 0.15s ease, transform 0.12s ease;
    pointer-events: auto;
}
.stash-corner-link:hover,
.stash-corner-link:focus-visible {
    opacity: 1;
    color: #374151;
    outline: none;
}
@media (prefers-reduced-motion: no-preference) {
    .stash-corner-link {
        animation: stash-corner-pulse 2.8s ease-in-out infinite;
    }
}
@keyframes stash-corner-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.85; }
}

.bg-stripes-yellow {
    background-color: #facc15;
    background-image: linear-gradient(
        45deg,
        #111827 25%,
        transparent 25%,
        transparent 50%,
        #111827 50%,
        #111827 75%,
        transparent 75%,
        transparent
    );
    background-size: 20px 20px;
}
