/* ==========================================================================
   Anel&King · Capture — design tokens + components
   Mobile first. Dark charcoal, warm cream/gold accents.
   ========================================================================== */

:root {
    /* Surfaces */
    --bg:          #0d1115;
    --surface:     #141a1f;
    --surface-2:   #1a2127;
    --surface-3:   #222a31;
    --border:      rgba(232, 211, 162, 0.12);
    --border-strong: rgba(232, 211, 162, 0.28);

    /* Text */
    --text:        #ede7db;
    --text-muted:  #9ba1a6;
    --text-faint:  #6c737a;

    /* Accents */
    --gold:        #e8d3a2;
    --gold-deep:   #c9a86a;
    --gold-ink:    #1c160c;
    --gold-grad:   linear-gradient(180deg, #f3e4bf 0%, #dcc08a 100%);
    --heart:       #f06a7a;
    --danger:      #f08a7a;
    --success:     #9fd3a8;

    /* Type */
    --font-display: "Cormorant Garamond", "Times New Roman", serif;
    --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    /* Shape + rhythm */
    --radius-sm: 8px;
    --radius:    12px;
    --radius-lg: 18px;
    --radius-pill: 999px;
    --gutter:    16px;
    --content-max: 1180px;
    --topbar-h:  60px;
    --bottombar-h: 64px;
    --tap:       44px;

    --shadow:    0 10px 30px rgba(0, 0, 0, 0.35);
    --ease:      cubic-bezier(0.22, 0.61, 0.36, 1);

    color-scheme: dark;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

img, svg { display: block; max-width: 100%; }

[hidden] { display: none !important; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.2; }

p { margin: 0; }

ul { margin: 0; padding: 0; list-style: none; }

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

.skip-link {
    position: absolute;
    left: var(--gutter);
    top: -100px;
    z-index: 100;
    padding: 10px 16px;
    background: var(--gold-grad);
    color: var(--gold-ink);
    border-radius: var(--radius-pill);
    font-weight: 600;
}
.skip-link:focus { top: 10px; }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

/* ---------- Icons ---------- */

.icon      { width: 22px; height: 22px; flex: none; }
.icon--sm  { width: 18px; height: 18px; }
.icon--xs  { width: 14px; height: 14px; }
.icon--lg  { width: 36px; height: 36px; }

/* ---------- Top bar ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding-top: env(safe-area-inset-top);
    background: rgba(13, 17, 21, 0.86);
    backdrop-filter: saturate(140%) blur(14px);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
    border-bottom: 1px solid var(--border);
}

.topbar__inner {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: var(--content-max);
    height: var(--topbar-h);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.topbar__title {
    flex: 1;
    font-size: 17px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.wordmark {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1;
    color: var(--text);
}
.wordmark span { color: var(--gold); padding: 0 1px; }

.icon-btn,
.avatar-btn {
    display: inline-grid;
    place-items: center;
    width: var(--tap);
    height: var(--tap);
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: background-color .2s var(--ease), color .2s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); }
.topbar__inner > .icon-btn:first-child { margin-left: -10px; }

.avatar-btn {
    width: 36px;
    height: 36px;
    margin: 4px;
    overflow: hidden;
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    color: var(--gold);
}
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Navigation ---------- */

.nav__list { display: flex; }

.nav__link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: color .2s var(--ease);
}
.nav__link:hover,
.nav__link.is-active { color: var(--gold); }

/* Mobile: fixed bottom bar */
.nav--bottom {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 30;
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(13, 17, 21, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
}
.nav--bottom .nav__list {
    justify-content: space-around;
    height: var(--bottombar-h);
    max-width: 560px;
    margin: 0 auto;
}
.nav--bottom li { flex: 1; }
.nav--bottom .nav__link {
    flex-direction: column;
    gap: 3px;
    height: 100%;
    min-height: var(--tap);
    font-size: 11px;
    font-weight: 500;
}
.nav--bottom .nav__link.is-active .nav__label {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Desktop inline nav (hidden on small screens) */
.nav--top { display: none; }

/* ---------- Page ---------- */

.page {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 16px var(--gutter) calc(var(--bottombar-h) + env(safe-area-inset-bottom) + 24px);
}
.page:focus { outline: none; }

.section + .section { margin-top: 32px; }

.section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section__title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.display {
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: -0.01em;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--tap);
    padding: 10px 24px;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .2s var(--ease), filter .2s var(--ease), background-color .2s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.btn--gold {
    background: var(--gold-grad);
    color: var(--gold-ink);
    box-shadow: 0 6px 18px rgba(220, 192, 138, 0.18);
}
.btn--gold:hover { filter: brightness(1.05); }

.btn--outline {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--text);
}
.btn--outline:hover { background: var(--surface-2); }

.btn--block { width: 100%; }

/* ---------- Photo grid + card ---------- */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.photo-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--surface-2);
    aspect-ratio: 1 / 1;
}
.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s var(--ease);
}
.photo-card:hover img { transform: scale(1.03); }

.photo-card__bar {
    position: absolute;
    inset: auto 0 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 6px 4px;
    background: linear-gradient(to top, rgba(0, 0, 0, .6), transparent);
    color: #fff;
    pointer-events: none; /* taps on the gradient fall through to the photo link */
}
.photo-card__bar > * { pointer-events: auto; }

.photo-card__link { display: block; width: 100%; height: 100%; }
.photo-card__link:focus-visible { outline-offset: -3px; border-radius: var(--radius); }

.photo-card__download { color: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
.photo-card__download:hover { background: rgba(0, 0, 0, .25); }

/* ---------- Heart button ---------- */

/* Heart toggle + count (the count opens "who hearted") */
.heart { display: inline-flex; align-items: center; }
.heart-form { display: inline-flex; margin: 0; }
.heart-count {
    display: inline-flex;
    align-items: center;
    min-width: 24px;
    min-height: var(--tap);
    padding: 0 8px 0 2px;
    font-size: 14px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}
.heart-count:hover { text-decoration: underline; text-underline-offset: 3px; }
.photo-card .heart-count { font-size: 13px; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }

.heart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--tap);
    min-height: var(--tap);
    padding: 0;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color .2s var(--ease);
}
.heart-btn:hover { background: rgba(255, 255, 255, .08); }
.photo-card .heart-btn { font-size: 13px; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.photo-card .heart-btn:hover { background: rgba(0, 0, 0, .25); }

.heart-btn__icon { transition: transform .2s var(--ease), fill .2s var(--ease), color .2s var(--ease); }
.heart-btn.is-hearted .heart-btn__icon { fill: var(--heart); color: var(--heart); }
.heart-btn.is-popping .heart-btn__icon { animation: heart-pop .45s var(--ease); }

@keyframes heart-pop {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.35); }
    60%  { transform: scale(.9); }
    100% { transform: scale(1); }
}

.feed-more { display: flex; justify-content: center; margin-top: 20px; }
.section__link { color: var(--gold); font-size: 14px; min-height: var(--tap); display: inline-flex; align-items: center; }

/* ---------- Timeline (Home) ---------- */

.timeline { max-width: 480px; margin: 0 auto; }
.timeline__list { display: grid; gap: 24px; }

.post { padding-bottom: 20px; border-bottom: 1px solid var(--border); }

.post__head { display: flex; align-items: center; gap: 10px; min-height: 56px; padding-bottom: 6px; }
.post__avatar { display: flex; flex: none; }
.post__who { display: grid; min-width: 0; line-height: 1.3; }
.post__name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post__name:hover { color: var(--gold); }

/* Media frame: full-bleed on phones, rounded card from 560px up. */
.post__media {
    position: relative;
    margin: 0 calc(-1 * var(--gutter));
    overflow: hidden;
    background: var(--surface-2);
    aspect-ratio: 4 / 5;
}
.post__media--square    { aspect-ratio: 1 / 1; }
.post__media--landscape { aspect-ratio: 3 / 2; }
.post__media--wide      { aspect-ratio: 1.91 / 1; }

.post__track {
    display: flex;
    height: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.post__track::-webkit-scrollbar { display: none; }
/* Desktop: albums can be dragged with the mouse (timeline.js); snapping pauses mid-drag. */
@media (hover: hover) and (pointer: fine) {
    .js [data-carousel] .post__track { cursor: grab; }
}
.post__track.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.post__track:focus { outline: none; }

.post__slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.post__photo { height: 100%; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.post__photo img { width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }

.post__nav {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: var(--tap);
    height: var(--tap);
    padding: 0;
    border: 0;
    background: none;
    color: #15191d;
    cursor: pointer;
    transform: translateY(-50%);
}
.post__nav svg {
    width: 28px;
    height: 28px;
    padding: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .62);
    color: #1b1f23;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .25);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    transition: background-color .2s var(--ease), transform .2s var(--ease);
}
.post__nav:hover svg,
.post__nav:focus-visible svg { background: rgba(255, 255, 255, .9); transform: scale(1.06); }
.post__nav:focus-visible { outline: none; }
.post__nav:focus-visible svg { outline: 2px solid var(--gold); outline-offset: 2px; }
.post__nav--prev { left: 4px; }
.post__nav--next { right: 4px; }

/* Dots take no height: they sit on the action row's centre line, between heart and download. */
.post__dots { position: relative; top: 23px; z-index: 1; display: flex; justify-content: center; gap: 4px; height: 0; pointer-events: none; }
.post__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); transition: background-color .2s var(--ease), transform .2s var(--ease); }
.post__dot.is-active { background: var(--gold); transform: scale(1.15); }

.post__actions { display: flex; align-items: center; justify-content: space-between; margin: 4px -8px 0; }
.post__actions .heart-count { font-size: 15px; font-weight: 600; }
.post__actions .heart-btn__icon { width: 26px; height: 26px; }
.post__download { color: var(--text); }

.post__caption { font-size: 14px; }
.post__caption-text {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    white-space: pre-line;
    overflow-wrap: anywhere;
}
.post__caption.is-open .post__caption-text { display: block; -webkit-line-clamp: unset; line-clamp: unset; }
.post__caption-name { font-weight: 600; }
.post__caption-name:hover { color: var(--gold); }
.post__more {
    padding: 2px 0;
    border: 0;
    background: none;
    color: var(--text);
    font-size: 14px;
    opacity: .5;
    cursor: pointer;
    transition: opacity .2s var(--ease);
}
.post__more:hover,
.post__more:focus-visible { opacity: .8; }

.post__time { margin-top: 6px; color: var(--text-faint); font-size: 12px; letter-spacing: .02em; }

/* Double-tap heart */
.post__burst { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.post__burst svg {
    width: 96px;
    height: 96px;
    fill: #fff;
    filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .45));
    animation: heart-burst .9s var(--ease) forwards;
}

@keyframes heart-burst {
    0%   { transform: scale(0);    opacity: 0; }
    15%  { transform: scale(1.2);  opacity: .95; }
    30%  { transform: scale(.95); }
    45%  { transform: scale(1); }
    80%  { transform: scale(1);    opacity: .95; }
    100% { transform: scale(.85);  opacity: 0; }
}

/* Owner "⋯" menu */
.post-menu { position: relative; margin-left: auto; flex: none; }
.post-menu > summary { list-style: none; cursor: pointer; margin-right: -10px; }
.post-menu > summary::-webkit-details-marker { display: none; }
.post-menu[open] > summary { background: var(--surface-2); }
.post-menu__list {
    position: absolute;
    top: calc(100% + 4px);
    right: -6px;
    z-index: 20;
    display: grid;
    min-width: 200px;
    padding: 6px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-3);
    box-shadow: var(--shadow);
    animation: menu-in .16s var(--ease);
}
.post-menu__item {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 20px;
    font-size: 15px;
}
.post-menu__item + .post-menu__item { border-top: 1px solid var(--border); }
.post-menu__item:hover,
.post-menu__item:focus-visible { background: rgba(255, 255, 255, .05); }
.post-menu__item--danger { color: var(--heart); font-weight: 500; }

@keyframes menu-in {
    from { opacity: 0; transform: translateY(-4px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

/* Edit / delete dialogs: bottom sheet on phones, centred card from 560px. */
.sheet {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    padding: 0;
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}
.sheet[open] { animation: sheet-in .22s var(--ease); }
.sheet::backdrop { background: rgba(5, 7, 9, .7); }
.sheet__body { display: grid; gap: 12px; padding: 22px var(--gutter) calc(22px + env(safe-area-inset-bottom)); }
.sheet__title { font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.sheet__sub,
.sheet__text { color: var(--text-muted); font-size: 14px; }
.sheet__count { text-align: right; }
.sheet .field__error:empty { display: none; }
.sheet__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.sheet__actions--stack { grid-template-columns: 1fr; }

/* "Hearts" sheet: who hearted a photo */
.hearts-sheet .sheet__body { max-height: 70vh; grid-template-rows: auto auto 1fr; }
.hearts-sheet__head { display: flex; align-items: center; justify-content: space-between; margin: -8px -10px 0 0; }
.hearts-list { display: grid; gap: 2px; margin: 0 calc(-1 * var(--gutter)); padding: 0; list-style: none; overflow-y: auto; }
.hearts-list__user { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px var(--gutter); }
.hearts-list__user:hover { background: var(--surface-2); }
.hearts-list__names { display: grid; min-width: 0; line-height: 1.3; font-size: 14px; }
.hearts-list__names strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hearts-list__names span { color: var(--text-muted); font-size: 13px; }
.hearts-page { max-width: 480px; margin: 0 auto; }
.hearts-page .hearts-list { margin: 12px calc(-1 * var(--gutter)) 0; }

@keyframes sheet-in {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- Lightbox ---------- */

body.has-lightbox { overflow: hidden; }

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    grid-template-rows: auto 1fr auto;
    background: #06080a;
    animation: lightbox-in .25s var(--ease);
}
@keyframes lightbox-in { from { opacity: 0; } }

.lightbox__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(env(safe-area-inset-top) + 8px) var(--gutter) 8px;
}
.lightbox__owner {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}
.lightbox__owner span { color: var(--text-muted); }
.lightbox__owner:hover strong { color: var(--gold); }

.lightbox__stage {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 0;
    padding: 0 var(--gutter);
    touch-action: pan-y;
}
.lightbox__img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
    transition: filter .3s var(--ease);
}
.lightbox__img.is-loading { filter: blur(2px); }

.lightbox__nav {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: var(--tap);
    height: var(--tap);
    margin-top: calc(var(--tap) / -2);
    border: 0;
    border-radius: 50%;
    background: rgba(20, 26, 31, 0.7);
    color: var(--text);
    cursor: pointer;
}
.lightbox__nav:hover { background: var(--surface-3); }
.lightbox__nav--prev { left: 8px; }
.lightbox__nav--next { right: 8px; }

.lightbox__bottom {
    display: grid;
    gap: 6px;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 12px var(--gutter) calc(env(safe-area-inset-bottom) + 16px);
}
.lightbox__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lightbox__links { display: flex; align-items: center; gap: 16px; }
.lightbox__open svg { width: 18px; height: 18px; }
.lightbox__open { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); color: var(--gold); font-size: 14px; }
.lightbox__caption { white-space: pre-line; overflow-wrap: anywhere; max-height: 30vh; overflow-y: auto; }
.lightbox__sub { color: var(--text-muted); font-size: 13px; }
.lightbox__sub a { color: var(--gold); }

/* ---------- Photo page ---------- */

.viewer { max-width: 960px; margin: 0 auto; }
.viewer__figure { margin: 0; }

.viewer__stage {
    position: relative;
    display: grid;
    place-items: center;
    margin: -16px calc(var(--gutter) * -1) 0;
    background: #06080a;
}
.viewer__img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: calc(100dvh - var(--topbar-h) - var(--bottombar-h) - 140px);
    object-fit: contain;
}

.viewer__nav {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: var(--tap);
    height: var(--tap);
    margin-top: calc(var(--tap) / -2);
    border-radius: 50%;
    background: rgba(20, 26, 31, 0.7);
}
.viewer__nav:hover { background: var(--surface-3); }
.viewer__nav--prev { left: 8px; }
.viewer__nav--next { right: 8px; }

.viewer__details { display: grid; gap: 10px; padding-top: 16px; }
.viewer__meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.viewer__owner { display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); min-width: 0; font-size: 14px; }
.viewer__owner:hover strong { color: var(--gold); }
.viewer__handle { color: var(--text-faint); }
.viewer__actions { display: flex; align-items: center; gap: 8px; flex: none; }
.viewer__caption { overflow-wrap: anywhere; }
.viewer__sub { color: var(--text-muted); font-size: 13px; }
.viewer__sub a { color: var(--gold); }

.viewer__edit { margin-top: 28px; }
.viewer__edit + .viewer__delete { margin-top: 16px; }
.viewer__delete { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border); }

.chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: var(--tap);
    min-height: var(--tap);
    padding: 0 8px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

/* ---------- Empty state ---------- */

.empty-state {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 56px 24px;
    text-align: center;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--surface);
}
.empty-state__icon {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin-bottom: 6px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--gold);
}
.empty-state__heading {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 500;
}
.empty-state__text { color: var(--text-muted); max-width: 32ch; }
.empty-state .btn  { margin-top: 12px; }

.btn--sm { min-height: 36px; padding: 6px 16px; font-size: 14px; }

.avatar-btn .avatar { width: 100%; height: 100%; border: 0; }

/* ---------- Avatar ---------- */

.avatar {
    display: inline-grid;
    place-items: center;
    flex: none;
    overflow: hidden;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 25%, #2c343c, var(--surface-3));
    border: 1px solid var(--border-strong);
    color: var(--gold);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 36px;  height: 36px; }
.avatar--md { width: 72px;  height: 72px; }
.avatar--lg { width: 96px;  height: 96px; }
.avatar--xl { width: 112px; height: 112px; }

.avatar__initial {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1;
}
.avatar--sm .avatar__initial { font-size: 18px; }
.avatar--md .avatar__initial { font-size: 32px; }
.avatar--lg .avatar__initial,
.avatar--xl .avatar__initial { font-size: 44px; }

/* ---------- Profile ---------- */

.profile { max-width: 720px; margin: 0 auto; }

.profile__banner {
    position: relative;
    margin: -16px calc(var(--gutter) * -1) 0;
    aspect-ratio: 8 / 3;
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 80% 0%, rgba(232, 211, 162, 0.22), transparent 60%),
        linear-gradient(160deg, #1f2830 0%, #12181d 100%);
}
.profile__banner img { width: 100%; height: 100%; object-fit: cover; }
.profile__banner::after {
    content: "";
    position: absolute;
    inset: 55% 0 0;
    background: linear-gradient(to bottom, transparent, var(--bg));
}

.profile__head {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 14px;
    margin-top: -48px;
}
.profile__avatar .avatar {
    border: 3px solid var(--bg);
    box-shadow: 0 0 0 1px var(--border-strong), var(--shadow);
}

.profile__identity { min-width: 0; padding-bottom: 6px; }

.profile__name {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.01em;
    overflow-wrap: anywhere;
}
.profile__username { color: var(--text-muted); font-size: 14px; }

.profile__bio {
    margin-top: 14px;
    white-space: normal;
    overflow-wrap: anywhere;
}
.profile__bio--empty { color: var(--text-faint); font-style: italic; }

.profile > .disclosure,
.profile > .btn--block,
.profile > .alert { margin-top: 18px; }

.profile__posts { margin-top: 20px; }

/* Profile grid: one tile per post, 3 across, edge to edge on phones. */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    margin: 0 calc(-1 * var(--gutter));
    padding: 0;
    list-style: none;
}
.post-tile { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: var(--surface-2); }
.post-tile__link { display: block; height: 100%; }
.post-tile__link img { width: 100%; height: 100%; object-fit: cover; transition: opacity .2s var(--ease); }
.post-tile__link:hover img { opacity: .88; }
.post-tile__link:focus-visible { outline-offset: -3px; }
.post-tile__badge {
    position: absolute;
    top: 7px;
    right: 7px;
    color: #fff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .55));
    pointer-events: none;
}
.post-tile__badge .icon-fill { fill: currentColor; }
.profile__footer { margin-top: 40px; }

/* ---------- Disclosure (details/summary panels) ---------- */

.disclosure > summary { list-style: none; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure[open] > summary { background: var(--surface-2); }

.disclosure__body {
    display: grid;
    gap: 22px;
    margin-top: 14px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.disclosure__body.form { gap: 18px; }

.btn--danger {
    background: rgba(240, 138, 122, 0.12);
    border-color: rgba(240, 138, 122, 0.45);
    color: #f6c1b8;
}
.btn--danger:hover { background: rgba(240, 138, 122, 0.2); }

.danger-zone > summary { list-style: none; display: inline-flex; align-items: center; }
.danger-zone > summary::-webkit-details-marker { display: none; }
.danger-zone__body {
    display: grid;
    gap: 14px;
    margin-top: 10px;
    padding: 14px;
    border: 1px solid rgba(240, 138, 122, 0.35);
    border-radius: var(--radius);
    background: rgba(240, 138, 122, 0.06);
    font-size: 14px;
}

/* ---------- Upload ---------- */

.upload { max-width: 640px; margin: 0 auto; }

.dropzone {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 40px 20px;
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--surface);
    text-align: center;
    cursor: pointer;
    transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.dropzone:hover,
.dropzone.is-dragging { border-color: var(--gold); background: var(--surface-2); }
.dropzone:focus-within { outline: 2px solid var(--gold); outline-offset: 3px; }
.dropzone__icon { color: var(--gold); margin-bottom: 6px; }
.dropzone__title { font-size: 17px; font-weight: 600; }
.dropzone__hint { color: var(--text-muted); font-size: 13px; }
.dropzone__meta { color: var(--text-faint); font-size: 12px; margin-top: 6px; }
.upload__form.has-items .dropzone { padding: 22px 20px; }

/* Camera capture only makes sense on touch devices; drag & drop only with a mouse. */
.camera-btn { display: none; }
@media (hover: none) and (pointer: coarse) {
    .camera-btn { display: inline-flex; }
    .dropzone__hint--drag { display: none; }
}
.camera-btn:focus-within { outline: 2px solid var(--gold); outline-offset: 3px; }

/* Selected photos: a grid of square tiles that upload while the caption is written. */
.upload-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.upload-grid:not(:has(.upload-tile:not([hidden]))) { display: none; }

.upload-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}
.upload-tile img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s var(--ease); }
.upload-tile[data-state="queued"] img,
.upload-tile[data-state="uploading"] img { opacity: .55; }
.upload-tile[data-state="failed"] img,
.upload-tile[data-state="invalid"] img { opacity: .35; }

/* Progress along the bottom edge; turns green when the photo is safely uploaded. */
.upload-tile__progress {
    position: absolute;
    inset: auto 0 0 0;
    height: 4px;
    background: rgba(0, 0, 0, .45);
    opacity: 0;
    transition: opacity .3s var(--ease);
}
.upload-tile[data-state="uploading"] .upload-tile__progress { opacity: 1; }
.upload-tile__bar { display: block; width: 0; height: 100%; background: var(--gold-grad); transition: width .2s linear; }

.upload-tile__label {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
    pointer-events: none;
}
.upload-tile__label:empty { display: none; }
.upload-tile[data-state="failed"] .upload-tile__label,
.upload-tile[data-state="invalid"] .upload-tile__label { font-size: 12px; font-weight: 500; color: #f6c1b8; padding-bottom: 40px; }

/* Uploaded: a small check badge. */
.upload-tile[data-state="uploaded"]::after {
    content: "";
    position: absolute;
    left: 6px;
    bottom: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d1115' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 13px no-repeat;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
    animation: tile-done .35s var(--ease);
}
@keyframes tile-done { from { transform: scale(0); } to { transform: scale(1); } }

.upload-tile__remove {
    position: absolute;
    top: 4px;
    right: 4px;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(13, 17, 21, .72);
    color: #fff;
    cursor: pointer;
}
.upload-tile__remove::before { content: ""; position: absolute; inset: -7px; }   /* 44px touch target */
.upload-tile__remove:hover { background: rgba(13, 17, 21, .9); }

.upload-tile__retry {
    position: absolute;
    left: 50%;
    bottom: 10px;
    min-height: 32px;
    padding: 0 14px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--gold-grad);
    color: var(--gold-ink);
    font-size: 13px;
    font-weight: 600;
    transform: translateX(-50%);
    cursor: pointer;
}

/* "Add more" tile */
.upload-tile--add { background: none; }
.upload-tile__add {
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 4px;
    width: 100%;
    height: 100%;
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 12.5px;
    cursor: pointer;
    transition: border-color .2s var(--ease), color .2s var(--ease);
}
.upload-tile__add:hover { border-color: var(--gold); color: var(--gold); }

.upload-progress { color: var(--text-muted); font-size: 13px; }
.upload__cancel { justify-self: center; color: var(--text-muted); }

.field__optional { color: var(--text-faint); font-weight: 400; }

.field__control--select { position: relative; }
.field__select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 40px;
    cursor: pointer;
}
.field__select option { background: var(--surface); color: var(--text); }
.field__select-icon { position: absolute; right: 14px; pointer-events: none; color: var(--text-muted); }

[data-album-error]:empty { display: none; }

.upload-summary {
    padding: 14px 16px;
    border: 1px solid rgba(159, 211, 168, 0.35);
    border-radius: var(--radius);
    background: rgba(159, 211, 168, 0.06);
    font-size: 14px;
}
.upload-summary.is-error { border-color: rgba(240, 138, 122, 0.4); background: rgba(240, 138, 122, 0.06); }
.upload-summary a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.upload-summary .link-btn { min-height: 0; padding: 0; color: var(--gold); }

/* ---------- Search ---------- */

.search { max-width: 960px; margin: 0 auto; }

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 6px 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    background: var(--surface);
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.search-bar:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232, 211, 162, 0.15); }
.search-bar__icon { color: var(--text-muted); }
.search-bar__input {
    flex: 1;
    min-width: 0;
    height: 46px;
    border: 0;
    background: transparent;
    font-size: 16px;
    outline: none;
}
.search-bar__input::placeholder { color: var(--text-faint); }
.search-bar__input::-webkit-search-cancel-button { filter: invert(.7); cursor: pointer; }

.search__results { transition: opacity .2s var(--ease); }
.search__results.is-loading { opacity: .7; }
.search__summary { margin-top: 14px; color: var(--text-muted); font-size: 14px; }
.search__summary strong { color: var(--text); }
.search__results > .empty-state { margin-top: 20px; }

mark {
    padding: 0 1px;
    border-radius: 3px;
    background: rgba(232, 211, 162, 0.22);
    color: var(--gold);
}

.person-list { display: grid; gap: 8px; margin-top: 16px; }
.person-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 60px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.person-row:hover { background: var(--surface-2); border-color: var(--border-strong); }
.person-row .avatar { width: 44px; height: 44px; }
.person-row__body { display: grid; flex: 1; min-width: 0; }
.person-row__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-row__meta { color: var(--text-muted); font-size: 12.5px; }
.person-row__chevron { color: var(--text-faint); }

/* ---------- Album list ---------- */

.album-list { display: grid; gap: 10px; margin-top: 16px; }

.album-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.album-row:hover { background: var(--surface-2); border-color: var(--border-strong); }

.album-row__cover {
    display: grid;
    place-items: center;
    flex: none;
    width: 80px;
    height: 64px;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: var(--surface-3);
    color: var(--gold-deep);
}
.album-row__cover img { width: 100%; height: 100%; object-fit: cover; }

.album-row__body { display: grid; gap: 2px; flex: 1; min-width: 0; }
.album-row__name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.album-row__meta { color: var(--text-muted); font-size: 12.5px; }
.album-row__chevron { color: var(--text-faint); }

/* ---------- Album page ---------- */

.album { max-width: 720px; margin: 0 auto; }

.album__head { display: grid; gap: 18px; }

.album__cover {
    display: grid;
    place-items: center;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background:
        radial-gradient(120% 90% at 80% 0%, rgba(232, 211, 162, 0.18), transparent 60%),
        linear-gradient(160deg, #1f2830 0%, #12181d 100%);
    color: var(--gold-deep);
}
.album__cover img { width: 100%; height: 100%; object-fit: cover; }

.album__info { display: grid; gap: 8px; }
.album__name {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.01em;
    overflow-wrap: anywhere;
}
.album__description { color: var(--text); overflow-wrap: anywhere; }
.album__meta { color: var(--text-muted); font-size: 13px; }

.album__owner {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-self: start;
    min-height: var(--tap);
    font-size: 14px;
    color: var(--text-muted);
}
.album__owner strong { color: var(--text); font-weight: 600; }
.album__owner:hover strong { color: var(--gold); }
.album__handle { color: var(--text-faint); }

.album > .disclosure { margin-top: 18px; }
.album__photos { margin-top: 24px; }

.media-form {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.media-form__preview { flex: none; }
.media-form__preview--banner {
    width: 96px;
    aspect-ratio: 8 / 3;
    margin-top: 4px;
    overflow: hidden;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: linear-gradient(160deg, #1f2830, #12181d);
}
.media-form__preview--banner img { width: 100%; height: 100%; object-fit: cover; }
.media-form__body { display: grid; gap: 6px; min-width: 0; }
.media-form__title { font-weight: 600; }
.media-form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.media-form.is-busy { opacity: .7; pointer-events: none; }

.file-btn { position: relative; }
.file-btn:focus-within { outline: 2px solid var(--gold); outline-offset: 3px; }

.link-btn {
    min-height: var(--tap);
    padding: 0 8px;
    border: 0;
    background: none;
    color: var(--text-muted);
    font-size: 14px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.link-btn:hover { color: var(--danger); }

.field__control--textarea { align-items: stretch; }
.field__textarea {
    height: auto;
    min-height: 96px;
    padding: 12px 14px;
    resize: vertical;
    line-height: 1.5;
}
.field__count { text-align: right; }

[data-upload-status]:empty { display: none; }
[data-upload-status].is-ok { color: var(--success); }

/* ---------- Forms ---------- */

.form { display: grid; gap: 18px; }

.form__row { display: grid; gap: 18px; align-items: start; }

.field { display: grid; gap: 6px; }

.field__label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.field__control {
    display: flex;
    align-items: center;
    min-height: 48px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field__control:focus-within {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(232, 211, 162, 0.15);
}
.has-error .field__control { border-color: var(--danger); }

.field__prefix {
    padding-left: 14px;
    color: var(--text-faint);
}
.field__prefix + .field__input { padding-left: 2px; }

.field__input {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 14px;
    border: 0;
    background: transparent;
    font-size: 16px; /* ≥16px stops iOS zooming on focus */
    outline: none;
}
.field__input::placeholder { color: var(--text-faint); }

.field__reveal {
    display: grid;
    place-items: center;
    flex: none;
    width: var(--tap);
    height: 46px;
    margin-left: -4px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-muted);
    cursor: pointer;
}
.field__reveal:hover,
.field__reveal:focus-visible { color: var(--text); }
.field__reveal-hide,
.field__reveal[aria-pressed="true"] .field__reveal-show { display: none; }
.field__reveal[aria-pressed="true"] .field__reveal-hide { display: block; }

.field__hint  { font-size: 12.5px; color: var(--text-faint); }
.field__error { font-size: 13px; color: var(--danger); }

/* ---------- Alerts + toast ---------- */

.alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: var(--radius);
    font-size: 14px;
}
.alert--error {
    border-color: rgba(240, 138, 122, 0.4);
    background: rgba(240, 138, 122, 0.08);
    color: #f6c1b8;
}

.toast {
    margin-bottom: 16px;
    padding: 12px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--gold);
    font-size: 14px;
    animation: toast-in .4s var(--ease);
}
.toast.is-hiding { opacity: 0; transition: opacity .4s var(--ease); }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-6px); }
}

/* ---------- Auth ---------- */

.auth {
    max-width: 420px;
    margin: 8px auto 0;
}

.auth__head { margin-bottom: 26px; text-align: center; }

.auth__eyebrow {
    margin-bottom: 10px;
    color: var(--gold-deep);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.32em;
    text-transform: uppercase;
}

.auth__title {
    font-family: var(--font-display);
    font-size: 38px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.auth__lead {
    margin-top: 8px;
    color: var(--text-muted);
}

.auth .btn--block { margin-top: 6px; }

.auth__switch {
    margin-top: 22px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}
.auth__switch a {
    display: inline-block;
    padding: 10px 2px;
    color: var(--gold);
    font-weight: 500;
}
.auth__switch a:hover { text-decoration: underline; text-underline-offset: 3px; }

.logout-form { max-width: 420px; margin: 0 auto; }

/* ---------- Breakpoints ---------- */

@media (min-width: 560px) {
    .post__media { margin: 0; border-radius: var(--radius); }
    .post-grid { gap: 4px; margin: 0; }
    .post-tile:first-child { border-top-left-radius: var(--radius); }
    .post-tile:nth-child(3) { border-top-right-radius: var(--radius); }
    .sheet { max-width: 420px; margin: auto; border-bottom: 1px solid var(--border); border-radius: var(--radius-lg); }
    .sheet__body { padding: 24px; }
    .hearts-list { margin: 0 -24px; }
    .hearts-list__user { padding: 6px 24px; }
}

@media (min-width: 640px) {
    :root { --gutter: 24px; }
    .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
    .form__row  { grid-template-columns: 1fr 1fr; }
    .auth       { margin-top: 32px; }
    .profile__banner { margin: 0; border-radius: var(--radius-lg); }
    .profile__head   { margin-top: -56px; padding-left: 20px; }
    .album__head     { grid-template-columns: 280px 1fr; align-items: center; gap: 24px; }
    .viewer__stage   { margin: 0; border-radius: var(--radius-lg); overflow: hidden; }
    .lightbox__nav--prev { left: 24px; }
    .lightbox__nav--next { right: 24px; }
}

@media (min-width: 1024px) {
    :root { --topbar-h: 72px; }

    .nav--bottom { display: none; }

    .nav--top {
        display: block;
        margin-left: 40px;
    }
    .nav--top .nav__list { gap: 4px; }
    .nav--top .nav__link {
        min-height: var(--tap);
        padding: 0 14px;
        border-radius: var(--radius-pill);
        font-size: 14px;
        font-weight: 500;
    }
    .nav--top .nav__link.is-active { background: var(--surface-2); }

    .topbar__search { display: none; }
    .wordmark { font-size: 32px; }

    .page { padding-bottom: 64px; }
    .photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
}

/* ---------- Skeleton loading ---------- */
/* One shimmer for placeholders (.skeleton) and for photo frames whose image hasn't arrived.
   The frame rules need JS (capture.js adds .js and marks frames .is-loaded), so without JS
   photos simply show as usual. */

.skeleton,
.js .post__slide:not(.is-loaded),
.js .post-tile:not(.is-loaded),
.js .photo-card:not(.is-loaded) {
    background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%);
    background-size: 300% 100%;
    animation: skeleton-shimmer 1.6s ease-in-out infinite;
}
.js .post__slide img,
.js .post-tile img,
.js .photo-card img { transition: opacity .4s var(--ease), transform .6s var(--ease); }
.js .post__slide:not(.is-loaded) img,
.js .post-tile:not(.is-loaded) img,
.js .photo-card:not(.is-loaded) img { opacity: 0; }

.skeleton--line { display: block; height: 12px; border-radius: 6px; }
.skeleton--sm { width: 22%; }
.skeleton--md { width: 38%; }
.skeleton--lg { width: 56%; }
.skeleton--xl { width: 86%; }
.skeleton--circle { flex: none; width: 36px; height: 36px; border-radius: 50%; }

.post--skeleton { pointer-events: none; }
.post--skeleton .post__head .skeleton--line { flex: none; }
.post--skeleton__lines { display: grid; gap: 10px; padding-top: 16px; }
.person-row--skeleton { pointer-events: none; }
.person-row--skeleton__lines { display: grid; flex: 1; gap: 8px; }

/* While the next page loads, the skeletons stand in for the "Loading…" button. */
.feed-more.is-loading .btn { visibility: hidden; }

@keyframes skeleton-shimmer {
    from { background-position: 100% 0; }
    to   { background-position: 0 0; }
}

/* ---------- Splash (first visit) ---------- */

.page-bare:focus { outline: none; }

.splash {
    position: relative;
    display: grid;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    background: #1a1712;
    color: #fff;
    isolation: isolate;
}
.splash__bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 60%;
    animation: splash-zoom 14s var(--ease) both;
}
/* Warm dusk wash at the top for the wordmark, deep fade at the bottom for the button. */
.splash__shade {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(38, 24, 12, .78) 0%, rgba(58, 38, 20, .38) 30%, rgba(0, 0, 0, 0) 48%),
        linear-gradient(0deg, rgba(8, 10, 12, .9) 0%, rgba(8, 10, 12, .55) 26%, rgba(0, 0, 0, 0) 52%);
}

.splash__content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: calc(56px + env(safe-area-inset-top)) 28px calc(36px + env(safe-area-inset-bottom));
    text-align: center;
}

.splash__brand { display: grid; justify-items: center; animation: splash-rise 1.1s var(--ease) .15s both; }
.splash__logo { width: 88px; height: 88px; filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .35)); }
.splash__title {
    margin-top: 6px;
    font-family: var(--font-display);
    font-size: clamp(40px, 12vw, 52px);
    font-weight: 500;
    letter-spacing: -0.01em;
    color: #f7efe0;
    text-shadow: 0 2px 16px rgba(0, 0, 0, .35);
}
.splash__title span { color: var(--gold); padding: 0 1px; }
.splash__eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    color: var(--gold);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: .38em;
    text-transform: uppercase;
}
.splash__eyebrow::before,
.splash__eyebrow::after { content: ""; width: 18px; height: 1px; background: currentColor; opacity: .7; }
.splash__eyebrow::after { margin-left: -.38em; } /* cancel the letter-spacing after the last letter */

.splash__footer { display: grid; justify-items: center; gap: 6px; animation: splash-rise 1.1s var(--ease) .45s both; }
.splash__quote {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 500;
    color: #f7efe0;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .45);
}
.splash__date { font-size: 13px; font-weight: 500; letter-spacing: .12em; color: rgba(247, 239, 224, .9); }
.splash__cta { width: min(100%, 240px); margin-top: 22px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.splash__login { margin-top: 6px; font-size: 14px; color: rgba(247, 239, 224, .78); }
.splash__login a {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    padding: 0 4px;
    color: var(--gold);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

@keyframes splash-zoom {
    from { transform: scale(1.08); }
    to   { transform: scale(1); }
}
@keyframes splash-rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
