/* =========================================================
   Ömür Can Güngören — "Workshop" design system
   Hand-built, dependency-free. Dark-first.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  /* Surfaces */
  --bg:          #0b0c10;
  --bg-soft:     #101218;
  --surface:     #14161d;
  --surface-2:   #1a1d26;
  --line:        rgba(255,255,255,.09);
  --line-strong: rgba(255,255,255,.16);

  /* Text */
  --text:    #ECEDF1;
  --muted:   #9aa0ad;
  --faint:   #6b7180;

  /* Accent — soft pastel blue. Calm, not neon. */
  --accent:      #9ec1e8;
  --accent-deep: #7ea6d6;
  --accent-glow: rgba(158,193,232,.16);
  --accent-ink:  #0c1a2b; /* text on accent */

  /* Type */
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body:    "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Metrics */
  --maxw: 1120px;
  --gutter: clamp(20px, 5vw, 56px);
  --radius: 14px;
  --radius-lg: 22px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Subtle workshop grid in the page background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1200px 600px at 75% -10%, rgba(158,193,232,.06), transparent 60%),
    linear-gradient(180deg, #0b0c10, #0a0b0e);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 100% 80% at 50% 0%, #000 30%, transparent 85%);
  pointer-events: none;
}

img, svg, video, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; letter-spacing: -.02em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.9rem); }
h3 { font-size: clamp(1.2rem, 2.4vw, 1.6rem); letter-spacing: -.01em; }
p { color: var(--muted); }
strong { color: var(--text); font-weight: 600; }

.mono { font-family: var(--font-mono); }

/* Section kicker — "01 / selected work" */
.kicker {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: .7ch;
}
.kicker::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--accent);
  opacity: .6;
}

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
section { padding-block: clamp(64px, 10vw, 130px); }
.section-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: clamp(34px, 5vw, 64px); }
.section-head h2 { max-width: 18ch; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; }
.brand .mark-img {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; object-position: 50% 16%;
  border: 1px solid var(--line-strong);
  box-shadow: 0 0 0 3px var(--accent-glow);
  transition: box-shadow .25s var(--ease);
}
.brand:hover .mark-img { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
.nav-links { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 32px); }
.nav-links a { font-family: var(--font-mono); font-size: .85rem; color: var(--muted); transition: color .2s; position: relative; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a.cta { color: var(--accent-ink); }
.nav-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: .88rem; font-weight: 500;
  padding: 12px 20px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  transition: transform .2s var(--ease), border-color .2s, background .2s, color .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn .arr { transition: transform .25s var(--ease); }
.btn:hover .arr { transform: translate(3px,-3px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-ghost { background: transparent; }

/* outline buttons: edge highlight that follows the cursor */
.btn::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  pointer-events: none; z-index: 2; opacity: 0; transition: opacity .3s var(--ease);
  background: radial-gradient(80px circle at var(--mx, 50%) var(--my, 50%), var(--accent), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.btn:hover::after { opacity: .9; }
/* filled buttons: soft sheen that follows the cursor (replaces the static glow) */
.btn-primary::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 1;
  opacity: 0; transition: opacity .3s var(--ease); mix-blend-mode: soft-light;
  background: radial-gradient(120px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.6), transparent 55%);
}
.btn-primary:hover::before { opacity: 1; }

/* ---------- Hero ---------- */
.hero { position: relative; padding-top: clamp(48px, 9vw, 96px); padding-bottom: clamp(48px, 8vw, 90px); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero .status {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: .78rem; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px;
  background: var(--surface);
}
.hero .status .dot { width: 8px; height: 8px; border-radius: 50%; background: #46d27e; box-shadow: 0 0 0 4px rgba(70,210,126,.16); }
.hero h1 { margin-top: 22px; }
.hero h1 .grad { color: var(--accent); }
.hero .lead { margin-top: 22px; font-size: clamp(1.02rem, 1.6vw, 1.18rem); max-width: 46ch; color: var(--muted); }
.hero .lead b { color: var(--text); font-weight: 600; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 38px; }
.hero-meta .item .n { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }
.hero-meta .item .l { font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }

/* Hero social links */
.hero-socials { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.hero-socials a {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: .84rem; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 9px 15px;
  transition: color .2s, border-color .2s, transform .2s;
}
.hero-socials a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.hero-socials a svg { width: 17px; height: 17px; }

/* Hero portrait */
.hero-photo {
  position: relative; aspect-ratio: 4/5; border-radius: var(--radius-lg);
  overflow: hidden; border: 1px solid var(--line);
  background: var(--surface); box-shadow: 0 40px 80px -40px rgba(0,0,0,.8);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(11,12,16,.5));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}

/* Hero interactive panel (canvas toy) */
.hero-panel {
  position: relative; aspect-ratio: 4/5; border-radius: var(--radius-lg);
  border: 1px solid var(--line); overflow: hidden;
  background: radial-gradient(120% 120% at 50% 0%, #14161d, #0c0d12);
  box-shadow: 0 40px 80px -40px rgba(0,0,0,.8);
}
.hero-panel canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-panel .panel-bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; font-family: var(--font-mono); font-size: .72rem; color: var(--faint);
  border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 80%, transparent);
}
.hero-panel .panel-bar .dots { display: inline-flex; gap: 5px; }
.hero-panel .panel-bar .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.hero-panel .panel-hint {
  position: absolute; bottom: 12px; left: 0; right: 0; z-index: 2; text-align: center;
  font-family: var(--font-mono); font-size: .72rem; color: var(--faint);
  pointer-events: none; transition: opacity .4s;
}

/* ---------- Now strip ---------- */
.now {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.now .wrap { display: flex; align-items: center; gap: clamp(16px, 4vw, 40px); padding-block: 26px; flex-wrap: wrap; }
.now .label { font-family: var(--font-mono); font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.now .text { color: var(--muted); font-size: 1.02rem; }
.now .text b { color: var(--text); }

/* ---------- Work cards ---------- */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(16px, 2.4vw, 26px); }
.work-card {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--surface); isolation: isolate;
  transition: transform .35s var(--ease), border-color .35s;
}
.work-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.work-card .thumb { aspect-ratio: 16/10; overflow: hidden; background: linear-gradient(150deg, var(--surface-2), var(--bg-soft)); }
.work-card .thumb .ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--faint); }
.work-card .thumb .ph svg { width: 46px; height: 46px; opacity: .45; }
.work-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease), filter .35s; filter: saturate(1.02); }
.work-card:hover .thumb img { transform: scale(1.05); }
.work-card .body { padding: 20px 22px 24px; }
.work-card .tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tag {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .04em;
  padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--muted); text-transform: uppercase;
}
.tag.solo { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.work-card h3 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.work-card h3 .arr { color: var(--faint); transition: transform .25s var(--ease), color .25s; }
.work-card:hover h3 .arr { transform: translate(3px,-3px); color: var(--accent); }
.work-card .meta { margin-top: 8px; font-family: var(--font-mono); font-size: .8rem; color: var(--faint); }
.work-card .full-link { position: absolute; inset: 0; z-index: 3; }

.work-card.feature { grid-column: span 2; }
.work-card.feature .thumb { aspect-ratio: 21/9; }

/* ---------- Toolbox ---------- */
.toolbox { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2.4vw, 26px); }
.tool-col { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--surface); }
.tool-col h4 { font-family: var(--font-mono); font-size: .76rem; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); font-weight: 500; margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-mono); font-size: .82rem; padding: 7px 12px;
  border-radius: 9px; border: 1px solid var(--line); color: var(--text);
  background: var(--bg-soft); transition: border-color .2s, color .2s, transform .2s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ---------- Playground teaser ---------- */
.pg-teaser {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 50px); align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
  background: linear-gradient(120deg, var(--surface), var(--bg-soft));
}
.pg-teaser .copy { padding: clamp(26px, 4vw, 48px); }
.pg-teaser .copy p { margin-top: 14px; max-width: 42ch; }
.pg-teaser .copy .btn { margin-top: 26px; }
.pg-teaser .demo { position: relative; min-height: 320px; align-self: stretch; border-left: 1px solid var(--line); }
.pg-teaser .demo canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--bg-soft); }
.footer .wrap { padding-block: clamp(48px, 7vw, 80px); }
.footer-top { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; align-items: flex-start; }
.footer h2 { max-width: 14ch; }
.footer .contact-link { font-family: var(--font-display); font-size: clamp(1.4rem,3vw,2rem); color: var(--text); display: inline-flex; align-items: center; gap: 12px; transition: color .2s, gap .2s; }
.footer .contact-link:hover { color: var(--accent); gap: 18px; }
.footer-socials { display: flex; gap: 12px; margin-top: 22px; }
.footer-socials a {
  width: 44px; height: 44px; border-radius: 11px; border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--muted);
  transition: color .2s, border-color .2s, transform .2s;
}
.footer-socials a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-3px); }
.footer-bottom {
  margin-top: clamp(40px, 6vw, 70px); padding-top: 24px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: .78rem; color: var(--faint);
}

/* ---------- Page header (inner pages) ---------- */
.page-head { padding-top: clamp(40px, 7vw, 80px); padding-bottom: clamp(8px, 2vw, 20px); }
.back-link { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: .82rem; color: var(--muted); transition: gap .2s, color .2s; }
.back-link:hover { color: var(--accent); gap: 12px; }
.page-head h1 { margin-top: 22px; }
.page-head .lead { margin-top: 18px; max-width: 60ch; font-size: clamp(1rem, 1.5vw, 1.12rem); }

/* ---------- Portfolio gallery ---------- */
.pf-filter { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 34px; }
.pf-filter button {
  font-family: var(--font-mono); font-size: .82rem; padding: 8px 15px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); transition: all .2s var(--ease);
}
.pf-filter button:hover { color: var(--text); border-color: var(--line-strong); }
.pf-filter button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pf-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(16px, 2.4vw, 26px); }
.pf-grid .work-card.hide { display: none; }
@media (min-width: 900px) { .pf-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Project page ---------- */
.project-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 4vw, 52px); align-items: end; }
.project-hero .tags { margin: 0 0 18px; }
.project-hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.project-hero .lead { margin-top: 18px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.facts .k { font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }
.facts .v { margin-top: 4px; color: var(--text); font-weight: 500; }
.project-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.banner-figure { margin-top: clamp(34px, 5vw, 60px); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.banner-figure img { width: 100%; display: block; }

.prose { max-width: 70ch; }
.prose h3 { margin-bottom: 14px; }
.prose p { margin-bottom: 16px; line-height: 1.7; }
.prose ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.prose li { position: relative; padding-left: 26px; color: var(--muted); }
.prose li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 9px; height: 9px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
.prose li strong { color: var(--text); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.gallery figure { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.gallery img, .gallery video { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.gallery figure:hover img, .gallery figure:hover video { transform: scale(1.03); }
/* video clips keep their full frame — no crop, no fake zoom */
.gallery figure:has(video) { align-self: start; }
.gallery video { height: auto; object-fit: contain; background: #0c0d12; }
.gallery figure:hover video { transform: none; }
.gallery.tall { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 18px; }
.video { position: relative; padding-bottom: 56.25%; height: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.divider { height: 1px; background: var(--line); border: 0; margin-block: clamp(40px, 6vw, 70px); }

/* rich outbound link card (e.g. Behance art gallery) */
.link-card { display: flex; align-items: stretch; max-width: 620px; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); transition: border-color .3s, transform .3s var(--ease); }
.link-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.link-card .lc-img { flex: 0 0 190px; }
.link-card .lc-img img { width: 100%; height: 100%; object-fit: cover; }
.link-card .lc-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.link-card .lc-title { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; color: var(--text); }
.link-card .lc-note { color: var(--muted); font-size: .9rem; }
.link-card .lc-domain { font-family: var(--font-mono); font-size: .73rem; color: var(--faint); display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; transition: color .2s; }
.link-card:hover .lc-domain { color: var(--accent); }
@media (max-width: 560px) { .link-card { flex-direction: column; } .link-card .lc-img { flex: none; aspect-ratio: 16/9; } }

.next-project { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 30px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); transition: border-color .3s, transform .3s var(--ease); flex-wrap: wrap; }
.next-project:hover { border-color: var(--accent); transform: translateY(-3px); }
.next-project .lbl { font-family: var(--font-mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); }
.next-project .ttl { font-family: var(--font-display); font-size: clamp(1.3rem, 3vw, 2rem); margin-top: 6px; }

@media (max-width: 860px) {
  .project-hero { grid-template-columns: 1fr; align-items: start; }
}

/* ---------- Playground ---------- */
.toy { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); margin-bottom: clamp(24px, 4vw, 40px); }
.toy-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toy-head .t h3 { display: flex; align-items: center; gap: 10px; }
.toy-head .t .src { font-family: var(--font-mono); font-size: .72rem; color: var(--faint); }
.toy-head .t p { margin-top: 8px; max-width: 60ch; font-size: .95rem; }
.toy-controls { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.toy-btn {
  font-family: var(--font-mono); font-size: .8rem; padding: 8px 14px; border-radius: 9px;
  border: 1px solid var(--line-strong); color: var(--text); background: var(--bg-soft);
  transition: all .18s var(--ease); white-space: nowrap;
}
.toy-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.toy-btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.toy-btn.primary:hover { color: var(--accent-ink); background: var(--accent-deep); }
.toy-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.toy-btn[aria-pressed="true"]:hover { color: var(--accent-ink); background: var(--accent-deep); }
.toy-stage { position: relative; height: clamp(320px, 50vh, 480px); background: #0c0d12; cursor: crosshair; }
.toy-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.builds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.build-card { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 26px 22px; background: var(--bg-soft); display: flex; flex-direction: column; gap: 8px; min-height: 160px; justify-content: center; }
.build-card .ic { color: var(--faint); }
.build-card .bt { font-family: var(--font-display); font-weight: 600; }
.build-card .bd { color: var(--muted); font-size: .9rem; }
.build-card.live { border-style: solid; }

/* ---------- The Shelf ---------- */
.shelf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: clamp(16px, 2.4vw, 24px); }
.shelf-card { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); display: flex; flex-direction: column; transition: transform .3s var(--ease), border-color .3s; }
.shelf-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.shelf-card.hide { display: none; }
.shelf-card .full-link { position: absolute; inset: 0; z-index: 3; }
.shelf-cover { position: relative; aspect-ratio: 3/4; background: linear-gradient(150deg, var(--surface-2), var(--bg-soft)); overflow: hidden; }
.shelf-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.shelf-card:hover .shelf-cover img { transform: scale(1.04); }
.shelf-cover .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); }
.shelf-cover .ph svg { width: 40px; height: 40px; opacity: .45; }
.shelf-cover .cat { position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text); background: color-mix(in srgb, var(--bg) 66%, transparent); backdrop-filter: blur(4px); border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px; }
.shelf-cover .cat svg { width: 12px; height: 12px; }
.shelf-card .fav { position: absolute; right: 10px; top: 10px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: .72rem; box-shadow: 0 4px 12px -4px var(--accent); }
.shelf-body { padding: 15px 16px 18px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.shelf-body h3 { font-size: 1.05rem; line-height: 1.2; }
.shelf-body .by { font-family: var(--font-mono); font-size: .73rem; color: var(--faint); }
.rate { display: flex; gap: 4px; }
.rate i { width: 9px; height: 9px; transform: rotate(45deg); border: 1px solid var(--accent); border-radius: 1px; opacity: .85; }
.rate i.on { background: var(--accent); }
.shelf-body .take { color: var(--muted); font-size: .9rem; line-height: 1.55; }
.shelf-body .stags { display: flex; flex-wrap: wrap; gap: 6px; }
.shelf-body .stags .tag { font-size: .62rem; padding: 3px 7px; }
.shelf-body .src { margin-top: auto; padding-top: 4px; font-family: var(--font-mono); font-size: .72rem; color: var(--faint); display: inline-flex; align-items: center; gap: 5px; transition: color .2s; }
.shelf-card:hover .src { color: var(--accent); }
.shelf-help { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 8px; justify-content: center; color: var(--muted); background: var(--bg-soft); }
.shelf-help .bt { font-family: var(--font-display); font-weight: 600; color: var(--text); }
.shelf-note { margin-bottom: 28px; border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 14px 18px; background: var(--bg-soft); font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }
.shelf-note b { color: var(--accent); }

/* ---------- CV ---------- */
.cv-contact { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.cv-contact a {
  display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-size: .85rem;
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 9px 15px;
  transition: color .2s, border-color .2s, transform .2s;
}
.cv-contact a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.cv-contact a svg { width: 16px; height: 16px; }

/* Selected shipped titles anchor */
.shipped { display: grid; grid-template-columns: 1fr 1fr; gap: 0 36px; }
.shipped .row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.shipped .row .t { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; }
.shipped .row .t .plat { font-family: var(--font-mono); font-size: .68rem; color: var(--accent); margin-left: 8px; letter-spacing: .04em; }
.shipped .row .m { font-family: var(--font-mono); font-size: .73rem; color: var(--faint); text-align: right; white-space: nowrap; }
@media (max-width: 680px) { .shipped { grid-template-columns: 1fr; } .shipped .row .m { white-space: normal; } }

.timeline { position: relative; margin-left: 6px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--line-strong), var(--line)); }
.tl-item { position: relative; padding-left: 40px; padding-bottom: clamp(28px, 4vw, 44px); }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line-strong); transition: border-color .3s, box-shadow .3s; }
.tl-item.current .tl-dot { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 5px var(--accent-glow); }
.tl-item:hover .tl-dot { border-color: var(--accent); }
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.tl-head .role { font-family: var(--font-display); font-size: 1.18rem; font-weight: 600; color: var(--text); }
.tl-head .co { color: var(--accent); font-weight: 500; }
.tl-head .co a { border-bottom: 1px solid transparent; transition: border-color .2s; }
.tl-head .co a:hover { border-bottom-color: var(--accent); }
.tl-date { font-family: var(--font-mono); font-size: .76rem; color: var(--faint); margin-top: 4px; }
.tl-badge { font-family: var(--font-mono); font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); padding: 2px 8px; border-radius: 999px; }
.tl-body { margin-top: 12px; }
.tl-body p { color: var(--muted); }
.tl-body ul { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; }
.tl-body li { position: relative; padding-left: 20px; color: var(--muted); font-size: .96rem; }
.tl-body li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 1px; background: var(--accent); transform: rotate(45deg); opacity: .8; }
.tl-body li strong { color: var(--text); }

.cv-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(30px, 5vw, 64px); align-items: start; }
.edu-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--surface); margin-bottom: 16px; }
.edu-item .deg { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; }
.edu-item .sch { color: var(--accent); font-family: var(--font-mono); font-size: .82rem; margin-top: 4px; }
.edu-item .yr { color: var(--faint); font-family: var(--font-mono); font-size: .76rem; margin-top: 2px; }
.edu-item p { margin-top: 12px; font-size: .94rem; }
.edu-item ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: .88rem; }
@media (max-width: 860px) { .cv-cols { grid-template-columns: 1fr; } }

/* Print / PDF */
@media print {
  body { background: #fff; color: #111; }
  body::before, body::after { display: none; }
  .nav, .footer, .cv-actions, .nav-toggle { display: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  a { color: #111; }
  .tl-head .co, .edu-item .sch, .kicker, .tl-head .co a { color: #0a7d72; }
  .tl-dot { background: #0a7d72; border-color: #0a7d72; }
  .timeline::before { background: #ccc; }
  .facts, .edu-item, .tool-col { border-color: #ddd; background: #fafafa; }
  section { padding-block: 18px; }
  .tl-badge { background: #0a7d72; color: #fff; }
}

/* ---------- Pointer-reactive cards + ambient light ---------- */
.shelf-card { isolation: isolate; }
.work-card::before, .shelf-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  pointer-events: none; z-index: 5; opacity: 0; transition: opacity .35s var(--ease);
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), var(--accent), transparent 65%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.work-card:hover::before, .shelf-card:hover::before { opacity: .7; }

/* ambient Tron-line canvas (injected by JS) */
.bg-fx { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

/* subtle cursor glow */
.cursor-glow {
  position: fixed; top: 0; left: 0; width: 420px; height: 420px; margin: -210px 0 0 -210px;
  border-radius: 50%; pointer-events: none; z-index: -1; opacity: 0;
  transition: opacity .35s ease; will-change: transform;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 13%, transparent), transparent 60%);
}
@media (hover: none), (prefers-reduced-motion: reduce) { .cursor-glow { display: none; } }

/* home "from the shelf" strip */
.shelf-peek { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2.4vw, 24px); }
@media (max-width: 820px) { .shelf-peek { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .shelf-peek { grid-template-columns: 1fr; } }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-panel { max-width: 420px; order: -1; aspect-ratio: 16/10; }
  .hero-photo { max-width: 280px; order: -1; aspect-ratio: 1/1; }
  .work-grid { grid-template-columns: 1fr; }
  .work-card.feature { grid-column: auto; }
  .toolbox { grid-template-columns: 1fr; }
  .pg-teaser { grid-template-columns: 1fr; }
  .pg-teaser .demo { border-left: none; border-top: 1px solid var(--line); min-height: 260px; }
}
@media (max-width: 620px) {
  .nav-links { gap: 16px; }
  .nav-links a:not(.cta) { display: none; }
  .nav-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); }
  .nav.open .nav-links a:not(.cta) { display: block; }
  .nav.open .nav-links { position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 18px; padding: 22px var(--gutter); background: var(--bg); border-bottom: 1px solid var(--line); }
}
