/* CornerHQ site styles.
   Locked rules (spec section 7): light paper page, dark surfaces only where media
   lives (hero, "who" blocks, closing band). One accent (gold). Bricolage Grotesque
   for everything, JetBrains Mono for numbers only. Radius rule: 6px buttons and
   thumbnails, 10px browser frames, 28px phone frame. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --paper: #F3F3F1;
  --paper-2: #E9E9E6;
  --ink: #1C1C1E;
  --ink-2: #6B6B70;
  --line: #D9D9D5;
  --dark: #0E0E10;
  --dark-2: #151517;
  --dark-line: #26262A;
  --bone: #EDE8DD;
  --bone-2: #9B968C;
  --gold: #8A6416;
  --gold-dark: #D4A83A;
  --gold-hover: #E2B84C;
  --r: 6px;
  --r-frame: 10px;
  --r-phone: 28px;
  --font: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --nav-h: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--gold-dark); outline-offset: 3px; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 56px); }
section[id], .anchor { scroll-margin-top: calc(var(--nav-h) + 24px); }
.anchor { display: block; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border: 0; border-radius: var(--r); cursor: pointer;
  font: inherit; font-weight: 700; font-size: 15px; line-height: 1;
  background: var(--gold-dark); color: #171205;
  transition: transform .25s var(--ease), background .2s;
}
.btn:hover { transform: translateY(-2px); background: var(--gold-hover); }
.btn:active { transform: scale(.98); }
.btn-ghost { background: transparent; color: var(--bone); border: 1px solid rgba(237, 232, 221, .3); }
.btn-ghost:hover { background: rgba(255, 255, 255, .06); }
.link { color: var(--gold); font-weight: 600; }
.link:hover { text-decoration: underline; }
button.link { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; cursor: pointer; }

/* Nav: dark over the hero, paper once the hero has scrolled away */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20; height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 56px);
  color: var(--bone);
  background: linear-gradient(180deg, rgba(14, 14, 16, .85), transparent);
  transition: background .35s, color .35s, box-shadow .35s;
}
.nav-logo img { height: 40px; width: auto; }
.nav-logo .logo-dark { display: none; }
.nav-links { display: flex; gap: 32px; font-size: 15px; opacity: .85; }
.nav-links a:hover { opacity: 1; }
.nav .btn { padding: 10px 16px; font-size: 14px; }
.nav.is-light { color: var(--ink); background: rgba(243, 243, 241, .88); backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--line); }
.nav.is-light .logo-light { display: none; }
.nav.is-light .logo-dark { display: block; }

/* Hero: dark triptych of the reel */
.hero { position: relative; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: 1fr auto; background: var(--dark); color: var(--bone); }
.hero-strip { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 2px; background: var(--dark); }
.hero-strip > div { position: relative; overflow: hidden; }
.hero-strip img, .hero-strip video { width: 100%; height: 100%; object-fit: cover; filter: saturate(.9); }
.hero-still img { opacity: .55; }
.hero-strip::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(14, 14, 16, .25) 0%, rgba(14, 14, 16, 0) 35%, rgba(14, 14, 16, .5) 60%, rgba(14, 14, 16, .96) 100%);
}
.hero-copy { position: relative; z-index: 2; grid-row: 2; padding-bottom: clamp(40px, 7vh, 80px); }
.hero h1 { font-size: clamp(2.4rem, 5.2vw, 4.8rem); line-height: .96; letter-spacing: -.03em; font-weight: 800; max-width: 26ch; margin-bottom: 20px; }
.hero h1 em { font-style: italic; color: var(--gold-dark); }
.hero-sub { font-size: clamp(1.05rem, 1.4vw, 1.3rem); color: var(--bone-2); max-width: 42ch; margin-bottom: 28px; line-height: 1.5; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.rise { animation: rise .9s var(--ease) both; }
.rise:nth-child(2) { animation-delay: .1s; }
.rise:nth-child(3) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Opinion line */
.opinion { padding: clamp(72px, 11vh, 130px) 0 0; }
.opinion p { font-size: clamp(1.5rem, 2.6vw, 2.3rem); line-height: 1.25; letter-spacing: -.02em; font-weight: 500; max-width: 30ch; }
.opinion em { font-style: italic; color: var(--gold); }

/* The work */
.work { padding: clamp(72px, 11vh, 130px) 0 0; }
.section-title { font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: -.03em; font-weight: 700; line-height: 1; margin-bottom: 12px; }
.section-lead { color: var(--ink-2); font-size: 1.1rem; max-width: 55ch; line-height: 1.5; }
.work .section-lead { margin-bottom: 56px; }
.piece { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(28px, 5vw, 80px); align-items: center; padding: clamp(48px, 8vh, 96px) 0; border-top: 1px solid var(--line); }
.piece-flip { grid-template-columns: 7fr 5fr; }
.piece-flip .piece-text { order: 2; }
.piece-wide { display: block; }
.piece-wide .piece-text { max-width: 60ch; margin-bottom: 40px; }
.piece-kind { color: var(--gold); font-weight: 600; font-size: 15px; margin-bottom: 10px; }
.piece h3 { font-size: clamp(1.7rem, 3vw, 2.6rem); letter-spacing: -.025em; font-weight: 700; line-height: 1.05; margin-bottom: 14px; }
.piece-text p:not(.piece-kind) { color: var(--ink-2); line-height: 1.55; max-width: 48ch; margin-bottom: 22px; font-size: 1.05rem; }
.facts { display: flex; gap: 28px; font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.facts b { display: block; color: var(--ink); font-size: 22px; font-weight: 500; margin-bottom: 4px; }
.piece .link { display: inline-block; margin-top: 18px; }
.phone {
  position: relative; width: min(100%, 360px); aspect-ratio: 9 / 16; margin: 0 auto;
  border-radius: var(--r-phone); overflow: hidden; background: #000;
  border: 1px solid #2C2C31; box-shadow: 0 30px 80px rgba(28, 28, 30, .28), 0 0 0 6px #111114;
}
.phone video { width: 100%; height: 100%; object-fit: cover; }
.phone-open { position: absolute; inset: 0; width: 100%; border: 0; background: transparent; cursor: pointer; color: var(--bone); font: inherit; }
.phone-open span { position: absolute; inset: auto 0 20px 0; text-align: center; font-size: 13px; color: var(--bone-2); }
.phone-open:hover span { color: var(--bone); }
.browser { border-radius: var(--r-frame); overflow: hidden; border: 1px solid var(--dark-line); background: var(--dark-2); box-shadow: 0 30px 80px rgba(28, 28, 30, .25); transition: transform .3s var(--ease); }
.browser:hover { transform: translateY(-4px); }
a.browser { display: block; color: inherit; }
.browser-bar { height: 36px; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--dark-line); font-family: var(--mono); font-size: 12px; color: var(--bone-2); }
.browser-body { position: relative; height: 520px; background: #000; }
.browser-body img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.piece-wide .browser-body { height: auto; }
.piece-wide .browser-body img { max-height: 640px; }

/* Who it's for: the one mid-page dark media block */
.who { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--paper); margin-top: clamp(48px, 8vh, 96px); }
.who a { position: relative; min-height: 460px; overflow: hidden; display: flex; align-items: flex-end; padding: 40px; color: var(--bone); background: var(--dark); }
.who img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .5; transition: transform .8s var(--ease), opacity .4s; }
.who a:hover img { transform: scale(1.04); opacity: .65; }
.who-text { position: relative; z-index: 1; }
.who h3 { font-size: clamp(1.8rem, 3vw, 2.6rem); letter-spacing: -.025em; font-weight: 700; margin-bottom: 10px; }
.who p { opacity: .85; max-width: 40ch; line-height: 1.5; }
.who .link { display: inline-block; margin-top: 18px; color: var(--gold-dark); }

/* What we do */
.services { padding: clamp(80px, 12vh, 140px) 0; }
.services .section-lead { margin-bottom: 48px; }
.svc-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(20px, 3vw, 40px); padding-top: 40px; border-top: 1px solid var(--line); }
.svc img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r); margin-bottom: 20px; transition: transform .4s var(--ease); }
.svc:hover img { transform: translateY(-4px); }
.svc h3 { font-size: 1.45rem; letter-spacing: -.02em; font-weight: 700; margin-bottom: 8px; }
.svc p { color: var(--ink-2); line-height: 1.5; font-size: .98rem; }

/* App pricing */
.app { padding: 0 0 clamp(80px, 12vh, 140px); }
.app-box { background: var(--paper-2); border-radius: var(--r-frame); padding: clamp(32px, 5vw, 64px); display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: end; }
.app h2 { font-size: clamp(1.8rem, 3.2vw, 2.8rem); letter-spacing: -.03em; font-weight: 700; line-height: 1.05; max-width: 22ch; margin-bottom: 10px; }
.app-box > div > p { color: var(--ink-2); max-width: 55ch; line-height: 1.5; }
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.tiers b { display: block; font-size: 32px; color: var(--ink); font-weight: 500; letter-spacing: -.02em; margin-bottom: 6px; }
.app-box .tiers-note { grid-column: 2; font-size: 13px; color: var(--ink-2); }
.app .link { display: inline-block; margin-top: 20px; }

/* Closing band: heading + enquiry form, the single dark band */
.book { position: relative; overflow: hidden; background: var(--dark); color: var(--bone); padding: clamp(80px, 12vh, 140px) 0; }
.book-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .22; }
.book .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
.book h2 { font-size: clamp(2.6rem, 6vw, 5.2rem); letter-spacing: -.03em; font-weight: 800; line-height: .96; max-width: 12ch; margin-bottom: 20px; }
.book-intro p { color: var(--bone-2); font-size: 1.15rem; max-width: 40ch; line-height: 1.5; }
.form { display: grid; gap: 22px; }
.form[hidden] { display: none; }
.field { display: grid; gap: 8px; }
.field label, .field .label { font-size: 14px; font-weight: 600; color: var(--bone); }
.pills { position: relative; display: flex; gap: 10px; flex-wrap: wrap; }
.field .pills input { position: absolute; opacity: 0; width: 0; height: 0; }
.pills span { display: inline-block; padding: 10px 16px; border-radius: var(--r); border: 1px solid var(--dark-line); background: var(--dark-2); color: var(--bone); font-size: 14px; cursor: pointer; transition: border-color .2s, background .2s; }
.field .pills input:checked + span { border-color: var(--gold-dark); background: rgba(212, 168, 58, .12); }
.field .pills input:focus-visible + span { outline: 2px solid var(--gold-dark); outline-offset: 2px; }
.field input, .field textarea {
  width: 100%; padding: 13px 14px; border-radius: var(--r);
  border: 1px solid var(--dark-line); background: var(--dark-2); color: var(--bone);
  font: inherit; font-size: 15px;
}
.field input::placeholder, .field textarea::placeholder { color: #7A7570; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--gold-dark); outline-offset: 0; border-color: var(--gold-dark); }
.field textarea { min-height: 120px; resize: vertical; }
.form-error { color: #F0A38B; font-size: 14px; line-height: 1.4; min-height: 0; }
.form-error:empty { margin-top: -22px; }
.form-success { display: none; padding: 24px; border-radius: var(--r); border: 1px solid var(--gold-dark); background: rgba(212, 168, 58, .1); font-size: 1.05rem; line-height: 1.5; }
.form-success.is-visible { display: block; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field legend { padding: 0; margin-bottom: 8px; }

footer { background: var(--dark); color: var(--bone-2); border-top: 1px solid var(--dark-line); padding: 32px 0; }
footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; font-size: 14px; }
footer img { height: 32px; width: auto; }
footer a:hover { color: var(--bone); }

/* Lightbox for the full reel */
.lightbox { inset: 0; margin: 0; border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100%; height: 100vh; height: 100dvh; }
.lightbox::backdrop { background: rgba(14, 14, 16, .92); }
.lightbox-inner { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
.lightbox video { height: min(90dvh, 960px); max-width: 100%; aspect-ratio: 9 / 16; border-radius: var(--r-frame); background: #000; }
.lightbox-close { position: absolute; top: 20px; right: 20px; padding: 12px 16px; border: 1px solid rgba(237, 232, 221, .3); border-radius: var(--r); background: rgba(14, 14, 16, .6); color: var(--bone); font: inherit; font-size: 14px; cursor: pointer; }
.lightbox-close:hover { background: rgba(14, 14, 16, .9); }

/* Scroll reveal: CSS scroll-driven, no JS, progressive enhancement */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal { animation: reveal both; animation-timeline: view(); animation-range: entry 0% entry 45%; }
    @keyframes reveal { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise { animation: none; }
  .btn, .browser, .who img, .svc img, .nav { transition: none; }
  .btn:hover, .browser:hover, .who a:hover img, .svc:hover img { transform: none; }
}

/* Mobile collapse */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .hero-strip { grid-template-columns: 1fr; }
  .hero-still { display: none; }
  .piece, .piece-flip { grid-template-columns: 1fr; }
  .piece-flip .piece-text { order: 0; }
  .browser-body { height: 380px; }
  .who { grid-template-columns: 1fr; }
  .who a { min-height: 340px; padding: 28px; }
  .svc-row { grid-template-columns: 1fr 1fr; gap: 24px; }
  .app-box { grid-template-columns: 1fr; }
  .tiers { grid-template-columns: 1fr; gap: 14px; }
  .app-box .tiers-note { grid-column: 1; }
  .book .wrap { grid-template-columns: 1fr; }
  .facts { flex-wrap: wrap; gap: 18px; }
}
