/* ============== atelier — black/white portfolio ============== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
:root {
  --bg: #0a0a0a;
  --fg: #f5f5f3;
  --mute: #6b6b68;
  --line: #1f1f1d;
  --line-2: #2a2a27;
  --hover-bg: #141412;
  --accent: #f5f5f3;
  --grain: 0.06;
  --font-display: "Space Grotesk", "Helvetica Neue", Helvetica, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-display);
  font-feature-settings: "ss01", "ss02";
  -webkit-font-smoothing: antialiased;
  cursor: none;
  overflow-x: hidden;
}
body.show-native-cursor { cursor: auto; }
body.show-native-cursor a, body.show-native-cursor button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button { background: none; border: 0; color: inherit; font: inherit; cursor: none; }
img { display: block; max-width: 100%; }

/* ====== layout ====== */
.app { position: relative; min-height: 100%; }
.shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 56px;
}
@media (max-width: 720px){
  .shell { padding: 0 20px; }
}

/* ====== grain overlay ====== */
.grain {
  pointer-events: none;
  position: fixed; inset: 0;
  z-index: 60;
  opacity: var(--grain);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.85 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ====== custom cursor ====== */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0;
  pointer-events: none;
  z-index: 200;
  transform: translate3d(-50%, -50%, 0);
  will-change: transform, width, height;
}
.cursor-dot {
  width: 6px; height: 6px;
  background: var(--fg);
  border-radius: 50%;
}
.cursor-ring {
  width: 36px; height: 36px;
  border: 1.5px solid var(--fg);
  border-radius: 50%;
  transition: width .22s ease, height .22s ease, border-radius .22s ease, background .2s ease, color .2s ease;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .04em;
  color: transparent;
}
.cursor-ring.is-link { width: 64px; height: 64px; }
.cursor-ring.is-view { width: 96px; height: 96px; background: var(--fg); color: var(--bg); border-color: var(--fg); }
.cursor-ring.is-text { width: 4px; height: 28px; border-radius: 0; background: var(--fg); }
.cursor-ring.is-drag { width: 80px; height: 80px; border-radius: 50%; background: var(--fg); color: var(--bg); }
.cursor-ring.is-explore {
  width: 96px; height: 96px;
  background: transparent;
  color: var(--bg);
  border-color: var(--fg);
  mix-blend-mode: difference;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 10px;
  letter-spacing: .2em;
}
.cursor-ring.is-explore + ,
.cursor-ring.is-explore { /* keeps blend on dot too via sibling */ }
.cursor-dot.is-explore-active { mix-blend-mode: difference; }
.cursor-ring__explore {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  line-height: 1;
}
.cursor-ring__explore { font-size: 14px; }
.cursor-ring__explore small {
  font-size: 9px;
  letter-spacing: .25em;
  margin-top: 2px;
  opacity: .85;
}
.hero__cta:hover .cta { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* ====== loader ====== */
.loader {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 500;
  display: grid; place-items: center;
  overflow: hidden;
}
.loader__count {
  position: absolute; left: 56px; bottom: 48px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .08em;
  color: var(--mute);
}
.loader__count b { color: var(--fg); font-weight: 400; }
.loader__bar {
  position: absolute; left: 0; bottom: 0;
  height: 1px; background: var(--fg);
  transform-origin: left center;
}
.loader__mark {
  display: flex; align-items: baseline; gap: 4px;
  font-size: 124px;
  font-family: "Instrument Serif", "Times New Roman", serif;
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.02em;
}
.loader__mark span {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  animation: loader-rise 700ms cubic-bezier(.2,.7,.2,1) forwards;
}
.loader__mark .dot {
  width: 12px; height: 12px;
  background: var(--fg);
  border-radius: 50%;
  align-self: end;
  transform: scale(0);
  animation: loader-pop 500ms cubic-bezier(.2,.7,.2,1) forwards 600ms;
  margin-left: 4px;
  margin-bottom: 14px;
}
@keyframes loader-rise { to { transform: translateY(0); opacity: 1; } }
@keyframes loader-pop  { to { transform: scale(1); } }
.loader__hint {
  position: absolute; right: 56px; bottom: 48px;
  font-family: var(--font-mono);
  font-size: 12px; color: var(--mute);
  letter-spacing: .08em;
}
.loader.is-out { animation: loader-out 700ms cubic-bezier(.7,0,.3,1) forwards; }
@keyframes loader-out { to { transform: translateY(-100%); } }

/* ====== topbar ====== */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 24px 56px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.topbar__left { display: flex; gap: 22px; align-items: center; font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; color: var(--mute); }
.topbar__left b { color: var(--fg); font-weight: 400; }
.topbar__brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 500; letter-spacing: -0.02em; justify-self: center; }
.topbar__right { display: flex; gap: 28px; align-items: center; justify-self: end; font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; color: var(--mute); }
.topbar__right b { color: var(--fg); font-weight: 400; }
.dot-blink {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--fg);
  animation: blink 1.6s infinite;
  vertical-align: middle; margin-right: 8px;
}
@keyframes blink { 0%,49%{opacity:1} 50%,100%{opacity:.15} }

/* brand mark — italic 'c' under a rotating wordmark seal */
.mark {
  width: 32px; height: 32px;
  display: inline-block;
  position: relative;
  flex: none;
}
.mark svg { width: 100%; height: 100%; overflow: visible; display: block; }
.mark .ring { fill: none; stroke: currentColor; }
.mark .ring--outer { stroke-width: 0.7; opacity: .45; }
.mark .ring--inner { stroke-width: 0.4; opacity: .18; }
.mark__rotor-text {
  font-family: var(--font-mono);
  fill: currentColor;
  font-weight: 400;
}
.mark__c {
  font-family: "Instrument Serif", "Times New Roman", serif;
  font-size: 16px;
  font-style: italic;
  font-weight: 400;
  fill: currentColor;
}
.mark__dot circle { transform-origin: 18px 18px; }
.mark.spinning .mark__rotor { /* animateTransform handles it inside SVG */ }

@media (max-width: 720px) {
  .mark { width: 28px; height: 28px; }
  .mark__c { font-size: 15px; }
}

/* menu burger */
.burger { display: inline-flex; flex-direction: column; gap: 5px; padding: 8px 6px; position: relative; }
.burger span { width: 22px; height: 1.5px; background: var(--fg); transition: transform .35s cubic-bezier(.2,.7,.2,1), opacity .25s; transform-origin: center; }
.burger:hover span:first-child { transform: translateX(-4px); }
.burger:hover span:last-child { transform: translateX(4px); }
.burger.is-open:hover span { transform: none; }
.burger.is-open span:first-child { transform: translateY(3.25px) rotate(45deg); }
.burger.is-open span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

/* ====== sidebar nav ====== */
.sidenav {
  position: fixed; left: 24px; top: 50%;
  transform: translateY(-50%);
  z-index: 70;
  display: flex; flex-direction: column;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .22em;
  color: var(--mute);
}
.sidenav button {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  padding: 10px 4px;
  color: var(--mute);
  transition: color .2s ease;
  position: relative;
}
.sidenav button.active { color: var(--fg); }
.sidenav button::before {
  content: ""; position: absolute;
  left: 50%; top: -16px;
  width: 1px; height: 10px;
  background: currentColor;
  transform: translateX(-50%) scaleY(0);
  transform-origin: top;
  transition: transform .25s ease;
}
.sidenav button.active::before { transform: translateX(-50%) scaleY(1); }
@media (max-width: 900px){ .sidenav { display: none; } }

/* ====== hero ====== */
.hero { min-height: 100vh; position: relative; display: flex; align-items: center; }
.hero__inner { width: 100%; }
.hero__eyebrow {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: .18em; color: var(--mute);
  margin-bottom: 36px;
  text-transform: uppercase;
}
.hero__eyebrow .line { width: 60px; height: 1px; background: var(--mute); }
.hero__title {
  font-size: clamp(64px, 11vw, 184px);
  line-height: 0.92;
  font-weight: 500;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.hero__title em {
  font-style: normal;
  font-family: "Instrument Serif", "Times New Roman", serif;
  font-weight: 400;
  font-style: italic;
  padding-right: 0.04em;
}
.hero__title .word { display: inline-block; overflow: hidden; vertical-align: bottom; }
.hero__title .word > span {
  display: inline-block;
  transform: translateY(110%);
  animation: hero-rise 900ms cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes hero-rise { to { transform: translateY(0); } }

.hero__row {
  margin-top: 48px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 24px;
}
.hero__bio {
  max-width: 360px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--mute);
}
.hero__bio b { color: var(--fg); font-weight: 400; }
.hero__cta { justify-self: center; }
.hero__meta {
  justify-self: end;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--mute);
  text-align: right;
  line-height: 1.9;
}
.hero__meta b { color: var(--fg); font-weight: 400; }
@media (max-width: 900px){
  .hero__row { grid-template-columns: 1fr; }
  .hero__cta, .hero__meta { justify-self: start; text-align: left; }
}

/* magnetic CTA */
.cta {
  position: relative;
  width: 168px; height: 168px;
  border-radius: 50%;
  border: 1px solid var(--fg);
  display: grid; place-items: center;
  transition: background .25s ease, color .25s ease, transform .2s ease;
  will-change: transform;
}
.cta:hover { background: var(--fg); color: var(--bg); }
.cta__rotor {
  position: absolute; inset: 0;
  animation: rotor 14s linear infinite;
}
.cta__rotor svg { width: 100%; height: 100%; }
.cta__inner {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .18em;
  display: flex; align-items: center; gap: 8px;
}
@keyframes rotor { to { transform: rotate(360deg); } }

/* arrow blink */
.arrow {
  display: inline-flex; gap: 2px; align-items: center;
}
.arrow svg { width: 14px; height: 14px; transition: transform .2s ease; }
a:hover .arrow svg, button:hover .arrow svg { transform: translate(3px, -3px); }

/* ====== marquee strip ====== */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 18px 0;
  position: relative;
  --speed: 38s;
  cursor: grab;
  user-select: none;
  touch-action: pan-y;
}
.marquee.is-dragging { cursor: grabbing; }
.marquee__track {
  display: flex; gap: 56px;
  white-space: nowrap;
  animation: marquee var(--speed) linear infinite;
  --drag-offset: 0px;
  font-size: clamp(36px, 6vw, 76px);
  font-weight: 500;
  letter-spacing: -0.035em;
  will-change: transform;
}
.marquee__track span { display: inline-flex; align-items: center; gap: 56px; }
.marquee__track em {
  font-style: italic;
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  color: var(--mute);
}
.marquee__track .star { width: 28px; height: 28px; flex: none; }
@keyframes marquee {
  from { transform: translateX(var(--drag-offset)); }
  to { transform: translateX(calc(-50% + var(--drag-offset))); }
}
.marquee.is-dragging .marquee__track,
.marquee:hover .marquee__track { animation-play-state: paused; }

/* ====== section header ====== */
.section { padding: 140px 0; position: relative; }
.section__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 32px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 64px;
}
.section__num {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: .2em; color: var(--mute);
}
.section__title {
  font-size: clamp(40px, 6.6vw, 96px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}
.section__title em { font-style: italic; font-family: "Instrument Serif", serif; font-weight: 400; }
.section__caption {
  max-width: 320px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--mute);
  text-align: right;
}

/* ====== works list ====== */
.works { display: flex; flex-direction: column; }
.work {
  position: relative;
  border-bottom: 1px solid var(--line);
  padding: 36px 0;
  display: grid;
  grid-template-columns: 60px 1fr 1fr 1fr 90px;
  gap: 24px;
  align-items: center;
  cursor: none;
}
.work__num { font-family: var(--font-mono); font-size: 12px; color: var(--mute); letter-spacing: .15em; }
.work__title { font-size: clamp(32px, 4.2vw, 56px); font-weight: 500; letter-spacing: -0.025em; line-height: 1; transition: transform .35s cubic-bezier(.2,.7,.2,1), color .25s; }
.work__title em { font-style: italic; font-family: "Instrument Serif", serif; font-weight: 400; }
.work__tag { font-family: var(--font-mono); font-size: 12px; color: var(--mute); letter-spacing: .12em; }
.work__year { font-family: var(--font-mono); font-size: 12px; color: var(--mute); letter-spacing: .15em; }
.work__arrow { justify-self: end; opacity: .35; transition: opacity .25s ease, transform .25s ease; }
.work__arrow svg { width: 18px; height: 18px; }
.work:hover .work__title { transform: translateX(16px); }
.work:hover .work__arrow { opacity: 1; transform: translate(6px, -6px); }
.work__preview {
  position: fixed;
  top: 0; left: 0;
  width: 320px; height: 220px;
  pointer-events: none;
  z-index: 30;
  transform: translate(-50%, -50%) scale(.85);
  opacity: 0;
  transition: opacity .35s ease, transform .35s cubic-bezier(.2,.7,.2,1);
  overflow: hidden;
  background: var(--line);
}
.work__preview.is-active { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.work__preview > div {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #1f1f1d 0%, #2a2a27 100%);
  display: grid; place-items: center;
  color: var(--mute);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .15em;
  position: relative;
  overflow: hidden;
}
.work__preview > div::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(135deg, transparent 0 12px, rgba(255,255,255,.04) 12px 13px);
}
@media (max-width: 900px){
  .work { grid-template-columns: 40px 1fr; }
  .work__tag, .work__year, .work__arrow { display: none; }
  .work__preview { display: none; }
}

/* ====== services ====== */
.services {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.service {
  background: var(--bg);
  padding: 36px 28px;
  min-height: 320px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: background .3s ease;
}
.service:hover { background: var(--hover-bg); }
.service__icon {
  width: 56px; height: 56px;
  margin-bottom: 24px;
}
.service__icon svg { width: 100%; height: 100%; overflow: visible; }
.service__num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--mute);
  position: absolute; top: 20px; right: 20px;
}
.service__name { font-size: 24px; font-weight: 500; letter-spacing: -0.02em; margin-bottom: 8px; }
.service__name em { font-style: italic; font-family: "Instrument Serif", serif; font-weight: 400; }
.service__desc { font-family: var(--font-mono); font-size: 12px; line-height: 1.6; color: var(--mute); }
.service__list { font-family: var(--font-mono); font-size: 11px; color: var(--mute); letter-spacing: .08em; line-height: 2; margin-top: 16px; }
.service__list b { color: var(--fg); font-weight: 400; }
@media (max-width: 900px){
  .services { grid-template-columns: 1fr 1fr; }
}

/* ====== about ====== */
.about {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 80px;
  align-items: start;
}
.about__lead {
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.18;
  letter-spacing: -0.025em;
  font-weight: 400;
  text-wrap: pretty;
}
.about__lead em { font-style: italic; font-family: "Instrument Serif", serif; }
.about__lead b { font-weight: 500; }
.about__side { display: flex; flex-direction: column; gap: 36px; }
.kv {
  display: grid; grid-template-columns: 100px 1fr; gap: 24px;
  padding: 18px 0; border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em;
}
.kv:last-child { border-bottom: 1px solid var(--line); }
.kv__k { color: var(--mute); text-transform: uppercase; }
.kv__v { color: var(--fg); }
.kv__v b { font-weight: 500; }
.stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  margin-top: 16px;
}
.stat {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.stat__n { font-size: 44px; font-weight: 500; letter-spacing: -0.03em; line-height: 1; }
.stat__l { font-family: var(--font-mono); font-size: 11px; color: var(--mute); letter-spacing: .12em; margin-top: 8px; text-transform: uppercase; }
@media (max-width: 900px){ .about { grid-template-columns: 1fr; gap: 48px; } }

/* ====== process clock ====== */
.clock {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 32px;
}
.clock__node {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.clock__node .n { font-family: var(--font-mono); font-size: 11px; color: var(--mute); letter-spacing: .2em; }
.clock__node .t { font-size: 22px; margin-top: 12px; font-weight: 500; letter-spacing: -0.02em; }
.clock__node .d { font-family: var(--font-mono); font-size: 12px; color: var(--mute); line-height: 1.6; margin-top: 8px; }
@media (max-width: 900px){ .clock { grid-template-columns: 1fr 1fr; } }

/* ====== footer ====== */
.foot {
  border-top: 1px solid var(--line);
  padding: 120px 0 40px;
  position: relative;
  overflow: hidden;
}
.foot__big {
  font-size: clamp(64px, 14vw, 220px);
  letter-spacing: -0.055em;
  font-weight: 500;
  line-height: .9;
  text-wrap: balance;
  position: relative;
  z-index: 2;
}
.foot__big em { font-style: italic; font-family: "Instrument Serif", serif; font-weight: 400; }

.foot__cta {
  display: inline-flex; align-items: center; gap: 14px;
  margin-top: 56px;
  padding: 18px 28px;
  border: 1px solid var(--fg);
  border-radius: 999px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .15em;
  transition: background .25s ease, color .25s ease, transform .2s ease;
  position: relative; z-index: 2;
}
.foot__cta:hover { background: var(--fg); color: var(--bg); }
.foot__cta .arrow svg { width: 14px; height: 14px; transition: transform .2s ease; }
.foot__cta:hover .arrow svg { transform: translate(3px, -3px); }

/* quick action cards */
.foot__cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 64px;
  position: relative; z-index: 2;
}
.foot__card {
  background: var(--bg);
  padding: 24px 22px 22px;
  display: flex; flex-direction: column; gap: 10px;
  transition: background .25s ease, transform .25s ease;
  position: relative;
  min-height: 160px;
}
.foot__card:hover { background: var(--hover-bg); }
.foot__card-icon {
  width: 36px; height: 36px;
  margin-bottom: 12px;
  color: var(--fg);
  opacity: .85;
  transition: transform .35s cubic-bezier(.2,.7,.2,1);
}
.foot__card:hover .foot__card-icon { transform: translateY(-3px) rotate(-3deg); }
.foot__card-icon svg { width: 100%; height: 100%; }
.foot__card-k { font-family: var(--font-mono); font-size: 10px; letter-spacing: .25em; color: var(--mute); }
.foot__card-v { font-size: 18px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.3; word-break: break-word; }
.foot__card-sub { font-family: var(--font-mono); font-size: 11px; color: var(--mute); letter-spacing: .08em; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
@media (max-width: 1024px) { .foot__cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px)  { .foot__cards { grid-template-columns: 1fr; } }

/* link columns */
.foot__row {
  margin-top: 80px;
  display: grid; grid-template-columns: 1fr 1fr 1fr 1.4fr;
  gap: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em;
  position: relative; z-index: 2;
}
.foot__col h5 {
  color: var(--mute);
  font-family: "Instrument Serif", "Times New Roman", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 20px;
  letter-spacing: -0.005em;
  margin-bottom: 18px;
  text-transform: none;
}
.foot__col--mono h5 {
  font-family: var(--font-mono);
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: 11px;
  margin-bottom: 16px;
}
.foot__col a { display: block; padding: 4px 0; position: relative; transition: color .2s ease; }
.foot__col a::after {
  content: "↗"; opacity: 0; margin-left: 8px;
  transition: opacity .2s ease, transform .2s ease;
  display: inline-block;
}
.foot__col a:hover::after { opacity: 1; transform: translate(2px, -2px); }

/* NOW widget */
.foot__now { display: flex; flex-direction: column; gap: 8px; }
.foot__now-row {
  display: grid; grid-template-columns: 80px 1fr; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.foot__now-row:last-child { border-bottom: 0; }
.foot__now-k { color: var(--mute); letter-spacing: .2em; font-size: 10px; }
.foot__now-v { color: var(--fg); }

/* bottom bar */
.foot__bottom {
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  font-family: var(--font-mono); font-size: 11px; color: var(--mute); letter-spacing: .15em;
  position: relative; z-index: 2;
}
.foot__top {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em;
  color: var(--fg);
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.foot__top:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.foot__top svg { width: 12px; height: 12px; transition: transform .25s ease; }
.foot__top:hover svg { transform: translateY(-3px); }

/* massive name watermark */
.foot__watermark {
  position: absolute;
  left: 50%;
  bottom: -3vw;
  transform: translateX(-50%);
  z-index: 1;
  pointer-events: none;
  width: 110%;
  text-align: center;
  font-family: "Instrument Serif", "Times New Roman", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 28vw;
  line-height: .9;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-2);
  letter-spacing: -0.04em;
  user-select: none;
}
.foot__watermark span { display: inline-block; }

@media (max-width: 900px){ .foot__row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) {
  .foot { padding: 80px 0 32px; }
  .foot__bottom { flex-direction: column; gap: 14px; align-items: flex-start; }
  .foot__now-row { grid-template-columns: 70px 1fr; gap: 8px; }
}

/* ====== now playing / status pill ====== */
.status {
  position: fixed; right: 24px; bottom: 24px;
  z-index: 50;
  background: rgba(20,20,18,.7);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 10px 16px 10px 12px;
  display: flex; gap: 10px; align-items: center;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em;
  color: var(--mute);
}
.status .pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--fg); position: relative;
}
.status .pulse::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 1px solid var(--fg);
  animation: ping 1.8s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(.6); opacity: 1 } 100% { transform: scale(1.8); opacity: 0 } }
.status b { color: var(--fg); font-weight: 400; }
@media (max-width: 720px){ .status { display: none; } }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* selection */
::selection { background: var(--fg); color: var(--bg); }

/* scroll progress */
.scroll-progress { position: fixed; top: 0; left: 0; height: 2px; background: var(--fg); z-index: 90; width: 0; }

/* layouts variant: tiles */
.works.is-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.works.is-tiles .work { grid-template-columns: 1fr; padding: 32px 28px; background: var(--bg); border: 0; }
.works.is-tiles .work .work__arrow { position: absolute; top: 24px; right: 24px; }
.works.is-tiles .work__preview { display: none; }

/* ====== research ====== */
.research {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 32px;
  align-items: stretch;
}
.paper {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px;
  border: 1px solid var(--line);
  min-height: 280px;
  position: relative;
  overflow: hidden;
  background: var(--bg);
  transition: background .25s ease, border-color .25s ease;
}
.paper:hover { background: var(--hover-bg); border-color: var(--line-2); }
.paper__meta {
  display: flex; justify-content: space-between; gap: 16px;
  font-family: var(--font-mono); font-size: 11px; color: var(--mute);
  letter-spacing: .2em;
}
.paper__title {
  font-size: clamp(22px, 2.6vw, 34px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.18;
  margin: 28px 0;
  max-width: 720px;
}
.paper__title em { font-style: italic; font-family: "Instrument Serif", serif; font-weight: 400; }
.paper__row {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .15em;
  padding-top: 24px; border-top: 1px solid var(--line);
}
.paper__side { display: flex; flex-direction: column; gap: 16px; }
.paper--mini {
  flex: 1; padding: 24px; min-height: 0;
}
.paper--mini .paper__name { font-size: 20px; font-weight: 500; letter-spacing: -0.015em; margin: 16px 0 8px; }
.paper--mini .paper__sub { font-family: var(--font-mono); font-size: 12px; color: var(--mute); letter-spacing: .1em; }
@media (max-width: 900px){ .research { grid-template-columns: 1fr; } }

/* preview image styling */
.work__preview img { display: block; }
.work__preview > div { padding: 0; }

/* ====== fullscreen menu ====== */
.menu {
  position: fixed; inset: 0;
  z-index: 75;
  pointer-events: none;
  display: flex;
}
.menu__bg {
  position: absolute; inset: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  transform: translateY(-101%);
  transition: transform .75s cubic-bezier(.7,0,.3,1);
}
.menu__inner {
  position: relative;
  width: 100%;
  padding-top: 110px;
  padding-bottom: 40px;
  display: flex; flex-direction: column;
  opacity: 0;
  transition: opacity .25s ease .25s;
}
.menu.is-open { pointer-events: auto; }
.menu.is-open .menu__bg { transform: translateY(0); }
.menu.is-open .menu__inner { opacity: 1; }

.menu__head {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em;
  color: var(--mute);
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.menu__list {
  list-style: none;
  flex: 1;
  margin-top: 12px;
}
.menu__list li {
  border-bottom: 1px solid var(--line);
  opacity: 0; transform: translateY(20px);
  transition: opacity .6s cubic-bezier(.2,.7,.2,1), transform .6s cubic-bezier(.2,.7,.2,1);
}
.menu.is-open .menu__list li { opacity: 1; transform: translateY(0); }
.menu__list button {
  width: 100%;
  display: grid;
  grid-template-columns: 80px 1fr 40px;
  align-items: center;
  padding: 22px 0;
  text-align: left;
  position: relative;
  overflow: hidden;
}
.menu__n {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .2em; color: var(--mute);
}
.menu__label {
  font-size: clamp(40px, 7vw, 92px);
  font-weight: 500; letter-spacing: -0.035em; line-height: 1;
  transition: transform .4s cubic-bezier(.2,.7,.2,1), color .25s;
}
.menu__arr { justify-self: end; opacity: .35; transition: opacity .25s ease, transform .35s cubic-bezier(.2,.7,.2,1); }
.menu__arr svg { width: 22px; height: 22px; }
.menu__list button:hover .menu__label { transform: translateX(20px); }
.menu__list button:hover .menu__arr { opacity: 1; transform: translate(8px, -8px); }

.menu__foot {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 2fr 1fr; gap: 32px;
}
.menu__k { font-family: var(--font-mono); font-size: 10px; letter-spacing: .25em; color: var(--mute); margin-bottom: 14px; }
.menu__socials { display: flex; flex-wrap: wrap; gap: 16px 28px; font-family: var(--font-mono); font-size: 13px; letter-spacing: .12em; }
.menu__socials a {
  opacity: 0; transform: translateY(10px);
  transition: opacity .5s ease, transform .5s ease;
}
.menu.is-open .menu__socials a { opacity: 1; transform: translateY(0); }
.menu__email {
  font-size: clamp(16px, 1.5vw, 18px);
  letter-spacing: -0.01em;
  line-height: 1.35;
}

/* ====== stickers (hero — refined, gentle) ====== */
.stickers { pointer-events: none; position: absolute; inset: 0; overflow: visible; }
.stickers > * { pointer-events: auto; }
.sticker {
  position: absolute;
  padding: 9px 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  background: var(--bg);
  color: var(--fg);
  white-space: nowrap;
  display: inline-flex; align-items: center;
  opacity: 0;
  animation: sticker-in .7s cubic-bezier(.2,.7,.2,1) forwards,
             sticker-bob 8s ease-in-out infinite 1s;
  box-shadow: 0 8px 24px -16px rgba(0,0,0,.6);
  transition: border-color .25s ease, color .25s ease, background .25s ease;
}
body.is-inverted .sticker { box-shadow: 0 8px 24px -16px rgba(0,0,0,.18); }
.sticker:hover { border-color: var(--fg); }
.sticker--dark { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.sticker--dark:hover { background: var(--bg); color: var(--fg); }
.sticker--link {
  text-decoration: none; cursor: pointer;
  border-color: var(--fg);
  background: var(--bg);
}
.sticker--link:hover { background: var(--fg); color: var(--bg); }

/* positions — slightly orbiting the hero text, not stacked on the name */
.sticker.s1 { top: 14%;    right: 7%;  animation-delay: 700ms, 1s; }
.sticker.s2 { top: 4%;     right: 26%; animation-delay: 780ms, 1.4s; }
.sticker.s3 { top: 30%;    right: 4%;  animation-delay: 860ms, 1.8s; }
.sticker.s4 { bottom: 26%; right: 8%;  animation-delay: 940ms, 2.2s; padding: 10px 18px; }
.sticker.s5 { bottom: 14%; right: 28%; animation-delay: 1020ms, 2.6s; }
.sticker.s6 { top: 50%;    right: 18%; animation-delay: 1100ms, 3s; }
.sticker.s7 { bottom: 4%;  right: 16%; animation-delay: 1180ms, 3.4s; }

@keyframes sticker-in {
  from { opacity: 0; translate: 0 8px; scale: .95; }
  to   { opacity: 1; translate: 0 0;   scale: 1; }
}
@keyframes sticker-bob {
  0%,100% { translate: 0 0; }
  50% { translate: 0 -4px; }
}

@media (max-width: 1200px) {
  .sticker.s6 { top: 60%; right: 4%; }
}
@media (max-width: 1024px) {
  .sticker.s2, .sticker.s3, .sticker.s6, .sticker.s7 { display: none; }
}
@media (max-width: 720px) {
  .stickers { display: none; }
}

/* ====== wavy text ====== */
.wavy { display: inline-block; }
.wavy__ch { display: inline-block; transition: transform .35s cubic-bezier(.2,.7,.2,1); }
.wavy-line { display: block; }
.wavy-line:hover .wavy__ch { transform: translateY(-14px); }

/* ====== inverted theme ====== */
body.is-inverted {
  --bg: #f5f5f3;
  --fg: #0a0a0a;
  --mute: #80807d;
  --line: #e6e6e2;
  --line-2: #d8d8d4;
  --hover-bg: #ebebe7;
}
body.is-inverted .grain { mix-blend-mode: multiply; opacity: calc(var(--grain) * 1.4); }

/* ====== touch / mobile ====== */
.app.is-touch, .app.is-touch * { cursor: auto !important; }
.app.is-touch a, .app.is-touch button { cursor: pointer !important; }
.app.is-touch .cursor-dot, .app.is-touch .cursor-ring { display: none !important; }
.app.is-touch .work__preview { display: none !important; }

/* ====== animated preview panel ====== */
.work__preview {
  width: 360px; height: 260px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.6);
}
body.is-inverted .work__preview { box-shadow: 0 30px 60px -20px rgba(0,0,0,.18); }
.work__preview-inner {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}
.work__preview-inner::before {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(0deg, transparent 0 14px, rgba(128,128,128,.05) 14px 15px);
  pointer-events: none;
}
.work__preview-meta {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em;
  color: var(--mute);
}
.work__preview-glyph { flex: 1; display: grid; place-items: center; position: relative; }
.work__preview-glyph svg { width: 100%; height: 100%; max-height: 180px; color: var(--fg); }
.work__preview-foot {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--fg);
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.work__preview-foot .dot-blink { width: 6px; height: 6px; margin: 0; }

/* tile-only inline glyph (and mobile force) */
.work__glyph, .work__note { display: none; }
.works.is-tiles {
  grid-template-columns: 1fr 1fr;
}
.works.is-tiles .work {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 28px;
  background: var(--bg);
  position: relative;
}
.works.is-tiles .work__num { font-size: 11px; }
.works.is-tiles .work__glyph {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  border: 1px solid var(--line);
  margin: 12px 0 18px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255,255,255,.02), transparent);
}
.works.is-tiles .work__glyph svg {
  width: 100%; height: 100%;
  padding: 18px;
  color: var(--fg);
}
.works.is-tiles .work__title {
  font-size: clamp(26px, 2.8vw, 36px);
  transform: none !important;
  line-height: 1.05;
  margin-bottom: 6px;
}
.works.is-tiles .work__tag,
.works.is-tiles .work__year { display: block; font-size: 11px; }
.works.is-tiles .work__year { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.works.is-tiles .work__note {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mute);
  line-height: 1.5;
  margin: 4px 0 12px;
}
.works.is-tiles .work__arrow { position: absolute; top: 24px; right: 24px; opacity: 1; transition: transform .25s ease; }
.works.is-tiles .work:hover .work__arrow { transform: translate(6px, -6px); }

/* ====== topbar mobile ====== */
@media (max-width: 820px) {
  .topbar { padding: 18px 20px; }
  .topbar__hide-mob { display: none !important; }
  .topbar__brand { font-size: 16px; }
  .topbar__left { font-size: 10px; gap: 12px; }
  .topbar__right { gap: 12px; }
}

/* ====== mobile general ====== */
@media (max-width: 720px) {
  .shell { padding: 0 18px; }
  .section { padding: 72px 0; }
  .section__head { flex-direction: column; align-items: flex-start; padding-bottom: 28px; margin-bottom: 32px; gap: 16px; }
  .section__caption { text-align: left; max-width: 100%; }
  .section__title { font-size: 14vw; line-height: .95; }
  .hero { padding-top: 96px; min-height: auto; padding-bottom: 64px; }
  .hero__title { font-size: 14vw; line-height: .94; }
  .hero__eyebrow { margin-bottom: 24px; font-size: 10px; flex-wrap: wrap; gap: 8px; }
  .hero__eyebrow .line { display: none; }
  .hero__row { margin-top: 40px; gap: 32px; grid-template-columns: 1fr; align-items: stretch; }
  .hero__cta { transform: scale(.78); transform-origin: left center; align-self: flex-start; }
  .hero__bio { max-width: 100%; font-size: 12px; }
  .hero__meta { font-size: 10px; line-height: 2; text-align: left; justify-self: start; }
  .about { gap: 36px; }
  .about__lead { font-size: 24px; }
  .clock { grid-template-columns: 1fr 1fr; gap: 16px; }
  .clock__node .t { font-size: 18px; }
  .stats { grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
  .stat__n { font-size: 28px; }
  .stat__l { font-size: 9px; }
  .foot { padding: 56px 0 32px; }
  .foot__big { font-size: 14vw; line-height: .92; }
  .foot__big a, .foot__big { line-height: .92; }
  .foot__row { grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 32px; padding-top: 24px; }
  .foot__bottom { flex-direction: column; gap: 8px; margin-top: 48px; font-size: 10px; align-items: flex-start; }
  .marquee { padding: 12px 0; }
  .marquee__track { font-size: 12vw; gap: 32px; }
  .marquee__track span { gap: 32px; }
  .marquee__track .star { width: 18px; height: 18px; }
  .works.is-tiles { grid-template-columns: 1fr; }
  .works.is-tiles .work { padding: 22px; }
  .paper { padding: 28px 24px; }
  .paper__title { margin: 22px 0; }
  .research { gap: 16px; }
  .paper__side { gap: 12px; }
  .menu__inner { padding-top: 90px; }
  .menu__list button { grid-template-columns: 44px 1fr 22px; padding: 16px 0; }
  .menu__label { font-size: 38px; }
  .menu__n { font-size: 10px; }
  .menu__foot { grid-template-columns: 1fr; gap: 24px; }
  .menu__socials { gap: 14px 22px; font-size: 12px; }
}

@media (max-width: 480px) {
  .hero__title { font-size: 16vw; }
  .section__title { font-size: 16vw; }
  .foot__big { font-size: 16vw; }
}

/* ====== cursive accent (Rewordium "Re") ====== */
.cursive {
  font-family: "Caveat", "Instrument Serif", cursive;
  font-weight: 600;
  letter-spacing: 0;
  font-style: normal;
  padding-right: 0.04em;
  display: inline-block;
  transform: translateY(0.04em);
}
.work__title .cursive {
  font-size: 1.18em;
}

/* ====== more projects grid (archive) ====== */
.more-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.more-card {
  background: var(--bg);
  padding: 24px 22px 22px;
  display: flex; flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: background .25s ease;
}
.more-card:hover { background: var(--hover-bg); }
.more-card__glyph {
  width: 100%;
  aspect-ratio: 16/10;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255,255,255,.02), transparent);
  position: relative;
  overflow: hidden;
}
.more-card__glyph svg {
  width: 100%; height: 100%;
  padding: 14px;
  color: var(--fg);
}
.more-card__body { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.more-card__head { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em; color: var(--mute); }
.more-card__code { color: var(--mute); }
.more-card__stars { display: inline-flex; align-items: center; gap: 4px; color: var(--fg); }
.more-card__stars svg { display: inline-block; }
.more-card__title { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
.more-card__tag { font-family: var(--font-mono); font-size: 11px; color: var(--mute); letter-spacing: .12em; }
.more-card__note { font-family: var(--font-mono); font-size: 12px; color: var(--mute); line-height: 1.5; flex: 1; }
.more-card__arrow {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em;
  color: var(--mute);
  padding-top: 12px; border-top: 1px solid var(--line);
  transition: color .2s ease;
}
.more-card__arrow svg { width: 14px; height: 14px; transition: transform .2s ease; }
.more-card:hover .more-card__arrow { color: var(--fg); }
.more-card:hover .more-card__arrow svg { transform: translate(4px, -4px); }
@media (max-width: 1100px) { .more-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .more-grid { grid-template-columns: 1fr; } }

/* ====== github stats ====== */
.gh { display: flex; flex-direction: column; gap: 40px; }
.gh__bignums {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.gh__num {
  background: var(--bg);
  padding: 36px 28px;
  display: flex; flex-direction: column; gap: 8px;
  text-align: left;
  transition: background .25s ease, transform .25s ease;
}
.gh__num:hover { background: var(--hover-bg); transform: translateY(-2px); }
.gh__n {
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 500; letter-spacing: -0.035em;
  line-height: 1;
}
.gh__l {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .2em; color: var(--mute);
}
@media (max-width: 720px) { .gh__bignums { grid-template-columns: 1fr 1fr; } .gh__num { padding: 24px 20px; } }

.gh__split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; }
.gh__col { border: 1px solid var(--line); padding: 28px; }
.gh__hd { font-family: var(--font-mono); font-size: 10px; letter-spacing: .25em; color: var(--mute); margin-bottom: 18px; }
.gh__repos { list-style: none; display: flex; flex-direction: column; gap: 1px; background: var(--line); }
.gh__repos li { background: var(--bg); }
.gh__repos a { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 14px 0; align-items: baseline; }
.gh__rname { font-size: 18px; font-weight: 500; letter-spacing: -0.015em; }
.gh__rstars { font-family: var(--font-mono); font-size: 12px; color: var(--mute); }
.gh__rdesc { grid-column: 1 / -1; font-family: var(--font-mono); font-size: 12px; color: var(--mute); line-height: 1.5; }

.gh__langs { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.gh__lname { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; }
.gh__lname span { color: var(--mute); }
.gh__bar { height: 4px; background: var(--line); position: relative; overflow: hidden; }
.gh__barfill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--fg); width: 0; transition: width .9s cubic-bezier(.2,.7,.2,1); }
.reveal.in .gh__barfill, .gh__col.in .gh__barfill { /* trigger via parent in */ }

/* contribution heatmap */
.gh__contrib { margin-top: 8px; }
.gh__grid {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  grid-auto-rows: 14px;
  gap: 3px;
  margin-top: 6px;
}
.gh__cell {
  display: inline-block;
  width: 100%; height: 14px;
  background: var(--line);
  border-radius: 2px;
  opacity: 0;
  animation: gh-cell-pop .5s cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes gh-cell-pop { to { opacity: 1; transform: none; } }
.gh__cell-0 { background: var(--line); }
.gh__cell-1 { background: #2a2a27; }
.gh__cell-2 { background: #585855; }
.gh__cell-3 { background: #9a9a96; }
.gh__cell-4 { background: var(--fg); }
body.is-inverted .gh__cell-0 { background: #e6e6e2; }
body.is-inverted .gh__cell-1 { background: #c8c8c4; }
body.is-inverted .gh__cell-2 { background: #888884; }
body.is-inverted .gh__cell-3 { background: #4a4a47; }
body.is-inverted .gh__cell-4 { background: var(--fg); }
.gh__legend {
  display: flex; align-items: center; gap: 4px;
  margin-top: 12px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .15em;
  color: var(--mute);
}
.gh__legend .gh__cell { width: 12px; height: 12px; opacity: 1; }
.gh__skel { display: block; height: 16px; background: var(--line); animation: skel 1.4s ease-in-out infinite; }
@keyframes skel { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

@media (max-width: 900px) {
  .gh__split { grid-template-columns: 1fr; }
}
/* ====== project modal ====== */
.pmodal {
  position: fixed; inset: 0;
  z-index: 110;
  pointer-events: none;
}
.pmodal__bg {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0);
  backdrop-filter: blur(0px);
  transition: background .4s ease, backdrop-filter .4s ease;
}
.pmodal__panel {
  position: absolute;
  left: 0; right: 0; bottom: 0; top: 0;
  background: var(--bg);
  border-top: 1px solid var(--line);
  transform: translateY(100%);
  transition: transform .65s cubic-bezier(.7,0,.3,1);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.pmodal.is-open { pointer-events: auto; }
.pmodal.is-open .pmodal__bg { background: rgba(0,0,0,.55); backdrop-filter: blur(8px); }
.pmodal.is-open .pmodal__panel { transform: translateY(0); }
body.is-inverted .pmodal.is-open .pmodal__bg { background: rgba(255,255,255,.6); }

.pmodal__chrome {
  position: sticky; top: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 36px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  z-index: 2;
}
.pmodal__close {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .18em;
  background: var(--bg);
  transition: background .25s ease, color .25s ease;
}
.pmodal__close:hover { background: var(--fg); color: var(--bg); }
.pmodal__esc {
  font-size: 9px;
  padding: 3px 6px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  margin-left: 4px;
  opacity: .6;
}
.pmodal__breadcrumb {
  display: flex; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em; color: var(--mute);
}

.pmodal__scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.pmodal__inner {
  padding: 80px 56px 96px;
  max-width: 1200px;
  display: flex; flex-direction: column; gap: 64px;
}

.pmodal__hero { display: flex; flex-direction: column; gap: 24px; }
.pmodal__meta {
  display: flex; justify-content: space-between; gap: 16px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em; color: var(--mute);
  padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.pmodal__title {
  font-size: clamp(36px, 6vw, 88px);
  font-weight: 500; letter-spacing: -0.045em;
  line-height: 1;
  text-wrap: balance;
}
.pmodal__title em { font-style: italic; font-family: "Instrument Serif", serif; font-weight: 400; }
.pmodal__tagline {
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.4;
  color: var(--mute);
  max-width: 800px;
  text-wrap: pretty;
}
.pmodal__tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 4px;
}
.pmodal__tag {
  padding: 6px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .15em; color: var(--fg);
}
.pmodal__cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.pmodal__cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border: 1px solid var(--fg);
  border-radius: 999px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .18em;
  background: transparent;
  transition: background .25s ease, color .25s ease;
}
.pmodal__cta:hover { background: var(--fg); color: var(--bg); }
.pmodal__cta svg { width: 14px; height: 14px; transition: transform .2s ease; }
.pmodal__cta:hover svg { transform: translate(3px, -3px); }
.pmodal__cta--solid { background: var(--fg); color: var(--bg); }
.pmodal__cta--solid:hover { background: transparent; color: var(--fg); }

.pmodal__glyph {
  width: 100%;
  aspect-ratio: 16/6;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent);
  position: relative;
  overflow: hidden;
  display: grid; place-items: center;
}
.pmodal__glyph svg { width: 100%; height: 100%; padding: 28px; color: var(--fg); max-height: 280px; max-width: 540px; }

.pmodal__section { display: flex; flex-direction: column; gap: 24px; }
.pmodal__sechead {
  display: flex; align-items: center; gap: 16px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .25em; color: var(--mute);
  padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.pmodal__sechead span:first-child { color: var(--fg); font-weight: 500; }
.pmodal__p {
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.6;
  color: var(--fg);
  max-width: 780px;
  text-wrap: pretty;
}
.pmodal__p + .pmodal__p { color: var(--mute); }

.pmodal__features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.pmodal__feat {
  background: var(--bg);
  padding: 28px 24px;
  display: flex; flex-direction: column; gap: 6px;
}
.pmodal__feat-n { font-family: var(--font-mono); font-size: 10px; letter-spacing: .25em; color: var(--mute); margin-bottom: 8px; }
.pmodal__feat-t { font-size: 18px; font-weight: 500; letter-spacing: -0.015em; }
.pmodal__feat-d { font-family: var(--font-mono); font-size: 12px; line-height: 1.6; color: var(--mute); }

.pmodal__stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
}
.pmodal__stack-col {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.pmodal__stack-k {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .25em; color: var(--mute); margin-bottom: 12px;
}
.pmodal__stack-col ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.pmodal__stack-col li {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.4;
}
.pmodal__stack-col li::before { content: "— "; color: var(--mute); }

.pmodal__foot {
  display: flex; gap: 12px; flex-wrap: wrap;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.pmodal__foot .pmodal__cta svg { transform: none; }

/* arch step list */
.arch { display: flex; flex-direction: column; gap: 12px; }
.arch__title { font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em; color: var(--mute); margin-bottom: 4px; }
.arch__steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.arch__steps li { background: var(--bg); padding: 20px 18px; display: flex; gap: 14px; align-items: flex-start; }
.arch__n { font-family: var(--font-mono); font-size: 10px; letter-spacing: .25em; color: var(--mute); margin-top: 2px; }
.arch__l { font-size: 16px; font-weight: 500; letter-spacing: -0.015em; margin-bottom: 4px; }
.arch__d { font-family: var(--font-mono); font-size: 12px; color: var(--mute); line-height: 1.5; }

/* mermaid */
.mermaid-wrap {
  border: 1px solid var(--line);
  background: #0d0d0c;
  padding: 32px;
  overflow-x: auto;
  display: grid; place-items: center;
  min-height: 320px;
}
body.is-inverted .mermaid-wrap { background: #eeeeea; }
.mermaid-block { width: 100%; max-width: 1100px; }
.mermaid-block svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.mermaid-loading {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .15em; color: var(--mute);
  padding: 40px;
}

@media (max-width: 900px) {
  .pmodal__inner { padding: 56px 24px 64px; gap: 48px; }
  .pmodal__features { grid-template-columns: 1fr; }
  .pmodal__chrome { padding: 14px 20px; }
}
/* ====== theme toggle ====== */
.theme-btn {
  width: 30px; height: 30px;
  display: inline-grid; place-items: center;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--bg);
  color: var(--fg);
  transition: border-color .25s ease, transform .35s cubic-bezier(.2,.7,.2,1), background .25s ease;
  margin-right: 4px;
}
.theme-btn svg { display: block; transition: transform .55s cubic-bezier(.2,.7,.2,1); }
.theme-btn:hover { border-color: var(--fg); background: var(--fg); color: var(--bg); }
.theme-btn.is-on svg { transform: rotate(180deg); }
@media (max-width: 720px) {
  .theme-btn { width: 28px; height: 28px; }
}

/* ====== AOSP / Android feature section ====== */
.aosp {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  align-items: stretch;
}
.aosp__droid {
  position: relative;
  border: 1px solid var(--line);
  padding: 56px 40px;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(255,255,255,.025), transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 22px, rgba(128,128,128,.04) 22px 23px);
  min-height: 520px;
  overflow: hidden;
}
body.is-inverted .aosp__droid {
  background:
    radial-gradient(circle at 50% 30%, rgba(0,0,0,.04), transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 22px, rgba(0,0,0,.04) 22px 23px);
}
.aosp__droid-svg {
  width: 100%;
  max-width: 320px;
  height: auto;
  color: var(--fg);
  filter: drop-shadow(0 20px 40px rgba(0,0,0,.4));
  transition: transform .5s cubic-bezier(.2,.7,.2,1);
}
body.is-inverted .aosp__droid-svg { filter: drop-shadow(0 20px 40px rgba(0,0,0,.12)); }
.aosp__droid:hover .aosp__droid-svg { transform: translateY(-6px); }
.aosp__corner {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .22em;
  color: var(--mute);
  pointer-events: none;
}
.aosp__corner--tl { top: 20px; left: 24px; }
.aosp__corner--tr { top: 20px; right: 24px; }
.aosp__corner--bl { bottom: 20px; left: 24px; }
.aosp__corner--br { bottom: 20px; right: 24px; }

.aosp__panel {
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 28px;
  display: flex; flex-direction: column; gap: 18px;
}
.aosp__head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.aosp__status {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em;
  color: var(--fg);
}
.aosp__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--fg);
  position: relative;
}
.aosp__dot::after {
  content: ""; position: absolute; inset: -3px;
  border: 1px solid var(--fg); border-radius: 50%;
  animation: ping 1.8s ease-out infinite;
}
.aosp__cl {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em; color: var(--mute);
}
.aosp__h3 {
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 500; letter-spacing: -0.02em;
  line-height: 1.25;
}
.aosp__h3 em { font-style: italic; font-family: "Instrument Serif", serif; font-weight: 400; }
.aosp__path {
  font-family: var(--font-mono);
  font-size: .7em;
  color: var(--mute);
  letter-spacing: .04em;
  padding: 2px 8px;
  border: 1px dashed var(--line-2);
  border-radius: 4px;
  margin-left: 4px;
  white-space: nowrap;
}
.aosp__lead {
  font-family: var(--font-mono); font-size: 12px; line-height: 1.7; color: var(--mute);
}
.aosp__lead b { color: var(--fg); font-weight: 400; }
.aosp__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.aosp__meta > div {
  background: var(--bg);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.aosp__meta dt {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .25em; color: var(--mute);
}
.aosp__meta dd {
  font-family: var(--font-mono); font-size: 12px; color: var(--fg);
}
.aosp__status--pending { color: var(--fg); }
.aosp__status--pending .aosp__dot { background: #d4a056; }
.aosp__status--pending .aosp__dot::after { border-color: #d4a056; }
body.is-inverted .aosp__status--pending .aosp__dot { background: #8a6624; }
body.is-inverted .aosp__status--pending .aosp__dot::after { border-color: #8a6624; }

.aosp__commit {
  border: 1px solid var(--line-2);
  background: #0d0d0c;
  overflow: hidden;
}
body.is-inverted .aosp__commit { background: #f0f0ec; }
.aosp__commit-bar {
  display: flex; justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line-2);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em; color: var(--mute);
}
.aosp__commit-sha { color: var(--fg); }
.aosp__commit pre {
  padding: 18px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--fg);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}
.aosp__commit pre code { color: inherit; }
.aosp__h3 code {
  font-family: var(--font-mono);
  font-size: .85em;
  color: var(--fg);
  background: rgba(128,128,128,.08);
  padding: 1px 5px;
  border-radius: 3px;
}
.aosp__lead code {
  font-family: var(--font-mono);
  font-size: .92em;
  background: rgba(128,128,128,.08);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--fg);
}

.aosp__cta-row { display: flex; gap: 10px; flex-wrap: wrap; }
.aosp__cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px;
  border: 1px solid var(--fg);
  border-radius: 999px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .18em;
  background: var(--fg); color: var(--bg);
  transition: background .25s ease, color .25s ease;
}
.aosp__cta:hover { background: transparent; color: var(--fg); }
.aosp__cta svg { width: 13px; height: 13px; transition: transform .2s ease; }
.aosp__cta:hover svg { transform: translate(3px, -3px); }
.aosp__cta--ghost { background: transparent; color: var(--fg); }
.aosp__cta--ghost:hover { background: var(--fg); color: var(--bg); }

.aosp__rail {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 12px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .22em; color: var(--mute);
}
.aosp__rail span:not(:nth-child(2n)) { color: var(--fg); }

@media (max-width: 1024px) {
  .aosp { grid-template-columns: 1fr; }
  .aosp__droid { min-height: 420px; }
}
@media (max-width: 720px) {
  .aosp__droid { padding: 40px 20px; min-height: 360px; }
  .aosp__corner { font-size: 9px; }
  .aosp__corner--tl, .aosp__corner--bl { left: 16px; }
  .aosp__corner--tr, .aosp__corner--br { right: 16px; }
  .aosp__panel { padding: 22px; }
  .aosp__meta { grid-template-columns: 1fr; }
  .aosp__rail { font-size: 10px; gap: 8px; }
  .pmodal__chrome { padding: 14px 18px; }
  .pmodal__close { padding: 8px 14px; font-size: 10px; }
  .pmodal__esc { display: none; }
  .pmodal__breadcrumb { font-size: 10px; gap: 6px; }
  .pmodal__inner { padding: 40px 18px 56px; }
  .pmodal__glyph { aspect-ratio: 4/3; }
  .pmodal__title { font-size: 38px; }
  .pmodal__tagline { font-size: 16px; }
  .arch__steps { grid-template-columns: 1fr; }
  .mermaid-wrap { padding: 16px; }
}




