/* Tokens ------------------------------------------------------------ */
:root {
  --paper: #EDF0F2;
  --paper-2: #E2E7EB;
  --surface: #FFFFFF;
  --ink: #15233B;
  --ink-2: #4A586B;
  --ink-3: #586474;
  --line: #CDD4DC;
  --amber: #F2B233;
  --amber-ink: #6B4A00;
  --green: #1F6F55;
  --green-bg: #DDEEE6;
  --red: #A5402D;
  --night: #15233B;
  --night-2: #1E2F4C;
  --night-line: #2F4364;
  --night-text: #DCE3EC;

  --code-bg: #15233B;
  --code-text: #DCE3EC;
  --code-dim: #8494AC;
  --code-str: #F2C66B;
  --code-kw: #8FC7FF;
  --code-num: #F59E7A;

  --sans: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  --step-3: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  --step-4: clamp(2.3rem, 1.5rem + 3.2vw, 4rem);

  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1200px;
  --radius-s: 6px;
  --radius-m: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E1828;
    --paper-2: #13213A;
    --surface: #172640;
    --ink: #E6ECF3;
    --ink-2: #AEBACB;
    --ink-3: #9DB0D0;
    --line: #2A3B58;
    --amber-ink: #F2B233;
    --green: #6FD0A8;
    --green-bg: #173A33;
    --red: #F08C77;
    --night: #0A1220;
    --night-2: #12203A;
    --night-line: #26395A;
    --code-bg: #0A1220;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0E1828; --paper-2: #13213A; --surface: #172640; --ink: #E6ECF3; --ink-2: #AEBACB;
  --ink-3: #9DB0D0; --line: #2A3B58; --amber-ink: #F2B233; --green: #6FD0A8; --green-bg: #173A33;
  --red: #F08C77; --night: #0A1220; --night-2: #12203A; --night-line: #26395A; --code-bg: #0A1220;
  color-scheme: dark;
}

/* Base -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.55;
  font-variation-settings: "opsz" 16;
  font-feature-settings: "tnum" 0;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--amber); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: calc(var(--maxw) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header ------------------------------------------------------------ */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.top.scrolled { border-bottom-color: var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.mark { font-weight: 800; font-variation-settings: "opsz" 24, "wdth" 85; font-size: 1.15rem; text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
nav { display: flex; gap: clamp(10px, 2.4vw, 28px); align-items: center; }
nav a { text-decoration: none; color: var(--ink-2); font-size: var(--step--1); }
nav a:hover { color: var(--ink); }
nav .nav-cta { color: var(--ink); font-weight: 600; border-bottom: 2px solid var(--amber); padding-bottom: 1px; }
@media (max-width: 560px) { nav a:not(.nav-cta) { display: none; } }

/* Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 10px;
  border: 1.5px solid var(--ink); color: var(--ink); background: transparent;
  font-weight: 600; font-size: var(--step--1); text-decoration: none; white-space: nowrap;
  transition: background .15s, color .15s;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: transparent; color: var(--ink); }
.btn-amber { background: var(--amber); border-color: var(--amber); color: #15233B; }
.btn-amber:hover { background: transparent; color: var(--amber); }
.btn-ghost { border-color: var(--night-line); color: var(--night-text); }
.btn-ghost:hover { background: var(--night-text); color: var(--night); }

/* Hero -------------------------------------------------------------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; padding-top: clamp(40px, 8vw, 104px); padding-bottom: clamp(56px, 9vw, 120px); }
.hello { color: var(--ink-2); font-size: var(--step--1); margin-bottom: 20px; }
.hero h1 { font-size: var(--step-4); font-variation-settings: "opsz" 96, "wdth" 92; font-weight: 700; letter-spacing: -0.015em; line-height: 1.02; max-width: 15ch; }
.lede { margin-top: 28px; font-size: var(--step-1); line-height: 1.5; color: var(--ink-2); max-width: 36em; }
.lede a { color: var(--ink); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* Matcher illustration */
.matcher { margin: 0; display: grid; grid-template-columns: minmax(0, 1.25fr) 44px minmax(0, 1fr); align-items: center; font-variant-numeric: tabular-nums; }
.m-head { font-size: 0.8rem; color: var(--ink-3); margin: 0 0 10px; }
.m-raw ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.m-raw li {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 10px 12px; font-size: 0.86rem; line-height: 1.3;
  animation: in .5s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 110ms + 150ms);
}
.m-shop { grid-column: 1; color: var(--ink-3); font-size: 0.75rem; }
.m-title { grid-column: 1; font-weight: 500; }
.m-price { white-space: nowrap; grid-column: 2; grid-row: 1 / span 2; align-self: center; font-weight: 600; }
.m-reject { border-style: dashed !important; background: transparent !important; color: var(--ink-3); }
.m-reject .m-title { text-decoration: line-through; text-decoration-color: var(--red); }
.m-why { grid-column: 1 / -1; color: var(--red); font-size: 0.75rem; margin-top: 4px; }
.m-wires { width: 44px; height: 300px; align-self: start; margin-top: 26px; overflow: visible; }
.m-wires path { fill: none; stroke: var(--amber); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-dasharray: 120; animation: draw .7s ease-out both; animation-delay: .75s; }
.m-card {
  background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--radius-m);
  padding: 16px; box-shadow: 0 12px 28px -16px rgba(0,0,0,.35); border-color: var(--amber);
  animation: pop .5s cubic-bezier(.2,.7,.2,1) both; animation-delay: 1.15s;
}
.m-name { font-weight: 700; font-size: 1.05rem; margin: 0; line-height: 1.2; font-variation-settings: "opsz" 24; }
.m-variant { color: var(--ink-2); font-size: 0.82rem; margin: 2px 0 12px; }
.m-low { white-space: nowrap; margin: 0 0 10px; font-size: 1.6rem; font-weight: 750; letter-spacing: -0.02em; line-height: 1; }
.m-low span { display: block; font-size: 0.75rem; font-weight: 500; color: var(--green); letter-spacing: 0; margin-bottom: 4px; }
.m-card ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.m-card li { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.85rem; border-bottom: 1px solid var(--line); }
.m-card li:first-child { color: var(--green); font-weight: 600; }
.m-card li:last-child { border-bottom: 0; }
.matcher figcaption { grid-column: 1 / -1; margin-top: 16px; font-size: 0.78rem; color: var(--ink-3); max-width: 46em; }
@keyframes in { from { opacity: 0; transform: translateX(-8px); } }
@keyframes draw { from { stroke-dashoffset: 120; } to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: translateX(-10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .m-raw li, .m-card { animation: none; opacity: 1; transform: none; }
  .m-wires path { animation: none; stroke-dashoffset: 0; }
}

/* Sections ---------------------------------------------------------- */
.section-h { font-size: var(--step-3); font-variation-settings: "opsz" 72, "wdth" 92; letter-spacing: -0.015em; }
.section-lede { color: var(--ink-2); max-width: 40em; margin-top: 16px; font-size: var(--step-1); line-height: 1.45; }
.work { padding-top: clamp(24px, 4vw, 48px); border-top: 1px solid var(--line); }
.work > .wrap:first-child { padding-top: clamp(32px, 5vw, 56px); }

/* Case studies */
.case { padding-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(56px, 8vw, 104px); }
.case + .case { border-top: 1px solid var(--line); }
.case-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: clamp(24px, 3vw, 40px); }
.case h3 { font-size: var(--step-3); font-variation-settings: "opsz" 72; letter-spacing: -0.018em; }
.case-sub { margin: 10px 0 0; color: var(--ink-2); font-size: var(--step-1); max-width: 34em; line-height: 1.4; }
.status { font-size: var(--step--1); color: var(--ink-3); border: 1px dashed var(--line); border-radius: 8px; padding: 8px 14px; }

/* Screenshot frames */
.shots { position: relative; }
.shots-kk { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: clamp(14px, 2vw, 24px); align-items: start; }
.frame {
  margin: 0; background: var(--surface); border-radius: var(--radius-m); overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 12px 24px -16px rgba(21,35,59,.35);
}
.frame-bar { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.frame-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.frame-bar span { margin-left: 10px; font-size: 0.75rem; color: var(--ink-3); background: var(--surface); border-radius: 999px; padding: 3px 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.frame-side { margin-top: clamp(24px, 5vw, 64px); }
.frame-side img { aspect-ratio: 1440 / 1500; object-fit: cover; object-position: top; }
.frame-wide img { aspect-ratio: 1568 / 778; object-fit: cover; }

.case-body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); margin-top: clamp(32px, 4vw, 56px); }
.case-text p { max-width: 38em; }
.case-text em { font-style: normal; background: linear-gradient(transparent 60%, color-mix(in srgb, var(--amber) 45%, transparent) 60%); }
.facts { margin: 0; display: grid; gap: 0; align-content: start; border-top: 1.5px solid var(--ink); }
.facts div { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.facts dt { font-size: 0.82rem; color: var(--ink-3); }
.facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.facts dd small { font-weight: 400; color: var(--ink-3); font-size: 0.8rem; margin-left: 4px; }

/* Code panels */
.code { margin: clamp(32px, 4vw, 56px) 0 0; background: var(--code-bg); color: var(--code-text); border-radius: var(--radius-m); overflow: hidden; border: 1px solid var(--night-line); }
.code figcaption { display: flex; justify-content: space-between; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--night-line); font-size: 0.8rem; color: var(--code-dim); }
.code figcaption span:first-child { color: var(--code-text); }
.code pre { margin: 0; padding: 18px; overflow-x: auto; font-family: var(--mono); font-size: 0.82rem; line-height: 1.65; tab-size: 4; }
.code code { font-family: inherit; font-variant-ligatures: none; font-feature-settings: "calt" 0, "liga" 0; }
.tok-c { color: var(--code-dim); font-style: italic; }
.tok-s { color: var(--code-str); }
.tok-k { color: var(--code-kw); }
.tok-n { color: var(--code-num); }

/* Dark case (Caralyze) */
.case-dark { background: var(--night); color: var(--night-text); border-radius: 20px; max-width: calc(var(--maxw) + 2 * var(--gutter)); padding-inline: clamp(18px, 4vw, 48px); margin-block: clamp(24px, 4vw, 48px); border: 0 !important; }
.case-dark .case-sub, .case-dark .facts dt, .case-dark .facts dd small { color: #A7B4C7; }
.case-dark .facts { border-top-color: var(--night-text); }
.case-dark .facts div { border-bottom-color: var(--night-line); }
.case-dark .btn { border-color: var(--night-text); color: var(--night-text); }
.case-dark .btn:hover { background: var(--night-text); color: var(--night); }
.case-dark .frame { border-color: var(--night-line); background: var(--night-2); box-shadow: 0 12px 24px -16px rgba(0,0,0,.6); }
.case-dark .frame-bar { background: var(--night-2); border-bottom-color: var(--night-line); }
.case-dark .frame-bar i { background: var(--night-line); }
.case-dark .frame-bar span { background: var(--night); color: #A7B4C7; }
.case-dark .code { background: #0B1424; }
.case-dark .case-text em { background: none; color: var(--amber); }
@media (max-width: 1296px) { .case-dark { border-radius: 0; } }

/* TooLazy */
.tl-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); }
.boards { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px 22px; align-self: start; }
.boards > p:first-child { font-size: 0.82rem; color: var(--ink-3); margin-bottom: 8px; }
.boards ul { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.boards li { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 0.88rem; background: var(--paper); }
.boards-stack { margin: 0; font-size: 0.88rem; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 12px; }

/* Agents */
.agents { background: var(--paper-2); padding-block: clamp(64px, 9vw, 120px); }
.flows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 4vw, 48px) clamp(24px, 4vw, 56px); margin-top: clamp(32px, 5vw, 56px); }
.flow h3 { font-size: var(--step-2); font-variation-settings: "opsz" 48; letter-spacing: -0.02em; margin-bottom: 10px; }
.flow > p { color: var(--ink-2); max-width: 34em; }
.graph { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; margin-top: 18px; padding: 18px; border-radius: var(--radius-m); background-color: var(--surface); border: 1px solid var(--line); }
.node { position: relative; display: inline-flex; flex-direction: column; justify-content: center; min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--ink); border-radius: 8px; background: var(--surface); font-size: 0.82rem; font-weight: 600; line-height: 1.2; }
.node small { font-weight: 400; color: var(--ink-3); font-size: 0.75rem; margin-top: 2px; }
.node:not(:last-child)::after { content: ""; position: absolute; right: -23px; top: 50%; width: 22px; height: 1.5px; background: var(--ink-3); }
.node.trig { border-radius: 22px 8px 8px 22px; }
.node.ai { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.node.ai small { color: inherit; opacity: .72; }
.node.key { border-color: var(--amber); }
.node.split { flex-direction: row; gap: 8px; align-items: center; }
.node.split i { font-style: normal; font-weight: 400; color: var(--ink-3); }
.code-js { margin-top: clamp(40px, 5vw, 64px); }

/* Archive table */
.archive { padding-block: clamp(64px, 9vw, 120px); }
.index { width: 100%; border-collapse: collapse; margin-top: clamp(24px, 4vw, 40px); font-size: 0.95rem; }
.index thead th { text-align: left; font-weight: 500; font-size: 0.82rem; color: var(--ink-3); padding: 0 16px 10px 0; border-bottom: 1.5px solid var(--ink); }
.index tbody th, .index td { text-align: left; vertical-align: top; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); }
.index tbody th { font-weight: 650; width: 22%; }
.index td:last-child { color: var(--ink-2); width: 24%; font-size: 0.88rem; }
.index tbody tr:hover { background: color-mix(in srgb, var(--amber) 10%, transparent); }
@media (max-width: 760px) {
  .index thead { display: none; }
  .index, .index tbody, .index tr, .index th, .index td { display: block; width: auto !important; }
  .index tr { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .index tbody th, .index td { border: 0; padding: 0 0 4px; }
}

/* Stack */
.stack { padding-bottom: clamp(64px, 9vw, 120px); }
.stack-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); margin-top: clamp(24px, 4vw, 40px); border-top: 1.5px solid var(--ink); padding-top: 24px; }
.stack-grid h3 { font-size: var(--step-1); margin-bottom: 8px; letter-spacing: -0.01em; }
.stack-grid p { color: var(--ink-2); font-size: 0.95rem; }

/* Contact */
.contact { background: var(--night); color: var(--night-text); padding-block: clamp(72px, 10vw, 136px); }
.contact h2 { font-size: var(--step-3); font-variation-settings: "opsz" 72, "wdth" 92; letter-spacing: -0.015em; max-width: 20ch; color: #fff; }
.contact p { margin-top: 20px; color: #A7B4C7; font-size: var(--step-1); }
.foot { padding-block: 28px; color: var(--ink-3); font-size: var(--step--1); }
.foot p { margin: 0; }

/* Responsive -------------------------------------------------------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero h1 { max-width: 16ch; }
  .case-body, .tl-grid { grid-template-columns: 1fr; }
  .flows { grid-template-columns: 1fr; }
  .stack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .shots-kk { grid-template-columns: 1fr; }
  .frame-side { margin-top: 0; }
  .frame-side img { aspect-ratio: 1440 / 1100; }
  .matcher { grid-template-columns: 1fr; }
  .m-wires { display: none; }
  .m-out { margin-top: 16px; }
  .stack-grid { grid-template-columns: 1fr; }
  .graph { gap: 18px; }
  .node:not(:last-child)::after { display: none; }
}

/* Workflow graphs as vertical pipelines: connectors never dangle when space is tight */
.graph { flex-direction: column; align-items: flex-start; gap: 16px; }
.node:not(:last-child)::after { right: auto; left: 20px; top: auto; bottom: -17px; width: 1.5px; height: 16px; display: block; }
.node:nth-child(2) { margin-left: 24px; }
.node:nth-child(3) { margin-left: 48px; }
.node:nth-child(4) { margin-left: 72px; }
.node:nth-child(5) { margin-left: 96px; }
.node:not(:last-child)::after { left: 34px; }

/* v2: web-app positioning ------------------------------------------- */
.hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.hero h1 { max-width: 12ch; }
.hero-proof { list-style: none; margin: 36px 0 0; padding: 0; border-top: 1px solid var(--line); max-width: 34em; }
.hero-proof li { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; color: var(--ink-2); }
.hero-proof strong { color: var(--ink); font-weight: 650; min-width: 12.5em; }

/* Collage of real app screenshots */
.collage { position: relative; aspect-ratio: 1 / 0.92; }
.collage .frame { position: absolute; margin: 0; }
.collage img { width: 100%; object-fit: cover; object-position: top left; }
.c-main { top: 0; right: 0; width: 86%; z-index: 1; }
.c-main img { aspect-ratio: 1440 / 900; }
.c-second { left: 0; top: 44%; width: 64%; z-index: 2; box-shadow: 0 16px 32px -18px rgba(21,35,59,.55); }
.c-second img { aspect-ratio: 1440 / 900; }
.c-third { right: 2%; top: 60%; width: 40%; z-index: 3; box-shadow: 0 16px 32px -18px rgba(21,35,59,.55); }
.c-third img { aspect-ratio: 1440 / 1000; }
@media (prefers-reduced-motion: no-preference) {
  .collage .frame { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
  .c-second { animation-delay: .15s !important; }
  .c-third { animation-delay: .3s !important; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* What I build */
.build { padding-block: clamp(56px, 8vw, 104px); border-top: 1px solid var(--line); }
.build-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(20px, 3vw, 36px); margin-top: clamp(28px, 4vw, 48px); }
.build-grid article { border-top: 3px solid var(--ink); padding-top: 18px; display: flex; flex-direction: column; }
.build-grid article:first-child { border-top-color: var(--amber); }
.build-grid h3 { font-size: var(--step-2); font-variation-settings: "opsz" 48; letter-spacing: -0.02em; margin-bottom: 12px; }
.build-grid p { color: var(--ink-2); font-size: 0.97rem; }
.build-grid .seen { margin-top: auto; margin-bottom: 0; font-size: 0.82rem; color: var(--ink-3); padding-top: 8px; }

/* Matcher inside the KomKoto case */
.case .matcher { margin-top: clamp(40px, 5vw, 64px); padding-block: clamp(24px, 3vw, 36px); border-block: 1px solid var(--line); }
.case .matcher .m-raw li { background: var(--surface); }

/* LinkedIn API case */
.li-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
.li-shot img { aspect-ratio: 1440 / 1480; object-fit: cover; object-position: top; }
.li-flow { list-style: none; margin: 0 0 28px; padding: 0; counter-reset: step; }
.li-flow li { counter-increment: step; position: relative; padding: 0 0 20px 44px; color: #A7B4C7; font-size: 0.97rem; }
.li-flow li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--amber); color: var(--amber); font-size: 0.82rem; font-weight: 700; display: grid; place-items: center; }
.li-flow li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 32px; bottom: 4px; width: 1.5px; background: var(--night-line); }
.li-flow strong { display: block; color: #fff; font-size: 1.05rem; margin-bottom: 2px; }
.case-dark .status { color: #A7B4C7; border-color: var(--night-line); }

/* TooLazy + Caralyze */
.work-2 { border-top: 1px solid var(--line); }
.shots-tl { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: clamp(14px, 2vw, 24px); align-items: start; }
.shots-tl .frame-side { margin-top: clamp(24px, 5vw, 64px); }
.shots-tl .frame-side img { aspect-ratio: 1440 / 900; }
.cz-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.frame-small img { aspect-ratio: 1568 / 778; object-fit: cover; }
.aside { color: var(--ink-3); font-size: 0.92rem; border-left: 2px solid var(--line); padding-left: 12px; }

@media (max-width: 1100px) {
  .build-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .collage { max-width: 680px; }
  .li-grid, .cz-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .build-grid { grid-template-columns: 1fr; }
  .shots-tl { grid-template-columns: 1fr; }
  .shots-tl .frame-side { margin-top: 0; }
  .collage { aspect-ratio: 1 / 1.02; }
  .c-main { width: 92%; }
  .c-second { width: 78%; top: 40%; }
  .c-third { width: 52%; top: 66%; }
  .hero-proof strong { min-width: 0; width: 100%; }
  .li-shot img { aspect-ratio: 1440 / 1100; }
}

.contact-in > p { max-width: 50ch; }
@media (max-width: 640px) { .hero .lede { font-size: 1.125rem; } }

.theme-btn {
  font: inherit; font-size: var(--step--1); color: var(--ink-2);
  background: none; border: 1px solid var(--line); border-radius: 8px;
  padding: 4px 12px; cursor: pointer;
}
.theme-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.theme-btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* Skills */
.skills { background: var(--paper-2); padding-block: clamp(64px, 9vw, 120px); }
.skill-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(32px, 4vw, 48px) clamp(20px, 2.6vw, 36px); margin-top: clamp(36px, 5vw, 56px);
}
.skill-group { border-top: 2px solid var(--ink); padding-top: 16px; }
.skill-group:first-child { border-top-color: var(--amber); }
.skill-group h3 { font-size: var(--step-0); font-weight: 700; letter-spacing: -0.01em; }
.skill-group ul { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.skill-group li {
  font-size: 0.82rem; font-weight: 600; line-height: 1.2; padding: 7px 11px;
  border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-2);
}
.skill-group li.core { background: var(--ink); border-color: var(--ink); color: var(--paper); }
@media (max-width: 1100px) { .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .skill-grid { grid-template-columns: 1fr; } }

/* Wrapping: no one-word last lines in headings or paragraphs */
h1, h2, h3 { text-wrap: balance; }
p, li, dd, td, figcaption { text-wrap: pretty; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.matcher figcaption { max-width: 54ch; }
