/* ─────────────────────────────────────────────────────────────────────────────
   Variation 8: changes on top of the V7 replica. Loaded last on every page.
   Fonts are chosen here, through a few variables; every other file uses those variables.
   ───────────────────────────────────────────────────────────────────────────── */

/* Manrope stays available in case it is used again (no variable uses it today). */
@font-face { font-family: 'Manrope'; src: url('../fonts/manrope-400.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('../fonts/manrope-500.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('../fonts/manrope-600.ttf') format('truetype'); font-weight: 600; font-display: swap; }

:root {
  /* Garamond for headlines only. EB Garamond is free (Google Fonts) and is also the email typeface.
     To use Garamond Premier Pro from Adobe Fonts: add the kit and put 'garamond-premier-pro' first. */
  --f-heading: 'EB Garamond', Georgia, 'Times New Roman', serif;
  /* Mono (DM Mono, css/mono.css) for everything that works as a label: menu, buttons, numbering, details. */
  --f-label: 'DM Mono', ui-monospace, monospace;
  --f-text: var(--f-label);
  --f-menu: var(--f-label);
  /* Body text: Spline Sans Mono Light (Google Fonts; the link is on every page). Size, letter-spacing, weight and
     variable axes travel with the font, because monospaced faces run wider. To change the font, change these
     lines and the Google Fonts link on every page. */
  --f-body: 'Spline Sans Mono', 'Helvetica Neue', Arial, sans-serif;
  --size-body: 13.5px;
  --tracking-body: -0.01em;
  --weight-body: 300;
  --axes-body: normal;

  --accent: #b9592c;     /* orange from the logo mark: the highlighted word in each headline */
  --cta-radius: 2px;     /* corner radius of the calls to action */
  --fill-anim: .45s cubic-bezier(.22, 1, .36, 1);   /* animation of the links that turn into buttons */
  --ease-soft: cubic-bezier(.22, 1, .36, 1);           /* easing curve for the photo animations (the same one Hinter uses) */

  /* The new renders already carry their grade (Kodak Portra): the site adds no filter or tint. */
  --film: none;
  --film-dark: none;
  --tint: none;
}

/* ── Headlines and body text ──────────────────────────────────────────────── */
h1, h2, h3, h4 { letter-spacing: -0.005em; }
.accent { font-style: italic; color: var(--accent); }
/* Body text in a light face with character: one size across the site, tight line spacing. */
p.sans { font-family: var(--f-body); font-weight: var(--weight-body); font-variation-settings: var(--axes-body); font-size: var(--size-body) !important; line-height: 1.55 !important; letter-spacing: var(--tracking-body); }
p.sans strong, p.sans b { font-weight: 500; }
footer p.sans { font-size: calc(var(--size-body) - 1px) !important; }
/* Boxed buttons are always mono, even when the class is missing */
a.box, button.box, .btn { font-family: var(--f-label) !important; }
/* Short details (studio · guest room · place to work) stay mono */
span.sans { font-family: var(--f-label); }
.menu span.sans { font-size: 13px !important; }
/* Configurator: its paragraphs set the font through their own inline style */
p[style*="--f-text"] { font-family: var(--f-body) !important; font-weight: var(--weight-body); font-variation-settings: var(--axes-body); line-height: 1.55; letter-spacing: var(--tracking-body); }

/* Garamond headings inside The cabin and Materials & process pages */
.mid-title { font-size: clamp(26px, 2.6vw, 38px); line-height: 1.15; color: var(--ink); margin-bottom: 20px; text-wrap: balance; }
.topic-title { font-size: clamp(22px, 2vw, 28px); line-height: 1.2; color: var(--ink); margin-bottom: 12px; }
.spec-title { font-size: 21px; line-height: 1.2; color: var(--ink); margin-bottom: 16px; }
.step-title { font-size: clamp(26px, 2.3vw, 32px); line-height: 1.15; color: var(--ink); margin-bottom: 12px; }

/* ── Top menu: more room between items ──────────────────────────────────── */
header > div:first-child > div, header nav.desk { gap: clamp(30px, 3.2vw, 48px) !important; }
.footer-nav { gap: 14px clamp(30px, 3.2vw, 48px) !important; }

/* ── Links that turn into buttons ─────────────────────────────────────────────
   The underline (or nothing, in the menu) rises from below and becomes a small filled box. */
.ul, .btn { position: relative; z-index: 0; border-bottom-color: transparent !important; transition: color .3s ease; }
.ul::before, .btn::before {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  left: 0; right: 0; bottom: 0; height: 0;
  background: var(--ink); border-radius: 0;
  transition: left var(--fill-anim), right var(--fill-anim), bottom var(--fill-anim), height var(--fill-anim), border-radius var(--fill-anim), background-color .3s ease;
}
/* Links that show an underline at rest */
.ul.line::before, .ul:is([style*="border-bottom-color:var(--ink)"], [style*="border-bottom-color: var(--ink)"])::before, .btn::before { height: 1px; }
.ul:hover::before, .ul:focus-visible::before, .btn:hover::before, .btn:focus-visible::before, a:hover .ul.view::before {
  left: -11px; right: -11px; bottom: -6px; height: calc(100% + 12px); border-radius: var(--cta-radius);
}
.ul:hover, .ul:focus-visible, .btn:hover, .btn:focus-visible, a:hover .ul.view { color: var(--bg) !important; }
/* Underlined links sit flush with the column edge: when they become a button, the box starts at that edge
   and the text moves in a little, so nothing breaks out of the grid. "View" sits on the right, so it moves in to the left. */
.ul.line, .ul.view, .ul:is([style*="border-bottom-color:var(--ink)"], [style*="border-bottom-color: var(--ink)"]) { display: inline-block; transition: color .3s ease, transform var(--fill-anim); }
/* inline-block: a bare inline link cannot be shifted, and its box used to break out of the column ("Learn more").
   The style is matched with and without a space after the colon, because pages rendered by React write it with a space. */
.ul.line:hover, .ul.line:focus-visible,
.ul:is([style*="border-bottom-color:var(--ink)"], [style*="border-bottom-color: var(--ink)"]):hover, .ul:is([style*="border-bottom-color:var(--ink)"], [style*="border-bottom-color: var(--ink)"]):focus-visible { transform: translateX(11px); }
a:hover .ul.view, .ul.view:focus-visible { transform: translateX(-11px); }
/* A link inside a paragraph does not become a button: it stays underlined and shows the pointer */
p.sans .ul { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; cursor: pointer; transform: none !important; }
p.sans .ul::before { display: none; }
p.sans .ul:hover, p.sans .ul:focus-visible { color: inherit !important; }
/* Closing buttons ("Start designing", "Talk to us"): mono, like the rest of the links */
.btn { font-family: var(--f-label); font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; padding: 4px 0; line-height: 1.6; }
.btn[style*="var(--line)"]::before { background: color-mix(in srgb, var(--ink) 25%, transparent); }
.btn[style*="var(--line)"]:hover::before, .btn[style*="var(--line)"]:focus-visible::before { background: var(--ink); }
/* In the photo viewer (dark background) the box is light */
.lb .ul::before { background: var(--bg); }
.lb .ul:hover, .lb .ul:focus-visible { color: var(--ink) !important; }

/* ── Boxed CTAs ("Design your cabin" at the top, "Send", "Add"…): corner radius and fill from below ── */
.box { border-radius: var(--cta-radius); background-position: 50% 100%; background-size: 100% 0%; transition: background-size var(--fill-anim), color .25s ease; }
.box:hover { background-size: 100% 100%; }

/* ── Photos: they slowly zoom in on hover ───────────────────────────────── */
.frame > img { transition: transform 1.2s var(--ease-soft); }
.frame:hover > img { transform: scale(1.03); }
/* The "How Bhu began" photos are black and white and turn to color on hover */
.frame > img.photo.bw { transition: filter 1.4s var(--ease-soft), transform 1.2s var(--ease-soft); }
.frame:hover > img.photo.bw { filter: grayscale(0) contrast(1) brightness(1); }

/* ── Cabin pages: spec sheet with mono labels and sans text ─── */
.spec dt { font-family: var(--f-label); font-weight: 500; font-size: 11px; letter-spacing: .14em; }
.spec dd span { font-family: var(--f-body); font-weight: var(--weight-body); font-variation-settings: var(--axes-body); font-size: calc(var(--size-body) - 1px); line-height: 1.5; letter-spacing: var(--tracking-body); }

/* ── Configurator: "Kitchen and bathroom". Each tile switches the photo above (see _v8 in the configurator script) ── */
.plate { aspect-ratio: 1 / 1; border-radius: 2px; overflow: hidden; }
.plate-photos { position: relative; width: 100%; height: 100%; }
.plate-photos img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.03); transition: opacity .8s ease, transform 1.6s var(--ease-soft); }
.plate-photos img.active { opacity: 1; transform: none; }
.option { display: block; width: 100%; text-align: left; cursor: pointer; padding: 16px 18px; border-radius: 2px; background: var(--nb-bg); border: 1px solid transparent; transition: border-color .3s ease, background-color .3s ease; }
.option:hover { border-color: color-mix(in srgb, var(--nb-ink) 30%, transparent); }
.option[aria-pressed="true"] { border-color: var(--nb-ink); }
.option span + span { font-family: var(--f-body) !important; font-weight: var(--weight-body); font-variation-settings: var(--axes-body); line-height: 1.45; }

/* ── Landing: "Built for a restful body" as a list with a photo ──────────────
   Hovering a point shows its photo (in color); tapping the photo moves to the next one (js/v8.js).
   On phones each point carries its photo underneath. */
.benefit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.benefit-list { display: flex; flex-direction: column; }
.benefit .b { padding: clamp(18px, 2vw, 26px) 0; border-top: 1px solid var(--line); cursor: default; outline: none; }
.benefit .b:last-child { border-bottom: 1px solid var(--line); }
.benefit .b h3 { font-size: clamp(24px, 2.4vw, 32px); line-height: 1.12; }
.benefit .b p { color: var(--body); margin-top: 10px; max-width: 52ch; }
.benefit .b.active h3, .benefit .b:focus-visible h3 { transform: translateX(6px); }
.benefit .b > h3, .benefit .b > p { transition: opacity .5s ease, transform var(--fill-anim); }
.benefit-list:hover .b:not(.active) > h3, .benefit-list:hover .b:not(.active) > p { opacity: .45; }
.benefit-photos { position: sticky; top: 120px; aspect-ratio: 4 / 5; cursor: pointer; }
.benefit-photos .bf { position: absolute; inset: 0; opacity: 0; transform: scale(1.04); transition: opacity .9s ease, transform 1.8s var(--ease-soft); }
.benefit:not([data-active]) .bf0,
.benefit[data-active="0"] .bf0, .benefit[data-active="1"] .bf1,
.benefit[data-active="2"] .bf2, .benefit[data-active="3"] .bf3 { opacity: 1; transform: none; }
.benefit-n { position: absolute; left: 16px; bottom: 14px; z-index: 3; color: #fff; font-size: 10.5px; text-shadow: 0 1px 8px rgba(0, 0, 0, .35); pointer-events: none; }
.benefit-n::after { content: '→'; display: inline-block; margin-left: 10px; transition: transform var(--fill-anim); }
.benefit-photos:hover .benefit-n::after { transform: translateX(5px); }
.benefit-mobile { display: none; }
@media (max-width: 720px) {
  .benefit { grid-template-columns: minmax(0, 1fr); }
  .benefit-photos { display: none; }
  .benefit-mobile { display: block; aspect-ratio: 4 / 3; margin-top: 16px; }
}

/* ── Footer: inline links, like the header ───────────────────────────────── */
.footer-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; align-content: start; }
@media (max-width: 720px) { .footer-nav { justify-content: flex-start; } }
@media (min-width: 721px) {
  footer .two { grid-template-columns: minmax(0, 1fr) auto !important; }
  /* The links drop to the height of the text on the left (below the logo) */
  .footer-nav { flex-wrap: nowrap; padding-top: 62px; }
}

/* ── Entrance animations (pages whose <body> has the reveal class) ──────────
   Like Hinter: the cover photo settles slowly, text fades in as you scroll, and
   photos ease back slightly as they enter the screen. Nothing moves if the visitor asked for reduced motion. */
@keyframes llegada { from { scale: 1.05; } to { scale: 1; } }
@keyframes respira { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }
@keyframes acerca { from { scale: 1.07; } to { scale: 1; } }
@media (prefers-reduced-motion: no-preference) {
  .reveal header + section.frame > img.photo { animation: llegada 2.6s var(--ease-soft); }
  @supports (animation-timeline: view()) {
    .reveal section h1, .reveal section h2, .reveal section h3, .reveal section p.sans, .reveal .benefit .b {
      animation: respira linear both; animation-timeline: view(); animation-range: entry 0% entry 100%;
    }
    .reveal .benefit .b h3, .reveal .benefit .b p { animation: none; }
    .reveal .frame > img.photo { animation: acerca linear both; animation-timeline: view(); animation-range: entry 0% cover 50%; }
    .reveal header .frame > img.photo, .reveal .benefit-photos > img { animation: none; }
  }
}

/* ── Configurator: no "film look" ────────────────────────────────────────────
   V7 applied a filter to the photos (more contrast, less brightness and color) that darkened them.
   The configurator writes it on :root from its own code; !important overrides it. */
:root { --nb-film: none !important; --nb-film-dark: none !important; }
