/* Layout: one long scrolling page. The intro is a tall sticky stage: scrolling through it walks the spider,
   step by step, to the top-right corner, where it becomes the menu. The other pages follow with generous gaps. */
@font-face { font-family: "Pretendard"; font-weight: 200; font-display: block; src: url("../fonts/pretendard-200.woff2") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 300; font-display: block; src: url("../fonts/pretendard-300.woff2") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 500; font-display: block; src: url("../fonts/pretendard-500.woff2") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 800; font-display: block; src: url("../fonts/pretendard-800.woff2") format("woff2"); }
:root {
  --bg: #FFFFFF;
  --fg: #1C1612;
  --spider: #FF6700;
  --ink: #FF6700;
  --ink-text: #E35A00;
  --muted: #9A8B80;
  --font: "Pretendard Variable", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #15110E; --fg: #F3ECE6; --spider: #FF6E0F; --ink: #FF7A1F; --ink-text: #FF8A3D; --muted: #A08F84; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #15110E; --fg: #F3ECE6; --spider: #FF6E0F; --ink: #FF7A1F; --ink-text: #FF8A3D; --muted: #A08F84; color-scheme: dark; }

html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); word-break: keep-all; }
html.locked, html.locked body { overflow: hidden; }

.page {
  min-height: 100vh; box-sizing: border-box;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.page + .page { margin-top: 24vh; }   /* breathing room between pages */
.page:last-child { margin-bottom: 6vh; }
.intro + .page { margin-top: -40vh; }  /* the profile slides up under the last of the tow-away instead of after an empty screen */

/* ---------- Intro ---------- */
.intro { height: 200vh; padding: 0; }   /* the tow-away is spread over this much scrolling */
.stage { position: sticky; top: 0; height: 100vh; overflow: clip; display: grid; place-items: center; box-sizing: border-box; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
.scroll-hint { position: absolute; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); margin: 0; font: 300 12px var(--font); letter-spacing: 0.12em; color: var(--muted); opacity: 0; transition: opacity 0.8s ease; }
.ready .scroll-hint { opacity: 1; }
.ready.moved .scroll-hint, .ready.auto .scroll-hint { opacity: 0; }
.comp {
  position: relative; container-type: inline-size;
  width: min(55%, calc((100vh - 48px) * 0.55), 640px);
  aspect-ratio: 990 / 900; max-width: 100%;
}
.wordmark {
  position: absolute; left: 57.98cqw; top: 50.81cqw; margin: 0;
  font-size: 9.29cqw; line-height: 1; white-space: nowrap;
  color: var(--ink); font-weight: 200; letter-spacing: -0.01em;
}
.wordmark .b { font-weight: 800; }
.wordmark { transform-origin: 0 55%; will-change: transform; }
.moved .caret { display: none; }
#rope { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 19; pointer-events: none; overflow: visible; }
#rope path { fill: none; stroke: var(--spider); stroke-width: 1.2; stroke-linecap: round; }
.wordmark .ch, .wordmark .sp { display: none; }
.wordmark .on { display: inline-block; }
.wordmark .sp.on { width: 0.22em; }
.wordmark .paren { position: relative; top: -0.085em; }
.caret { display: inline-block; width: 0.055em; height: 0.936em; margin-left: 0.06em; vertical-align: -0.114em; background: var(--ink); opacity: 0; }
.typing .caret { opacity: 1; }
.typed .caret { animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- The one spider ---------- */
#walker { position: fixed; left: 0; top: 0; z-index: 20; pointer-events: none; will-change: transform; visibility: hidden; }
#walker svg { display: block; width: 100%; height: 100%; overflow: visible; }
#walker polygon { fill: var(--spider); }
#walker.menu-mode { transition: opacity 0.7s ease; }

/* ---------- Menu: the spider lets down a thread ---------- */
.menu-btn {
  position: fixed; z-index: 22; background: none; border: 0; padding: 0; cursor: pointer;
  border-radius: 12px; display: none;
}
.onpage .menu-btn { display: block; }
.menu-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.thread {
  position: fixed; z-index: 19; width: 1.5px; margin-left: -0.75px;
  background: var(--spider); transform: scaleY(0); transform-origin: top;
  transition: transform 0.5s cubic-bezier(.5, 0, .3, 1) 0.15s;
}
.menu-open .thread { transform: scaleY(1); transition: transform 0.75s cubic-bezier(.3, .7, .2, 1); }
.menu-list { list-style: none; margin: 0; padding: 0; }
.pt {
  position: fixed; z-index: 21; display: flex; align-items: center; gap: 10px; translate: -100% 0; white-space: nowrap;
  min-height: 32px; padding: 0 0 0 12px; background: none; border: 0; cursor: pointer;
  font: 500 12px var(--font); color: var(--ink-text); letter-spacing: 0.01em;
  opacity: 0; visibility: hidden; transform: translateX(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}
.menu-open .pt {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity 0.35s ease var(--d), transform 0.35s ease var(--d), visibility 0s linear var(--d);
}
.pt .dia { width: 5px; height: 5px; background: var(--spider); transform: rotate(45deg); transition: transform 0.2s ease; flex: none; }
.pt:hover .dia, .pt[aria-current="page"] .dia { transform: rotate(45deg) scale(1.6); }
.pt[aria-current="page"] { font-weight: 800; }
.pt:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
/* While the menu is open the page behind goes soft, so only the menu reads */
.scrim {
  position: fixed; inset: 0; z-index: 18;   /* same as the logo but later in the page, so it veils the logo too */
  background: color-mix(in srgb, var(--bg) 45%, transparent);
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
.menu-open .scrim { opacity: 1; visibility: visible; transition: opacity 0.35s ease; }
@media (max-width: 760px) {
  .scrim { background: color-mix(in srgb, var(--bg) 75%, transparent); }   /* the menu hangs right over text on phones */
}

.logo {
  position: fixed; z-index: 18;
  left: calc(20px + env(safe-area-inset-left, 0px)); top: calc(14px + env(safe-area-inset-top, 0px));
  background: none; border: 0; padding: 4px 2px; cursor: pointer;
  font: 200 26px/1 var(--font); color: var(--ink); letter-spacing: -0.01em;
  opacity: 0; visibility: hidden; transition: opacity 0.6s ease, visibility 0s linear 0.6s;
}
.logo b { font-weight: 800; }
.logo .paren { position: relative; top: -0.085em; }
.onpage .logo { opacity: 1; visibility: visible; transition: opacity 0.6s ease; }
.logo:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

/* ---------- Profile ---------- */
.profile-page { display: grid; align-items: center; align-content: center; padding-block: 80px 24px; }
.profile {
  width: 100%; max-width: 1360px; margin: 0 auto; box-sizing: border-box;
  padding-left: clamp(0px, 7.4vw, 130px); padding-right: clamp(0px, 9vw, 150px);
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start;
}
/* about a seventh of the screen wide, in the photo's own proportions */
.photo {
  display: block; width: clamp(160px, 15vw, 240px); height: auto; aspect-ratio: 4 / 5; max-width: 100%;
  object-fit: cover; background: var(--spider);
}
.info { display: flex; flex-direction: column; justify-content: space-between; gap: 48px; min-width: 0; }
/* the negative top margin takes off the line's half-leading, so the slogan's letters start level with the photo's top */
.info h2 { margin: -0.3em 0 0; font-weight: 300; font-size: clamp(22px, 2.1vw, 36px); line-height: 1.6; letter-spacing: -0.02em; text-wrap: pretty; }
.info h2 strong { font-weight: 800; }
.facts { margin: 44px 0 0; display: grid; gap: 20px; font-weight: 300; font-size: clamp(16px, 1.3vw, 21px); color: var(--ink-text); }
.facts div { display: flex; gap: 6px; }
.facts dt, .facts dd { margin: 0; }
/* the address copies on click, same as Mail on the contact page */
.copy-mail { padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: inherit; text-decoration: underline 1px; text-underline-offset: 0.2em; }
.copy-mail:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.docs { margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.docs .process-link { background: none; color: var(--ink-text); box-shadow: inset 0 0 0 1.5px var(--ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.edu { margin: 0; font-weight: 300; font-size: clamp(15px, 1.2vw, 19px); line-height: 1.9; color: var(--ink-text); }
.edu h3 { margin: 0; font: inherit; }
.edu ul { list-style: none; margin: 0; padding: 0; }
.edu time { font-variant-numeric: tabular-nums; }
.history { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 28px 64px; }
.history > :first-child { grid-column: 1 / -1; }   /* education on its own row, activities and certificates side by side */
.history > .edu:not(:first-child) { font-size: clamp(12px, 0.85vw, 14px); }
@media (max-width: 640px) { .history { grid-template-columns: minmax(0, 1fr); } }
/* next: a spider hanging on a thread; its legs are animated from main.js */
.next-drop {
  justify-self: center; display: flex; flex-direction: column; align-items: center; gap: 4px;
  margin-top: clamp(12px, 2vw, 28px); padding: 0 16px 8px; background: none; border: 0; cursor: pointer; color: var(--ink);
}
/* The thread stretches and the spider moves with transforms only, so the page never changes height under the reader.
   Thread: 40px long at rest; hover lets out 18px more, a click 110px. */
.nd-thread {
  width: 1.5px; height: 40px; background: var(--spider); transform-origin: top center;
  transition: scale 0.55s cubic-bezier(.3, 1.6, .5, 1);   /* springs a little, like the thread stretching */
}
.next-drop:hover .nd-thread, .next-drop:focus-visible .nd-thread { scale: 1 1.45; }
.next-drop.drop .nd-thread { scale: 1 3.75; transition: scale 0.45s cubic-bezier(.55, 0, .9, .4); }
/* the drawing faces right; turned to hang head-down, then nudged so the tip of the abdomen sits on the thread's end */
.nd-spider {
  display: block; margin-top: -8px; rotate: 90deg; translate: -2.3px -6.5px;
  transition: translate 0.55s cubic-bezier(.3, 1.6, .5, 1);
}
.next-drop:hover .nd-spider, .next-drop:focus-visible .nd-spider { translate: -2.3px 11.5px; }
.next-drop.drop .nd-spider { translate: -2.3px 103.5px; transition: translate 0.45s cubic-bezier(.55, 0, .9, .4); }
.nd-spider svg { display: block; width: 44px; height: auto; overflow: visible; fill: var(--spider); }
.nd-label { margin-top: 6px; font-weight: 300; font-size: 14px; letter-spacing: 0.04em; transition: translate 0.55s cubic-bezier(.3, 1.6, .5, 1), opacity 0.3s ease; }
.next-drop:hover .nd-label, .next-drop:focus-visible .nd-label { translate: 0 18px; }
.next-drop.drop .nd-label { opacity: 0; }
.next-drop:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 8px; }

/* ---------- Pages still being written ---------- */
/* Pages rise into place from below as they scroll into view */
.rise { opacity: 0; transform: translateY(90px); transition: opacity 1s ease, transform 1.3s cubic-bezier(.2, .7, .2, 1); }
.in .rise { opacity: 1; transform: none; }
.in .rise + .rise { transition-delay: 0.18s; }
.stub { display: grid; place-content: center; text-align: center; gap: 12px; }
.stub h2 { margin: 0; font-weight: 800; font-size: clamp(34px, 6vw, 84px); letter-spacing: -0.03em; color: var(--ink); }
.stub p { margin: 0; font-weight: 300; font-size: 16px; color: var(--muted); }

/* ---------- Main projects: two webs, each holding one project ---------- */
.mp-page { padding: 0; overflow-x: clip; display: grid; align-content: center; }
.mp { position: relative; width: 100%; aspect-ratio: 1920 / 1080; container-type: inline-size; }
.mp-title {
  position: absolute; left: 0; right: 0; top: 3.6cqw; margin: 0; text-align: center;
  font-weight: 300; font-size: max(26px, 2.6cqw); letter-spacing: -0.01em; color: var(--ink);
}
.mp-hint {
  position: absolute; left: 0; right: 0; top: 8.4cqw; margin: 0; text-align: center;
  font-weight: 300; font-size: max(13px, 0.85cqw); letter-spacing: 0.02em; color: var(--muted);
}
/* both webs sit 180 artboard units higher than in main.svg so the projects show up with the title */
.proj { position: absolute; left: var(--x); top: calc(var(--y) - 16.667%); width: var(--w); }
.web-inner { position: relative; }
.proj svg { display: block; width: 100%; height: auto; overflow: visible; }
.web { fill: none; stroke: var(--spider); opacity: 0.32; }
.web path, .web line { stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.cat { fill: #FFB600; }
.cat-eye { fill: #FFF; }
.cat-mouth { fill: none; stroke: #FFF; stroke-miterlimit: 10; }
.bus-word { fill: #FFF; font: 800 12px var(--font); }
.wsp { fill: var(--spider); opacity: 0.75; pointer-events: none; }
.hit {
  position: absolute; left: var(--hx); top: var(--hy); width: 34%; aspect-ratio: 1;
  translate: -50% -50%; border-radius: 50%; cursor: pointer;
}
.proj-label {
  position: absolute; left: var(--hx); top: var(--ly); translate: -50% 0;
  width: max-content; max-width: 30cqw; text-align: center; text-decoration: none; color: var(--fg);
  text-shadow: 0 0 6px var(--bg), 0 0 2px var(--bg), 0 0 1px var(--bg);
}
.pl-name { display: block; font-weight: 800; font-size: max(18px, 1.35cqw); letter-spacing: -0.02em; transition: color 0.2s ease; }
.pl-desc { display: block; margin-top: 0.35em; font-weight: 300; font-size: max(13px, 0.85cqw); }
.pl-tags { display: block; margin-top: 0.7em; font-weight: 500; font-size: max(11px, 0.7cqw); color: var(--ink-text); }
.proj.hot .pl-name { color: var(--ink-text); }
.proj-label:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; border-radius: 4px; }

@media (max-width: 760px) {
  .mp-page { display: block; padding-block: 72px 24px; }
  .mp { aspect-ratio: auto; }
  .mp-title, .mp-hint { position: static; }
  .mp-hint { margin-top: 8px; }
  .proj { position: relative; left: auto; top: auto; width: 100%; margin-top: 28px; }
  /* phone: crop each web around its logo */
  .web-box { position: relative; aspect-ratio: 5 / 4; overflow: hidden; }
  .web-inner { position: absolute; width: 150%; left: -25%; top: var(--mt); }
  .proj-label { position: static; translate: none; display: block; margin: -12% auto 0; max-width: 90%; }
}

/* ---------- Project page (placeholder until each project is designed) ---------- */
html.viewing { overflow: hidden; }   /* html only: hiding body too clamps the page scroll to 0 */
.proj-view {
  position: fixed; inset: 0; z-index: 30; overflow: auto; background: var(--bg); color: var(--fg);
  --ox: 50vw; --oy: 50vh;
  clip-path: circle(0px at var(--ox) var(--oy)); visibility: hidden;
  transition: clip-path 0.6s cubic-bezier(.6, 0, .3, 1), visibility 0s linear 0.6s;
}
.proj-view.open { clip-path: circle(150vmax at var(--ox) var(--oy)); visibility: visible; transition: clip-path 0.65s cubic-bezier(.6, 0, .3, 1); }
.pv-back {
  position: absolute; z-index: 1; top: calc(16px + env(safe-area-inset-top, 0px)); left: calc(18px + env(safe-area-inset-left, 0px));
  background: none; border: 0; padding: 8px 4px; cursor: pointer;
  font: 500 14px var(--font); color: var(--ink-text);
}
.pv-back:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
.pv-body {
  max-width: 1040px; min-height: 100%; margin: 0 auto; box-sizing: border-box; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: clamp(48px, 7vw, 88px);
  padding: 104px max(20px, env(safe-area-inset-right, 0px)) 96px max(20px, env(safe-area-inset-left, 0px));
}
.pv-hero { display: grid; justify-items: center; text-align: center; gap: 14px; }
.pv-hero > * { margin: 0; }
.pv-body > * { margin: 0; opacity: 0; transform: translateY(16px); transition: opacity 0.2s ease, transform 0.2s ease; }
.proj-view.open .pv-body > * { opacity: 1; transform: none; transition: opacity 0.6s ease 0.35s, transform 0.8s cubic-bezier(.2, .7, .2, 1) 0.35s; }
.pv-mark svg { display: block; width: clamp(72px, 9vw, 120px); height: auto; }
.pv-no { font-weight: 500; font-size: 12px; letter-spacing: 0.16em; color: var(--muted); }
.pv-body h2 { font-weight: 800; font-size: clamp(34px, 5vw, 72px); letter-spacing: -0.03em; color: var(--ink); }
.pv-desc { font-weight: 400; font-size: clamp(16px, 1.4vw, 21px); color: var(--ink); }
.pv-intro { max-width: 680px; font-weight: 400; font-size: 15px; line-height: 1.75; color: var(--fg); }
.pv-intro:empty { display: none; }
/* team / role / tools / year, one column each */
.pv-facts {
  margin: 0; padding: 28px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px;
  border-block: 1px solid color-mix(in srgb, var(--ink) 30%, transparent);
}
.pv-facts dt { font-weight: 500; font-size: 12px; letter-spacing: 0.14em; color: var(--muted); }
.pv-facts dd { margin: 8px 0 0; font-weight: 400; font-size: 15px; line-height: 1.6; color: var(--ink); }
.pv-h { margin: 0 0 10px; font-weight: 300; font-size: clamp(26px, 2.6vw, 40px); letter-spacing: -0.01em; color: var(--ink); }
.pv-lead { margin: 0 0 28px; font-weight: 400; font-size: clamp(15px, 1.2vw, 18px); line-height: 1.6; color: var(--ink); }
.pv-lead:empty { display: none; }
/* troubleshooting: each problem sits beside its solution */
.ts { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.ts li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.ts-card { display: grid; align-content: start; gap: 12px; padding: clamp(20px, 2.4vw, 32px); border-radius: 20px; }
.ts-p { border: 1.5px solid var(--ink); color: var(--ink); }
.ts-s { background: var(--ink); color: #FFF; }
.ts-k { font-weight: 600; font-size: 12px; letter-spacing: 0.14em; opacity: 0.75; }
.ts-t { margin: 0; font-weight: 400; font-size: clamp(15px, 1.15vw, 17px); line-height: 1.65; }
.ts .ts-empty { display: block; margin: 0; font-weight: 300; font-size: 15px; color: var(--muted); }
/* troubleshooting told as a story: a numbered heading, then paragraphs and process images in order */
.ts .ts-story { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: 860px; padding-top: 28px; border-top: 1px solid color-mix(in srgb, var(--ink) 25%, transparent); }
.ts:has(.ts-story) { gap: 56px; }
.ts-head { display: grid; gap: 6px; }
.ts-head .ts-k { color: var(--ink); }
.ts-title { margin: 0; font-weight: 600; font-size: clamp(17px, 1.4vw, 21px); line-height: 1.5; color: var(--ink); }
.ts-story .ts-t { color: var(--fg); line-height: 1.85; }
.ts-story .st-gallery { margin: 8px 0; }
.ts-story .st-gallery:has(> figure:only-child) { max-width: 480px; }   /* a lone image stays small so the story keeps moving */
.pv-model {
  aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; cursor: grab; border-radius: 20px;
  background: color-mix(in srgb, var(--ink) 7%, var(--bg)); font-weight: 300; font-size: 14px; color: var(--muted);
}
.pv-model:active { cursor: grabbing; }
.pv-model canvas { display: block; width: 100%; height: 100%; }
.pv-video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 20px; background: #000; }
/* model and video: two small panels side by side, stacked on phones */
.pv-media { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; max-width: 860px; margin: 0 auto; }
.pv-fig { margin: 0; display: grid; gap: 10px; align-content: start; }
.pv-fig[hidden] { display: none; }
.pv-fig figcaption { font-weight: 300; font-size: 13px; line-height: 1.5; color: var(--ink); }
.pv-fig figcaption b { font-weight: 600; margin-right: 6px; }

/* ---------- Project story: planning, design, making — long and image-rich, like a product detail page ---------- */
.pv-story { display: grid; gap: clamp(64px, 9vw, 120px); }
.pv-story:empty { display: none; }
.st-sec { display: grid; gap: 28px; }
.st-head { display: grid; gap: 6px; }
.st-no { font-weight: 500; font-size: 12px; letter-spacing: 0.16em; color: var(--muted); }
.st-head .pv-h { margin: 0; }
.st-head .pv-h small { margin-left: 10px; font-size: 0.5em; font-weight: 400; color: var(--ink-text); }
.st-lead { margin: 0; max-width: 760px; font-weight: 400; font-size: clamp(16px, 1.3vw, 19px); line-height: 1.7; color: var(--ink); }
.st-text { max-width: 760px; }
.st-text h4 { margin: 0 0 8px; font-weight: 600; font-size: 16px; color: var(--ink); }
.st-text p { margin: 0 0 10px; font-weight: 400; font-size: 15px; line-height: 1.8; color: var(--fg); }
.st-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.st-card { padding: 20px 22px; border: 1.5px solid color-mix(in srgb, var(--ink) 55%, transparent); border-radius: 16px; }
.st-card h4 { margin: 0 0 8px; font-weight: 600; font-size: 15px; color: var(--ink); }
.st-card p { margin: 0; font-weight: 400; font-size: 14px; line-height: 1.7; color: var(--fg); }
.st-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; counter-reset: step; }
.st-steps li { position: relative; padding: 46px 20px 20px; border-radius: 16px; background: color-mix(in srgb, var(--ink) 8%, var(--bg)); counter-increment: step; }
.st-steps li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 20px; top: 16px; font-weight: 600; font-size: 13px; letter-spacing: 0.1em; color: var(--ink); }
.st-steps h4 { margin: 0 0 6px; font-weight: 600; font-size: 15px; color: var(--ink); }
.st-steps p { margin: 0; font-weight: 400; font-size: 14px; line-height: 1.7; color: var(--fg); }
.st-gallery { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 16px; }
.st-gallery figure { margin: 0; display: grid; gap: 10px; align-content: start; }
.st-gallery img {
  display: block; width: 100%; height: auto; border-radius: 12px; cursor: zoom-in;
  background: color-mix(in srgb, var(--ink) 6%, var(--bg)); transition: transform 0.3s ease;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--fg) 10%, transparent);   /* keeps white screenshots off the white page */
}
.st-gallery img:hover { transform: translateY(-2px); }
.st-yt { margin: 0; display: grid; gap: 10px; max-width: 860px; }
.st-yt iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; background: #000; }
.st-yt figcaption { font-weight: 400; font-size: 13px; line-height: 1.6; color: var(--fg); }
.st-yt a { color: var(--ink-text); }
.st-gallery figcaption { font-weight: 400; font-size: 13px; line-height: 1.6; color: var(--fg); }
.st-gallery figcaption b { font-weight: 600; color: var(--ink); }
@media (max-width: 760px) {
  .st-gallery { grid-template-columns: minmax(0, 1fr); }
}
.lightbox {
  position: fixed; inset: 0; z-index: 2; margin: 0; padding: 24px; box-sizing: border-box; cursor: zoom-out;
  display: grid; place-content: center; justify-items: center; gap: 12px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(1400px, 94vw); max-height: 84vh; border-radius: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15); }
.lightbox figcaption { max-width: 760px; text-align: center; font-size: 14px; line-height: 1.6; color: var(--ink); }
@media (max-width: 760px) {
  .ts li { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}

/* ---------- Sub projects: a list hanging on one thread ---------- */
.sec-title { margin: 0 0 clamp(48px, 7vw, 96px); text-align: center; font-weight: 300; font-size: clamp(26px, 2.6vw, 50px); letter-spacing: -0.01em; color: var(--ink); }
.sp-page { padding-block: 72px 48px; }
.sp-list {
  position: relative; list-style: none; margin: 0 auto; padding: 0 0 0 clamp(28px, 4vw, 56px);
  max-width: 880px; display: grid; gap: clamp(40px, 5vw, 64px);
}
.sp-list::before {   /* the thread */
  content: ""; position: absolute; left: 0; top: calc(-1 * clamp(24px, 4vw, 56px)); bottom: 0; width: 1.5px;
  background: var(--spider); opacity: 0.55;
}
.sub { position: relative; }
.sub::before {   /* where each project is tied on */
  content: ""; position: absolute; top: 18px; left: calc(-1 * clamp(28px, 4vw, 56px) + 0.75px); width: 7px; height: 7px;
  translate: -50% 0; rotate: 45deg; background: var(--spider); transition: scale 0.25s ease;
}
.sub:hover::before, .sub:focus-within::before { scale: 1.6; }
.sub-link {
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: center;
  color: var(--fg); text-decoration: none;
}
.sub-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 8px; border-radius: 4px; }
.sub-thumb { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--spider); }
.sub-thumb img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(1.05); transition: filter 0.45s ease, transform 0.8s cubic-bezier(.2, .7, .2, 1);
}
.sub-thumb::after {   /* orange duotone until hovered */
  content: ""; position: absolute; inset: 0; background: var(--spider); mix-blend-mode: multiply; transition: opacity 0.45s ease;
}
.sub-link:hover .sub-thumb img, .sub-link:focus-visible .sub-thumb img { filter: none; transform: scale(1.03); }
.sub-link:hover .sub-thumb::after, .sub-link:focus-visible .sub-thumb::after { opacity: 0; }
.sub-text { display: grid; justify-items: start; gap: 10px; min-width: 0; }
.sub-no { font-weight: 200; font-size: clamp(26px, 2.4vw, 40px); line-height: 1; letter-spacing: -0.02em; color: var(--ink); }
.sub-name { font-weight: 800; font-size: clamp(20px, 1.7vw, 28px); letter-spacing: -0.02em; color: var(--ink); }
.sub-link:hover .sub-name { text-decoration: underline 1.5px; text-underline-offset: 0.18em; }
.sub-meta { font-weight: 500; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.sub-desc { font-weight: 300; font-size: clamp(14px, 1.05vw, 16px); line-height: 1.55; color: var(--ink); }
.sub-tags { font-weight: 500; font-size: 13px; color: var(--ink-text); }
@media (max-width: 760px) {
  .sub-link { grid-template-columns: minmax(0, 1fr); }
  .sub-text { gap: 8px; }
}
.pv-mark img { display: block; width: clamp(240px, 40vw, 560px); aspect-ratio: 16 / 10; object-fit: cover; }
.pv-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border-radius: 999px;
  background: var(--ink); color: #FFF; font-weight: 500; font-size: 14px; text-decoration: none;
}
.pv-link[hidden] { display: none; }
.pv-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------- Skills: click a tool and a spider walks its thread out to the level ---------- */
.sk-page { padding-block: 72px 48px; }
.sec-hint {
  margin: calc(-1 * clamp(32px, 5vw, 72px)) 0 clamp(40px, 5vw, 64px); text-align: center;
  font-weight: 300; font-size: 13px; letter-spacing: 0.02em; color: var(--muted);
}
.sk-groups { max-width: 880px; margin: 0 auto; display: grid; gap: clamp(32px, 4vw, 48px); }
.sk-group-name { margin: 0 0 14px; font-weight: 500; font-size: 12px; letter-spacing: 0.14em; color: var(--muted); }
.sk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.skill { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; }
.sk-pill {
  width: 100%; min-height: 34px; padding: 4px 14px; box-sizing: border-box; cursor: pointer;
  border: 1.5px solid var(--ink); border-radius: 999px; background: transparent;
  font: 500 14px var(--font); color: var(--ink-text); transition: background 0.2s ease, color 0.2s ease;
}
.sk-pill:hover { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.sk-pill[aria-pressed="true"] { background: var(--ink); color: #FFF; }
.sk-pill:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.sk-track { position: relative; height: 40px; margin-right: 96px; }   /* room for the spider and number at 100% */
.sk-line {
  position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; margin-top: -0.75px;
  background: var(--spider); transform: scaleX(0); transform-origin: left center;
}
.sk-walk { position: absolute; left: 0; top: 50%; width: 0; height: 0; opacity: 0; pointer-events: none; will-change: transform; }
/* the spider's abdomen sits on the end of the thread */
.sk-walk svg { position: absolute; left: -9.65px; top: -11px; width: 30px; height: auto; overflow: visible; fill: var(--spider); }
.sk-pct { position: absolute; left: 27px; top: 0; translate: 0 -50%; font-weight: 500; font-size: 13px; color: var(--ink-text); white-space: nowrap; }
/* the projects a tool was used in, under its track */
.sk-projects { grid-column: 2; margin: -6px 0 4px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; }
.sk-projects a { color: var(--muted); text-decoration: none; transition: color 0.2s ease; }
.sk-projects a::before { content: '\2197\00a0'; }
.sk-projects a:hover, .sk-projects a:focus-visible { color: var(--ink-text); }
.skill:has(.sk-pill[aria-pressed="true"]) .sk-projects a:not(:hover) { color: var(--fg); }
.sk-note { margin: 14px 0 0; font-weight: 300; font-size: 12px; color: var(--muted); }
@media (max-width: 760px) {
  .skill { grid-template-columns: 116px minmax(0, 1fr); }
  .sk-pill { font-size: 13px; padding-inline: 8px; }
  .sk-track { margin-right: 70px; }
}

/* ---------- Contact: the note on the left, the links caught in a web on the right ---------- */
.ct-page { padding-block: 72px 10vh; }
.ct {
  max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(24px, 4vw, 64px); align-items: center;
}
.ct-text { font-weight: 400; font-size: clamp(15px, 1.25vw, 22px); line-height: 1.6; color: var(--ink); }
.ct-text p { margin: 0 0 1.1em; }
.ct-text p:last-child { margin: 1.6em 0 0; }
.ct-text strong { font-weight: 800; color: var(--ink); }
.ct-web { position: relative; container-type: inline-size; width: min(100%, 76vh); justify-self: center; }   /* the whole web fits on screen with the title */
.ct-web svg { display: block; width: 100%; height: auto; overflow: visible; }
.ct-link {
  position: absolute; left: var(--lx); top: var(--ly); padding: 4px 6px; margin: -4px -6px;
  background: none; border: 0; cursor: pointer; text-decoration: none;
  font: 700 max(17px, 3.8cqw) var(--font); color: var(--ink); white-space: nowrap;
  text-shadow: 0 0 6px var(--bg), 0 0 2px var(--bg);
}
.ct-link:hover { text-decoration: underline 2px; text-underline-offset: 0.2em; }
.ct-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
.ct-toast {
  position: fixed; z-index: 25; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); translate: -50% 12px; margin: 0;
  padding: 10px 18px; border-radius: 999px; background: var(--ink); color: #FFF; font-weight: 500; font-size: 14px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease, translate 0.25s ease;
}
.ct-toast.show { opacity: 1; translate: -50% 0; }
@media (max-width: 760px) {
  .ct { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .profile { grid-template-columns: minmax(0, 1fr); padding-inline: 0; }
  .photo { width: min(46vw, 190px); }
  .info { padding-block: 0; }
  .profile-page { align-items: start; }
}
@media (prefers-reduced-motion: reduce) {
  .thread, .pt, .logo, .rise, .scrim, .proj-view, .pv-body > * { transition: none !important; }
  .rise { transform: none; }
}
