/* ============================================================
   HomeTourDaddy landing page
   No framework. A landing page does not need a build step.
   Theme is locked dark. One accent. One radius rule.
   ============================================================ */

@layer reset, base, layout, components, motion;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; }
  body { -webkit-font-smoothing: antialiased; }
  img, video, svg { display: block; max-width: 100%; }
  button, input { font: inherit; color: inherit; }
}

@layer base {
  :root {
    /* Palette. Off-black, never #000. One accent: warm amber, the colour of
       interior light at dusk — which is literally what sells a house. */
    --ink:        #0B0B0C;
    --ink-raised: #121214;
    --ink-line:   #26262A;
    --paper:      #F2F0EC;
    --muted:      #8A8A93;
    --muted-dim:  #5C5C64;
    --amber:      #E8A33D;
    --amber-dim:  #A8752A;

    /* One radius rule: 4px on anything interactive, 0 on media. */
    --r: 4px;

    --measure: 62ch;
    --gutter: clamp(1.25rem, 4vw, 3rem);
    --shell: 1320px;

    /* Cinematic ease. Used everywhere so motion feels like one hand made it. */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);

    --font: ui-sans-serif, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    color-scheme: dark;
  }

  body {
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.6;
    letter-spacing: -0.011em;
  }

  h1, h2, h3 {
    letter-spacing: -0.035em;
    line-height: 1.05;
    text-wrap: balance;
    font-weight: 560;
  }

  h1 { font-size: clamp(2.6rem, 6.2vw, 5rem); }
  h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); }
  h3 { font-size: clamp(1.15rem, 1.6vw, 1.4rem); font-weight: 540; }

  p { text-wrap: pretty; }
  a { color: inherit; text-decoration: none; }

  ::selection { background: var(--amber); color: var(--ink); }

  /* Visible to screen readers, not to eyes. Preferred over aria-label
     because it survives translation. */
  .sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

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

@layer layout {
  .shell {
    width: 100%;
    max-width: var(--shell);
    margin-inline: auto;
    padding-inline: var(--gutter);
  }

  section { padding-block: clamp(4rem, 7.5vw, 6.75rem); }

  .lede {
    color: var(--muted);
    font-size: clamp(1.02rem, 1.25vw, 1.18rem);
    max-width: var(--measure);
  }

  /* Section label. Rationed: three on the whole page, by design. */
  .label {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--amber-dim);
    margin-bottom: 1.5rem;
  }
}

/* ============================ NAV ============================ */
@layer components {
  .nav {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 68px;
    display: flex;
    align-items: center;
    background: color-mix(in oklab, var(--ink) 82%, transparent);
    backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s var(--ease);
  }
  .nav[data-stuck="true"] { border-bottom-color: var(--ink-line); }

  .nav .shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
  }

  .wordmark {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    font-size: 1.02rem;
    white-space: nowrap;
  }
  .wordmark .aperture { width: 19px; height: 19px; flex: none; color: var(--amber); }

  .nav-links {
    display: flex;
    gap: 2rem;
    font-size: 0.9rem;
    color: var(--muted);
  }
  .nav-links a { transition: color 0.2s var(--ease); }
  .nav-links a:hover { color: var(--paper); }
  @media (max-width: 860px) { .nav-links { display: none; } }

  /* --------------------------- BUTTONS --------------------------- */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    border-radius: var(--r);
    border: 1px solid transparent;
    padding: 0.72rem 1.15rem;
    font-size: 0.92rem;
    font-weight: 520;
    cursor: pointer;
    transition: transform 0.15s var(--ease), background-color 0.2s var(--ease),
                border-color 0.2s var(--ease), color 0.2s var(--ease);
  }
  .btn:active { transform: translateY(1px); }

  /* Amber on near-black text: 8.1:1. Passes AA comfortably. */
  .btn-primary { background: var(--amber); color: #17120A; }
  .btn-primary:hover { background: #F2B356; }

  .btn-ghost { border-color: var(--ink-line); color: var(--paper); background: transparent; }
  .btn-ghost:hover { border-color: var(--muted-dim); background: var(--ink-raised); }

  /* ---------------------------- HERO ----------------------------- */
  .hero {
    position: relative;
    min-height: min(92dvh, 880px);
    display: flex;
    align-items: center;
    padding-block: clamp(3rem, 8vw, 6rem);
    overflow: hidden;
    isolation: isolate;
  }

  .hero-bed {
    position: absolute;
    inset: 0;
    z-index: -2;
  }
  .hero-bed video, .hero-bed img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Two-stop scrim. Left-weighted so the copy column always clears AA
     regardless of which frame of the loop is on screen. */
  .hero-bed::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(100deg, rgb(11 11 12 / 0.94) 0%, rgb(11 11 12 / 0.72) 42%, rgb(11 11 12 / 0.28) 100%),
      linear-gradient(to top, rgb(11 11 12 / 0.9) 0%, transparent 38%);
  }

  .hero-copy { max-width: 40rem; }
  .hero-copy h1 { margin-bottom: 1.35rem; }
  /* Lifted off --muted. This copy sits over a moving image, so the worst
     frame of the loop sets the contrast floor, not the average one. */
  .hero-copy .lede { margin-bottom: 2.25rem; color: #D6D4CF; }
  .hero em {
    font-style: italic;
    color: var(--amber);
    line-height: 1.1;
    padding-bottom: 0.06em;
    display: inline-block;
  }

  /* The paste field is the primary CTA. The product is "give us a link", so
     the hero should let them do exactly that without a page change. */
  .paster {
    display: flex;
    gap: 0.5rem;
    padding: 0.4rem;
    background: color-mix(in oklab, var(--ink-raised) 88%, transparent);
    border: 1px solid var(--ink-line);
    border-radius: var(--r);
    backdrop-filter: blur(10px);
    max-width: 33rem;
    transition: border-color 0.25s var(--ease);
  }
  .paster:focus-within { border-color: var(--amber-dim); }
  .paster input {
    flex: 1;
    min-width: 0;
    background: none;
    border: 0;
    padding: 0.6rem 0.75rem;
    outline: none;
  }
  /* 4.7:1 against the field background. Placeholders are text too. */
  .paster input::placeholder { color: #9A9AA3; }

  .hero-sources {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    margin-top: 1.4rem;
    font-size: 0.82rem;
    color: #A9A7A2;
  }

  /* ------------------------- SCROLL SCRUB ------------------------- */
  /* The section is tall; the stage is sticky; scroll position picks the
     frame painted to the canvas. The technique from the scroll-cinematic
     playbook, sized to one shot: 61 frames, lazy-loaded on approach.
     Frame 0 is the untouched listing photo, so the gesture itself is the
     before/after. */
  .scrub {
    position: relative;
    height: 320vh;
    padding-block: 0;
  }

  .scrub-stage {
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow: hidden;
    isolation: isolate;
  }

  .scrub-stage canvas,
  .scrub-fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* JS promotes the canvas and demotes the fallback once frames load.
     Until then (and forever under reduced motion) the video carries it. */
  .scrub-stage canvas { display: none; }
  .scrub.is-live .scrub-stage canvas { display: block; }
  .scrub.is-live .scrub-fallback { display: none; }

  .scrub-copy {
    position: absolute;
    left: 0;
    right: 0;
    bottom: clamp(2.5rem, 8vh, 5rem);
    display: grid;
    justify-items: start;
    padding-inline: var(--gutter);
    max-width: var(--shell);
    margin-inline: auto;
    z-index: 2;
  }

  .scrub-line {
    grid-area: 1 / 1;
    max-width: 26rem;
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    color: #E9E7E2;
    background: rgb(11 11 12 / 0.78);
    backdrop-filter: blur(8px);
    padding: 0.9rem 1.1rem;
    border-radius: var(--r);
    border: 1px solid var(--ink-line);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
  }
  .scrub-line strong { color: var(--amber); font-weight: 560; }
  .scrub-line.is-on { opacity: 1; transform: none; }

  @media (prefers-reduced-motion: reduce) {
    .scrub { height: auto; }
    .scrub-stage { position: static; height: auto; aspect-ratio: 16 / 9; }
    .scrub-copy { position: static; padding-block: 1.5rem; }
    .scrub-line { opacity: 1; transform: none; }
    .scrub-line:not(:first-child) { display: none; }
  }

  /* ------------------------ VS TEMPLATES -------------------------- */
  .vs {
    display: grid;
    gap: 1px;
    background: var(--ink-line);
    border: 1px solid var(--ink-line);
    overflow-x: auto;
  }
  .vs-row {
    display: grid;
    grid-template-columns: minmax(8rem, 0.7fr) 1fr 1fr;
    gap: 1px;
    background: var(--ink-line);
  }
  .vs-row > span {
    background: var(--ink);
    padding: 1.1rem 1.25rem;
    font-size: 0.93rem;
    color: var(--muted);
  }
  .vs-head > span {
    padding-block: 0.8rem;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted-dim);
  }
  .vs-dim { color: var(--muted-dim); }
  .vs-us { background: var(--ink-raised) !important; color: var(--paper) !important; }
  .vs-head .vs-us { color: var(--amber) !important; }
  @media (max-width: 720px) {
    .vs-row { grid-template-columns: 1fr; }
    .vs-head { display: none; }
    .vs-row > span:nth-child(2)::before { content: "Template platforms — "; color: var(--muted-dim); }
    .vs-row .vs-us::before { content: "Here — "; color: var(--amber-dim); }
  }

  /* --------------------------- TWO UP ---------------------------- */
  /* Deliberately not a drag-compare. A split handle implies the two sides are
     spatially aligned; here the camera has travelled, so a seam reads as two
     different rooms. Side by side, labelled, says it without the confusion. */
  .twoup { display: grid; gap: 1px; background: var(--ink-line);
           border: 1px solid var(--ink-line); }
  @media (min-width: 820px) { .twoup { grid-template-columns: 1fr 1fr; } }

  .twoup-panel { position: relative; background: var(--ink); margin: 0; }
  .twoup-panel img, .twoup-panel video {
    width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block;
  }
  .twoup-panel figcaption {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 2.5rem 1.1rem 0.95rem;
    background: linear-gradient(to top, rgb(11 11 12 / 0.9), transparent);
    font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--paper);
  }
  /* The right panel is the one doing the work. Mark it without a badge. */
  .twoup-panel:last-child figcaption { color: var(--amber); }

  /* --------------------------- STEPS ----------------------------- */
  /* Four short beats in a 2x2. They had illustrative art per row, but every
     image was already used in the hero or the move grid, and four identical
     text-left / image-right rows in a column is the most tiring layout on the
     internet. The words carry it. */
  .steps {
    display: grid;
    gap: 1px;
    background: var(--ink-line);
    border: 1px solid var(--ink-line);
    margin-top: 2.75rem;
  }
  @media (min-width: 800px) { .steps { grid-template-columns: 1fr 1fr; } }

  .step {
    background: var(--ink);
    padding: 2rem 1.9rem 2.25rem;
    display: grid;
    gap: 0.7rem;
    align-content: start;
  }
  .step-n {
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    color: var(--amber-dim);
  }
  .step p { color: var(--muted); font-size: 0.95rem; }

  /* ------------------------- MOVE GRID --------------------------- */
  /* Five clips, five cells, no holes. A 3-col grid with a 2x2 hero needs six
     slots and leaves one empty, so instead the hero takes a full-height left
     column and the other four fill a 2x2 beside it. Exactly filled. */
  .moves {
    display: grid;
    gap: 1px;
    background: var(--ink-line);
    border: 1px solid var(--ink-line);
    grid-template-columns: 1fr;
  }
  @media (min-width: 800px) {
    .moves {
      grid-template-columns: 1.55fr 1fr 1fr;
      grid-template-rows: repeat(2, minmax(0, 14.5rem));
    }
    .moves > :first-child { grid-row: span 2; }
    .move { aspect-ratio: auto; height: 100%; }
  }

  .move {
    position: relative;
    background: var(--ink);
    aspect-ratio: 16 / 10;
    overflow: hidden;
    margin: 0;
  }
  .move video, .move img { width: 100%; height: 100%; object-fit: cover; opacity: 0.92; }
  .move figcaption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 2.25rem 1.25rem 1.1rem;
    background: linear-gradient(to top, rgb(11 11 12 / 0.92), transparent);
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
  }
  .move strong { font-weight: 540; font-size: 0.98rem; }
  .move span { font-family: var(--mono); font-size: 10.5px; color: #A9A7A2; letter-spacing: 0.08em; }

  /* ------------------------- STATEMENT --------------------------- */
  .statement {
    border-block: 1px solid var(--ink-line);
    background: var(--ink-raised);
  }
  .statement-grid { display: grid; gap: clamp(2rem, 5vw, 4.5rem); }
  @media (min-width: 940px) { .statement-grid { grid-template-columns: 1.05fr 0.95fr; align-items: center; } }
  .statement h2 { margin-bottom: 1.5rem; }

  .rules { display: grid; gap: 1px; background: var(--ink-line); border: 1px solid var(--ink-line); }
  .rule { background: var(--ink); padding: 1.35rem 1.5rem; display: flex; gap: 1rem; align-items: flex-start; }
  .rule svg { flex: none; margin-top: 3px; color: var(--amber); }
  .rule p { font-size: 0.94rem; color: var(--muted); margin-top: 0.25rem; }
  .rule strong { font-weight: 540; }

  /* ------------------------- SURFACES ---------------------------- */
  .surfaces { display: grid; gap: 1.5rem; }
  @media (min-width: 900px) { .surfaces { grid-template-columns: 1.25fr 1fr 1fr; } }
  .surface {
    border: 1px solid var(--ink-line);
    padding: 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    background: var(--ink-raised);
    min-height: 15rem;
  }
  .surface-mark { color: var(--amber); }
  .surface p { color: var(--muted); font-size: 0.94rem; }
  .surface .pill {
    margin-top: auto;
    align-self: flex-start;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted-dim);
    border: 1px solid var(--ink-line);
    border-radius: var(--r);
    padding: 0.3rem 0.55rem;
  }

  /* -------------------------- PRICING ---------------------------- */
  .plans { display: grid; gap: 1px; background: var(--ink-line); border: 1px solid var(--ink-line); }
  @media (min-width: 980px) { .plans { grid-template-columns: repeat(4, 1fr); } }
  .plan {
    background: var(--ink);
    padding: 1.9rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
  }
  .plan[data-featured="true"] { background: var(--ink-raised); }
  .plan-name { display: flex; align-items: center; gap: 0.6rem; font-weight: 560; }
  .plan-name .flag {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #17120A;
    background: var(--amber);
    border-radius: var(--r);
    padding: 0.2rem 0.4rem;
  }
  .plan-price { display: flex; align-items: baseline; gap: 0.35rem; }
  .plan-price b { font-size: 2.4rem; font-weight: 560; letter-spacing: -0.04em; }
  .plan-price span { color: var(--muted-dim); font-size: 0.86rem; }
  .plan-note { font-size: 0.86rem; color: var(--muted); min-height: 2.6rem; }
  .plan ul { list-style: none; padding: 0; display: grid; gap: 0.6rem; font-size: 0.9rem; }
  .plan li { display: flex; gap: 0.6rem; color: var(--muted); }
  .plan li svg { flex: none; margin-top: 5px; color: var(--amber-dim); }
  .plan .btn { margin-top: auto; width: 100%; }

  .plans-foot {
    margin-top: 1.5rem;
    font-size: 0.88rem;
    color: var(--muted-dim);
    max-width: var(--measure);
  }

  /* --------------------------- FOOTER ---------------------------- */
  .foot { border-top: 1px solid var(--ink-line); padding-block: 3.5rem 2.5rem; }
  .foot-grid { display: grid; gap: 2.5rem; }
  @media (min-width: 780px) { .foot-grid { grid-template-columns: 1.6fr repeat(3, 1fr); } }
  .foot h4 { font-size: 0.78rem; font-family: var(--mono); letter-spacing: 0.16em;
             text-transform: uppercase; color: var(--muted-dim); margin-bottom: 1rem; font-weight: 400; }
  .foot ul { list-style: none; padding: 0; display: grid; gap: 0.6rem; font-size: 0.9rem; color: var(--muted); }
  .foot a:hover { color: var(--paper); }
  .foot-base {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--ink-line);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--muted-dim);
  }

  .disclosure {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--muted-dim);
    border: 1px solid var(--ink-line);
    border-radius: var(--r);
    padding: 0.4rem 0.7rem;
  }
}

/* ============================ MOTION ============================ */
@layer motion {
  /* Reveal on scroll. Communicates reading order in a page that is mostly
     silent video; nothing here is decorative.

     Gated on .js, which an inline script in <head> sets before first paint.
     Without that gate the failure mode is catastrophic: any JS error leaves
     every section at opacity 0 and the page looks empty below the hero.
     Content is visible by default; the reveal is the enhancement. */
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  }
  .js [data-reveal].is-in { opacity: 1; transform: none; }

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

/* ---------------------- TOUR PAGE ---------------------- */
@layer components {
  .tour-frame {
    border: 1px solid var(--ink-line);
    background: #000;
    overflow: hidden;
  }
  .tour-frame video { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; display: block; }

  .tour-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--ink-line);
    border: 1px solid var(--ink-line);
    border-top: 0;
  }
  @media (min-width: 700px) { .tour-meta { grid-template-columns: repeat(4, 1fr); } }
  .tour-meta > div {
    background: var(--ink);
    padding: 1.25rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
  }
  .tour-meta strong {
    font-size: 1.5rem; font-weight: 560; letter-spacing: -0.03em; color: var(--amber);
  }
  .tour-meta span {
    font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--muted);
  }

  .tour-vertical { display: flex; justify-content: center; }
  .tour-vertical video {
    width: min(100%, 300px);
    aspect-ratio: 9 / 16;
    border: 1px solid var(--ink-line);
    background: #000;
    display: block;
  }
}
