/* ============================================================================
   Quark — "Drafting Sheet" marketing landing page
   The website rendered as an engineering drawing. Values transcribed from the
   Claude Design handoff (variant-blueprint.jsx / models.jsx).

   Layout is fully fluid: the design is authored at a 1440px reference and all
   type / spacing scale with the viewport via clamp(), with no max-width — the
   sheet fills any screen and grows proportionally on large monitors.
   The vw coefficients are <reference-px> / 14.4 (1vw at 1440px = 14.4px).
   ============================================================================ */

:root {
  --paper:     #f6f3eb; /* page background — warm off-white */
  --paper-hi:  #fbf9f3; /* panels: drawing frame interior, step cards */
  --ink:       #0b2552; /* primary type & primary action background */
  --ink-hover: #15356b; /* primary CTA hover */
  --blue:      #1d3f7a; /* secondary type, dimensions, mono labels */
  --rule:      rgba(11, 37, 82, 0.25);  /* standard rules & card borders */
  --rule-35:   rgba(11, 37, 82, 0.35);  /* title-block cell dividers */
  --rule-soft: rgba(29, 63, 122, 0.06); /* hero grid overlay */
  --ok:        #3b8c5a; /* status dot */
  --body-text: #2a3957; /* hero body copy */
  --body-mute: #3a4866; /* step-card body copy */

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
  --font-display: 'Instrument Serif', Georgia, serif;

  /* Fluid spacing — scales with viewport, grows on large screens */
  --gutter:    clamp(16px, 2.22vw, 56px);  /* outer horizontal page margin (32@1440) */
  --band-gap:  clamp(64px, 8.33vw, 176px); /* vertical gap between bands (120@1440) */
  --hero-pad-x: clamp(20px, 3.89vw, 88px); /* hero horizontal padding (56@1440) */
  --hero-pad-t: clamp(32px, 4.17vw, 96px); /* hero top padding (60@1440) */
  --hero-pad-b: clamp(20px, 2.22vw, 48px); /* hero bottom padding (32@1440) */
  --hero-gap:  clamp(28px, 3.33vw, 64px);  /* hero column gap (48@1440) */
  --page-pad-b: clamp(20px, 2.22vw, 48px); /* page-end bottom margin (32@1440) */

  /* Fluid typography */
  --fs-h1:        clamp(44px, 5.28vw, 104px); /* hero H1 (76@1440) */
  --fs-h2:        clamp(32px, 3.89vw, 76px);  /* section H2 (56@1440) */
  --fs-step-title: clamp(22px, 1.94vw, 38px); /* step title (28@1440) */
  --fs-body:      clamp(16px, 1.25vw, 23px);  /* hero body (18@1440) */
  --fs-step-copy: clamp(13px, 0.97vw, 17px);  /* step copy (14@1440) */
  --fs-stat:      clamp(24px, 2.22vw, 44px);  /* stat number (32@1440) */
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  /* subtle paper grain */
  background-image:
    radial-gradient(circle at 20% 10%, rgba(11,37,82,0.04), transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(11,37,82,0.03), transparent 50%);
  background-attachment: fixed;
}

/* No max-width: the sheet fills the viewport at any size */
.sheet {
  position: relative;
  overflow: hidden;
}

.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;
}

a:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ===== BAND 1 — Top nav ==================================================== */

.nav {
  position: relative;
  margin: 24px var(--gutter) 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav__left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.nav__wordmark {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.24em;
  font-weight: 600;
}

.nav__tagline {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--blue);
  opacity: 0.7;
}

.nav__right {
  display: flex;
  align-items: center;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav__link {
  color: var(--ink);
  text-decoration: none;
}

.nav__link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Buttons (nav + hero CTAs) */
.btn {
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  border-radius: 2px;
  font-weight: 600;
  font-family: var(--font-mono);
  transition: background-color 150ms ease;
}

.btn:hover { background: var(--ink-hover); }

.btn--nav {
  padding: 10px 18px;
  font-size: 12px;
  letter-spacing: 0.16em;
  white-space: nowrap;
}

.btn--hero {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 26px;
  font-size: 12px;
  letter-spacing: 0.22em;
}

/* ===== BAND 2 — Hero ====================================================== */

.hero {
  position: relative;
  margin: 0 var(--gutter);
  border-left: 1px solid var(--ink);
  border-right: 1px solid var(--ink);
  padding: var(--hero-pad-t) var(--hero-pad-x) var(--hero-pad-b);
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: var(--hero-gap);
}

.hero__grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--rule-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--rule-soft) 1px, transparent 1px);
  background-size: 24px 24px;
}

.hero__copy,
.hero__right {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--blue);
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.eyebrow__rule {
  width: 28px;
  height: 1px;
  background: var(--blue);
  flex: none;
}

.hero__h1 {
  margin: 0;
  font-size: var(--fs-h1);
  line-height: 0.96;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.hero__body {
  margin: 28px 0 0;
  font-size: var(--fs-body);
  line-height: 1.55;
  max-width: 460px;
  color: var(--body-text);
}

.cta-row {
  margin-top: 36px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.cta-row__note {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--blue);
  opacity: 0.7;
  letter-spacing: 0.1em;
}

.stats {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 18px 0;
  gap: 12px;
}

.stat__num {
  font-family: var(--font-display);
  font-size: var(--fs-stat);
  color: var(--ink);
  line-height: 1;
}

.stat__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--blue);
  opacity: 0.75;
  text-transform: uppercase;
  margin-top: 6px;
}

/* Right column — drawing frame. Aspect-ratio keeps it proportional at any
   width (was a fixed 540px in the 1440 reference). */
.frame {
  position: relative;
  border: 1.5px solid var(--ink);
  background: var(--paper-hi);
  aspect-ratio: 6 / 5;
  overflow: hidden;
}

.reg { position: absolute; }
.reg--tl { left: -1px;  top: -1px; }
.reg--tr { right: -1px; top: -1px; }
.reg--bl { left: -1px;  bottom: -1px; }
.reg--br { right: -1px; bottom: -1px; }

.frame__art { position: absolute; inset: 0; }

.wireframe {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.frame__label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--blue);
  letter-spacing: 0.18em;
}
.frame__label--tl { left: 14px;  top: 14px; }
.frame__label--tr { right: 14px; top: 14px; }
.frame__label--bl { left: 14px;  bottom: 14px; }
.frame__label--br { right: 14px; bottom: 14px; }
.frame__label--soft { opacity: 0.7; }

.prompt {
  margin-top: 14px;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  display: flex;
  gap: 12px;
}

.prompt__chev { color: #7b9ad6; }
.prompt__lead { opacity: 0.65; }

/* ===== BAND 3 — Title block =============================================== */

/* Cells flex proportionally (grow values set inline ≈ the 1440 reference
   widths) so the row scales smoothly instead of wrapping raggedly. */
.titleblock {
  margin: 0 var(--gutter);
  border: 1px solid var(--ink);
  background: #fff;
  display: flex;
  flex-wrap: wrap;
}

.tbcell {
  border-right: 1px solid var(--rule-35);
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.tbcell--last { border-right: none; }

.tbcell__label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--blue);
  text-transform: uppercase;
  opacity: 0.7;
}

.tbcell__value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  margin-top: 2px;
}

.tbstatus {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 1px solid var(--rule-35);
  white-space: nowrap;
}

.tbstatus__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  flex: none;
}

.tbstatus__text {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink);
}

/* ===== BAND 4 — How it works ============================================== */

.how {
  margin: var(--band-gap) var(--gutter) 0;
  position: relative;
}

.how__header {
  display: flex;
  align-items: baseline;
  gap: 24px;
  margin-bottom: 56px;
  flex-wrap: wrap;
}

.how__sec {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--blue);
}

.how__h2 {
  margin: 0;
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
}

.how__fill {
  flex: 1;
  min-width: 40px;
  height: 1px;
  background: var(--rule);
}

.how__fig {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--blue);
  opacity: 0.7;
}

/* 1px gap over a rule-colored background = crisp single dividers */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.step {
  background: var(--paper-hi);
  padding: 28px 26px 26px;
  position: relative;
  min-height: 320px;
}

.step__head {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 10px;
}

.step__fill {
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.step__title {
  margin: 18px 0 0;
  font-size: var(--fs-step-title);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.step__copy {
  margin: 12px 0 0;
  font-size: var(--fs-step-copy);
  line-height: 1.55;
  color: var(--body-mute);
}

.demo {
  margin-top: 22px;
  height: 120px;
  border: 1px solid var(--rule);
  background: #fff;
  position: relative;
  overflow: hidden;
}

/* 01 — prompt */
.demo-prompt {
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--ink);
}
.demo-prompt__cursor,
.demo-prompt__ref { color: var(--blue); opacity: 0.6; }
.demo-prompt__ref { margin-top: 6px; }

/* 02 — generated part */
.demo-gen { width: 100%; height: 100%; }

/* 03 — chat thread */
.demo-chat {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bubble {
  padding: 5px 9px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  max-width: 78%;
  border-radius: 2px;
}
.bubble--me { align-self: flex-end; background: var(--ink); color: var(--paper); }
.bubble--ai { align-self: flex-start; background: #eef2f8; color: var(--ink); }

/* 04 — file list */
.demo-files {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.filerow {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chip {
  width: 12px;
  height: 12px;
  border: 1px solid var(--ink);
  position: relative;
  flex: none;
}
.chip::after {
  content: "";
  position: absolute;
  inset: 2px;
}
.chip--0::after { background: var(--ink); }
.chip--1::after { background: var(--blue); }
.chip--2::after { background: var(--ok); }
.filerow__name {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink);
  white-space: pre;
}
.filerow__dl {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--blue);
}

/* ===== BAND 5 — Page-end strip =========================================== */

.pageend {
  margin: var(--band-gap) var(--gutter) var(--page-pad-b);
  padding-top: 16px;
  border-top: 1px solid var(--ink);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--blue);
  opacity: 0.7;
}

/* ===== Hero wobble animation ============================================== */

.bp-wobble {
  animation: bp-wobble 14s ease-in-out infinite;
  transform-box: view-box;
  transform-origin: 400px 340px;
}

@keyframes bp-wobble {
  0%, 100% { transform: rotate(-0.6deg) translateY(-3px); }
  50%      { transform: rotate(0.6deg)  translateY(3px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bp-wobble { animation: none; }
}

/* ===== Responsive structure ==============================================
   Spacing & type are already fluid via clamp(); these breakpoints only
   change layout structure (column counts, stacking, what's shown). */

/* Tablet — ≤ 1023px */
@media (max-width: 1023px) {
  .nav__tagline { display: none; }

  .hero { grid-template-columns: 1fr; }

  .steps { grid-template-columns: repeat(2, 1fr); }

  /* Title block → rows of three */
  .tbcell { flex: 1 1 33.333% !important; }
  .tbcell--last { border-right: 1px solid var(--rule-35); }
  .tbstatus {
    flex: 1 1 100%;
    margin-left: 0;
    border-left: none;
    border-top: 1px solid var(--rule-35);
  }
}

/* Mobile — ≤ 767px */
@media (max-width: 767px) {
  .nav__link { display: none; }

  .how__fill { display: none; }

  .steps { grid-template-columns: 1fr; }
  .step { min-height: 0; }

  .btn--hero { width: 100%; justify-content: center; }

  /* Title block → two columns */
  .tbcell { flex: 1 1 50% !important; }

  .pageend { flex-direction: column; gap: 6px; }
}
