/* ==========================================================================
   Homelookout — interface styles
   --------------------------------------------------------------------------
   The reference is an architecture studio's portfolio, not a SaaS dashboard:
   editorial typography, generous whitespace, deep charcoal on warm off-white,
   one metallic accent. Motion is slow and confident, and disappears entirely
   for anyone who asks for reduced motion.
   ========================================================================== */

/* --- Design tokens ------------------------------------------------------- */

:root {
    /* Ink */
    /* Text tones. Every value below is measured against --paper (#F6F3EE):
       --ink 16.9:1, --ink-70 8.7:1, --ink-50 5.7:1, --ink-30 4.2:1.
       --ink-50 was #7A7267 (4.28:1) and --ink-30 was #ABA396 (2.26:1); both
       failed WCAG AA for body text and read as washed out on a bright screen. */
    --ink:          #14120F;
    --ink-90:       #211E19;
    --ink-70:       #4A443B;
    --ink-50:       #665F55;
    --ink-30:       #6E6759;

    /* Ground */
    --paper:        #F6F3EE;
    --paper-warm:   #EFEAE1;
    --paper-deep:   #E4DDD1;
    --white:        #FFFFFF;

    /* Accent — a single metallic, used sparingly.
       --brass is for rules, borders and fills. --brass-text is the darker
       version for actual words: the original #9C7C46 measured only 3.52:1 on
       paper, which fails AA at the small uppercase sizes the eyebrows use. */
    --brass:        #9C7C46;
    --brass-text:   #7A5F2E;
    --brass-light:  #C0A473;
    --brass-wash:   rgba(156, 124, 70, 0.10);

    --line:         rgba(20, 18, 15, 0.13);
    --line-soft:    rgba(20, 18, 15, 0.07);

    --danger:       #8C3B2E;
    --success:      #3F6046;

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

    /* Rhythm */
    --gutter:   clamp(1.25rem, 5vw, 4.5rem);
    --section:  clamp(4.5rem, 11vh, 9rem);
    --measure:  68ch;
    --radius:   2px;              /* almost square — rounded corners read cheap here */

    /* Motion */
    --ease:      cubic-bezier(0.22, 0.61, 0.36, 1);
    --ease-slow: cubic-bezier(0.16, 0.84, 0.44, 1);
    --dur:       0.7s;
}

/* --- Reset --------------------------------------------------------------- */

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

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

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--body);
    font-size: 1rem;
    line-height: 1.65;
    font-weight: 400;
    letter-spacing: 0.005em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

img, video, canvas { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* Visible focus everywhere — this is an accessibility requirement, not a
   decoration, so it is never removed. */
:focus-visible {
    outline: 2px solid var(--brass);
    outline-offset: 3px;
}

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

.skip-link {
    position: absolute; left: -999px; top: 0; z-index: 999;
    background: var(--ink); color: var(--paper); padding: 0.75rem 1.25rem;
}
.skip-link:focus { left: 0; }

/* --- Typography ---------------------------------------------------------- */

h1, h2, h3, h4 {
    font-family: var(--display);
    font-weight: 300;
    line-height: 1.06;
    letter-spacing: -0.015em;
    margin: 0 0 0.5em;
    text-wrap: balance;
}

h1 { font-size: clamp(2.9rem, 7.2vw, 6.2rem); }
h2 { font-size: clamp(2.1rem, 4.6vw, 3.9rem); }
h3 { font-size: clamp(1.35rem, 2.2vw, 1.85rem); }
h4 { font-size: 1.15rem; letter-spacing: 0; }

p { margin: 0 0 1.15em; max-width: var(--measure); }

.eyebrow {
    font-family: var(--body);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--brass-text);
    margin: 0 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
}
.eyebrow::before {
    content: "";
    width: 2.4rem;
    height: 1px;
    background: var(--brass);
    opacity: 0.6;
}

.lede {
    font-size: clamp(1.05rem, 1.5vw, 1.28rem);
    line-height: 1.6;
    color: var(--ink-70);
    max-width: 56ch;
}

.muted   { color: var(--ink-50); }
.small   { font-size: 0.85rem; }
.tiny    { font-size: 0.78rem; letter-spacing: 0.02em; }
.italic  { font-style: italic; }

/* --- Layout -------------------------------------------------------------- */

.wrap {
    width: 100%;
    max-width: 1400px;
    margin-inline: auto;
    padding-inline: var(--gutter);
}
.wrap--narrow { max-width: 880px; }

.section { padding-block: var(--section); }
.section--tight { padding-block: calc(var(--section) * 0.55); }
.section--dark {
    background: var(--ink);
    color: var(--paper);
}
.section--dark .lede,
.section--dark .muted { color: rgba(246, 243, 238, 0.80); }
.section--dark .eyebrow { color: var(--brass-light); }
.section--dark .eyebrow::before { background: var(--brass-light); }

.grid { display: grid; gap: clamp(1.5rem, 3vw, 3rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }

.split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
    gap: clamp(2rem, 5vw, 5.5rem);
    align-items: center;
}

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* --- Header -------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(246, 243, 238, 0.94);
    backdrop-filter: saturate(140%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line-soft); }

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    min-height: 4.75rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--display);
    font-size: 1.55rem;
    font-weight: 400;
    letter-spacing: -0.012em;
    white-space: nowrap;
}

/* The mark sits in a solid deep-ink tile. Outlined marks vanish at header
   size; a filled badge gives the brand real weight and a place for the brass
   to read as metal rather than a pale tan line. */
.brand__badge {
    display: grid;
    place-items: center;
    width: 2.3rem;
    height: 2.3rem;
    flex: none;
    border-radius: 5px;
    background: linear-gradient(155deg, var(--ink-90) 0%, var(--ink) 62%, #000 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        0 3px 10px -3px rgba(20, 18, 15, 0.5);
    transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.brand__badge svg { width: 1.45rem; height: 1.45rem; display: block; }
.brand:hover .brand__badge {
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 6px 16px -4px rgba(20, 18, 15, 0.55);
}

.brand__word { line-height: 1; }
.brand__home { font-weight: 600; color: var(--ink); letter-spacing: -0.015em; }
.brand__lookout {
    color: var(--brass-text);
    font-style: italic;
    font-weight: 500;
}

/* Footer sits on ink, so the wordmark inverts. */
.brand--footer .brand__home { color: var(--paper); }
.brand--footer .brand__lookout { color: var(--brass-light); }

.nav { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2.4rem); }
.nav a:not(.btn) {
    font-size: 0.84rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
    padding-block: 0.4rem;
    position: relative;
    transition: color 0.3s var(--ease);
}
.nav a:not(.btn)::after {
    content: "";
    position: absolute; left: 0; bottom: 0;
    width: 0; height: 1px; background: var(--brass);
    transition: width 0.4s var(--ease);
}
.nav a:not(.btn):hover { color: var(--brass-text); }
.nav a:not(.btn):hover::after,
.nav a:not(.btn)[aria-current="page"]::after { width: 100%; }

.nav__toggle {
    display: none;
    background: none; border: 0; padding: 0.5rem; cursor: pointer;
}
.nav__toggle span {
    display: block; width: 22px; height: 1px; background: var(--ink); margin: 5px 0;
    transition: transform 0.35s var(--ease), opacity 0.2s;
}

@media (max-width: 860px) {
    .nav__toggle { display: block; }
    .nav {
        position: fixed; inset: 4.75rem 0 auto 0;
        flex-direction: column; align-items: flex-start;
        gap: 0;
        background: var(--paper);
        border-bottom: 1px solid var(--line);
        padding: 1rem var(--gutter) 2rem;
        transform: translateY(-120%);
        transition: transform 0.5s var(--ease);
        max-height: calc(100vh - 4.75rem);
        overflow-y: auto;
    }
    .nav.is-open { transform: translateY(0); }
    .nav a:not(.btn) { width: 100%; padding-block: 0.95rem; border-bottom: 1px solid var(--line-soft); }
    .nav .btn { margin-top: 1rem; width: 100%; justify-content: center; }
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.95rem 1.9rem;
    border: 1px solid var(--ink);
    border-radius: var(--radius);
    background: var(--ink);
    color: var(--paper);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: color 0.45s var(--ease), border-color 0.45s var(--ease), transform 0.3s var(--ease);
}
.btn::before {
    content: "";
    position: absolute; inset: 0;
    background: var(--paper);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.45s var(--ease-slow);
    z-index: -1;
}
.btn > * { position: relative; z-index: 1; }
.btn:hover:not(:disabled) { color: var(--ink); }
.btn:hover:not(:disabled)::before { transform: scaleY(1); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost::before { background: var(--ink); }
.btn--ghost:hover:not(:disabled) { color: var(--paper); }

.btn--brass { background: var(--brass); border-color: var(--brass); color: var(--white); }
.btn--brass::before { background: var(--ink); }
.btn--brass:hover:not(:disabled) { color: var(--white); border-color: var(--ink); }

.btn--light { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.btn--light::before { background: var(--brass); }
.btn--light:hover:not(:disabled) { color: var(--white); border-color: var(--brass); }

.btn--sm { padding: 0.6rem 1.15rem; font-size: 0.7rem; }
.btn--block { width: 100%; }

.link-arrow {
    display: inline-flex; align-items: center; gap: 0.6rem;
    font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink); border-bottom: 1px solid var(--line); padding-bottom: 0.35rem;
    transition: gap 0.35s var(--ease), border-color 0.35s var(--ease);
}
.link-arrow:hover { gap: 1.1rem; border-bottom-color: var(--brass); }

/* --- Hero ---------------------------------------------------------------- */

.hero {
    position: relative;
    min-height: min(92vh, 900px);
    display: grid;
    align-items: center;
    padding-block: clamp(3rem, 8vh, 6rem);
    overflow: hidden;
}

.hero__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 27rem), 1fr));
    gap: clamp(2.5rem, 5vw, 5rem);
    align-items: center;
    width: 100%;
}

.hero h1 { margin-bottom: 1.6rem; }
.hero h1 em {
    font-style: italic;
    color: var(--brass);
}

.hero__actions {
    display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.4rem;
}

.hero__meta {
    display: flex; flex-wrap: wrap; gap: clamp(1.5rem, 4vw, 3rem);
    margin-top: 3rem; padding-top: 1.75rem; border-top: 1px solid var(--line);
}
.hero__meta div { min-width: 6rem; }
.hero__meta strong {
    display: block;
    font-family: var(--display);
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
}
.hero__meta span { font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-50); }

/* Hero photograph — used instead of the slider when one has been imported. */
.hero__photo {
    margin: 0;
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--paper-deep);
    box-shadow: 0 30px 70px -40px rgba(20, 18, 15, 0.55);
}
.hero__photo img { width: 100%; height: 100%; object-fit: cover; }

/* --- Before / after comparison ------------------------------------------ */

.compare {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--paper-deep);
    border-radius: var(--radius);
    user-select: none;
    touch-action: pan-y;
    cursor: ew-resize;
    box-shadow: 0 30px 70px -40px rgba(20, 18, 15, 0.55);
}
.compare img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    pointer-events: none;
}
.compare__after { clip-path: inset(0 0 0 var(--pos, 50%)); }

.compare__handle {
    position: absolute;
    top: 0; bottom: 0;
    left: var(--pos, 50%);
    width: 1px;
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(-0.5px);
    pointer-events: none;
    box-shadow: 0 0 0 1px rgba(20, 18, 15, 0.18);
}
.compare__knob {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 3rem; height: 3rem;
    border-radius: 50%;
    background: var(--paper);
    display: grid; place-items: center;
    box-shadow: 0 6px 24px rgba(20, 18, 15, 0.28);
}
.compare__knob::before,
.compare__knob::after {
    content: "";
    width: 0; height: 0;
    border-block: 4px solid transparent;
    position: absolute;
}
.compare__knob::before { border-right: 6px solid var(--ink); left: 0.85rem; }
.compare__knob::after  { border-left: 6px solid var(--ink); right: 0.85rem; }

.compare__label {
    position: absolute;
    bottom: 1rem;
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 0.4rem 0.8rem;
    background: rgba(20, 18, 15, 0.62);
    color: #fff;
    backdrop-filter: blur(6px);
    pointer-events: none;
}
.compare__label--before { left: 1rem; }
.compare__label--after  { right: 1rem; }

.compare__range {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: ew-resize;
    margin: 0;
}
/* The range input is the accessible control: it is invisible but focusable,
   so the slider works with a keyboard and is announced by screen readers. */
.compare__range:focus-visible + .compare__handle {
    box-shadow: 0 0 0 3px var(--brass);
}

/* --- Cards --------------------------------------------------------------- */

.card {
    background: var(--white);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.55s var(--ease), box-shadow 0.55s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: 0 24px 48px -32px rgba(20, 18, 15, 0.4); }
.card__media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper-deep); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease-slow); }
.card:hover .card__media img { transform: scale(1.045); }
.card__body { padding: 1.5rem 1.5rem 1.75rem; }
.card__body h3 { margin-bottom: 0.35rem; }

.tile {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1.6rem 1.4rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.35s var(--ease), background 0.35s var(--ease), transform 0.35s var(--ease);
}
.tile:hover { border-color: var(--ink-30); transform: translateY(-2px); }
.tile.is-selected {
    border-color: var(--brass);
    background: var(--brass-wash);
}
.tile__name { font-family: var(--display); font-size: 1.3rem; line-height: 1.15; }
.tile__hint { font-size: 0.8rem; color: var(--ink-50); }

.numbered {
    counter-reset: step;
    display: grid;
    gap: clamp(2rem, 4vw, 3.5rem);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}
.numbered > li { list-style: none; counter-increment: step; }
.numbered > li::before {
    content: counter(step, decimal-leading-zero);
    display: block;
    font-family: var(--display);
    font-size: 2.6rem;
    font-weight: 300;
    color: var(--brass);
    line-height: 1;
    margin-bottom: 0.9rem;
}

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

.field { margin-bottom: 1.35rem; }
.field > label,
.field-label {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-50);
    margin-bottom: 0.55rem;
}

.input, select.input, textarea.input {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--ink);
    transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
    -webkit-appearance: none;
    appearance: none;
}
.input:focus {
    border-color: var(--brass);
    box-shadow: 0 0 0 3px var(--brass-wash);
    outline: none;
}
textarea.input { min-height: 6.5rem; resize: vertical; }
select.input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237A7267' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.field__error { color: var(--danger); font-size: 0.78rem; margin-top: 0.4rem; display: block; }
.input.has-error { border-color: var(--danger); }

.checkbox {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    font-size: 0.86rem;
    color: var(--ink-70);
    line-height: 1.5;
    cursor: pointer;
}
.checkbox input { margin-top: 0.28rem; accent-color: var(--brass); width: 1rem; height: 1rem; flex: none; }

/* Honeypot — hidden from people, visible to naive bots. */
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

.notice {
    padding: 0.95rem 1.15rem;
    border-left: 2px solid var(--brass);
    background: var(--brass-wash);
    font-size: 0.88rem;
    margin-bottom: 1.5rem;
}
.notice--error { border-left-color: var(--danger); background: rgba(140, 59, 46, 0.07); }
.notice--success { border-left-color: var(--success); background: rgba(63, 96, 70, 0.08); }

/* --- Studio -------------------------------------------------------------- */

.studio { padding-block: clamp(2rem, 5vh, 4rem) 5rem; }

.steps {
    display: flex; flex-wrap: wrap; gap: 0.5rem 2rem;
    margin-bottom: 2.5rem; padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink-30);
}
.steps span { display: inline-flex; align-items: center; gap: 0.5rem; transition: color 0.4s var(--ease); }
.steps span::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; opacity: 0.5;
}
.steps span.is-active { color: var(--brass-text); font-weight: 500; }
.steps span.is-done { color: var(--ink-70); }

.studio__layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: clamp(2rem, 4vw, 4rem);
    align-items: start;
}
@media (max-width: 1000px) { .studio__layout { grid-template-columns: 1fr; } }

.dropzone {
    position: relative;
    border: 1px dashed var(--ink-30);
    border-radius: var(--radius);
    background: var(--white);
    padding: clamp(2.5rem, 6vw, 5rem) 2rem;
    text-align: center;
    transition: border-color 0.35s var(--ease), background 0.35s var(--ease);
}
.dropzone.is-dragover { border-color: var(--brass); background: var(--brass-wash); }
.dropzone__icon { width: 2.75rem; height: 2.75rem; margin: 0 auto 1.25rem; color: var(--brass); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone__actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }

.preview {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--paper-deep);
    aspect-ratio: 4 / 3;
}
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview__replace {
    position: absolute; top: 0.85rem; right: 0.85rem;
}

.stage {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--ink);
    aspect-ratio: 4 / 3;
    display: grid;
    place-items: center;
    color: var(--paper);
}
.stage__progress { text-align: center; padding: 2rem; max-width: 30rem; }
.stage__bar {
    width: min(18rem, 60vw); height: 1px; background: rgba(246, 243, 238, 0.2);
    margin: 1.75rem auto 1rem; overflow: hidden; position: relative;
}
.stage__bar i {
    position: absolute; inset: 0;
    background: var(--brass-light);
    transform: translateX(-100%);
    animation: sweep 1.8s var(--ease-slow) infinite;
}
@keyframes sweep { to { transform: translateX(100%); } }

.stage__status {
    font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase;
    color: rgba(246, 243, 238, 0.6);
}
.stage__caption { font-family: var(--display); font-size: 1.5rem; font-weight: 300; }

.result-actions {
    display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem;
}

.disclaimer {
    font-size: 0.78rem;
    color: var(--ink-50);
    border-top: 1px solid var(--line-soft);
    padding-top: 0.9rem;
    margin-top: 1.5rem;
}

/* --- Gate (sign in) ------------------------------------------------------ */

.gate {
    border: 1px solid var(--line);
    background: var(--white);
    padding: clamp(1.5rem, 3vw, 2.25rem);
    border-radius: var(--radius);
}
.gate h3 { margin-bottom: 0.5rem; }
.otp-row { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }
.otp-row .field { flex: 1 1 10rem; margin-bottom: 0; }

/* --- Portfolio gallery ---------------------------------------------------- */

.portfolio {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    /* Fixed row height plus row spans, rather than per-item aspect ratios.
       Mixing aspect ratios inside a grid row leaves the shorter item floating
       with dead space beneath it — which is exactly what the first attempt
       did. With a fixed row unit every tile fills its cell exactly. */
    grid-auto-rows: clamp(150px, 15.5vw, 235px);
    gap: clamp(0.75rem, 1.3vw, 1.15rem);
}

.portfolio__item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--paper-deep);
    margin: 0;
    grid-column: span 4;
    grid-row: span 1;
}

/* The lead image runs two columns wide and two rows tall, so the gallery reads
   as a portfolio rather than a uniform product grid. Six items then tile
   exactly: hero (8x2) + two stacked (4x1, 4x1) + a row of three (4+4+4). */
.portfolio__item:nth-child(6n + 1) { grid-column: span 8; grid-row: span 2; }

@media (max-width: 900px) {
    .portfolio { grid-auto-rows: clamp(150px, 26vw, 220px); }
    .portfolio__item { grid-column: span 6; }
    .portfolio__item:nth-child(6n + 1) { grid-column: span 12; grid-row: span 2; }
}
@media (max-width: 560px) {
    .portfolio { grid-auto-rows: clamp(180px, 52vw, 260px); }
    .portfolio__item,
    .portfolio__item:nth-child(6n + 1) { grid-column: span 12; grid-row: span 1; }
}

.portfolio__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.6s var(--ease-slow);
}
.portfolio__item:hover img { transform: scale(1.05); }

.portfolio__caption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 2.5rem 1.25rem 1.1rem;
    background: linear-gradient(to top, rgba(12, 11, 9, 0.86) 0%, rgba(12, 11, 9, 0) 100%);
    color: #fff;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
.portfolio__item:hover .portfolio__caption,
.portfolio__item:focus-within .portfolio__caption { opacity: 1; transform: none; }

/* Touch devices have no hover, so the caption is always shown there. */
@media (hover: none) {
    .portfolio__caption { opacity: 1; transform: none; }
}

.portfolio__title { font-family: var(--display); font-size: 1.3rem; line-height: 1.15; }
.portfolio__meta {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
    white-space: nowrap;
}

/* --- Showcase strip ------------------------------------------------------ */

.showcase-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: min(78vw, 30rem);
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 1.5rem;
    scrollbar-width: thin;
}
.showcase-strip > * { scroll-snap-align: start; }

/* --- Footer -------------------------------------------------------------- */

.site-footer {
    background: var(--ink);
    color: rgba(246, 243, 238, 0.86);
    padding-block: clamp(3.5rem, 8vh, 6rem) 2.5rem;
    font-size: 0.88rem;
}
.site-footer a { color: rgba(246, 243, 238, 0.86); transition: color 0.3s var(--ease); }
.site-footer a:hover { color: var(--brass-light); }
.site-footer h4 {
    font-family: var(--body);
    font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--brass-light); margin-bottom: 1.1rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.site-footer__bottom {
    margin-top: 3.5rem; padding-top: 1.5rem;
    border-top: 1px solid rgba(246, 243, 238, 0.12);
    display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
    font-size: 0.78rem; color: rgba(246, 243, 238, 0.62);
}

/* --- WhatsApp float ------------------------------------------------------ */

.wa-float {
    position: fixed; right: clamp(1rem, 3vw, 2rem); bottom: clamp(1rem, 3vw, 2rem);
    z-index: 50;
    display: inline-flex; align-items: center; gap: 0.6rem;
    padding: 0.85rem 1.25rem;
    background: var(--ink); color: var(--paper);
    border-radius: 999px;
    box-shadow: 0 14px 40px -18px rgba(20, 18, 15, 0.7);
    font-size: 0.76rem; letter-spacing: 0.1em; text-transform: uppercase;
    transition: transform 0.4s var(--ease), background 0.4s var(--ease);
}
.wa-float:hover { transform: translateY(-2px); background: var(--brass); }
.wa-float svg { width: 1.05rem; height: 1.05rem; }

/* --- Scroll reveals ------------------------------------------------------ */

[data-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity var(--dur) var(--ease-slow), transform var(--dur) var(--ease-slow);
    transition-delay: var(--reveal-delay, 0s);
    will-change: opacity, transform;
}
[data-reveal].is-visible { opacity: 1; transform: none; }

/* Slow drift on hero imagery — the "confident" motion, not a bounce. */
.kenburns { animation: kenburns 22s var(--ease-slow) infinite alternate; }
@keyframes kenburns {
    from { transform: scale(1) translate3d(0, 0, 0); }
    to   { transform: scale(1.07) translate3d(-1.2%, -1%, 0); }
}

/* --- Utilities ----------------------------------------------------------- */

.stack > * + * { margin-top: var(--stack-gap, 1rem); }
.cluster { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }

.badge {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--ink-50);
}
.badge--brass { border-color: var(--brass); color: var(--brass); }

/* --- Reduced motion ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    [data-reveal] { opacity: 1; transform: none; }
    .kenburns { animation: none; }
}

/* --- Print --------------------------------------------------------------- */

@media print {
    .site-header, .site-footer, .wa-float, .btn { display: none !important; }
    body { background: #fff; }
}
