@font-face {
    font-family: "Cabinet Grotesk";
    src: url("../fonts/CabinetGrotesk-Medium.woff2") format("woff2");
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "Cabinet Grotesk";
    src: url("../fonts/CabinetGrotesk-Bold.woff2") format("woff2");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: "Cabinet Grotesk";
    src: url("../fonts/CabinetGrotesk-Extrabold.woff2") format("woff2");
    font-style: normal;
    font-weight: 800;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

:root {
    color-scheme: light;
    --ink: #2b2420;
    --ink-soft: #4e4540;
    --muted: #746b65;
    --paper: #f8f5f0;
    --paper-warm: #f1ebe3;
    --surface: #fffdf9;
    --stone: #b9a88f;
    --stone-light: #ded3c4;
    --stone-deep: #8d7b63;
    --oxblood: #89291b;
    --oxblood-dark: #631a11;
    --line: #ded5ca;
    --danger: #a12f27;
    --success: #337056;
    --shadow-sm: 0 12px 32px rgb(54 42 33 / 8%);
    --shadow-lg: 0 32px 90px rgb(54 42 33 / 13%);
    --radius-sm: 14px;
    --radius: 24px;
    --radius-lg: 42px;
    --font-display: "Cabinet Grotesk", "Vazirmatn", "Segoe UI", sans-serif;
    --font-body: "Cabinet Grotesk", "Vazirmatn", "Segoe UI", sans-serif;
    font-family: var(--font-body);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--paper); scroll-behavior: smooth; }

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 8%, rgb(185 168 143 / 14%), transparent 25rem),
        radial-gradient(circle at 90% 26%, rgb(137 41 27 / 5%), transparent 28rem),
        var(--paper);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.7;
    overflow-x: hidden;
}

html[lang^="fa"] body { font-family: "Vazirmatn", Tahoma, sans-serif; }
html[lang^="fa"] h1,
html[lang^="fa"] h2,
html[lang^="fa"] h3 { font-family: "Vazirmatn", Tahoma, sans-serif; letter-spacing: -.035em; }

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a, summary, label { -webkit-tap-highlight-color: transparent; }
img, svg { max-width: 100%; }
svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
p { margin-block: 0 1rem; }
h1, h2, h3 { margin-block: 0 .7rem; font-family: var(--font-display); line-height: 1.05; text-wrap: balance; }
h1 { font-size: clamp(2.7rem, 5vw, 5.3rem); font-weight: 700; letter-spacing: -.06em; }
h2 { font-size: clamp(2rem, 4vw, 4rem); font-weight: 700; letter-spacing: -.055em; }
h3 { font-size: clamp(1.25rem, 2vw, 1.7rem); font-weight: 700; letter-spacing: -.035em; }
:focus-visible { outline: 3px solid rgb(137 41 27 / 45%); outline-offset: 4px; }

.skip-link {
    position: fixed;
    inset-block-start: .5rem;
    inset-inline-start: .5rem;
    z-index: 1000;
    padding: .7rem 1rem;
    color: white;
    background: var(--oxblood);
    border-radius: 10px;
    transform: translateY(-180%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
    position: sticky;
    inset-block-start: 0;
    z-index: 100;
    border-bottom: 1px solid rgb(222 213 202 / 70%);
    background: rgb(248 245 240 / 88%);
    backdrop-filter: blur(20px);
}

.nav-shell, .page-shell, .site-footer {
    width: min(1240px, calc(100% - 2.5rem));
    margin-inline: auto;
}

.nav-shell {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.brand { display: inline-flex; align-items: center; width: clamp(136px, 14vw, 184px); }
.brand img, .footer-brand img { display: block; width: 100%; height: auto; }
.nav-actions { display: flex; align-items: center; gap: clamp(.55rem, 1.6vw, 1.3rem); font-size: .93rem; font-weight: 700; }
.nav-actions > a:not(.language-link):not(.nav-cta), .link-button { position: relative; }
.nav-actions > a:not(.language-link):not(.nav-cta)::after, .link-button::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-end: -.25rem;
    height: 1px;
    background: var(--oxblood);
    transform: scaleX(0);
    transition: transform .25s ease;
}
.nav-actions > a:hover::after, .link-button:hover::after { transform: scaleX(1); }
.nav-actions form { margin: 0; }
.link-button { border: 0; padding: 0; color: inherit; background: transparent; cursor: pointer; }
.nav-cta { min-height: 42px; display: inline-flex; align-items: center; padding: .55rem 1rem; color: white; background: var(--oxblood); border-radius: 12px; }
.nav-cta:hover { background: var(--oxblood-dark); }
.language-link { min-width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: rgb(255 253 249 / 72%); }

.page-shell { min-height: calc(100vh - 170px); padding-block: clamp(2.5rem, 6vw, 6rem); }
.site-footer {
    min-height: 110px;
    display: grid;
    grid-template-columns: 180px 1fr auto;
    align-items: center;
    gap: 2rem;
    padding-block: 1.6rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .9rem;
}
.site-footer p { margin: 0; text-align: center; }
.footer-brand { width: 160px; }

.eyebrow {
    margin: 0 0 1rem;
    color: var(--oxblood);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}
html[lang^="fa"] .eyebrow { letter-spacing: .03em; }

.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-block-start: 1.8rem; }
.button, button.button {
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .76rem 1.3rem;
    border: 1px solid transparent;
    border-radius: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .25s ease, background .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.button:hover { transform: translateY(-2px); }
.button.primary { color: white; background: var(--oxblood); box-shadow: 0 10px 22px rgb(137 41 27 / 18%); }
.button.primary:hover { background: var(--oxblood-dark); box-shadow: 0 14px 28px rgb(137 41 27 / 24%); }
.button.secondary { border-color: var(--line); background: var(--surface); }
.button.secondary:hover { border-color: var(--stone); }
.button.danger { color: white; background: var(--danger); }
.button.light { color: var(--oxblood); background: var(--surface); }
.button.text-button { padding-inline: .5rem; color: var(--ink); background: transparent; }
.full-button { width: 100%; }
.compact-button { min-height: 40px; padding: .48rem .9rem; font-size: .84rem; }

/* Home */
.home-page .page-shell { width: 100%; max-width: none; padding-block-start: 0; }
.home-hero, .home-interest, .story-section, .home-cta { width: min(1400px, calc(100% - 2.5rem)); margin-inline: auto; }
.home-hero {
    min-height: min(800px, calc(100vh - 78px));
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(22rem, .9fr);
    align-items: stretch;
    overflow: hidden;
    background: var(--paper-warm);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.hero-copy { align-self: center; padding: clamp(3rem, 8vw, 8rem); }
.hero-copy h1 { max-width: 18ch; color: var(--stone-deep); }
.hero-text { max-width: 58ch; color: var(--ink-soft); font-size: clamp(1.03rem, 1.6vw, 1.23rem); }
.hero-visual { position: relative; min-height: 620px; display: grid; place-items: center; overflow: hidden; background: var(--stone-light); isolation: isolate; }
.hero-visual::before {
    content: "";
    position: absolute;
    width: min(34rem, 74%);
    aspect-ratio: 1;
    border: 1px solid rgb(137 41 27 / 22%);
    border-radius: 50%;
    box-shadow: inset 0 0 0 5rem rgb(255 253 249 / 14%);
}
.hero-camera { position: relative; z-index: 3; width: min(620px, 92%); filter: drop-shadow(0 22px 35px rgb(66 47 35 / 12%)); }
.hero-orbit { position: absolute; border: 1px solid rgb(137 41 27 / 18%); border-radius: 50%; }
.orbit-one { width: 76%; aspect-ratio: 1; }
.orbit-two { width: 102%; aspect-ratio: 1; }
.memory-slip { position: absolute; z-index: 2; width: clamp(74px, 9vw, 126px); aspect-ratio: .78; padding: .55rem; background: var(--surface); box-shadow: var(--shadow-sm); }
.memory-slip span { display: block; width: 100%; height: 100%; background: linear-gradient(145deg, var(--stone), var(--oxblood)); opacity: .72; }
.memory-slip-one { inset-block-start: 12%; inset-inline-start: 10%; transform: rotate(-9deg); }
.memory-slip-two { inset-block-end: 9%; inset-inline-end: 11%; transform: rotate(8deg); }
.memory-slip-three { inset-block-start: 15%; inset-inline-end: -4%; transform: rotate(13deg); }

.home-interest { padding-block: clamp(8rem, 16vw, 14rem); }
.editorial-heading { max-width: 780px; margin-block-end: clamp(3rem, 7vw, 5rem); }
.editorial-heading > p:last-child { max-width: 62ch; color: var(--muted); font-size: 1.08rem; }
.feature-accordion { min-height: 440px; display: flex; grid-auto-flow: dense; overflow: hidden; border-radius: var(--radius-lg); }
.feature-panel {
    min-width: 0;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 3rem;
    padding: clamp(1.7rem, 3vw, 3rem);
    color: var(--ink);
    background: var(--stone-light);
    transition: flex .65s cubic-bezier(.22, 1, .36, 1), background .35s ease;
}
.feature-panel:hover, .feature-panel:focus-within { flex-grow: 1.35; }
.feature-panel-dark { color: white; background: var(--ink); }
.feature-panel-accent { color: white; background: var(--oxblood); }
.feature-panel p { max-width: 40ch; margin: 0; opacity: .78; }
.feature-icon { width: 62px; height: 62px; display: grid; place-items: center; }
.feature-icon svg { width: 100%; height: 100%; stroke-width: 1.4; }

.story-section { display: grid; grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr); gap: clamp(3rem, 10vw, 9rem); padding-block: clamp(6rem, 13vw, 11rem); }
.story-intro { align-self: start; padding-block-start: 1rem; }
.story-intro h2 { max-width: 12ch; }
.story-intro img { width: min(230px, 70%); margin-block-start: 3rem; }
.story-cards { display: grid; align-content: start; padding-block-end: 14vh; }
.story-card {
    position: sticky;
    inset-block-start: 7rem;
    min-height: 340px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 90px;
    align-items: end;
    gap: 1.5rem;
    padding: clamp(2rem, 4vw, 4rem);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    transform-origin: center top;
}
.story-card + .story-card { margin-block-start: 28vh; }
.story-card:nth-child(2) { inset-block-start: 8rem; background: var(--paper-warm); }
.story-card:nth-child(3) { inset-block-start: 9rem; color: white; background: var(--oxblood); border-color: var(--oxblood); }
.story-card h3 { font-size: clamp(1.8rem, 3.8vw, 3.4rem); }
.story-card p { max-width: 40ch; margin: 0; color: var(--muted); }
.story-card:nth-child(3) p { color: rgb(255 255 255 / 74%); }
.story-mark { align-self: start; color: var(--stone-deep); font-size: .82rem; font-weight: 800; letter-spacing: .1em; }
.story-card:nth-child(3) .story-mark { color: rgb(255 255 255 / 72%); }
.story-card svg { width: 82px; height: 82px; stroke-width: 1.4; }

.home-cta {
    position: relative;
    min-height: 540px;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: clamp(3rem, 8vw, 7rem);
    color: white;
    background: var(--oxblood);
    border-radius: var(--radius-lg);
    isolation: isolate;
}
.home-cta > img { position: absolute; z-index: -1; width: min(1050px, 90%); opacity: .13; filter: brightness(0) invert(1); }
.home-cta > div { max-width: 900px; text-align: center; }
.home-cta h2 { font-size: clamp(2.6rem, 6.5vw, 6rem); }
.home-cta p { max-width: 54ch; margin: 1rem auto 2rem; color: rgb(255 255 255 / 78%); font-size: 1.1rem; }

/* Forms and states */
.auth-page .page-shell, .state-page .page-shell { width: min(1280px, calc(100% - 2rem)); }
.auth-shell { min-height: 680px; display: grid; grid-template-columns: minmax(0, .92fr) minmax(360px, 1.08fr); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); }
.auth-card { width: min(560px, 100%); align-self: center; justify-self: center; padding: clamp(2rem, 6vw, 5rem); }
.form-brand { display: block; width: min(220px, 60%); height: auto; margin-block-end: 2.2rem; }
.auth-heading h1 { font-size: clamp(2.8rem, 5vw, 4.8rem); }
.auth-heading > p:last-child { color: var(--muted); }
.auth-visual { position: relative; min-height: 100%; display: grid; place-items: center; overflow: hidden; padding: 3rem; color: white; background: var(--stone); isolation: isolate; }
.auth-visual::before { content: ""; position: absolute; z-index: -2; width: 560px; aspect-ratio: 1; border: 1px solid rgb(255 255 255 / 35%); border-radius: 50%; box-shadow: 0 0 0 7rem rgb(255 255 255 / 8%); }
.auth-visual::after { content: ""; position: absolute; z-index: -1; inset: auto -10% -35% 20%; aspect-ratio: 1; background: var(--oxblood); border-radius: 50%; opacity: .92; }
.auth-visual img { width: min(680px, 108%); filter: brightness(0) invert(1); }
.auth-visual p { position: absolute; inset-inline: 3rem; inset-block-end: 2.5rem; margin: 0; font-size: clamp(1.35rem, 2vw, 2rem); font-weight: 700; text-align: center; }

.form-stack { display: grid; gap: 1rem; margin-block-start: 1.6rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.field { display: grid; gap: .42rem; }
.field label { color: var(--ink-soft); font-size: .88rem; font-weight: 800; }
.field input, .field textarea, .field select, .copy-field input {
    width: 100%;
    min-height: 50px;
    padding: .78rem .95rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--ink);
    background: var(--surface);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.field input:hover, .field textarea:hover, .field select:hover { border-color: var(--stone); }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--oxblood); outline: 0; box-shadow: 0 0 0 4px rgb(137 41 27 / 9%); }
.field textarea { min-height: 120px; resize: vertical; }
.field input[type="color"] { min-height: 64px; padding: .45rem; }
.field-validation-error, .validation-summary-errors { color: var(--danger); font-size: .86rem; }
.validation-summary-valid { display: none; }
.help-text { margin: 0; color: var(--muted); font-size: .84rem; }
.help-text a { color: var(--oxblood); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.full-row { grid-column: 1 / -1; }

.state-card { min-height: 600px; display: grid; grid-template-columns: minmax(300px, .9fr) minmax(0, 1.1fr); align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); }
.state-card > div:last-child { padding: clamp(2rem, 7vw, 6rem); }
.state-card h1 { max-width: 16ch; font-size: clamp(2.5rem, 5vw, 4.8rem); }
.state-art { align-self: stretch; display: grid; place-items: center; overflow: hidden; padding: 2rem; background: var(--stone-light); }
.state-art img { width: min(600px, 130%); }
.compact-state { min-height: 520px; }

/* Dashboard */
.page-brand-logo { display: block; width: min(190px, 50vw); height: auto; margin-block-end: 1.4rem; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-block-end: 2rem; }
.page-heading h1 { max-width: 18ch; font-size: clamp(2.7rem, 5vw, 5rem); }
.page-heading p { color: var(--muted); }
.panel, .narrow-card { padding: clamp(1.4rem, 4vw, 2.6rem); border: 1px solid var(--line); border-radius: var(--radius); background: rgb(255 253 249 / 92%); box-shadow: var(--shadow-sm); }
.narrow-card { width: min(560px, 100%); margin-inline: auto; }
.narrow-card h1, .panel h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
.section-gap { margin-block-start: 1.3rem; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.stat-card { position: relative; overflow: hidden; padding: 1.6rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stat-card::after { content: ""; position: absolute; inset-inline-end: -2rem; inset-block-end: -3rem; width: 8rem; aspect-ratio: 1; border: 1.4rem solid rgb(185 168 143 / 15%); border-radius: 50%; }
.stat-value { display: block; font-family: var(--font-display); font-size: clamp(2.2rem, 4vw, 3.5rem); font-weight: 800; line-height: 1; }
.stat-label { color: var(--muted); }
.details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 1rem; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; }
th { color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
html[lang^="fa"] th { letter-spacing: 0; }
tbody tr { transition: background .2s ease; }
tbody tr:hover { background: var(--paper-warm); }
tr:last-child td { border-bottom: 0; }
.table-link { color: var(--oxblood); font-weight: 800; }
.account-control-stack { display: flex; align-items: flex-start; gap: .55rem; }
.account-control-stack form { margin: 0; }
.account-actions { min-width: 12rem; white-space: normal; }
.account-actions summary { cursor: pointer; color: var(--oxblood); font-weight: 800; }
.account-actions-panel { display: grid; gap: 1rem; width: min(28rem, 78vw); margin-block-start: .8rem; }
.compact-form { margin: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.compact-form h3 { font-size: 1.2rem; }
.danger-zone { border-color: rgb(137 41 27 / 30%); background: #fff8f6; }
.danger-zone h3 { color: var(--oxblood); }
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .32rem .65rem; border-radius: 9px; background: var(--paper-warm); font-size: .78rem; font-weight: 800; }
.badge::before { content: ""; width: .42rem; height: .42rem; border-radius: 50%; background: var(--stone-deep); }
.badge.active { color: var(--success); background: #e9f3ed; }
.badge.active::before { background: var(--success); }
.badge.inactive { color: var(--danger); background: #f6eae8; }
.badge.inactive::before { background: var(--danger); }
.alert { margin-block: 1rem; padding: .9rem 1rem; border-inline-start: 3px solid var(--stone); border-radius: 9px; background: var(--paper-warm); }
.alert.success { color: #245d45; border-color: var(--success); background: #e9f4ed; }
.alert.error { color: #7c251f; border-color: var(--danger); background: #f8e9e7; }
.copy-field { display: flex; gap: .65rem; }
.copy-field input { min-width: 0; flex: 1; background: var(--paper); }
.qr-wrap { display: flex; align-items: center; gap: 1.2rem; margin-block-start: 1.4rem; }
.qr-wrap img { width: 160px; height: 160px; padding: .65rem; border: 1px solid var(--line); border-radius: 16px; background: white; }
.definition-list { display: grid; gap: .2rem; }
.definition-list div { display: flex; justify-content: space-between; gap: 1rem; padding-block: .7rem; border-bottom: 1px solid var(--line); }
.definition-list dt { color: var(--muted); }
.definition-list dd { margin: 0; font-weight: 800; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.2rem; }
.section-heading p, .empty-state { color: var(--muted); }
.section-heading form { margin: 0; }

/* Guest room */
.guest-room { --room-primary: var(--oxblood); --room-accent: var(--stone); width: min(920px, 100%); margin-inline: auto; }
.guest-hero { position: relative; min-height: 390px; display: grid; place-items: center; align-content: center; overflow: hidden; margin-block-end: 1.2rem; padding: clamp(3rem, 8vw, 6rem); text-align: center; border-radius: var(--radius-lg); background: var(--paper-warm); isolation: isolate; }
.guest-brand { width: min(210px, 55%); margin-block-end: 2rem; }
.guest-camera-watermark { position: absolute; z-index: -1; width: 105%; opacity: .055; }
.guest-hero h1 { max-width: 18ch; margin-inline: auto; color: var(--room-primary); font-size: clamp(2.8rem, 7vw, 6rem); }
.guest-hero p:last-child { max-width: 58ch; margin: 0 auto; color: var(--muted); }
.guest-panel { margin-block-end: 1.2rem; }
.guest-panel .button.primary { background: var(--room-primary); }
.allowance-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.allowance-row strong { flex: 0 0 auto; padding: .5rem .7rem; border: 1px solid var(--stone-light); border-radius: 10px; color: var(--room-primary); background: var(--paper-warm); }
.capture-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin-block: 1.4rem; }
.capture-button { min-height: 150px; display: grid; place-items: center; align-content: center; gap: .7rem; padding: 1rem; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); cursor: pointer; text-align: center; font-weight: 800; transition: transform .25s ease, border-color .25s ease, background .25s ease; }
.capture-button:hover { border-color: var(--room-primary); background: var(--surface); transform: translateY(-3px); }
.capture-icon { width: 42px; height: 42px; color: var(--room-primary); }
.capture-icon svg { width: 100%; height: 100%; stroke-width: 1.6; }
.form-error { margin: .5rem 0 0; color: var(--danger); }
.upload-queue { display: grid; gap: .6rem; margin-block-start: 1rem; }
.upload-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, .8fr) auto; align-items: center; gap: .7rem; padding: .6rem; border-radius: 10px; background: var(--paper); font-size: .82rem; }
.upload-row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-row progress { width: 100%; accent-color: var(--room-primary); }
.upload-state { display: grid; justify-items: end; gap: .25rem; color: var(--muted); text-align: end; }
.upload-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem .65rem; }
.upload-actions .link-button { font-size: .76rem; }
.guest-gallery-section { margin-block-start: 3rem; }
.guest-gallery-section > p { color: var(--muted); }
.guest-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.guest-media-card, .owner-media-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); transition: transform .35s ease, box-shadow .35s ease; }
.guest-media-card:hover, .owner-media-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-sm); }
.guest-media-card img, .media-placeholder, .owner-media-card img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--paper-warm); transition: transform .7s cubic-bezier(.22, 1, .36, 1); }
.guest-media-card:hover img, .owner-media-card:hover img { transform: scale(1.045); }
.media-placeholder { display: grid; place-items: center; padding: 1rem; color: var(--muted); text-align: center; }
.media-card-footer { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem .8rem; font-size: .78rem; }
.media-card-footer > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.danger-text { flex: 0 0 auto; color: var(--danger); }
.owner-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; margin-block-start: 1.4rem; }
.owner-media-card > a { position: relative; display: block; overflow: hidden; }
.owner-media-card > div { display: grid; padding: .75rem .85rem; font-size: .78rem; }
.owner-media-card > div span { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.video-mark { position: absolute; inset: 50% auto auto 50%; width: 2.7rem; height: 2.7rem; display: grid; place-items: center; border-radius: 50%; color: white; background: rgb(43 36 32 / 74%); transform: translate(-50%, -50%); }
.gallery-tools { display: flex; align-items: center; justify-content: flex-end; gap: .7rem; margin-block-start: 1.4rem; }
.gallery-tools label { color: var(--muted); font-size: .85rem; font-weight: 800; }
.gallery-tools select { min-height: 44px; min-width: min(100%, 240px); padding: .55rem 2.2rem .55rem .8rem; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--surface); }
.sender-media-groups { display: grid; gap: 2.2rem; margin-block-start: 1.6rem; }
.sender-media-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-block-end: .7rem; border-bottom: 1px solid var(--line); }
.sender-media-heading h3 { margin: 0; font-size: 1.3rem; }
.sender-media-heading span { color: var(--muted); font-size: .82rem; }
.sender-media-group .owner-gallery { margin-block-start: .9rem; }

/* Contact */
.contact-hero { min-height: 420px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); align-items: center; overflow: hidden; padding: clamp(2rem, 7vw, 6rem); border-radius: var(--radius-lg); background: var(--paper-warm); }
.contact-hero > div { position: relative; z-index: 1; }
.contact-hero h1 { max-width: 12ch; font-size: clamp(3rem, 7vw, 6.4rem); }
.contact-hero p:last-child { max-width: 58ch; color: var(--muted); }
.contact-hero img { width: min(650px, 125%); max-width: none; opacity: .86; transform: rotate(-3deg); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 1rem; }
.contact-aside { min-height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: clamp(2rem, 5vw, 4rem); border-radius: var(--radius-md); color: white; background: var(--oxblood); }
.contact-aside img { width: min(220px, 70%); margin-block-end: 3rem; filter: brightness(0) invert(1); }
.contact-aside h2 { color: inherit; }
.contact-aside a { margin-block: .5rem 1.5rem; border-bottom: 1px solid rgb(255 255 255 / 45%); font-weight: 800; }
.contact-aside p { max-width: 34ch; }
.contact-aside small { max-width: 40ch; margin-block-start: 2rem; color: rgb(255 255 255 / 72%); }
.form-trap { position: absolute !important; inset-inline-start: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

@media (max-width: 980px) {
    .home-hero { grid-template-columns: 1fr; }
    .hero-copy { padding-block: 5rem; }
    .hero-visual { min-height: 520px; }
    .story-section { grid-template-columns: 1fr; gap: 3rem; }
    .story-intro { position: static !important; max-width: 760px; }
    .story-intro h2 { max-width: 18ch; }
    .story-intro img { display: none; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-visual { min-height: 390px; grid-row: 1; }
    .auth-card { padding-block: 3rem; }
    .state-card { grid-template-columns: 1fr; }
    .state-art { min-height: 280px; }
    .owner-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .contact-hero { grid-template-columns: 1fr; }
    .contact-hero img { width: min(560px, 100%); margin: 2rem auto -4rem; }
    .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .nav-shell, .page-shell, .site-footer, .home-hero, .home-interest, .story-section, .home-cta { width: min(100% - 1.25rem, 1240px); }
    .nav-shell { min-height: 68px; gap: .65rem; }
    .brand { width: 126px; }
    .nav-actions { gap: .5rem; font-size: .8rem; }
    .nav-actions .nav-cta { min-height: 38px; padding: .45rem .7rem; }
    .language-link { min-width: 38px; height: 38px; }
    .contact-nav-link { display: none; }
    .home-hero { border-radius: 0 0 28px 28px; }
    .hero-copy { padding: 3.5rem 1.4rem 3rem; }
    .hero-copy h1 { max-width: none; font-size: clamp(2.8rem, 13vw, 4.4rem); }
    .hero-visual { min-height: 390px; }
    .memory-slip { width: 76px; }
    .home-interest { padding-block: 7rem; }
    .feature-accordion { min-height: 0; display: grid; border-radius: 28px; }
    .feature-panel { min-height: 280px; }
    .story-section { padding-block: 4rem 7rem; }
    .story-card { position: relative; inset: auto !important; min-height: 320px; grid-template-columns: 1fr 62px; align-items: start; padding: 1.5rem; }
    .story-card + .story-card { margin-block-start: 1rem; }
    .story-mark { grid-column: 1 / -1; }
    .story-card svg { width: 58px; height: 58px; }
    .home-cta { min-height: 480px; padding: 2rem 1.25rem; border-radius: 28px; }
    .auth-page .page-shell, .state-page .page-shell { width: min(100% - 1.25rem, 1280px); }
    .auth-shell { border-radius: 28px; }
    .auth-card { padding: 2rem 1.25rem 2.5rem; }
    .auth-visual { min-height: 280px; padding: 1.5rem; }
    .auth-visual p { inset-inline: 1.5rem; inset-block-end: 1.25rem; }
    .form-grid, .details-grid, .stat-grid { grid-template-columns: 1fr; }
    .full-row { grid-column: auto; }
    .copy-field, .qr-wrap { align-items: stretch; flex-direction: column; }
    .qr-wrap img { align-self: center; }
    .capture-grid { grid-template-columns: 1fr; }
    .capture-button { min-height: 112px; grid-template-columns: 42px 1fr; justify-items: start; text-align: start; }
    .guest-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .owner-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .section-heading, .page-heading, .allowance-row { align-items: stretch; flex-direction: column; }
    .gallery-tools { align-items: stretch; flex-direction: column; }
    .gallery-tools select { width: 100%; }
    .upload-row { grid-template-columns: 1fr auto; }
    .upload-row progress { grid-column: 1 / -1; grid-row: 2; }
    .upload-state { max-width: 155px; }
    .site-footer { grid-template-columns: 1fr; justify-items: center; gap: .6rem; text-align: center; }
    .footer-brand { width: 145px; }
    .site-footer p { text-align: center; }
}

@media (max-width: 480px) {
    .brand { width: 96px; }
    .nav-actions { gap: .3rem; font-size: .72rem; }
    .nav-actions .nav-cta { padding: .42rem .54rem; }
    .about-nav-link { display: none; }
    .home-hero { min-height: auto; }
    .hero-visual { min-height: 320px; }
    .button-row .button { width: 100%; }
    .guest-gallery, .owner-gallery { grid-template-columns: 1fr 1fr; gap: .6rem; }
    .guest-hero { min-height: 330px; padding-inline: 1rem; }
}

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