/* Portfolio: a neutral shell, and one drenched colour world per product. */

:root {
  --bg: #ecebe4;
  --fg: #121311;
  --muted: #54574f;
  --line: #cdcabf;
  --panel: #f7f6f1;
  --accent: #121311;
  --accent-ink: #ecebe4;
  --pkt: #e5431a;
  --shadow: 18 19 17;

  --c-smashdrop: #0d9a58;
  --c-editpatra: #d9480f;
  --c-trainx: #6f8f00;
  --c-folio: #6b5ca8;
  --c-jobed: #4b4be0;
  --c-axilerate: #0b8f8a;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --sans: 'Archivo', ui-sans-serif, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --gutter: clamp(20px, 5vw, 72px);
}

[data-theme='smashdrop'] { --bg: #04130d; --fg: #eaf7ef; --muted: #93b8a5; --line: #1b4332; --panel: #0a2419; --accent: #2ee88f; --accent-ink: #04130d; --pkt: #ffd84a; --shadow: 0 0 0; }
[data-theme='editpatra'] { --bg: #faf4e8; --fg: #1b1611; --muted: #675b4c; --line: #e0d3ba; --panel: #fffdf8; --accent: #c2410c; --accent-ink: #fff8ef; --pkt: #c2410c; --shadow: 70 45 10; }
[data-theme='trainx'] { --bg: #0a0a0a; --fg: #f2f2ec; --muted: #a1a196; --line: #2a2a27; --panel: #151514; --accent: #c8f135; --accent-ink: #0a0a0a; --pkt: #c8f135; --shadow: 0 0 0; }
[data-theme='folio'] { --bg: #f4f5f0; --fg: #13302a; --muted: #4f655d; --line: #cfdcd4; --panel: #fcfdfa; --accent: #5a4b98; --accent-ink: #fcfdfa; --pkt: #a3452a; --shadow: 19 48 42; }
[data-theme='jobed'] { --bg: #f4f4fb; --fg: #14142b; --muted: #57577a; --line: #d9d9ec; --panel: #ffffff; --accent: #4b4be0; --accent-ink: #ffffff; --pkt: #4b4be0; --shadow: 20 20 80; }
[data-theme='axilerate'] { --bg: #052a2e; --fg: #e8f6f5; --muted: #94c0bd; --line: #124a4f; --panel: #0a383d; --accent: #2dd4bf; --accent-ink: #052a2e; --pkt: #7dd3fc; --shadow: 0 0 0; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 60px; -webkit-text-size-adjust: 100%; scrollbar-color: #8b8a82 #ecebe4; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 1.0625rem/1.55 var(--sans);
  font-stretch: 100%;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent); color: var(--accent-ink); }
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
code { font: 500 0.86em var(--mono); background: color-mix(in srgb, var(--fg) 8%, transparent); padding: 0.1em 0.36em; border-radius: 4px; }
h1, h2, h3, h4, p, dl, dd, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

.wrap { max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter); }
.i { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.i-fill { fill: currentColor; stroke: none; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 30; background: #121311; color: #ecebe4; padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }

/* ---------- nav: takes the colours of whichever section sits under it ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 0 var(--gutter); height: 60px;
  background: var(--bg); color: var(--fg); border-bottom: 1px solid var(--line);
  font-size: 0.9375rem;
  transition: background-color 320ms ease, color 320ms ease, border-color 320ms ease;
}
.nav[data-top] { border-bottom-color: transparent; }
.nav a { text-decoration: none; }
.nav-name { font-weight: 700; font-stretch: 118%; letter-spacing: -0.01em; }
.nav nav { display: flex; gap: clamp(14px, 2.4vw, 30px); align-items: center; }
.nav nav a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 0; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 260ms var(--ease-out); }
.nav nav a:hover { background-size: 100% 1px; }

/* ---------- hero ---------- */
.hero { padding: clamp(104px, 14vh, 150px) 0 clamp(56px, 8vh, 96px); }
h1 {
  font-size: clamp(2.7rem, 7.4vw, 6rem); line-height: 0.96; font-weight: 760; font-stretch: 125%;
  letter-spacing: -0.038em; max-width: 14ch; text-wrap: balance;
}
.hero-lede { margin-top: clamp(22px, 3vw, 36px); max-width: 62ch; font-size: clamp(1.06rem, 1.35vw, 1.22rem); color: var(--muted); text-wrap: pretty; }
.map { margin-top: clamp(40px, 6vw, 72px); }
.map-hint { font-size: 0.875rem; color: var(--muted); margin-bottom: 14px; }
.index { display: none; }

/* the mark, plotted on a ten-second loop */
.hero-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: clamp(24px, 5vw, 80px); align-items: center; }
.mark { width: 100%; height: auto; overflow: visible; }
.mark path, .mark circle { fill: none; }
.mk-guides > * { stroke: var(--fg); stroke-width: 0.75; stroke-dasharray: 1; opacity: 0.32; vector-effect: non-scaling-stroke; }
.mk-line path { stroke: var(--fg); stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; opacity: 0; }
.mk-solid path { stroke: url(#mk); stroke-width: 27; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; }
.mk-run circle { fill: #f7f6f1; stroke: none; }
.mk-anchors rect { fill: var(--bg); stroke: var(--fg); stroke-width: 1; }
@media (prefers-reduced-motion: no-preference) {
  .mk-guides > * { animation: mk-guide 10s var(--ease-out) infinite; animation-delay: calc(var(--i) * 70ms); }
  .mk-line path { animation: mk-line 10s var(--ease-in-out) infinite; animation-delay: calc(var(--i) * 140ms); }
  .mk-solid path { animation: mk-solid 10s var(--ease-in-out) infinite; animation-delay: calc(var(--i) * 160ms); }
  .mk-run { animation: mk-run 10s linear infinite; }
  .mk-anchors rect { animation: mk-anchor 10s var(--ease-out) infinite; animation-delay: calc(var(--i) * 45ms); transform-box: fill-box; transform-origin: center; }
  .mark { animation: mk-float 10s ease-in-out infinite; }
}
@media (prefers-reduced-motion: reduce) { .mk-run { display: none; } }
@keyframes mk-guide { 0% { stroke-dashoffset: 1; opacity: 0.5; } 16%, 30% { stroke-dashoffset: 0; opacity: 0.5; } 46%, 88% { stroke-dashoffset: 0; opacity: 0.2; } 96%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes mk-line { 0%, 11% { stroke-dashoffset: 1; opacity: 0; } 12% { stroke-dashoffset: 1; opacity: 1; } 28%, 34% { stroke-dashoffset: 0; opacity: 1; } 44%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes mk-solid { 0%, 27% { stroke-dashoffset: 1; opacity: 0; filter: none; } 28% { stroke-dashoffset: 1; opacity: 1; filter: none; } 44%, 88% { stroke-dashoffset: 0; opacity: 1; filter: none; } 96%, 100% { stroke-dashoffset: 0; opacity: 0; filter: blur(10px); } }
@keyframes mk-run { 0%, 46% { opacity: 0; } 52%, 86% { opacity: 1; } 90%, 100% { opacity: 0; } }
@keyframes mk-anchor { 0%, 8% { opacity: 0; transform: scale(0.4); } 16%, 88% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; transform: none; } }
@keyframes mk-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* the path from idea to product */
.path { margin-top: clamp(48px, 6vw, 84px); }
.path h2 { font-size: clamp(1.45rem, 2.3vw, 1.9rem); font-weight: 700; font-stretch: 118%; letter-spacing: -0.022em; line-height: 1.1; }
.path ol { counter-reset: stage; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(24px, 3.4vw, 52px); margin-top: 26px; }
.path li { counter-increment: stage; padding: 16px 0 30px; border-top: 1px solid var(--fg); }
.path li::before { content: counter(stage); display: block; font: 500 0.75rem var(--mono); color: var(--muted); margin-bottom: 10px; }
.path h3 { font-size: 1.14rem; font-weight: 680; font-stretch: 108%; letter-spacing: -0.012em; line-height: 1.25; }
.path p { margin-top: 7px; color: var(--muted); font-size: 0.9875rem; max-width: 40ch; text-wrap: pretty; }

/* ---------- diagrams ---------- */
.scroll-x { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; padding-bottom: 6px; }
.scroll-x svg { width: 100%; min-width: 900px; height: auto; overflow: visible; }
svg .col { font: 600 11px var(--sans); letter-spacing: 0.09em; text-transform: uppercase; fill: var(--muted); }
svg .edge { fill: none; stroke: var(--line); stroke-width: 1.25; transition: stroke 240ms ease, opacity 240ms ease, stroke-width 240ms ease; }
svg .edge.on { stroke: var(--hot, var(--accent)); stroke-width: 2; }
svg.tracing .edge:not(.on) { opacity: 0.4; }
svg .node rect { fill: var(--panel); stroke: var(--line); stroke-width: 1; transition: stroke 200ms ease, fill 200ms ease; }
svg .node.on rect { stroke: var(--hot, var(--accent)); stroke-width: 1.5; }
svg .node.now rect { fill: color-mix(in srgb, var(--hot, var(--accent)) 14%, var(--panel)); }
svg .nl { font: 620 15px var(--sans); fill: var(--fg); letter-spacing: -0.005em; }
svg .ns { font: 400 12px var(--sans); fill: var(--muted); }
svg .pkt { fill: var(--pkt); }
svg a.node { cursor: pointer; text-decoration: none; }
svg a.node:hover rect, svg a.node:focus-visible rect { stroke: var(--fg); }
svg a.node:focus-visible { outline: none; }
svg a.node:focus-visible rect { stroke-width: 2; }
svg .dot { fill: var(--c); }
svg a.node[data-id='smashdrop'] { --c: var(--c-smashdrop); }
svg a.node[data-id='editpatra'] { --c: var(--c-editpatra); }
svg a.node[data-id='trainx'] { --c: var(--c-trainx); }
svg a.node[data-id='folio'] { --c: var(--c-folio); }
svg a.node[data-id='jobed'] { --c: var(--c-jobed); }
svg a.node[data-id='axilerate'] { --c: var(--c-axilerate); }
.map[data-on='smashdrop'] { --hot: var(--c-smashdrop); --pkt: var(--c-smashdrop); }
.map[data-on='editpatra'] { --hot: var(--c-editpatra); --pkt: var(--c-editpatra); }
.map[data-on='trainx'] { --hot: var(--c-trainx); --pkt: var(--c-trainx); }
.map[data-on='folio'] { --hot: var(--c-folio); --pkt: var(--c-folio); }
.map[data-on='jobed'] { --hot: var(--c-jobed); --pkt: var(--c-jobed); }
.map[data-on='axilerate'] { --hot: var(--c-axilerate); --pkt: var(--c-axilerate); }

/* ---------- chapters ---------- */
.chapter { background: var(--bg); color: var(--fg); padding: clamp(84px, 11vw, 160px) 0 clamp(72px, 9vw, 130px); scrollbar-color: var(--line) transparent; }
.ch-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 6vw, 96px); align-items: end; }
h2 { font-size: clamp(3rem, 9.4vw, 6rem); line-height: 0.94; font-weight: 780; font-stretch: 125%; letter-spacing: -0.04em; text-wrap: balance; }
.ch-lede { margin-top: clamp(18px, 2.2vw, 28px); font-size: clamp(1.12rem, 1.6vw, 1.38rem); line-height: 1.42; max-width: 34em; text-wrap: pretty; }
.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(20px, 2.4vw, 30px); }
.link {
  display: inline-flex; align-items: center; gap: 9px; padding: 9px 14px 9px 12px;
  border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 0.9375rem; font-weight: 520;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 160ms var(--ease-out);
}
.link:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.link:active { transform: scale(0.97); }
.link em { font: 500 0.72rem var(--mono); font-style: normal; opacity: 0.72; padding-left: 9px; border-left: 1px solid currentColor; }

.spec div { display: grid; grid-template-columns: 6.2em 1fr; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 0.9375rem; }
.spec div:last-child { border-bottom: 1px solid var(--line); }
.spec dt { color: var(--muted); }

/* viewer */
.viewer { position: relative; margin-top: clamp(40px, 5.5vw, 76px); }
.stage { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel); box-shadow: 0 30px 60px -28px rgb(var(--shadow) / 0.55), 0 8px 18px -10px rgb(var(--shadow) / 0.3); }
.chrome { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.chrome i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.chrome span { margin-left: 10px; font: 400 0.75rem var(--mono); color: var(--muted); }
.screen { position: relative; aspect-ratio: 16 / 10; background: var(--panel); }
.screen video, .screen .still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; transition: opacity 260ms ease, filter 260ms ease; }
.screen .swap { opacity: 0; filter: blur(6px); }
.phone {
  position: absolute; right: clamp(16px, 4vw, 56px); bottom: 74px; width: clamp(120px, 15.5%, 200px); height: auto;
  border: 5px solid #0c0c0c; border-radius: clamp(18px, 2.2vw, 28px); background: #0c0c0c;
  box-shadow: 0 34px 50px -22px rgb(var(--shadow) / 0.7), 0 10px 20px -8px rgb(var(--shadow) / 0.4);
}
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-right: clamp(150px, 20%, 270px); }
.thumb { height: 54px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); opacity: 0.72; transition: opacity 180ms ease, border-color 180ms ease, transform 160ms var(--ease-out); }
.thumb img { height: 100%; width: 86px; object-fit: cover; object-position: top; }
.thumb:hover { opacity: 1; }
.thumb:active { transform: scale(0.97); }
.thumb[aria-pressed='true'] { opacity: 1; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.thumb-video { display: inline-flex; align-items: center; gap: 8px; padding: 0 16px 0 13px; font-size: 0.9rem; font-weight: 560; }
.thumb-video .i { fill: currentColor; stroke: none; }
.thumb-video[aria-pressed='true'] { background: var(--accent); color: var(--accent-ink); }
figcaption { margin-top: 12px; font-size: 0.9rem; color: var(--muted); min-height: 1.5em; }

/* system */
.system { margin-top: clamp(64px, 8vw, 116px); }
.system-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 18px 32px; margin-bottom: 26px; }
h3 { font-size: clamp(1.45rem, 2.3vw, 1.9rem); font-weight: 700; font-stretch: 118%; letter-spacing: -0.022em; line-height: 1.1; }
.flows { display: flex; flex-wrap: wrap; gap: 8px; }
.flow { padding: 8px 15px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.9rem; font-weight: 540; transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 160ms var(--ease-out); }
.flow:hover { border-color: var(--fg); }
.flow:active { transform: scale(0.97); }
.flow[aria-pressed='true'] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 22px; margin-top: 26px; }
.steps[hidden] { display: none; }
.steps li { counter-increment: step; position: relative; padding: 14px 0 18px; border-top: 2px solid var(--line); color: var(--muted); font-size: 0.9375rem; line-height: 1.45; transition: color 220ms ease, border-color 220ms ease; }
.steps li::before { content: counter(step); display: block; font: 500 0.75rem var(--mono); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.steps li.on { color: var(--fg); border-top-color: var(--accent); }

/* integrations */
.integrations { margin-top: clamp(64px, 8vw, 116px); }
.integrations dl { margin-top: 22px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(32px, 6vw, 96px); }
.integrations div { display: grid; grid-template-columns: 9.5em 1fr; gap: 18px; padding: 15px 0 17px; border-top: 1px solid var(--line); font-size: 0.9375rem; line-height: 1.5; }
.integrations dt { font-weight: 650; font-stretch: 106%; }
.integrations dd { color: color-mix(in srgb, var(--fg) 82%, var(--bg)); text-wrap: pretty; }

/* notes + stack */
.detail { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: clamp(36px, 7vw, 110px); margin-top: clamp(64px, 8vw, 116px); align-items: start; }
.notes article { margin-top: 30px; max-width: 68ch; }
.notes article + article { margin-top: 34px; }
h4 { font-size: 1.14rem; font-weight: 680; font-stretch: 108%; letter-spacing: -0.012em; line-height: 1.25; }
.notes p { margin-top: 8px; color: color-mix(in srgb, var(--fg) 84%, var(--bg)); text-wrap: pretty; }
.stack { position: sticky; top: 88px; }
.stack dl { margin-top: 22px; }
.stack div { padding: 12px 0; border-top: 1px solid var(--line); font-size: 0.9375rem; }
.stack div:last-child { border-bottom: 1px solid var(--line); }
.stack dt { color: var(--muted); font-size: 0.8125rem; margin-bottom: 3px; }
.stack dd { line-height: 1.45; }

/* ---------- method ---------- */
.method { padding: clamp(90px, 12vw, 170px) 0; }
.method h2 { font-size: clamp(2.3rem, 6vw, 4.4rem); max-width: 14ch; }
.threads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(32px, 6vw, 96px); margin-top: clamp(40px, 5vw, 70px); }
.threads div { padding: 24px 0 28px; border-top: 1px solid var(--line); }
.threads dt { font-size: 1.2rem; font-weight: 680; font-stretch: 112%; letter-spacing: -0.015em; }
.threads dd { margin-top: 8px; color: var(--muted); max-width: 52ch; text-wrap: pretty; }

/* ---------- contact ---------- */
.contact, .nav[data-theme='contact'] { --bg: #121311; --fg: #ecebe4; --muted: #a9a89f; --line: #34352f; --accent: #ecebe4; --accent-ink: #121311; }
.contact { background: var(--bg); color: var(--fg); padding: clamp(90px, 12vw, 170px) 0 48px; }
.contact h2 { font-size: clamp(2.3rem, 6vw, 4.6rem); max-width: 16ch; }
.contact-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(32px, 4vw, 52px); }
.contact-links .link { font-size: clamp(1rem, 1.5vw, 1.2rem); padding: 13px 20px 13px 16px; }
.fine { margin-top: clamp(70px, 10vw, 140px); padding-top: 22px; border-top: 1px solid var(--line); font-size: 0.875rem; color: var(--muted); max-width: none; }

/* ---------- the one authored entrance ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js h1, .js .hero-lede, .js .map, .js .path { opacity: 0; transform: translateY(18px); filter: blur(8px); transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out), filter 900ms var(--ease-out); }
  .js .hero-lede { transition-delay: 90ms; }
  .js .path { transition-delay: 180ms; }
  .js .map { transition-delay: 260ms; }
  .js.ready h1, .js.ready .hero-lede, .js.ready .map, .js.ready .path { opacity: 1; transform: none; filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* ---------- narrow ---------- */
@media (max-width: 900px) {
  .ch-head, .detail, .integrations dl { grid-template-columns: 1fr; }
  .path ol { grid-template-columns: 1fr; }
  .hero-top { grid-template-columns: 1fr; }
  .mark { max-width: 250px; margin-top: 8px; }
  .path li { padding-bottom: 22px; }
  .ch-head { align-items: start; }
  .stack { position: static; }
  .threads { grid-template-columns: 1fr; }
  .map { display: none; }
  .index { display: block; margin-top: 40px; border-bottom: 1px solid var(--line); }
  .index { border-bottom-color: #cdcabf; }
  .index a { border-top-color: #cdcabf !important; display: grid; grid-template-columns: 12px 1fr; gap: 2px 12px; align-items: baseline; padding: 14px 0; border-top: 1px solid var(--line); text-decoration: none; }
  .index .sw { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 1px solid rgb(0 0 0 / 0.25); }
  .index strong { font-weight: 700; font-stretch: 115%; font-size: 1.15rem; }
  .index a span:last-child { grid-column: 2; color: #54574f; font-size: 0.9375rem; }
  .phone { display: none; }
  .thumbs { padding-right: 0; }
  .nav nav a:not(:last-child):not(:first-child) { display: none; }
}
@media (max-width: 520px) {
  .spec div { grid-template-columns: 5.4em 1fr; }
  .integrations div { grid-template-columns: 1fr; gap: 4px; }
  .thumb img { width: 70px; }
  .thumb { height: 46px; }
}
