/* otto-editions — style study of Shopify Editions Winter '26, content: Ottomatic */

:root {
  --black: #000000;
  --ink: #1a1a1a;
  --cream: #ede9e0;
  --cream-2: #f2efe8;
  --white: #ffffff;
  --pink: #ff2d9b;
  --pink-ink: #c9106f; /* darker pink for small text on light grounds */
  --divider: #d8d4cc;
  --card: #ffffff;
  --sans: 'Switzer', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --script: 'Italianno', cursive;
  --nav-h: 48px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
html.gl, html.lenis { scroll-behavior: auto; }

/* ---------- persistent WebGL2 stage ---------- */
#gl {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  display: none; pointer-events: none;
}
body.gl #gl { display: block; }
/* everything scrolls above the canvas; transparent regions reveal it */
body.gl main, body.gl .hero-pin { position: relative; z-index: 2; }
/* the GL scene replaces the DOM depth surrogates on capable desktops */
body.gl .hero-stage, body.gl .hero-bg-mobile,
body.gl .chapter-media, body.gl .chapter-veil, body.gl .stage-float { display: none; }
/* founding title is rendered in-scene, behind the painted figures */
body.gl #founding .mega-title { opacity: 0; }
/* the GL scene draws the title frame at depth; drop the flat DOM border */
body.gl .hero-card { border-color: transparent; text-shadow: 0 1px 3px rgba(24,14,8,.35), 0 2px 26px rgba(24,14,8,.4); }
body.gl .mega-title, body.gl .chapter-tagline { text-shadow: 0 1px 3px rgba(0,0,0,.3), 0 3px 32px rgba(0,0,0,.42); }
/* longer scroll drivers feed the camera scrub */
body.gl .hero-pin { height: 500vh; }
body.gl #triage .chapter-hero { height: 550vh; }
body.gl #agentic .chapter-hero { height: 600vh; }
body.gl #brief .chapter-hero { height: 460vh; }
body.gl #private .chapter-hero { height: 460vh; }
body.gl #founding .chapter-hero { height: 460vh; }

body {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--black);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--pink); color: var(--white); }

a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--pink); outline-offset: 3px; border-radius: 2px;
}

img { display: block; max-width: 100%; }
a { color: inherit; }

/* ---------- Canvas intro (frame draw → constellation → title → iris reveal) ---------- */
.intro {
  position: fixed; inset: 0; z-index: 60;
  width: 100%; height: 100%;
  display: block; pointer-events: none;
  transition: opacity .8s ease;
}
.intro.out { opacity: 0; }

/* ---------- Top nav ---------- */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 24px;
  padding: 0 20px;
  color: var(--white);
  background: transparent;
  transition: background .4s ease;
}
.topnav.scrolled { background: rgba(0,0,0,.78); backdrop-filter: blur(8px); }
.topnav .wordmark {
  font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap;
  display: flex; align-items: baseline; gap: 8px;
}
.wordmark .o-accent { color: var(--pink); }
.wordmark .edition-label { font-weight: 400; opacity: .65; font-size: 12px; }
.topnav .spacer { flex: 1; }
.topnav .nav-link {
  font-size: 13px; text-decoration: none; opacity: .85; white-space: nowrap;
}
@media (max-width: 700px) {
  .topnav { gap: 12px; padding: 0 14px; }
  .topnav .nav-link { display: none; }
}
.topnav .nav-link:hover { opacity: 1; }
.topnav .caret { font-size: 9px; opacity: .7; }
.cta-pill {
  background: var(--white); color: var(--ink);
  font-size: 13px; font-weight: 500;
  padding: 7px 16px; border-radius: 20px;
  text-decoration: none; white-space: nowrap;
  transition: transform .2s ease, background .2s ease;
}
.cta-pill:hover { background: var(--pink); color: var(--white); }

/* ---------- Left side nav ---------- */
.sidenav {
  position: fixed; left: 14px; top: 50%; transform: translateY(-50%);
  z-index: 90; width: 148px;
  color: var(--white);
  font-size: 11px; line-height: 1.4;
  mix-blend-mode: difference;
}
.sidenav ol { list-style: none; }
.sidenav li { margin: 3px 0; }
.sidenav a {
  display: flex; align-items: baseline; gap: 8px;
  text-decoration: none; opacity: .68;
  transition: opacity .3s ease;
}
.sidenav a:hover { opacity: .9; }
.sidenav a .dash {
  flex: 1; border-top: 1px solid currentColor;
  opacity: 0; transform: scaleX(.3); transform-origin: left;
  transition: opacity .3s ease, transform .3s ease;
}
.sidenav li.active a { opacity: 1; font-weight: 500; }
.sidenav li.active .dash { opacity: .8; transform: scaleX(1); }
.sidenav .numeral { font-size: 10px; opacity: .9; }
.sidenav .legal {
  margin-top: 22px; font-size: 9px; opacity: .55;
  display: flex; flex-direction: column; gap: 2px;
}
.sidenav .legal a { display: inline; opacity: 1; text-decoration: none; }
.sidenav .legal a:hover { text-decoration: underline; }
@media (max-width: 1023px) { .sidenav { display: none; } }

/* ---------- Hero ---------- */
/* hero pins like the original's first stage; the next painting scrolls over it */
.hero-pin { position: relative; height: 160vh; height: 160svh; margin-bottom: -60vh; }
.hero {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: clip;
  display: flex; align-items: center;
}
/* layered hero stage — bg plate + figures + props parallax independently */
.hero-stage { position: absolute; inset: 0; z-index: 0; }
.hero-layer { position: absolute; will-change: transform; }
.hero-layer .layer-img { width: 100%; height: auto; }
.layer-plate { inset: -7% -4%; }
.layer-plate .plate {
  position: absolute; inset: 0;
  background: url('assets/hero-bg-plate.webp') center 32% / cover no-repeat;
}
.layer-fig-left  { left: 4%;  top: 27%; width: clamp(280px, 31vw, 500px); }
.layer-fig-right { right: 1%; top: 23%; width: clamp(300px, 33vw, 540px); }
.layer-phone     { left: 46.5%; top: 27%; width: clamp(84px, 8.4vw, 138px); }
.layer-plane     { left: 54%; top: 62%; width: clamp(110px, 11.5vw, 190px); }
.layer-env1      { left: 43%; top: 5%;  width: clamp(64px, 6.6vw, 110px); }
.layer-env2      { left: 58%; top: 13%; width: clamp(44px, 4.6vw, 78px); transform: rotate(14deg); }
.layer-cup       { left: 8%;  bottom: 4%; width: clamp(56px, 6vw, 96px); }
/* mobile: flat painting + two drifting props only */
.hero-bg-mobile { display: none; }
@media (max-width: 700px) {
  .hero-stage .layer-plate, .hero-stage .layer-fig, .hero-stage .layer-phone, .hero-stage .layer-cup { display: none; }
  .hero-bg-mobile {
    display: block; position: absolute; inset: -8% 0; z-index: 0;
    background: url('assets/painting-hero-mobile.webp') center 30% / cover no-repeat;
    will-change: transform;
  }
  .hero-stage { z-index: 1; }
  .layer-plane { left: 58%; top: 68%; width: 96px; }
  .layer-env1 { left: 12%; top: 7%; width: 60px; }
  .layer-env2 { left: 70%; top: 4%; width: 44px; }
}
.hero-card {
  position: relative; z-index: 2;
  margin-left: clamp(20px, 22vw, 30%);
  margin-top: -4vh;
  border: 1px solid rgba(255,255,255,.35);
  padding: clamp(24px, 3.4vw, 44px) clamp(24px, 3.6vw, 52px);
  color: var(--white);
  max-width: 560px;
  opacity: 0; transform: translateY(24px);
  transition: opacity 1.1s ease .25s, transform 1.1s ease .25s;
}
body.loaded .hero-card { opacity: 1; transform: none; }
.hero-title {
  font-weight: 500; line-height: 1.02; letter-spacing: -.01em;
  font-size: clamp(40px, 5.2vw, 64px);
}
.hero-title .line { display: block; }
.hero-title .line-the { font-size: .58em; font-weight: 400; margin-bottom: .1em; }
.hero-title .ai {
  font-family: var(--script); font-weight: 400; font-style: normal;
  font-size: 1.28em; line-height: 0; letter-spacing: 0;
  display: inline-block; transform: translateY(.03em);
  opacity: 0; filter: blur(4px);
  transition: opacity 1s ease 1.1s, filter 1s ease 1.1s;
}
body.loaded .hero-title .ai { opacity: 1; filter: blur(0); }
.hero-sub {
  margin-top: 18px; font-size: clamp(14px, 1.3vw, 17px); opacity: .92; max-width: 40ch;
}
.hero-index {
  margin-top: 28px;
  display: grid; grid-template-columns: 1fr 1fr;
  column-gap: clamp(20px, 4vw, 56px); row-gap: 5px;
}
.hero-index a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  font-size: 13px; text-decoration: none; opacity: .85;
  transition: opacity .2s ease;
}
.hero-index a:hover { opacity: 1; }
.hero-index .numeral { font-size: 10px; opacity: .8; }
@media (max-width: 700px) {
  .hero { align-items: flex-end; }
  .hero-card { margin: 0 16px 12vh; }
  .hero-index { grid-template-columns: 1fr; }
}

/* ---------- Chapter (painting) sections ---------- */
.chapter-hero { position: relative; height: 170vh; }
.chapter-hero.short { height: 150vh; }
/* cream content scrolls OVER the pinned stage (original's sticky-stage behavior) */
.chapter-hero + .content { margin-top: -60vh; }
.chapter-hero.short + .content { margin-top: -42vh; }
.chapter-sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  overflow: clip;
  display: flex; flex-direction: column; justify-content: center;
}
.chapter-media {
  position: absolute; inset: -12% 0; z-index: 0;
  will-change: transform;
}
.chapter-painting {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}

/* floating composited UI inside painting stages (drift, then dock on scroll) */
.stage-float {
  position: absolute; z-index: 2; pointer-events: none;
  will-change: transform;
}
.stage-float .mock.mini { font-size: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.35); }
.float-inbox { right: 7%; top: 15%; width: min(340px, 58vw); }
.float-chip  { right: 15%; bottom: 18%; }
.float-chip .mock.mini.chip {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  font-size: 12px; color: #55524b; white-space: nowrap;
}
.float-chat  { right: 9%; top: 18%; width: min(300px, 56vw); }
.float-chat .mini-chat { padding: 12px; display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.float-brief { right: 8%; top: 20%; width: min(320px, 58vw); }
.float-brief .mini-tg { padding: 12px; }
@media (max-width: 700px) {
  .float-inbox { right: 4%; top: 9%; width: 62vw; }
  .float-chat  { right: 4%; top: 10%; width: 58vw; }
  .float-brief { right: 4%; top: 10%; width: 60vw; }
  .float-chip  { right: 8%; bottom: 14%; }
}

/* torn-paper edges between painting stages and cream content */
.tear {
  position: absolute; left: 0; right: 0; z-index: 1;
  height: clamp(26px, 4.6vw, 64px); pointer-events: none;
}
.tear svg { display: block; width: 100%; height: 100%; fill: var(--cream); }
.tear-top { top: 1px; transform: translateY(-100%); }
.tear-bottom { bottom: 1px; transform: translateY(100%) scaleY(-1); }
.chapter-veil { position: absolute; inset: 0; z-index: 1; background: rgba(0,0,0,.18); }
.chapter-titlebox {
  position: relative; z-index: 2; color: var(--white);
  padding: 0 4vw; width: 100%;
}
@media (min-width: 1024px) {
  .chapter-titlebox, .chapter-numeral { padding-left: clamp(180px, 14vw, 230px); }
}
.mega-title {
  font-size: clamp(64px, 15vw, 216px);
  font-weight: 400; line-height: .95; letter-spacing: -.02em;
  white-space: nowrap;
  opacity: 0; transform: scale(.92) translateY(30px);
  transition: opacity 1s ease, transform 1.2s cubic-bezier(.16,1,.3,1);
}
.mega-title.smaller { font-size: clamp(52px, 12.5vw, 190px); }
.chapter-tagline {
  margin-top: 22px; max-width: 46ch;
  font-size: clamp(17px, 1.8vw, 24px); line-height: 1.4;
  opacity: 0; transform: translateY(24px);
  transition: opacity 1s ease .2s, transform 1s ease .2s;
}
.in-view .mega-title, .in-view .chapter-tagline { opacity: 1; transform: none; }
.chapter-numeral {
  position: relative; z-index: 2; padding: 0 4vw; margin-bottom: 10px;
  color: var(--white); font-size: 12px; letter-spacing: .28em; opacity: 0;
  transition: opacity 1s ease .1s;
}
.in-view .chapter-numeral { opacity: .8; }

/* Dark cosmic variant uses painting too */

/* ---------- Cream content sections ---------- */
.content {
  position: relative; z-index: 3;
  background: var(--cream);
  color: var(--ink);
  padding: clamp(72px, 10vw, 140px) 0;
}
.content.tight { padding-top: clamp(56px, 7vw, 96px); }
.container {
  width: min(1160px, calc(100vw - clamp(16px, 13vw, 220px) - clamp(20px, 4vw, 64px)));
  margin-left: clamp(16px, 13vw, 220px);
  margin-right: auto;
}
@media (max-width: 1023px) {
  .container { margin: 0 auto; width: min(1160px, 90vw); }
}

.eyebrow {
  font-size: 13px; font-weight: 500;
  margin-bottom: 14px;
}
.feature-head {
  font-size: clamp(30px, 3.6vw, 48px);
  font-weight: 400; line-height: 1.08; letter-spacing: -.015em;
  max-width: 18ch;
}
.dropcap {
  font-family: var(--script);
  font-size: 2.6em; line-height: .6;
  display: inline-block; transform: translateY(.08em);
  margin-right: .02em;
}
.feature-body {
  margin-top: 20px; max-width: 52ch; font-size: 16px; color: #3a3833;
}
.cta-flat {
  display: inline-block; margin-top: 22px;
  font-size: 15px; text-decoration: none; color: var(--ink);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, color .2s ease;
}
.cta-flat:hover { border-color: var(--ink); }
.cta-flat .arr { display: inline-block; margin-left: 4px; transition: transform .2s ease; }
.cta-flat:hover .arr { transform: translate(2px, -2px); }

.feature-row {
  display: grid; grid-template-columns: minmax(300px, 5fr) 7fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
  margin-top: clamp(56px, 7vw, 100px);
}
.feature-row:first-child { margin-top: 0; }
.feature-row.flip { grid-template-columns: 7fr minmax(300px, 5fr); }
.feature-row.flip .feature-text { order: 2; }
@media (max-width: 860px) {
  .feature-row, .feature-row.flip { grid-template-columns: 1fr; }
  .feature-row.flip .feature-text { order: 0; }
}

/* Two-up cards */
.card-duo {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  margin-top: clamp(48px, 6vw, 80px);
}
@media (max-width: 860px) { .card-duo { grid-template-columns: 1fr; } }
.flat-card {
  background: var(--card); border-radius: 8px; overflow: hidden;
  border: 1px solid #e4e0d7;
  transition: transform .35s ease;
}
.flat-card:hover { transform: translateY(-3px); }
.flat-card .card-pad { padding: 26px 26px 30px; }
.flat-card h4 { font-size: 20px; font-weight: 500; margin-bottom: 8px; }
.flat-card p { font-size: 14.5px; color: #4a4842; }

/* ---------- Borderless 3-col feature table ---------- */
.feature-table { margin-top: clamp(48px, 6vw, 88px); }
.feature-table .table-title {
  font-size: 13px; font-weight: 500; margin-bottom: 8px;
}
.feature-table .row {
  display: grid; grid-template-columns: 3fr 6fr 2fr;
  gap: 24px; padding: 18px 0;
  border-top: 1px solid var(--divider);
  align-items: baseline;
}
.feature-table .row:last-child { border-bottom: 1px solid var(--divider); }
.feature-table .fname { font-size: 16px; font-weight: 500; }
.feature-table .fdesc { font-size: 14px; color: #4a4842; }
.feature-table .fact { text-align: right; }
.feature-table .fact a {
  font-size: 13px; text-decoration: none; color: var(--ink); opacity: .75;
}
.feature-table .fact a:hover { opacity: 1; }
@media (max-width: 700px) {
  .feature-table .row { grid-template-columns: 1fr; gap: 4px; }
  .feature-table .fact { text-align: left; }
}

/* ---------- UI mockups ---------- */
.mock {
  background: var(--card); border-radius: 10px;
  border: 1px solid #e4e0d7;
  overflow: hidden;
  font-size: 13.5px;
}
.mock-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-bottom: 1px solid #eeeae2;
  font-size: 12px; color: #6a675f;
}
.mock-dot { width: 8px; height: 8px; border-radius: 50%; background: #ddd8ce; }
.mock-dot.pink { background: var(--pink); }

/* inbox mock */
.inbox-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 18px; border-bottom: 1px solid #f0ece4;
}
.inbox-row:last-child { border-bottom: 0; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--cream); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; flex-shrink: 0;
}
.avatar.pink { background: var(--pink); color: var(--white); }
.inbox-meta { min-width: 0; flex: 1; }
.inbox-meta .sender { display: block; font-weight: 500; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-meta .subject {
  display: block; font-size: 12.5px; color: #6a675f;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tag {
  font-size: 10px; font-weight: 500; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 10px; white-space: nowrap;
  background: #f0ece4; color: #55524b;
}
.tag.needs-you { background: var(--pink-ink); color: var(--white); }
.tag.drafted { background: #1a1a1a; color: var(--white); }

/* telegram brief mock */
.tg-body { padding: 18px; background: #f7f5f0; }
.tg-bubble {
  background: var(--white); border: 1px solid #e8e4db;
  border-radius: 4px 14px 14px 14px;
  padding: 14px 16px; max-width: 92%;
  font-size: 13px; line-height: 1.55;
}
.tg-bubble strong { font-weight: 600; }
.tg-bubble .brief-line { display: flex; gap: 8px; margin-top: 6px; }
.tg-bubble .brief-line .n { color: var(--pink-ink); font-weight: 600; }
.tg-time { font-size: 10.5px; color: #a09c92; margin-top: 6px; }

/* draft mock */
.draft-field {
  display: flex; gap: 10px; padding: 10px 18px;
  border-bottom: 1px solid #f0ece4; font-size: 13px;
}
.draft-field .k { color: #a09c92; width: 56px; flex-shrink: 0; }
.draft-body { padding: 16px 18px; font-size: 13.5px; line-height: 1.6; color: #3a3833; }
.draft-actions {
  display: flex; gap: 10px; padding: 12px 18px;
  border-top: 1px solid #f0ece4;
}
.draft-actions .btn {
  font-size: 12px; font-weight: 500; padding: 7px 14px;
  border-radius: 16px; text-decoration: none;
}
.btn.approve { background: var(--ink); color: var(--white); }
.btn.tweak { border: 1px solid var(--divider); color: var(--ink); }

/* phone float in agentic */
.float-phone {
  width: min(300px, 72vw);
  margin: 0 auto;
  background: #101010; border-radius: 34px; padding: 12px;
  border: 1px solid rgba(255,255,255,.14);
  transform: rotate(-3deg);
}
.float-phone .screen {
  background: #f7f5f0; border-radius: 24px; overflow: hidden;
  font-size: 12.5px;
}
.float-phone .chat-head {
  padding: 12px 16px; font-weight: 600; font-size: 12px;
  border-bottom: 1px solid #e8e4db; display:flex; align-items:center; gap:8px;
}
.float-phone .chat { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat .msg { padding: 9px 12px; border-radius: 12px; max-width: 88%; line-height: 1.45; }
.chat .them { background: var(--white); border: 1px solid #e8e4db; align-self: flex-start; }
.chat .me { background: var(--pink); color: var(--white); align-self: flex-end; }

/* pricing */
.price-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: clamp(40px,5vw,64px); }
@media (max-width: 900px) { .price-cards { grid-template-columns: 1fr; } }
.price-card {
  background: var(--card); border: 1px solid #e4e0d7; border-radius: 8px;
  padding: 30px 28px; display: flex; flex-direction: column; gap: 10px;
}
.price-card.feature { border-color: var(--ink); }
.price-card .tier { font-size: 13px; font-weight: 500; letter-spacing: .03em; }
.price-card .amount { font-size: 38px; font-weight: 500; letter-spacing: -.02em; }
.price-card .amount small { font-size: 15px; font-weight: 400; color: #6a675f; }
.price-card .note { font-size: 13.5px; color: #4a4842; }
.price-card .lock { font-size: 12px; color: var(--pink-ink); font-weight: 500; }

/* guarantee strip */
.guarantee {
  margin-top: clamp(40px, 5vw, 64px);
  border-top: 1px solid var(--divider); border-bottom: 1px solid var(--divider);
  padding: 22px 0; display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap;
}
.guarantee .g-cap { font-family: var(--script); font-size: 34px; line-height: 1; }
.guarantee p { font-size: 15px; max-width: 60ch; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s cubic-bezier(.16,1,.3,1); }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Mobile end legal (left nav hidden) ---------- */
.mobile-legal {
  display: none;
  background: var(--cream); color: #6a675f;
  padding: 28px 5vw 40px; font-size: 11px;
  gap: 14px; flex-wrap: wrap;
}
.mobile-legal a { color: inherit; }
@media (max-width: 1023px) { .mobile-legal { display: flex; } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .intro { display: none; }
  .hero-card, .hero-title .ai, .mega-title, .chapter-tagline, .chapter-numeral, .reveal {
    opacity: 1 !important; transform: none !important; filter: none !important;
    transition: none !important;
  }
  .hero-bg-mobile, .chapter-media, .chapter-painting, .hero-layer, .stage-float { transform: none !important; }
  .layer-env2 { transform: rotate(14deg) !important; }
  .flat-card, .flat-card:hover { transform: none; transition: none; }
}

/* scrollbar flavor */
@media (min-width: 1024px) {
  ::-webkit-scrollbar { width: 10px; }
  ::-webkit-scrollbar-track { background: #0d0d0d; }
  ::-webkit-scrollbar-thumb { background: #3a3833; border-radius: 5px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--pink); }
}
