/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: "Fraunces";
  src: url("../assets/fonts/fraunces-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  --ink: #0e0e0e;
  --paper: #f5f0ea;
  --champagne: #e8d5c0;
  --font-display: "Fraunces", serif;
  --font-body: "Inter", system-ui, sans-serif;
  --space: clamp(1.5rem, 4vw, 4rem);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.1vw, 1.125rem);
  line-height: 1.6;
  background: var(--ink);
  color: var(--paper);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(var(--space) * 0.75) var(--space);
  z-index: 10;
  mix-blend-mode: difference;
  color: #fff;
}
.logo { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: 0.02em; }
.logo-star { font-size: 0.7em; vertical-align: super; }
.menu-link { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.12em; }

/* ---------- Contact panel ---------- */
.contact-panel {
  position: fixed;
  top: calc(var(--space) * 1.9);
  right: var(--space);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
  min-width: 19rem;
  padding: 1.75rem 2rem;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid rgba(232, 213, 192, 0.35); /* crisp champagne hairline */
  /* hardware-accelerated open/close */
  opacity: 0;
  transform: translateY(-0.75rem);
  visibility: hidden;
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              visibility 0s linear 0.45s;
  will-change: transform, opacity;
}
.contact-panel.is-open {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  transition-delay: 0s;
}
.contact-panel-eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--champagne);
  opacity: 0.85;
}
.contact-panel-link {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.6vw, 1.5rem);
  line-height: 1.3;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, color 0.25s ease;
}
.contact-panel-link:hover {
  color: var(--champagne);
  border-bottom-color: var(--champagne);
}
@media (prefers-reduced-motion: reduce) {
  .contact-panel { transition: opacity 0.2s ease, visibility 0s linear 0.2s; transform: none; }
  .contact-panel.is-open { transition-delay: 0s; }
}
@media (max-width: 720px) {
  .contact-panel { left: var(--space); right: var(--space); min-width: 0; align-items: flex-start; }
}

/* ---------- Haven acquisition drawer ---------- */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(14, 14, 14, 0.55);
  opacity: 0; visibility: hidden;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}
.drawer-overlay.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
.drawer {
  position: fixed; inset: 0 0 0 auto; z-index: 40;
  width: min(30rem, 92vw);
  padding: clamp(2rem, 4vw, 3.5rem);
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 1.75rem;
  background: var(--ink); color: var(--paper);
  border-left: 1px solid rgba(232, 213, 192, 0.35);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              visibility 0s linear 0.55s;
  will-change: transform;
}
.drawer.is-open { transform: none; visibility: visible; transition-delay: 0s; }
@media (prefers-reduced-motion: reduce) {
  .drawer { transition-duration: 0.2s; transform: none; opacity: 0; }
  .drawer.is-open { opacity: 1; }
}
.drawer-close {
  position: absolute; top: 1.1rem; right: 1.25rem;
  width: 2.5rem; height: 2.5rem;
  background: none; border: none; cursor: pointer;
  color: var(--paper); font-size: 1.75rem; line-height: 1;
  transition: color 0.25s ease;
}
.drawer-close:hover { color: var(--champagne); }
.drawer-title {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(1.9rem, 3vw, 2.6rem); line-height: 1.05;
  color: var(--champagne);
  padding-right: 2.5rem;
}
.drawer-cta {
  align-self: flex-start;
  padding: 0.8em 1.8em;
  font-size: 0.8rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--ink); background: var(--paper);
  border-radius: 999px;
  transition: background 0.25s ease;
}
.drawer-cta:hover { background: var(--champagne); }
.drawer-heading {
  font-size: 0.75rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--champagne); opacity: 0.85;
  margin-bottom: 0.9rem;
}
.drawer-list { list-style: none; display: grid; gap: 0.55rem; }
.drawer-list li {
  padding-left: 1.4rem; position: relative;
  font-size: 0.95rem; line-height: 1.5; opacity: 0.9;
}
.drawer-list li::before {
  content: "✦"; position: absolute; left: 0; top: 0.1em;
  font-size: 0.7em; color: var(--champagne);
}
.drawer-form { display: flex; flex-direction: column; gap: 1.1rem; border-top: 1px solid rgba(245, 240, 234, 0.15); padding-top: 1.75rem; }
.drawer-field { display: flex; flex-direction: column; gap: 0.35rem; }
.drawer-field span {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.16em; opacity: 0.7;
}
.drawer-field input, .drawer-field textarea {
  background: transparent; border: none;
  border-bottom: 1px solid rgba(245, 240, 234, 0.35);
  padding: 0.45em 0; color: var(--paper);
  font-family: var(--font-body); font-size: 1rem;
  resize: vertical;
}
.drawer-field input:focus, .drawer-field textarea:focus {
  outline: none; border-bottom-color: var(--champagne);
}
.drawer-submit {
  align-self: flex-start; margin-top: 0.4rem;
  padding: 0.8em 1.8em; cursor: pointer;
  font-size: 0.8rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--paper); background: none;
  border: 1px solid var(--champagne); border-radius: 999px;
  transition: background 0.25s ease, color 0.25s ease;
}
.drawer-submit:hover { background: var(--champagne); color: var(--ink); }
.drawer-submit:disabled { opacity: 0.55; cursor: wait; }
.drawer-form-success {
  color: var(--champagne);
  font-size: 0.95rem;
  line-height: 1.55;
  border: 1px solid rgba(232, 213, 192, 0.35);
  padding: 0.9rem 1.1rem;
}
.drawer-form-error {
  color: var(--paper);
  font-size: 0.9rem;
  opacity: 0.85;
}
.drawer-form-error a { border-bottom: 1px solid var(--champagne); }
.badge--btn { cursor: pointer; background: none; color: inherit; transition: color 0.25s ease, border-color 0.25s ease; }
.badge--btn:hover { color: #7a5c3e; }

/* ---------- Sections ---------- */
.section {
  position: relative;
  padding: calc(var(--space) * 2.5) var(--space);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.section--dark { background: var(--ink); color: var(--paper); }
.section--light { background: var(--paper); color: var(--ink); }

/* ---------- Display type ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(4rem, 16vw, 15rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
}
.display--champagne { color: var(--champagne); }

/* ---------- Hero ---------- */
.hero {
  justify-content: flex-end;
  min-height: 100svh;
  overflow: hidden;
  /* top padding clears the fixed header; bottom padding is the safety
     margin that keeps the name's letter bottoms off the viewport edge */
  padding-top: max(calc(var(--space) * 2), 5.5rem);
  padding-bottom: max(4vh, 1.5rem);
}
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-media img { width: 100%; height: 110%; object-fit: cover; }
.hero-figure {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* framing: head and visor in view, shoulders flaring to the base —
     bottom-anchoring cropped us into the torso and lost the character */
  object-position: center 12%;
  filter: saturate(1.5) contrast(1.05); /* keeps the visor glowing through the multiply */
  /* multiply: the artwork's white bloom dissolves into the dusk gradient
     while the figure reads as a dark silhouette — screen/lighten would do
     the opposite and erase the figure instead of the halo */
  mix-blend-mode: multiply;
  /* radial mask feathers the asset edges: no rectangular border can show */
  -webkit-mask-image: radial-gradient(ellipse 75% 80% at 50% 62%, #000 55%, transparent 95%);
  mask-image: radial-gradient(ellipse 75% 80% at 50% 62%, #000 55%, transparent 95%);
  pointer-events: none;
}
.hero-media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(14,14,14,0.55), rgba(14,14,14,0.05) 50%);
}
/* margin-bottom: auto lets the intro-to-name gap flex: it soaks up spare
   height on tall viewports and collapses to zero on short ones, so the
   full-size name always fits inside the first viewport */
.hero-intro { position: relative; z-index: 1; max-width: 34rem; margin-bottom: auto; font-size: clamp(1.1rem, 1.8vw, 1.5rem); }
.hero-name {
  position: relative; z-index: 1;
  font-size: clamp(5rem, 22vw, 24rem);
  /* no negative bleed: the name stays fully inside the hero's padded box */
  margin-bottom: 0;
  padding-bottom: 0.08em; /* descender room ("pp") at line-height 0.9 */
  color: #fff;
}
.scroll-pill {
  position: absolute; right: var(--space); bottom: 18vh; z-index: 2;
  width: 6rem; height: 6rem; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(245, 240, 234, 0.18);
  backdrop-filter: blur(8px);
  font-size: 0.85rem;
}

/* ---------- Story ---------- */
.story {
  display: grid;
  /* fixed-width text column so it can't balloon on wide screens and
     shove the orb to the margin; the media column takes the center-right
     space immediately after the text */
  grid-template-columns: minmax(0, 40rem) minmax(0, 1fr);
  gap: calc(var(--space) * 1.25);
  align-items: start;
  min-height: 160vh; /* scroll room that drives the orb scrub */
  background: #000; /* pitch black so the video's #000 blends with zero seams */
  isolation: isolate; /* own stacking context: nothing here can overlap the hero name above */
}
.story-text { align-self: center; }
.story-copy { max-width: 36rem; margin-top: calc(var(--space) * 1.5); display: grid; gap: 1.25rem; }
.story-media {
  position: sticky;
  top: 0;
  height: 100svh;
  display: grid;
  place-items: center;
}
.story-orb {
  /* substantial center-right footprint: up to ~52% of the viewport wide,
     centered in its column, never taller than the viewport it sits in.
     No transforms — clean fluid bounds that stay inside this section. */
  width: min(100%, 52vw);
  max-height: 82svh;
  aspect-ratio: 1;
  object-fit: contain; /* whole solar system scales uniformly, no clipping */
  /* screen blending: video blacks resolve to the pitch-black section,
     so no square border can ever show around the orb */
  mix-blend-mode: screen;
  pointer-events: none;
}
@media (max-width: 720px) {
  .story { grid-template-columns: 1fr; min-height: 120vh; }
  .story-media { position: static; height: auto; margin-top: var(--space); }
  .story-orb { width: 100%; max-height: 50vh; }
}

/* ---------- Work grids ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: calc(var(--space) * 2) var(--space);
  margin-top: calc(var(--space) * 1.5);
}
.work-card:nth-child(even) { transform: translateY(calc(var(--space) * 2)); }
.work-card--flagship { grid-column: 1 / -1; max-width: 72rem; }
.work-card img { width: 100%; object-fit: cover; }
.work-card h3 { font-family: var(--font-display); font-size: 1.75rem; margin-top: 1rem; font-weight: 400; }
.work-card p { opacity: 0.75; max-width: 28rem; }
.badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.75rem;
  padding: 0.3em 0.9em;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  border: 1px solid currentColor;
  border-radius: 999px;
  opacity: 0.85;
}
.for-sale-lede { max-width: 30rem; margin-top: 1.5rem; font-size: 1.15rem; }

/* ---------- Request a Build ---------- */
.request-lede { max-width: 30rem; margin-top: 1.5rem; font-size: 1.15rem; }
.build-form {
  margin-top: calc(var(--space) * 1.5);
  max-width: 44rem;
  padding: clamp(2rem, 4vw, 3.25rem);
  background: var(--ink);
  color: var(--paper);
  border: 1px solid rgba(232, 213, 192, 0.35);
}
.build-progress {
  height: 2px;
  background: rgba(245, 240, 234, 0.15);
  margin-bottom: 1rem;
  overflow: hidden;
}
.build-progress-bar {
  display: block;
  height: 100%;
  width: 33.33%;
  background: var(--champagne);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.build-step-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--champagne);
  opacity: 0.85;
  margin-bottom: 1.75rem;
}
.build-step { border: none; padding: 0; margin: 0; display: none; }
.build-step.is-active { display: block; animation: build-step-in 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes build-step-in {
  from { opacity: 0; transform: translateX(1.25rem); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .build-step.is-active { animation: none; }
  .build-progress-bar { transition: none; }
}
.build-legend {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  color: var(--champagne);
  margin-bottom: 1.5rem;
}
.build-sublabel {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  opacity: 0.7;
  margin: 1.4rem 0 0.7rem;
}
.pill-group { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.pill { cursor: pointer; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span {
  display: inline-block;
  padding: 0.65em 1.4em;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  border: 1px solid rgba(245, 240, 234, 0.35);
  border-radius: 999px;
  transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}
.pill:hover span { border-color: var(--champagne); }
.pill input:checked + span {
  background: var(--champagne);
  border-color: var(--champagne);
  color: var(--ink);
}
.pill input:focus-visible + span {
  outline: 2px solid var(--champagne);
  outline-offset: 2px;
}
.build-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}
.build-nav .build-next:only-child { margin-left: auto; }
.build-back {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--paper);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  opacity: 0.7;
  transition: opacity 0.25s ease, color 0.25s ease;
}
.build-back:hover { opacity: 1; color: var(--champagne); }
.build-form .drawer-field { margin-bottom: 1.1rem; }
@media (max-width: 720px) {
  .build-nav { flex-wrap: wrap; }
}

/* ---------- Contact ---------- */
.contact { justify-content: space-between; padding-top: calc(var(--space) * 3); }
.contact-email {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 3rem);
  border-bottom: 1px solid var(--champagne);
  align-self: flex-start;
  margin-top: var(--space);
}
.footer { display: flex; justify-content: space-between; align-items: end; margin-top: calc(var(--space) * 2); }
.footer-links { display: flex; gap: 1.5rem; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.1em; }
.footer-note { opacity: 0.5; font-size: 0.85rem; }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .work-grid { grid-template-columns: 1fr; }
  .work-card:nth-child(even) { transform: none; }
  .scroll-pill { width: 4.5rem; height: 4.5rem; bottom: 44vh; }
  .footer { flex-direction: column; align-items: flex-start; gap: 1rem; }
}
