:root {
  color-scheme: light;
  --paper: #F3F5FA;
  --ink: #14163A;
  --blue: #3651F5;
  --sun: #FFC24B;
  --pink: #FF7AA2;
  --mint: #34D399;
  --lilac: #B6A6FF;
  --muted: #555A7E;
  --line: rgba(20, 22, 58, 0.14);
  --grid: rgba(54, 81, 245, 0.07);
  --display: "Bricolage Grotesque", "DM Sans", system-ui, sans-serif;
  --text: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }

h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.02em; }

/* ---------- Header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 0;
}
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 800; font-size: 1.45rem;
  letter-spacing: -0.02em; text-decoration: none;
}
.logo svg { width: 26px; height: 26px; }
.site-nav { display: flex; gap: 28px; font-weight: 500; }
.site-nav a { text-decoration: none; }
.site-nav a:hover { text-decoration: underline; text-underline-offset: 6px; }

/* ---------- Hero ---------- */
.hero-zone { position: relative; isolation: isolate; }
.hero-zone::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: center top;
  -webkit-mask-image: linear-gradient(#000 70%, transparent);
          mask-image: linear-gradient(#000 70%, transparent);
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center; gap: 40px;
  padding: 36px 0 120px;
}
.hero h1 {
  font-weight: 800;
  font-size: clamp(2.8rem, 6.6vw, 5.6rem);
  line-height: 1.0; letter-spacing: -0.035em;
  max-width: 10ch;
}
.hero .lead { margin: 28px 0 0; max-width: 31em; font-size: 1.2rem; color: var(--muted); }
.platforms { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.platforms li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 10px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line);
  font-weight: 500; font-size: .95rem;
}
.platforms svg { width: 20px; height: 20px; fill: none; stroke: var(--blue); stroke-width: 1.8; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: 40px; }
.button {
  display: inline-block; padding: 15px 28px; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font-weight: 600; text-decoration: none;
  transition: transform .15s ease, background .15s ease;
}
.button:hover { background: var(--blue); transform: translateY(-2px); }
.text-link { font-weight: 600; text-underline-offset: 6px; }

.blueprint { width: 100%; max-width: 500px; justify-self: center; }
.blueprint svg { display: block; width: 100%; height: auto; overflow: visible; }

/* Hero drawing sequence */
.bp-outline {
  fill: none; stroke: var(--ink); stroke-width: 3;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: draw 1.1s var(--ease) forwards;
  animation-delay: calc(.2s + var(--o, 0) * .3s);
}
.bp-hinge {
  stroke: var(--paper); stroke-width: 2; stroke-dasharray: 4 5; opacity: 0;
  animation: fade .5s ease 3.2s forwards;
}
.bp-dim { stroke: var(--blue); stroke-width: 1.5; fill: none; opacity: 0; animation: fade .6s ease 1.1s forwards; }
.bp-dim-label { fill: var(--blue); font: 600 14px var(--text); opacity: 0; animation: fade .6s ease 1.4s forwards; }
.bp-wire {
  fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 5 5; opacity: 0;
  animation: fade .4s ease forwards;
  animation-delay: calc(1.1s + var(--d) * 70ms);
}
.bp-fill {
  opacity: 0; transform: scale(.88);
  transform-box: fill-box; transform-origin: center;
  animation: fill .6s var(--ease) forwards;
  animation-delay: calc(2.1s + var(--d) * 80ms);
}

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@keyframes fill { to { opacity: 1; transform: scale(1); } }

/* ---------- Sections ---------- */
.section { padding: 104px 0; }
.section-head h2,
.contact h2 {
  font-weight: 700;
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  line-height: 1.08;
}
.section-head p { margin: 18px 0 0; max-width: 34em; color: var(--muted); font-size: 1.15rem; }

/* ---------- Process (scroll-driven) ---------- */
.process {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 64px;
  margin-top: 56px;
}
.steps { list-style: none; margin: 0; padding: 0; }
.steps-wrap { position: relative; }
.steps-wrap::before {
  content: ""; position: absolute; left: 19px; top: 8px; bottom: 8px;
  width: 2px; background: var(--line);
}
.rail-fill {
  position: absolute; left: 19px; top: 8px; width: 2px; height: 0;
  background: var(--blue); transition: height .5s var(--ease);
}
.step {
  position: relative;
  min-height: 62vh;
  padding: 4px 0 0 64px;
  display: flex; flex-direction: column; justify-content: center;
  opacity: .38; transition: opacity .4s ease;
}
.step:first-child { justify-content: flex-start; padding-top: 20vh; }
.step.is-active { opacity: 1; }
.step-num {
  position: absolute; left: 0; top: 50%; translate: 0 -50%;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper); border: 2px solid var(--line);
  font: 700 1rem var(--display);
  transition: background .3s ease, border-color .3s ease, color .3s ease;
}
.step:first-child .step-num { top: calc(20vh + 18px); translate: 0 0; }
.step.is-active .step-num, .step.is-done .step-num { background: var(--blue); border-color: var(--blue); color: #fff; }
.step h3 { font-size: 1.9rem; font-weight: 700; line-height: 1.15; }
.step p { margin: 12px 0 0; max-width: 28em; color: var(--muted); }

.canvas-col { position: relative; }
.canvas {
  position: sticky; top: 14vh;
  height: 72vh; max-height: 620px; min-height: 460px;
  border-radius: 36px;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 28px 28px,
    #fff;
  border: 1px solid var(--line);
  overflow: hidden;
}
.scene {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  opacity: 0; transform: translateY(16px) scale(.98);
  transition: opacity .5s ease, transform .6s var(--ease);
  pointer-events: none;
}
.canvas[data-step="1"] .s1,
.canvas[data-step="2"] .s2,
.canvas[data-step="3"] .s3,
.canvas[data-step="4"] .s4 { opacity: 1; transform: none; }
.scene-label {
  position: absolute; left: 24px; bottom: 22px;
  font-weight: 600; font-size: .95rem; color: var(--muted);
}

/* Scene 1: scattered idea notes */
.notes { position: relative; width: 82%; height: 74%; }
.note {
  position: absolute; width: 150px; padding: 14px;
  border-radius: 16px; background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 14px 24px -18px rgba(20, 22, 58, .45);
  transform: rotate(var(--r));
  transition: transform .6s var(--ease);
}
.canvas[data-step="1"] .note { animation: drift 5s ease-in-out infinite alternate; animation-delay: var(--dl); }
.note i { display: block; height: 8px; border-radius: 4px; background: rgba(20,22,58,.14); margin-top: 8px; }
.note i:first-child { margin-top: 0; width: 34px; height: 10px; background: var(--c); }
.note i.w70 { width: 70%; }
@keyframes drift { to { transform: rotate(var(--r)) translateY(-8px); } }

/* Scene 2: scoring */
.scores { width: 78%; display: grid; gap: 14px; }
.score-row {
  display: grid; grid-template-columns: 1fr 1.3fr 40px; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line);
}
.score-row.top { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(54,81,245,.12); }
.score-row .label { height: 9px; border-radius: 5px; background: rgba(20,22,58,.16); }
.bar { height: 10px; border-radius: 5px; background: rgba(20,22,58,.07); overflow: hidden; }
.bar span {
  display: block; height: 100%; width: 0; border-radius: 5px; background: var(--c);
  transition: width 1s var(--ease);
  transition-delay: var(--dl);
}
.canvas[data-step="2"] .bar span { width: var(--w); }
.score-row b { font: 700 1rem var(--display); text-align: right; }
.criteria { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.criteria span {
  padding: 5px 12px; border-radius: 999px; font-size: .85rem; font-weight: 500;
  background: rgba(54,81,245,.08); color: var(--blue);
}

/* Scenes 3 & 4: device cluster */
.devices { position: relative; width: 380px; height: 300px; }
.dev { position: absolute; padding: 6px; }
.dev .scr { height: 100%; overflow: hidden; display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.s3 .dev { border: 2px dashed var(--ink); }
.s4 .dev { background: var(--ink); box-shadow: 0 30px 40px -28px rgba(20,22,58,.6); }
.s4 .dev .scr { background: var(--blue); }
.b { display: block; height: 22px; border-radius: 7px; flex: none; }
.b.big { flex: 1; height: auto; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; flex: 0 0 34%; }
.pair .b { height: auto; }
.s3 .b { border: 1.5px dashed rgba(20,22,58,.5); }
.s4 .b { background: var(--c); }

.tablet { left: 0; top: 18px; width: 210px; height: 148px; border-radius: 20px; }
.tablet .scr { border-radius: 14px; display: grid; grid-template-columns: 28% 1fr; grid-template-rows: 9px 1fr 34%; gap: 6px; }
.tablet .side { grid-row: 1 / 4; height: auto; }
.tablet .pair { flex: none; }
.phone { left: 232px; top: 0; width: 90px; height: 180px; border-radius: 22px; }
.phone .scr { border-radius: 16px; padding-top: 14px; }
.fold { left: 12px; top: 186px; width: 176px; height: 114px; border-radius: 16px; }
.fold .scr { border-radius: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; position: relative; }
.fold .scr::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 2px dashed rgba(20,22,58,.35); }
.s4 .fold .scr::after { border-left-color: rgba(255,255,255,.5); }
.pane { display: flex; flex-direction: column; gap: 6px; }
.pane .b { height: 18px; }
.watch { left: 238px; top: 214px; width: 76px; height: 84px; border-radius: 26px; }
.watch::before, .watch::after {
  content: ""; position: absolute; left: 18px; right: 18px; height: 22px; z-index: -1;
}
.watch::before { top: -20px; border-radius: 8px 8px 0 0; }
.watch::after { bottom: -20px; border-radius: 0 0 8px 8px; }
.s3 .watch::before, .s3 .watch::after { border: 2px dashed var(--ink); }
.s4 .watch::before, .s4 .watch::after { background: var(--ink); opacity: .85; }
.watch .scr { border-radius: 20px; display: grid; place-items: center; padding: 6px; }
.ring { display: block; width: 40px; height: 40px; border-radius: 50%; }
.s3 .ring { border: 2px dashed rgba(20,22,58,.5); }
.s4 .ring { border: 6px solid var(--sun); border-right-color: rgba(255,255,255,.25); transform: rotate(20deg); }

.ship-badge {
  position: absolute; left: 300px; top: 30px;
  padding: 9px 16px; border-radius: 999px;
  background: var(--mint); color: var(--ink);
  font-weight: 600; font-size: .9rem; white-space: nowrap;
  transform: scale(.6) rotate(-6deg); opacity: 0;
  transition: transform .5s cubic-bezier(.2,.9,.3,1.4) .35s, opacity .3s ease .35s;
}
.canvas[data-step="4"] .ship-badge { transform: scale(1) rotate(-6deg); opacity: 1; }
.spark { position: absolute; width: 12px; height: 12px; border-radius: 50%; opacity: 0; }
.canvas[data-step="4"] .spark { animation: burst .9s var(--ease) .45s forwards; }
@keyframes burst {
  0% { opacity: 0; transform: translate(0,0) scale(.4); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(1); }
}

/* Devices pop in one after another when a scene becomes active */
.canvas .dev { opacity: 0; transform: translateY(10px); transition: opacity .4s ease, transform .5s var(--ease); }
.canvas[data-step="3"] .s3 .dev,
.canvas[data-step="4"] .s4 .dev { opacity: 1; transform: none; }
.canvas .dev.phone { transition-delay: .08s; }
.canvas .dev.fold { transition-delay: .16s; }
.canvas .dev.watch { transition-delay: .24s; }

/* ---------- Principles ---------- */
.principles { margin: 48px 0 0; padding: 0; list-style: none; }
.principles li {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 24px 48px; padding: 32px 0; border-top: 1px solid var(--line);
}
.principles li:last-child { border-bottom: 1px solid var(--line); }
.principles h3 { font-weight: 700; font-size: 1.7rem; line-height: 1.15; }
.principles p { margin: 0; max-width: 34em; color: var(--muted); }

/* ---------- Contact ---------- */
.contact { padding: 120px 0 96px; }
.contact p { margin: 20px 0 0; max-width: 30em; color: var(--muted); }
.mail {
  display: inline-block; margin-top: 32px;
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.35rem, 4.6vw, 3rem); letter-spacing: -0.02em;
  text-decoration-thickness: 3px; text-underline-offset: 8px; overflow-wrap: anywhere;
}
.mail:hover { color: var(--blue); }
.site-footer { padding: 28px 0 40px; border-top: 1px solid var(--line); font-size: .95rem; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-bottom: 80px; }
  .hero h1 { max-width: 11ch; }
  .blueprint { max-width: 360px; }
  .section { padding: 80px 0; }
  .process { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .canvas-col { order: -1; position: sticky; top: 0; z-index: 2; padding: 12px 0; background: var(--paper); }
  .canvas { position: relative; top: 0; height: 300px; min-height: 0; border-radius: 26px; }
  .step { min-height: 44vh; }
  .scene-label { display: none; }
  .step:first-child { padding-top: 6vh; }
  .step:first-child .step-num { top: calc(6vh + 18px); }
  .note { width: 116px; padding: 11px; }
  .scores { width: 88%; gap: 9px; }
  .score-row { padding: 9px 12px; }
  .criteria { display: none; }
  .devices { transform: scale(.72); }
  .principles li { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 26px 0; }
  .contact { padding: 88px 0 64px; }
}
@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  .site-nav { gap: 18px; font-size: .95rem; }
  .step { padding-left: 56px; }
  .step h3 { font-size: 1.55rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .bp-outline { stroke-dashoffset: 0; }
  .bp-dim, .bp-dim-label, .bp-wire, .bp-hinge { opacity: 1; }
  .bp-fill { opacity: 1; transform: none; }
}

/* ---------- Header extras ---------- */
.site-nav { align-items: center; }
.site-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
.lang { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; border: 1px solid var(--line); font-size: .85rem; font-weight: 600; }
.lang a { padding: 3px 9px; border-radius: 999px; color: var(--muted); }
.lang a:hover { text-decoration: none !important; color: var(--ink); }
.lang a[aria-current="true"] { background: var(--ink); color: var(--paper); }

/* ---------- Portfolio ---------- */
.page-head { padding: 40px 0 72px; }
.page-head h1 { font-weight: 800; font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.02; letter-spacing: -0.035em; }
.page-head p { margin: 20px 0 0; max-width: 32em; font-size: 1.2rem; color: var(--muted); }

.stats { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats li { padding: 32px 28px; }
.stats li + li { border-left: 1px solid var(--line); }
.stat-num { display: block; font: 800 clamp(2.6rem, 5vw, 3.6rem)/1 var(--display); letter-spacing: -0.03em; }
.stat-label { display: block; margin-top: 10px; font-weight: 500; color: var(--muted); }
.stat-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chip { padding: 3px 10px; border-radius: 999px; font-size: .82rem; font-weight: 500; background: rgba(54,81,245,.08); color: var(--blue); }

.acc-list { padding: 72px 0 24px; display: grid; gap: 16px; }
.acc { border: 1px solid var(--line); border-radius: 28px; background: #fff; }
.acc summary {
  display: flex; align-items: center; gap: 14px;
  padding: 26px 30px; cursor: pointer; list-style: none;
  font: 700 clamp(1.4rem, 3vw, 1.9rem)/1.1 var(--display); letter-spacing: -0.02em;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary .count { font: 600 .95rem var(--text); color: var(--muted); letter-spacing: 0; }
.acc summary .soon { font: 600 .82rem var(--text); letter-spacing: 0; padding: 4px 12px; border-radius: 999px; background: rgba(255,194,75,.28); }
.acc summary::after {
  content: ""; margin-left: auto; width: 12px; height: 12px; flex: none;
  border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink);
  transform: translateY(-3px) rotate(45deg); transition: transform .25s var(--ease);
}
.acc[open] summary::after { transform: translateY(3px) rotate(-135deg); }
.acc-body { padding: 0 30px 34px; }
.acc-body > p { margin: 0; max-width: 34em; color: var(--muted); }
.acc-body > p a { font-weight: 600; text-underline-offset: 4px; }

.group-title { margin: 8px 0 16px; font: 600 .9rem var(--text); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.group-title:not(:first-child) { margin-top: 36px; }
.apps { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.app {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 16px; align-items: start;
  height: 100%; padding: 18px; border-radius: 20px; border: 1px solid var(--line);
  text-decoration: none; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.app:hover { border-color: var(--blue); transform: translateY(-2px); box-shadow: 0 16px 28px -22px rgba(20,22,58,.5); }
.app img { grid-row: 1 / 4; width: 64px; height: 64px; border-radius: 15px; border: 1px solid var(--line); background: #fff; object-fit: contain; }
.app img.ext { padding: 8px; }
.app img.pixel { image-rendering: pixelated; }
.app-name { font: 700 1.12rem/1.25 var(--display); }
.app-desc { font-size: .95rem; line-height: 1.45; color: var(--muted); }
.app-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: .85rem; font-weight: 600; }
.app-meta .store { margin-left: auto; color: var(--blue); white-space: nowrap; }

@media (max-width: 900px) {
  .page-head { padding: 24px 0 48px; }
  .acc-list { padding-top: 48px; }
}
@media (max-width: 640px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stats li { padding: 22px 4px; }
  .stats li + li { border-left: 0; border-top: 1px solid var(--line); }
  .acc summary { padding: 22px 20px; }
  .acc-body { padding: 0 16px 24px; }
  .apps { grid-template-columns: minmax(0, 1fr); }
  .site-nav .nav-how { display: none; }
}
.site-header { gap: 16px; }
@media (max-width: 480px) {
  .logo { font-size: 1.3rem; gap: 8px; }
  .logo svg { width: 22px; height: 22px; }
  .site-nav { gap: 14px; font-size: .92rem; }
}
@media (max-width: 420px) {
  .site-nav .nav-contact { display: none; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
