/* ------------------------------------------------------------------
   Tokens
   ------------------------------------------------------------------ */
:root {
  --black: #1d1a1a;          /* warm charcoal, sampled from the hero photo */
  --bg-rgb: 29 26 26;
  --snow: #ededeb;
  --granite: #8e8e8e;
  --ash: #3a3434;
  --signal: #e10600;
  --signal-hi: #ff2a1f;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --t-sm: 0.875rem;
  --t-base: 1.0625rem;
  --t-md: 1.375rem;
  --t-lg: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem);
  --t-xl: clamp(2.5rem, 1.6rem + 3.4vw, 4.5rem);
  --t-name: clamp(5rem, 2rem + 16vw, 16rem);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --pad: clamp(1.25rem, 0.6rem + 3vw, 4rem);
  --measure: 36rem;
  --header-h: 4.5rem;
}

/* ------------------------------------------------------------------
   Base
   ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  color-scheme: dark;
  background: var(--black);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (pointer: fine) { html { overscroll-behavior: none; } }

body {
  background: var(--black);
  color: var(--snow);
  font-family: var(--font);
  font-size: var(--t-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; touch-action: manipulation; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
[id] { scroll-margin-top: calc(var(--header-h) + 1rem); }

:focus-visible { outline: 2px solid var(--signal-hi); outline-offset: 4px; border-radius: 2px; }

.skip-link {
  position: fixed; left: var(--pad); top: 0.75rem; z-index: 60;
  background: var(--snow); color: var(--black);
  padding: 0.6rem 1rem; font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus-visible { transform: none; }

/* Matrix code rain behind the whole page */
#rain {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  opacity: 0.55; pointer-events: none;
}
.hero, main, .ticker, .site-footer { position: relative; z-index: 1; }

/* scroll progress */
.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 70; pointer-events: none; }
.progress span {
  display: block; height: 100%; background: var(--signal);
  transform: scaleX(0); transform-origin: left center;
  box-shadow: 0 0 10px rgb(225 6 0 / 0.8);
}

/* ------------------------------------------------------------------
   Header: fixed, turns solid after the hero
   ------------------------------------------------------------------ */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: calc(var(--header-h) + env(safe-area-inset-top));
  display: flex; align-items: center; gap: 2rem;
  padding: env(safe-area-inset-top) calc(var(--pad) + env(safe-area-inset-right)) 0 calc(var(--pad) + env(safe-area-inset-left));
  border-bottom: 1px solid transparent;
  transition: background-color 250ms ease, border-color 250ms ease;
}
.site-header.solid {
  background: rgb(var(--bg-rgb) / 0.82);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  border-bottom-color: var(--ash);
}
.wordmark { font-weight: 800; font-stretch: 62%; font-size: 1.6rem; line-height: 1; }
.site-header nav { display: flex; gap: clamp(1rem, 2.6vw, 2.25rem); margin-left: auto; }
.site-header nav a {
  position: relative;
  font-size: var(--t-sm); font-weight: 500; color: var(--granite);
  padding: 0.5rem 0;
  transition: color 150ms ease;
}
.site-header nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.2rem; height: 2px;
  background: var(--signal);
  transform: scaleX(0); transform-origin: left center;
  transition: transform 250ms var(--ease-out);
}
.site-header nav a.active { color: var(--snow); }
.site-header nav a.active::after { transform: scaleX(1); }

/* ------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------ */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 1.5rem;
  font-weight: 600; font-size: 1rem; letter-spacing: 0.005em;
  border: 1px solid transparent; user-select: none;
  transition: transform 160ms var(--ease-out), background-color 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 200ms ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--signal); color: #fff; }
.btn-quiet { border-color: #4a4a4a; color: var(--snow); background: rgb(var(--bg-rgb) / 0.45); }
.btn-small { min-height: 38px; padding: 0 1rem; font-size: var(--t-sm); border-color: #4a4a4a; }
/* sheen sweep on hover */
.btn::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgb(255 255 255 / 0.22) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 600ms var(--ease-out);
}

/* ------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------ */
.hero { height: 100svh; min-height: 640px; overflow: hidden; isolation: isolate; }
.hero { container-type: size; }
.hero-art {
  /* 2:1 wide art, scaled to COVER the whole screen (the photo stays centred) */
  position: absolute; z-index: -2; left: 50%; top: 50%;
  width: max(100cqw, 200cqh); height: max(100cqh, 50cqw);
  transform: translate(-50%, -50%);
  container-type: size;
  -webkit-mask-image: linear-gradient(to bottom, #000 84%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 84%, transparent 100%);
  animation: art-in 1100ms var(--ease-out) both;
}
/* live code rain: above the photo, under the name and the cut-out of him (never on his face/body) */
.hero-rain { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; mix-blend-mode: screen; opacity: 0.9; }
.hero-photo, .hero-cut {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  user-select: none; -webkit-user-drag: none;
}
.hero-word {
  position: absolute; left: 50%; bottom: 57.5cqh;     /* letters end just below the cap top (~38%) */
  transform: translateX(-50%);
  font-size: min(27cqh, 39vw);                          /* fits inside the feathered photo / the phone */ font-weight: 900; font-stretch: 62%;
  line-height: 0.8; letter-spacing: -0.01em; white-space: nowrap;
  color: var(--snow);
}
.hero-word .scr { color: var(--signal-hi); }
@keyframes art-in { from { opacity: 0; transform: translate(-50%, -50%) scale(1.04); } to { opacity: 1; transform: translate(-50%, -50%); } }

.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 48% 52% at 0% 100%, rgb(var(--bg-rgb) / 0.88) 0%, rgb(var(--bg-rgb) / 0.55) 55%, transparent 100%);
}
@media (max-aspect-ratio: 1/1) {
  .hero::after { background: linear-gradient(to top, rgb(var(--bg-rgb) / 0.85) 0%, rgb(var(--bg-rgb) / 0.35) 26%, transparent 44%); }
}

.hero-copy {
  position: absolute;
  left: calc(var(--pad) + env(safe-area-inset-left));
  bottom: calc(clamp(2rem, 6vh, 4.5rem) + env(safe-area-inset-bottom));
  max-width: 31rem;
}
.hero-name {
  font-size: var(--t-name); font-weight: 900; font-stretch: 62%;
  line-height: 0.82; letter-spacing: -0.01em; text-transform: uppercase; margin-bottom: 1.5rem;
}
.hero-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.lede { font-size: var(--t-lg); font-weight: 700; font-stretch: 75%; line-height: 1.1; }
.sub { margin-top: 0.75rem; color: #c4c4c2; max-width: 30rem; }
.terminal { margin-top: 1.25rem; font-family: var(--mono); font-size: var(--t-sm); color: var(--granite); min-height: 1.6em; }
.terminal .prompt { color: var(--signal-hi); }
.caret {
  display: inline-block; width: 0.55em; height: 1.05em; vertical-align: -0.15em;
  background: var(--signal); margin-left: 2px; animation: caret 1s steps(1) infinite;
}
.caret.done { animation: caret 1s steps(1) 4 forwards; }
@keyframes caret { 50% { opacity: 0; } }
.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

.enter { animation: rise 700ms var(--ease-out) both; animation-delay: var(--d, 0ms); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------
   Ticker (kinetic type band)
   ------------------------------------------------------------------ */
.ticker {
  overflow: hidden; border-block: 1px solid var(--ash);
  background: rgb(var(--bg-rgb) / 0.75);
  padding: 1.1rem 0;
}
.ticker-track {
  display: flex; align-items: center; gap: clamp(2.5rem, 4vw, 4.5rem); width: max-content;
  font-size: clamp(1.4rem, 1rem + 1.6vw, 2.4rem); font-weight: 700; font-stretch: 100%;
  letter-spacing: -0.01em; line-height: 1; white-space: nowrap;
  animation: ticker 42s linear infinite;
}
.ticker-track .tk { display: inline-flex; align-items: center; gap: 0.5em; color: var(--snow); }
.ticker-track svg { width: 1.15em; height: 1.15em; flex: none; }
/* official wordmarks: sized by height so each logo keeps its own proportions */
.ticker-track .wm { height: 1.35em; width: auto; flex: none; display: block; }
.ticker-track .wm-ts { height: 1.05em; }
.ticker-track .wm-py { height: 1.6em; }
.ticker-track .wm-node { height: 1.35em; }
.ticker-track .wm-blender { height: 1.45em; }
.ticker-track .wm-git { height: 1.3em; }
.ticker-track .wm-icon { height: 1.35em; width: auto; flex: none; }
.ticker-track .wm-tux { height: 1.5em; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ------------------------------------------------------------------
   Content blocks
   ------------------------------------------------------------------ */
.block {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) minmax(0, 3fr);
  gap: 1.5rem clamp(2rem, 6vw, 6rem);
  padding: clamp(4.5rem, 10vw, 9rem) calc(var(--pad) + env(safe-area-inset-right)) 0 calc(var(--pad) + env(safe-area-inset-left));
  max-width: 82rem; margin: 0 auto;
}
.block h2 {
  font-size: var(--t-md); font-weight: 700; font-stretch: 75%; line-height: 1.2;
  color: var(--granite); padding-top: 0.35rem; font-variant-ligatures: none;
}
.block h2::before { content: ""; display: inline-block; width: 0.5em; height: 2px; background: var(--signal); vertical-align: 0.35em; margin-right: 0.5em; }
.block-body { min-width: 0; position: relative; }

.statement {
  font-size: var(--t-xl); font-weight: 800; font-stretch: 62%;
  line-height: 1.02; letter-spacing: -0.01em; color: var(--snow);
  max-width: 18ch; margin-bottom: 2rem;
}
.prose p:not(.statement) { max-width: var(--measure); color: #c4c4c2; }
.prose p + p { margin-top: 1rem; }
.prose strong { color: var(--snow); font-weight: 700; }

/* timeline */
.timeline { list-style: none; position: relative; }
.timeline::before { content: ""; position: absolute; left: 0; top: 0.6rem; bottom: 0.6rem; width: 1px; background: var(--ash); }
.timeline li {
  position: relative; display: grid; grid-template-columns: minmax(8rem, 1fr) minmax(0, 3fr); gap: 0.5rem 2rem;
  padding: 0 0 2.75rem 2rem;
}
.timeline li::before {
  content: ""; position: absolute; left: -5px; top: 0.45rem; width: 11px; height: 11px;
  background: var(--black); border: 2px solid var(--signal); border-radius: 50%;
}
.timeline li:first-child::before { background: var(--signal); box-shadow: 0 0 12px rgb(225 6 0 / 0.8); }
.timeline .when { color: var(--granite); font-size: var(--t-sm); font-variant-numeric: tabular-nums; padding-top: 0.2rem; }
.timeline h3 { font-size: var(--t-lg); font-weight: 800; font-stretch: 62%; line-height: 1.05; }
.timeline .where { color: var(--signal-hi); font-weight: 600; margin: 0.25rem 0 0.5rem; }
.timeline p:not(.where) { color: #c4c4c2; max-width: var(--measure); }

/* work list */
.work { list-style: none; border-top: 1px solid var(--ash); }
.work-row {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
  gap: 0.5rem 2rem; align-items: baseline; padding: 1.6rem 0; border-bottom: 1px solid var(--ash);
}
.work-row::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--signal);
  transform: scaleX(0); transform-origin: left center; transition: transform 260ms var(--ease-out);
}
.work-row::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(225 6 0 / 0.12), transparent 60%);
  opacity: 0; transition: opacity 260ms ease; pointer-events: none;
}
.work-title { font-size: var(--t-lg); font-weight: 800; font-stretch: 62%; line-height: 1.05; overflow-wrap: anywhere; transition: transform 260ms var(--ease-out); }
.work-desc { color: var(--granite); max-width: 32rem; }
.work-year { color: var(--granite); font-variant-numeric: tabular-nums; font-size: var(--t-sm); }

/* tools */
.tools { display: grid; border-top: 1px solid var(--ash); }
.tools > div { display: grid; grid-template-columns: minmax(7rem, 1fr) minmax(0, 3fr); gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--ash); }
.tools dt { color: var(--granite); font-size: var(--t-sm); padding-top: 0.15rem; }
.tools dd { font-size: var(--t-md); font-weight: 500; font-stretch: 87.5%; line-height: 1.35; }

/* contact */
.contact { padding-bottom: clamp(4rem, 9vw, 8rem); }
.mail {
  display: inline-block; font-size: var(--t-xl); font-weight: 800; font-stretch: 62%; line-height: 1;
  overflow-wrap: anywhere; padding-bottom: 0.4rem;
  background-image: linear-gradient(var(--signal), var(--signal));
  background-size: 100% 3px; background-repeat: no-repeat; background-position: 0 100%;
  transition: color 150ms ease;
}
.socials { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; margin-top: 2.5rem; }
.socials a { color: var(--granite); padding: 0.5rem 0; display: inline-block; transition: color 150ms ease; }

.site-footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 2rem;
  padding: 2rem calc(var(--pad) + env(safe-area-inset-right)) calc(2rem + env(safe-area-inset-bottom)) calc(var(--pad) + env(safe-area-inset-left));
  border-top: 1px solid var(--ash); background: rgb(var(--bg-rgb) / 0.85);
  color: #6a6a6a; font-size: var(--t-sm);
}
.site-footer a { color: var(--granite); }

/* ------------------------------------------------------------------
   Connect: two hands made of live code characters
   ------------------------------------------------------------------ */
.connect {
  position: relative; height: 120svh; min-height: 680px;
  display: grid; grid-template-rows: 1fr auto;
  margin-top: clamp(4rem, 8vw, 7rem);
}
.connect-stage {
  position: sticky; top: 0; height: 100svh; grid-row: 1 / -1; grid-column: 1;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 12%, #000 82%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 12%, #000 82%, transparent 100%);
}
.connect-stage canvas { display: block; width: 100%; height: 100%; }
/* quiet the page rain behind the hands so the forms read */
.connect-stage { background: radial-gradient(ellipse 70% 60% at 50% 42%, rgb(var(--bg-rgb) / 0.93), rgb(var(--bg-rgb) / 0.78) 70%, rgb(var(--bg-rgb) / 0.6)); }
.connect-copy {
  grid-row: 2; grid-column: 1; position: relative; z-index: 1;
  text-align: center; padding: 0 var(--pad) clamp(3rem, 8vh, 6rem);
}
.connect-title { font-size: var(--t-xl); font-weight: 800; font-stretch: 62%; line-height: 1; }
.connect-sub { margin: 1rem auto 0; max-width: 34rem; color: #c4c4c2; }
.connect-ai { margin: 0.9rem auto 0; max-width: 34rem; font-family: var(--mono); font-size: var(--t-sm); color: var(--snow); }
.connect-ai span { color: var(--signal-hi); }

/* ------------------------------------------------------------------
   One-time scroll entrances (JS adds .in)
   ------------------------------------------------------------------ */
.js .stagger > * { opacity: 0; transform: translateY(14px); }
.js .stagger.in > * {
  opacity: 1; transform: none;
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.js .reveal-mask { clip-path: inset(0 0 100% 0); transform: translateY(18px); }
.js .reveal-mask.in {
  clip-path: inset(0 0 0 0); transform: none;
  transition: clip-path 1000ms var(--ease-in-out), transform 1000ms var(--ease-out);
}

/* ------------------------------------------------------------------
   Hover: real pointers only
   ------------------------------------------------------------------ */
@media (hover: hover) and (pointer: fine) {
  .site-header nav a:hover { color: var(--snow); }
  .btn:hover::before { transform: translateX(120%); }
  .btn-primary:hover { background: var(--signal-hi); box-shadow: 0 0 28px rgb(225 6 0 / 0.45); }
  .btn-quiet:hover, .btn-small:hover { border-color: var(--snow); }
  .work-row:hover::before { transform: scaleX(1); }
  .work-row:hover::after { opacity: 1; }
  .work-row:hover .work-title { transform: translateX(10px); }
  .mail:hover { color: var(--signal-hi); }
  .socials a:hover, .site-footer a:hover { color: var(--snow); }
  .ticker:hover .ticker-track { animation-play-state: paused; }
}

/* ------------------------------------------------------------------
   Tablet mode on phones: tablet layout, scaled to the phone, larger text so it stays readable
   ------------------------------------------------------------------ */
.tablet-mode { font-size: 135%; }
.tablet-mode .hero { height: 1024px; min-height: 0; }          /* the tablet's 3:4 hero framing */
.tablet-mode .site-header nav { gap: 1.1rem; }
.tablet-mode .site-header .btn-small { padding: 0 0.75rem; }
.tablet-mode .block { grid-template-columns: 1fr; gap: 1.75rem; }      /* label above content: full width for text */
.tablet-mode .block h2 { padding-top: 0; }
.tablet-mode .work-row { grid-template-columns: minmax(0, 1fr) auto; }
.tablet-mode .work-desc { grid-column: 1 / -1; grid-row: 2; max-width: none; }

/* ------------------------------------------------------------------
   Small screens
   ------------------------------------------------------------------ */
@media (max-width: 760px) {
  :root { --header-h: 4rem; }
  .site-header nav { display: none; }
  .site-header .btn-small { margin-left: auto; }
  .block { grid-template-columns: 1fr; }
  .block h2 { padding-top: 0; }
  .work-row { grid-template-columns: minmax(0, 1fr) auto; }
  .work-desc { grid-column: 1 / -1; grid-row: 2; }
  .tools > div, .timeline li { grid-template-columns: 1fr; gap: 0.15rem; }
  .hero-copy { right: var(--pad); }
  .sub { display: none; }                    /* keeps the hero text below the face */
}

/* ------------------------------------------------------------------
   Reduced motion: keep opacity, drop movement and loops
   ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .enter { animation: fade 300ms ease both; animation-delay: 0ms; }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
  .hero-art { animation: fade 300ms ease both; }
  .caret, .caret.done, .ticker-track{ animation: none; }
  .js .stagger > *, .js .reveal-mask { transform: none; clip-path: none; }
  .js .stagger.in > * { transition: opacity 300ms ease; transition-delay: 0ms; }
  .btn::before { display: none; }
}

/* Phones: photo covers the whole hero (original), smaller name */
@media (max-width: 760px) {
  .hero-word { font-size: min(20cqh, 27vw); }
}

/* ------------------------------------------------------------------
   Research: publication showcase (each card opens its DOI)
   ------------------------------------------------------------------ */
.research { padding: clamp(4rem, 9vw, 8rem) var(--pad) 0; max-width: 84rem; margin: 0 auto; }
.research-term { font-family: var(--mono); margin-bottom: clamp(2rem, 5vw, 3.2rem); max-width: 50rem; }
.rt-line { margin: 0; font: inherit; white-space: pre-wrap; word-break: break-word; }
.rt-title { font-size: clamp(2.6rem, 1.4rem + 5vw, 5.5rem); font-weight: 400; letter-spacing: -.03em; line-height: 1; color: var(--snow); min-height: 1em; }
.rt-lede { margin-top: 1.1rem; font-size: clamp(1rem, .9rem + .5vw, 1.3rem); line-height: 1.55; color: #c4c4c2; min-height: 1.55em; }
.rt-note { margin-top: .9rem; font-size: var(--t-sm); line-height: 1.6; color: var(--granite); min-height: 1.6em; }
.rt-hi { color: var(--signal-hi); }
.rt-caret { display: inline-block; width: .55em; height: 1.05em; vertical-align: -.18em; margin-left: .3em; background: var(--signal); animation: caret 1s steps(1) infinite; }
.js .research-term:not(.typed) .rt-line { visibility: hidden; }

.papers { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: 1rem; }
.paper {
  position: relative; display: flex; flex-direction: column; gap: .8rem; height: 100%;
  padding: 1.4rem 1.4rem 1.2rem; color: inherit; text-decoration: none;
  background: linear-gradient(180deg, #272323, #201d1d);
  border: 1px solid rgb(255 255 255 / .1);
  transition: border-color .25s, transform .35s var(--ease-out), background .25s;
}
.paper::before { content: ""; position: absolute; left: -1px; top: -1px; height: 2px; width: 0; background: var(--signal); transition: width .45s var(--ease-out); }
.paper:hover, .paper:focus-visible { border-color: rgb(255 26 13 / .55); transform: translateY(-4px); background: linear-gradient(180deg, rgb(255 26 13 / .08), rgb(255 255 255 / .015)); }
.paper:hover::before, .paper:focus-visible::before { width: calc(100% + 2px); }
.paper--lead { border-color: rgb(255 26 13 / .35); }
.paper--lead::before { width: calc(100% + 2px); }

.paper-top { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.paper-pub { padding: .22rem .5rem; border: 1px solid rgb(255 255 255 / .22); color: var(--snow); }
.paper-pub--ieee { background: #00629b; border-color: #00629b; }
.paper-pub--elsevier { background: #e9711c; border-color: #e9711c; color: #1d1a1a; }
.paper-pub--iet { background: #5b2c83; border-color: #5b2c83; }
.paper-year { color: var(--granite); }
.paper-first { margin-left: auto; padding: .22rem .5rem; background: var(--signal); color: #fff; font-weight: 700; }
.paper-title { font-size: 1.12rem; font-weight: 700; line-height: 1.25; color: var(--snow); }
.paper-venue { font-size: .88rem; color: var(--granite); line-height: 1.4; }
.paper-foot { margin-top: auto; padding-top: .9rem; border-top: 1px solid rgb(255 255 255 / .08); display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1rem; }
.paper-metric { font-family: var(--mono); font-size: .78rem; color: var(--granite); }
.paper-metric b { font-family: inherit; font-size: 1.35rem; font-weight: 700; color: var(--signal-hi); margin-right: .25rem; }
.paper-metric--tag { color: #c4c4c2; }
.paper-doi { font-family: var(--mono); font-size: .72rem; color: var(--granite); word-break: break-all; }
.paper:hover .paper-doi { color: var(--snow); text-decoration: underline; text-underline-offset: 3px; }
.paper-arrow { margin-left: auto; color: var(--signal-hi); transition: transform .3s var(--ease-out); }
.paper:hover .paper-arrow { transform: translate(3px, -3px); }

.paper, .paper-title, .paper-venue { font-family: var(--mono); }
.paper-title { font-size: .98rem; line-height: 1.4; }
.paper-venue { font-size: .8rem; }
.research-all { display: inline-flex; gap: .5rem; margin-top: 1.6rem; font-family: var(--mono); font-size: var(--t-sm); color: var(--snow); text-decoration: none; border-bottom: 1px solid var(--signal); padding-bottom: .2rem; }
.research-all:hover { color: var(--signal-hi); }

@media (max-width: 760px) {
  .paper { padding: 1.2rem 1.1rem 1rem; }
}

/* paper cards: two actions (DOI + download) */
.paper:hover { transform: translateY(-3px); }
.paper-title { margin: 0; font-weight: 700; }
.paper-mid { margin-top: auto; padding-top: .9rem; border-top: 1px solid rgb(255 255 255 / .08); display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; }
.paper-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.paper-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.6rem; padding: 0 .8rem;
  font-family: var(--mono); font-size: .78rem; letter-spacing: .03em; text-decoration: none; color: var(--snow);
  border: 1px solid rgb(255 255 255 / .2); transition: background .2s, border-color .2s, color .2s;
}
.paper-btn:hover, .paper-btn:focus-visible { border-color: var(--snow); background: rgb(255 255 255 / .06); }
.paper-btn--dl { background: var(--signal); border-color: var(--signal); color: #fff; }
.paper-btn--dl:hover, .paper-btn--dl:focus-visible { background: var(--signal-hi); border-color: var(--signal-hi); }
.paper-btn--off { color: var(--granite); border-style: dashed; cursor: default; }
.paper-pub--accepted { background: transparent; border-color: var(--signal-hi); color: var(--signal-hi); }
.papers-sub { margin: clamp(2.5rem, 6vw, 4rem) 0 1.2rem; font-family: var(--mono); font-size: var(--t-sm); font-weight: 400; letter-spacing: .06em; text-transform: uppercase; color: var(--granite); }
.paper--accepted { border-style: dashed; }

/* About headline: rotating word */
.rotator { color: var(--signal-hi); white-space: nowrap; }
.rotator-caret { display: inline-block; width: .08em; height: .9em; margin-left: .04em; vertical-align: -.08em; background: var(--signal-hi); animation: caret 1s steps(1) infinite; }

/* About: justified body text */
#about .prose p:not(.statement) { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }

/* ------------------------------------------------------------------
   Work showcase: project cards with live animated visuals
   ------------------------------------------------------------------ */
.showcase { display: grid; gap: clamp(1.25rem, 3vw, 2rem); }
.proj {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: stretch;
  border: 1px solid rgb(255 255 255 / .1);
  background: linear-gradient(180deg, #262222, #201d1d);
  transition: border-color .3s;
}
.proj:hover { border-color: rgb(255 26 13 / .45); }
.proj-vis { position: relative; min-height: 15rem; background: #141212; border-right: 1px solid rgb(255 255 255 / .08); overflow: hidden; }
.proj-vis canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.proj-info { padding: clamp(1.2rem, 2.5vw, 1.8rem); display: flex; flex-direction: column; gap: .8rem; }
.proj-meta { display: flex; align-items: center; gap: .7rem; font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--granite); }
.proj-badge { padding: .22rem .5rem; border: 1px solid rgb(255 255 255 / .25); color: var(--snow); }
.proj-badge--soon { background: var(--signal); border-color: var(--signal); color: #fff; font-weight: 700; }
.proj-title { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem); font-weight: 800; font-stretch: 62%; line-height: 1; text-transform: uppercase; }
.proj-desc { color: #c4c4c2; line-height: 1.55; }
.proj-tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.proj-tags li { font-family: var(--mono); font-size: .72rem; padding: .2rem .5rem; background: rgb(255 255 255 / .06); color: #c4c4c2; }
.proj-note { margin-top: auto; font-family: var(--mono); font-size: .78rem; color: var(--signal-hi); }
.proj-link { margin-top: auto; align-self: flex-start; font-family: var(--mono); font-size: .8rem; color: var(--snow); text-decoration: none; border-bottom: 1px solid var(--signal); padding-bottom: .15rem; }
.proj-link:hover { color: var(--signal-hi); }
.proj-more { margin-top: clamp(1.5rem, 4vw, 2.5rem); }
@media (max-width: 900px) {
  .proj { grid-template-columns: 1fr; }
  .proj-vis { min-height: 0; aspect-ratio: 16 / 10; border-right: 0; border-bottom: 1px solid rgb(255 255 255 / .08); }
}

/* Freyr: real chart + HUD */
.proj-vis--chart { background: #0f0d0d; }
.fx-chart { position: absolute; inset: 0; }
.fx-head, .fx-agent, .fx-pos { position: absolute; z-index: 2; font-family: var(--mono); pointer-events: none; }
.fx-head { top: 10px; left: 12px; right: 70px; display: flex; flex-wrap: wrap; align-items: baseline; gap: .55rem; font-size: .72rem; color: var(--granite); }
.fx-pair { color: var(--snow); font-weight: 700; font-size: .8rem; }
.fx-tf { padding: .05rem .35rem; background: rgb(255 255 255 / .08); color: var(--snow); }
.fx-price { font-weight: 700; font-size: .8rem; }
.fx-agent { left: 12px; top: 34px; display: flex; align-items: center; gap: .45rem; font-size: .68rem; color: var(--granite); }
.fx-agent i { width: 6px; height: 6px; border-radius: 50%; background: var(--signal-hi); animation: caret 1s steps(1) infinite; }
.fx-agent span { color: var(--snow); font-weight: 700; letter-spacing: .06em; }
.fx-agent b { font-weight: 400; color: #c4c4c2; }
.fx-pos { left: 12px; top: 54px; padding: .25rem .5rem; background: rgb(15 13 13 / .85); border: 1px solid rgb(255 255 255 / .1); font-size: .68rem; color: #c4c4c2; }
.fx-pos b { font-weight: 700; margin-left: .3rem; }

/* Backbencher: full-width two-screen scene */
.proj--wide { grid-template-columns: 1fr; }
.proj--wide .proj-vis { min-height: 0; aspect-ratio: 2.15 / 1; border-right: 0; border-bottom: 1px solid rgb(255 255 255 / .08); }
.proj--wide .proj-info { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); column-gap: 2rem; row-gap: .8rem; align-items: start; }
.proj--wide .proj-meta, .proj--wide .proj-title { grid-column: 1; }
.proj--wide .proj-desc { grid-column: 2; grid-row: 1 / span 2; }
.proj--wide .proj-tags { grid-column: 1; }
.proj--wide .proj-link { grid-column: 2; margin-top: 0; }
@media (max-width: 900px) {
  .proj--wide .proj-info { display: flex; }
  .proj--wide .proj-vis { aspect-ratio: 3 / 4; }
}

.proj-vis--coar { background: #0f0d0d; min-height: 19rem; }
@media (max-width: 900px) { .proj-vis--coar { aspect-ratio: 1 / 1; } }

/* project detail points */
.proj-points { list-style: none; padding: 0; display: grid; gap: .45rem; }
.proj-points li { position: relative; padding-left: 1.1rem; color: #c4c4c2; font-size: .92rem; line-height: 1.5; }
.proj-points li::before { content: ""; position: absolute; left: 0; top: .62em; width: .45rem; height: 2px; background: var(--signal); }
.proj-points strong { color: var(--snow); }
.proj--wide .proj-points { grid-column: 2; }
.proj--wide .proj-desc { grid-row: 1 / span 2; }
.proj--wide .proj-desc { grid-column: 2; grid-row: 1 / span 2; }
.proj--wide .proj-points { grid-column: 2; grid-row: 3 / span 2; }
.proj--wide .proj-tags { grid-column: 1; grid-row: 3; align-self: start; }
.proj--wide .proj-link { grid-column: 2; grid-row: 5; }
/* all project cards: wide visual on top */
.proj--wide .proj-vis--chart { aspect-ratio: 2.4 / 1; }
.proj--wide .proj-vis--coar { aspect-ratio: 2.4 / 1; min-height: 0; }
.proj--wide .proj-note { grid-column: 1; grid-row: 4; margin-top: 0; align-self: start; }
@media (max-width: 900px) {
  .proj--wide .proj-vis--chart { aspect-ratio: 4 / 3; }
  .proj--wide .proj-vis--coar { aspect-ratio: 1 / 1; }
}
/* keep the left column (badge, title, tags, note) packed at the top */
.proj--wide .proj-info { grid-template-rows: auto auto auto auto 1fr; }
.proj--wide .proj-desc { grid-column: 2; grid-row: 1 / span 5; }
.proj--wide .proj-points { grid-column: 2; grid-row: 6; }
.proj--wide .proj-link { grid-column: 2; grid-row: 7; }
.proj--wide .proj-meta { grid-row: 1; } .proj--wide .proj-title { grid-row: 2; }
.proj--wide .proj-tags { grid-row: 3; } .proj--wide .proj-note { grid-row: 4; }

/* project info: two clean columns */
.proj--wide .proj-info { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); grid-template-rows: none; column-gap: 2.2rem; }
.proj-side, .proj-main { display: flex; flex-direction: column; gap: .8rem; min-width: 0; }
.proj--wide .proj-side > *, .proj--wide .proj-main > * { grid-column: auto; grid-row: auto; }
.proj-side .proj-note { margin-top: .2rem; }
.proj-main .proj-link { margin-top: .4rem; }
@media (max-width: 900px) { .proj--wide .proj-info { display: flex; flex-direction: column; gap: .8rem; } }

/* ------------------------------------------------------------------
   Desktop width: use the screen instead of a narrow centred column
   ------------------------------------------------------------------ */
:root { --measure: 48rem; }
.block { max-width: 112rem; grid-template-columns: minmax(8rem, 0.55fr) minmax(0, 3fr); }
.research { max-width: 112rem; padding-left: calc(var(--pad) + env(safe-area-inset-left)); padding-right: calc(var(--pad) + env(safe-area-inset-right)); }
.research-term { max-width: 64rem; }
.work-desc { max-width: 48rem; }
/* Work: heading on top, showcase full width */
#work.block { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1200px) {
  .proj--wide .proj-vis--chart, .proj--wide .proj-vis--coar { aspect-ratio: 2.8 / 1; }
  .proj--wide .proj-vis { aspect-ratio: 2.5 / 1; }
  .papers { grid-template-columns: repeat(auto-fill, minmax(24rem, 1fr)); }
}
/* desktop: tight date column, longer lines on big screens */
@media (min-width: 761px) { .timeline li { grid-template-columns: 9rem minmax(0, 1fr); } }
@media (min-width: 1500px) { :root { --measure: 62rem; } .statement { max-width: 24ch; } }

.proj-note--free { color: #0ecb81; margin-top: 0; }

/* ------------------------------------------------------------------
   Work: editorial feature rows (replaces the boxed cards)
   ------------------------------------------------------------------ */
.showcase { display: block; }
.feat {
  display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr); align-items: center;
  gap: clamp(2rem, 5vw, 5.5rem);
  padding: clamp(2.5rem, 5vw, 4.5rem) 0;
  border-top: 1px solid rgb(255 255 255 / .1);
}
.feat:last-child { border-bottom: 1px solid rgb(255 255 255 / .1); }
.feat:nth-child(even) .feat-vis { order: -1; }

.feat-num { display: flex; align-items: center; gap: .9rem; font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--granite); margin-bottom: 1.1rem; }
.feat-num span:first-child { color: var(--signal-hi); font-size: .8rem; }
.feat-status { color: var(--signal-hi); border-left: 1px solid rgb(255 255 255 / .2); padding-left: .9rem; }
.feat-title { font-size: clamp(2.6rem, 1.6rem + 3.2vw, 4.6rem); font-weight: 900; font-stretch: 62%; line-height: .88; letter-spacing: -.01em; text-transform: uppercase; color: var(--snow); }
.feat-sub { margin-top: .9rem; font-family: var(--mono); font-size: .78rem; color: var(--granite); }
.feat-sub--free { color: #0ecb81; }
.feat-desc { margin-top: 1.4rem; max-width: 38rem; color: #c4c4c2; font-size: 1.02rem; line-height: 1.65; }
.feat-points { list-style: none; padding: 0; margin-top: 1.6rem; max-width: 38rem; counter-reset: pt; }
.feat-points li {
  counter-increment: pt; display: grid; grid-template-columns: 2.2rem minmax(0, 1fr);
  padding: .7rem 0; border-top: 1px solid rgb(255 255 255 / .07); font-size: .9rem; line-height: 1.55; color: #b9b8b6;
}
.feat-points li::before { content: counter(pt, decimal-leading-zero); font-family: var(--mono); font-size: .7rem; color: var(--granite); padding-top: .15rem; }
.feat-points strong { color: var(--snow); font-weight: 600; }
.feat-stack { margin-top: 1.4rem; font-family: var(--mono); font-size: .74rem; letter-spacing: .02em; color: var(--granite); }
.feat-link { display: inline-flex; gap: .5rem; margin-top: 1.4rem; font-family: var(--mono); font-size: .8rem; color: var(--snow); text-decoration: none; padding-bottom: .25rem; background: linear-gradient(var(--signal), var(--signal)) left bottom / 100% 1px no-repeat; transition: background-size .4s var(--ease-out), color .2s; }
.feat-link:hover { color: var(--signal-hi); background-size: 0 1px; }

/* framed visual, smaller than before */
.feat .feat-vis {
  position: relative; margin: 0; width: 100%; max-width: 44rem; justify-self: center;
  aspect-ratio: 16 / 10 !important; min-height: 0 !important;
  background: #0f0d0d; border: 1px solid rgb(255 255 255 / .09); border-radius: 12px; overflow: hidden;
  box-shadow: 0 50px 90px -40px rgb(0 0 0 / .9), 0 0 0 1px rgb(0 0 0 / .4);
}
.feat .feat-vis canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

@media (max-width: 900px) {
  .feat { grid-template-columns: 1fr; gap: 1.6rem; }
  .feat .feat-vis { order: -1; }
  .feat .proj-vis--coar { aspect-ratio: 1 / 1 !important; }
  .feat .feat-vis:has(canvas[data-anim="copilot"]) { aspect-ratio: 3 / 4 !important; }
  .feat .proj-vis--chart { aspect-ratio: 4 / 3 !important; }
}

/* Lenis smooth scroll */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
.feat-points li { display: block; position: relative; padding-left: 2.2rem; }
.feat-points li::before { position: absolute; left: 0; top: .85rem; }

/* phones: single column again (the desktop width rules must not apply here) */
@media (max-width: 760px) {
  .block { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .block h2 { padding-top: 0; }
  .timeline li { grid-template-columns: minmax(0, 1fr); gap: .2rem; padding-left: 1.4rem; }
  #about .prose p:not(.statement) { text-align: left; hyphens: manual; }
}

/* About headline: fixed-width slot so swapping words never reflows the text */
.rotator { display: inline-block; position: relative; vertical-align: bottom; overflow: hidden; white-space: nowrap; text-align: left; }
.rotator-word { display: inline-block; transition: transform .55s var(--ease-out), opacity .45s ease; }
.rotator-word.out { transform: translateY(-60%); opacity: 0; }
.rotator-word.in { transform: translateY(60%); opacity: 0; transition: none; }
.rotator-caret { display: none; }
/* changing word sits on its own line: no gap, no reflow */
.rotator { display: block; width: auto !important; height: 1.02em; }
.statement:has(.rotator) { max-width: none; }
/* typing caret: solid (no blink), word on a fixed line */
.rotator-word { transition: none; transform: none; opacity: 1; }
.rotator-type-caret { display: inline-block; width: .07em; height: .82em; margin-left: .06em; vertical-align: -.02em; background: var(--signal-hi); }
/* About: justified on every screen size (hyphenation keeps phone spacing even) */
#about .prose p:not(.statement) { text-align: justify !important; hyphens: auto !important; -webkit-hyphens: auto !important; text-justify: inter-word; }
.wordmark { white-space: nowrap; }
@media (max-width: 760px) { .wordmark { font-size: 1.25rem; } }
@media (max-width: 380px) { .wordmark { font-size: 1.05rem; } }
/* phones: shorter visuals */
@media (max-width: 900px) {
  .feat .proj-vis--chart { aspect-ratio: 16 / 11 !important; }
  .feat .proj-vis--coar { aspect-ratio: 4 / 3.3 !important; }
  .feat .feat-vis:has(canvas[data-anim="copilot"]) { aspect-ratio: 1 / 1 !important; }
}

/* project visuals: translucent so the background matrix rain shows through */
.feat .feat-vis, .feat .proj-vis--chart, .feat .proj-vis--coar {
  background: rgb(15 13 13 / .38) !important;
  border-color: rgb(255 255 255 / .12);
  box-shadow: 0 40px 80px -45px rgb(0 0 0 / .7);
}
.feat .feat-vis > * { opacity: .86; }
.feat .fx-pos { background: rgb(15 13 13 / .6); }

/* ------------------------------------------------------------------
   Research: success-story paper cards (reference style)
   ------------------------------------------------------------------ */
.stories {
  --ink: #191919; --white: #fff; --line: #e3e3e3; --line-2: #cfcfcf; --muted: #6b6b6b;
  --ok: #16a34a; --ok-bg: #e8f6ec; --f-btn: "Geist", system-ui, sans-serif;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
  font-family: "Geist", system-ui, sans-serif;
}
@media (max-width: 1100px) { .stories { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .stories { grid-template-columns: minmax(0, 1fr); } }

.story { display: flex; flex-direction: column; gap: 16px; padding: 18px; background: var(--white); color: var(--ink); border: 1px solid #e3e3e3; box-shadow: 0 14px 30px -22px rgba(0,0,0,.35); transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s; min-width: 0; }
.story:hover { transform: translateY(-4px); box-shadow: 0 22px 40px -24px rgba(0,0,0,.4); }
.story-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.story-pub { font-weight: 700; font-size: 15px; letter-spacing: -0.02em; color: var(--ink); }
.story-q { display: inline-block; margin-left: 6px; padding: 2px 7px; font-size: 12px; font-weight: 600; background: var(--ok-bg); color: #14532d; border: 1px solid #b7e4c4; vertical-align: 1px; }
.story-date { font-size: 12px; padding: 3px 8px; background: var(--ink); color: #fff; white-space: nowrap; }
.story-t { font-size: 17px; line-height: 1.3; letter-spacing: -0.03em; font-weight: 400; flex: 1; color: var(--ink); font-stretch: normal; text-transform: none; }
.story-v { font-size: 13px; color: var(--muted); margin-top: -8px; }
.story-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.story-ok { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: #14532d; }
.story-ok--acc { color: #92400e; }
.story-ok--acc .tick { background: #d97706; }
.story-btns { display: inline-flex; gap: 8px; }

.stories .tick { width: 14px; height: 14px; border-radius: 50%; background: var(--ok); display: inline-grid; place-items: center; flex: none; }
.stories .tick::after { content: ""; width: 6px; height: 3px; border: solid #fff; border-width: 0 0 1.5px 1.5px; transform: translateY(-1px) rotate(-45deg); }

.stories .btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; font: 400 15px/1 var(--f-btn); letter-spacing: -0.04em; cursor: pointer; border: 0; white-space: nowrap; text-decoration: none; min-width: 0; transition: background .25s ease, color .25s ease, box-shadow .25s ease; }
.stories .btn::before { display: none; }
.stories .btn svg { width: 12px; height: 12px; transition: transform .3s ease; }
.stories .btn:hover svg { transform: translate(2px, -2px); }
.stories .btn-dark { background: var(--ink); color: var(--white); }
.stories .btn-dark:hover { background: #000; }
.stories .btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.stories .btn-line:hover { background: #f3f3f3; }
.stories .btn-line:hover svg { transform: translateY(2px); }

.fitbox { position: relative; width: 100%; overflow: hidden; }
.fit { transform-origin: 0 0; }
.pc-paper { border: 1px solid var(--line); background: #f6f6f6; }
.pc-paper .fit { position: relative; overflow: hidden; padding: 14px 16px 0; box-sizing: border-box; }
.pc-paper .fit::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 60px; background: linear-gradient(rgba(246,246,246,0), #f6f6f6); }
.ppr { margin: 0; padding: 20px 20px 14px; border: 1px solid var(--line); background: #fff; font-family: "Tinos", "Times New Roman", Times, serif; color: #1a1a1a; letter-spacing: 0; box-shadow: 0 10px 24px -18px rgba(0,0,0,.3); }
.ppr-j { display: flex; justify-content: space-between; font-size: 8px; letter-spacing: .04em; text-transform: uppercase; color: #666; border-bottom: .5px solid #bbb; padding-bottom: 5px; margin-bottom: 10px; }
.ppr-t { font-size: 17px; line-height: 1.2; text-align: center; font-weight: 400; max-width: 30ch; margin: 0 auto; }
.ppr-full { margin-top: 12px; padding: 0 6px; min-height: 116px; }
.ppr-abs { font-size: 9.5px; line-height: 1.4; text-align: justify; text-justify: inter-word; hyphens: auto; margin-bottom: 6px; color: #1a1a1a; }
.ppr-abs b { font-style: italic; font-weight: 700; }
.ppr-body { text-indent: 1em; }
.ppr-cols { margin-top: 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ppr-h { font-size: 9px; letter-spacing: .08em; text-transform: uppercase; text-align: center; margin: 8px 0 6px; }
.ppr-sk { display: grid; gap: 5px; }
.ppr-sk i { display: block; height: 4px; background: #e9e9e9; }
.ppr-fig { margin: 0; border: 1px solid #eee; padding: 6px; }
.ppr-fig svg { display: block; width: 100%; height: auto; }
.ppr-fig figcaption { font-size: 8.5px; text-align: center; margin-top: 3px; }
.ppr-foot { margin-top: 14px; padding-top: 6px; border-top: .5px solid #ddd; font-size: 8.5px; color: #666; text-align: center; }

/* ------------------------------------------------------------------
   Research flashcards: dark, translucent, flip on tap / swipe
   ------------------------------------------------------------------ */
.stories { --ink: #efeeec; --line: rgb(255 255 255 / .1); --line-2: rgb(255 255 255 / .28); --muted: #8e8e8e; --ok: #0ecb81; }
.fc { perspective: 1600px; cursor: pointer; outline: none; min-width: 0; -webkit-tap-highlight-color: transparent; touch-action: pan-y; }
.fc-inner { display: grid; height: 100%; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.fc.flipped .fc-inner { transform: rotateY(180deg); }
.fc-face {
  grid-area: 1 / 1; display: flex; flex-direction: column; gap: 14px; padding: 18px; min-width: 0;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  background: linear-gradient(180deg, rgb(38 34 34 / .9), rgb(26 23 23 / .9));
  border: 1px solid rgb(255 255 255 / .1); color: #efeeec;
  box-shadow: 0 30px 60px -40px rgb(0 0 0 / .9);
  transition: border-color .3s, box-shadow .3s;
}
.fc-back { transform: rotateY(180deg); }
.fc:hover .fc-face, .fc:focus-visible .fc-face { border-color: rgb(255 42 31 / .5); box-shadow: 0 30px 60px -38px rgb(255 26 13 / .35); }
.fc:hover .fc-front { transform: none; }

.fc .story-pub { color: #efeeec; }
.fc .story-date { background: rgb(255 255 255 / .08); color: #c4c4c2; border: 1px solid rgb(255 255 255 / .12); }
.fc .story-q { background: rgb(255 42 31 / .12); color: #ff6a5f; border-color: rgb(255 42 31 / .45); }
.fc .story-t { color: #efeeec; font-size: 16.5px; }
.fc .story-v { color: #8e8e8e; }
.fc-hint { margin-top: auto; font-family: var(--mono); font-size: 11px; letter-spacing: .02em; color: #8e8e8e; display: flex; gap: .45rem; align-items: center; }
.fc-hint span { color: var(--signal-hi); font-size: 13px; }

/* dark mini paper */
.fc .pc-paper { background: rgb(16 14 14 / .7); border-color: rgb(255 255 255 / .08); }
.fc .pc-paper .fit::after { background: linear-gradient(rgb(20 18 18 / 0), rgb(20 18 18 / .95)); }
.fc .ppr { background: #161313; border-color: rgb(255 255 255 / .08); color: #dcdad6; box-shadow: 0 14px 30px -20px rgb(0 0 0 / .9); }
.fc .ppr-j { color: #8e8e8e; border-bottom-color: rgb(255 255 255 / .14); }
.fc .ppr-abs { color: #cfcdc9; }
.fc .ppr-sk i { background: rgb(255 255 255 / .07); }
.fc .ppr-fig { border-color: rgb(255 255 255 / .08); }
.fc .ppr-fig figcaption, .fc .ppr-foot { color: #8e8e8e; }
.fc .ppr-foot { border-top-color: rgb(255 255 255 / .1); }
.ppr-sk--abs { margin-top: 2px; }

/* back face */
.fc-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--signal-hi); margin-bottom: -6px; }
.fc-abs { font-family: "Tinos", "Times New Roman", serif; font-size: 15.5px; line-height: 1.55; color: #dcdad6; text-align: justify; hyphens: auto; }
.fc-terms { font-family: var(--mono); font-size: 11.5px; line-height: 1.6; color: #a9a7a4; }
.fc-venue { margin-top: 0; font-size: 12.5px; }
.fc .story-ok { color: #4ade80; }
.fc .story-ok--acc { color: #fbbf24; }

/* buttons on dark */
.fc .btn-dark { background: var(--signal); color: #fff; }
.fc .btn-dark:hover { background: var(--signal-hi); }
.fc .btn-line { color: #efeeec; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .28); }
.fc .btn-line:hover { background: rgb(255 255 255 / .08); }
@media (prefers-reduced-motion: reduce) { .fc-inner { transition: none; } }
.fc-back .fc-venue { margin-top: auto; }
.fc-back .fc-hint { margin-top: 0; }

/* flashcards: grey + transparent so the matrix rain shows through */
.fc-face {
  background: linear-gradient(180deg, rgb(92 86 86 / .22), rgb(70 66 66 / .16));
  border-color: rgb(255 255 255 / .14);
  box-shadow: 0 30px 60px -45px rgb(0 0 0 / .6);
}
.fc .pc-paper { background: rgb(120 114 114 / .1); border-color: rgb(255 255 255 / .1); }
.fc .pc-paper .fit::after { background: linear-gradient(rgb(60 56 56 / 0), rgb(48 45 45 / .55)); }
.fc .ppr { background: rgb(58 54 54 / .45); border-color: rgb(255 255 255 / .12); box-shadow: 0 14px 30px -24px rgb(0 0 0 / .6); }
.fc .ppr-sk i { background: rgb(255 255 255 / .1); }
.fc .story-date { background: rgb(255 255 255 / .1); }

/* flashcards: smoked-glass charcoal with a faint red tint (site palette) */
.fc-face {
  background:
    linear-gradient(160deg, rgb(255 42 31 / .07) 0%, rgb(255 42 31 / 0) 38%),
    linear-gradient(180deg, rgb(24 20 20 / .62), rgb(16 13 13 / .7));
  border-color: rgb(255 255 255 / .1);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .05), 0 30px 60px -40px rgb(0 0 0 / .85);
}
.fc .pc-paper { background: rgb(10 8 8 / .45); border-color: rgb(255 255 255 / .07); }
.fc .pc-paper .fit::after { background: linear-gradient(rgb(14 11 11 / 0), rgb(14 11 11 / .85)); }
.fc .ppr { background: rgb(22 18 18 / .72); border-color: rgb(255 255 255 / .09); box-shadow: 0 14px 30px -22px rgb(0 0 0 / .8); }
.fc .ppr-sk i { background: rgb(255 255 255 / .07); }
.fc .story-date { background: rgb(255 255 255 / .06); border-color: rgb(255 255 255 / .1); }
.fc:hover .fc-face, .fc:focus-visible .fc-face { border-color: rgb(255 42 31 / .45); }

/* ------------------------------------------------------------------
   Research overview + highlighted "Download & read my papers" button
   ------------------------------------------------------------------ */
.rt-lede { max-width: 62rem; text-align: justify; hyphens: auto; }
.research-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem 2rem; margin: 2rem 0 clamp(3rem, 7vw, 5rem); }
.papers-btn {
  position: relative; display: inline-flex; align-items: center; gap: .9rem; isolation: isolate;
  padding: 1.05rem 1.6rem 1.05rem 1.8rem; border: 0; cursor: pointer;
  font-family: var(--mono); font-size: clamp(.9rem, .85rem + .2vw, 1.02rem); letter-spacing: .02em; color: #fff;
  background: var(--signal); box-shadow: 0 0 0 1px rgb(255 42 31 / .6), 0 18px 40px -14px rgb(255 26 13 / .7);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, background .25s;
}
.papers-btn:hover { background: var(--signal-hi); transform: translateY(-2px); box-shadow: 0 0 0 1px rgb(255 42 31 / .8), 0 24px 50px -14px rgb(255 26 13 / .85); }
.papers-btn:active { transform: translateY(0) scale(.98); }
.papers-btn-glow { position: absolute; inset: -6px; z-index: -1; border: 1px solid rgb(255 42 31 / .55); animation: btn-ring 2.2s ease-out infinite; pointer-events: none; }
@keyframes btn-ring { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.12, 1.35); } }
.papers-btn-arrow { transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.papers-btn:hover .papers-btn-arrow { transform: translateX(5px); }
.scholar-link { font-family: var(--mono); font-size: .85rem; color: var(--snow); text-decoration: none; border-bottom: 1px solid rgb(255 255 255 / .3); padding-bottom: .15rem; }
.scholar-link:hover { color: var(--signal-hi); border-color: var(--signal-hi); }
@media (prefers-reduced-motion: reduce) { .papers-btn-glow { animation: none; } }

/* terminal overlay */
.term-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem; background: rgb(10 8 8 / 0); transition: background .35s ease, opacity .35s ease; }
.term-overlay.on { background: rgb(10 8 8 / .78); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.term-overlay.leaving { opacity: 0; }
html.term-open { overflow: hidden; }
.term-win { width: min(44rem, 100%); background: #0f0d0d; border: 1px solid rgb(255 255 255 / .12); border-radius: 10px; overflow: hidden; box-shadow: 0 40px 100px -30px rgb(0 0 0 / .9), 0 0 0 1px rgb(255 42 31 / .15); transform: translateY(16px) scale(.97); opacity: 0; transition: transform .45s cubic-bezier(.2,.8,.2,1), opacity .35s ease; }
.term-overlay.on .term-win { transform: none; opacity: 1; }
.term-bar { display: flex; align-items: center; gap: .45rem; padding: .7rem 1rem; background: #1a1717; border-bottom: 1px solid rgb(255 255 255 / .07); font-family: var(--mono); font-size: .75rem; color: #8e8e8e; }
.term-bar i { width: .7rem; height: .7rem; border-radius: 50%; background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: auto; margin-right: auto; padding-right: 2.2rem; }
.term-body { margin: 0; padding: 1.1rem 1.2rem 1.4rem; min-height: 15rem; max-height: 60vh; overflow: auto; font-family: var(--mono); font-size: clamp(.78rem, .72rem + .3vw, .92rem); line-height: 1.75; color: #dcdad6; white-space: pre-wrap; word-break: break-word; }
.term-body .tp { color: #0ecb81; } .term-body .td { color: #6ea8ff; }
.term-body .to { color: #a9a7a4; }
.term-body .tg { color: #0ecb81; } .term-body .tw { color: #fff; font-weight: 700; } .term-body .tb { color: var(--signal-hi); }
.tcur { display: inline-block; width: .55em; height: 1.05em; vertical-align: -.18em; background: #dcdad6; margin-left: 1px; }

/* ------------------------------------------------------------------
   Publications page
   ------------------------------------------------------------------ */
.pubs-page .site-header { background: rgb(29 26 26 / .7); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.pubs-back { font-family: var(--mono); font-size: .85rem; }
.pubs { max-width: 112rem; margin: 0 auto; padding: calc(var(--header-h, 4.5rem) + 3rem) var(--pad) clamp(4rem, 8vw, 7rem); position: relative; z-index: 1; }
.pubs-head { margin-bottom: clamp(2rem, 5vw, 3.5rem); max-width: 60rem; }
.pubs-path { font-family: var(--mono); font-size: .85rem; color: var(--snow); } .pubs-path span { color: var(--granite); }
.pubs-title { font-size: clamp(3rem, 1.6rem + 6vw, 6.5rem); font-weight: 900; font-stretch: 62%; line-height: .9; text-transform: uppercase; color: var(--snow); margin: .5rem 0 1rem; }
.pubs-sub { color: #c4c4c2; font-size: 1.05rem; line-height: 1.6; max-width: 46rem; }
.pubs-filter { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.6rem; }
.pf { font-family: var(--mono); font-size: .8rem; padding: .55rem .9rem; color: #c4c4c2; background: rgb(255 255 255 / .05); border: 1px solid rgb(255 255 255 / .12); cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.pf b { font-weight: 700; color: var(--granite); margin-left: .35rem; }
.pf:hover { border-color: rgb(255 255 255 / .3); color: #fff; }
.pf.on { background: var(--signal); border-color: var(--signal); color: #fff; } .pf.on b { color: #fff; }
.pubs-page .site-footer { position: relative; z-index: 1; }
.research-term .rt-lede { min-height: 0; font-family: "Archivo", system-ui, sans-serif; font-size: clamp(1rem, .92rem + .35vw, 1.2rem); line-height: 1.7; color: #c4c4c2; }
.research-term .rt-hi { font-weight: 600; }
#research-intro .rt-line { visibility: visible !important; }
.term-overlay[hidden] { display: none !important; }

/* role badges on flashcards */
.fc-roles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -4px; }
.role { font-family: "Geist", system-ui, sans-serif; font-size: 11.5px; font-weight: 600; padding: 3px 8px; border: 1px solid rgb(255 255 255 / .18); color: #dcdad6; background: rgb(255 255 255 / .05); }
.role--first-author { color: #ff6a5f; border-color: rgb(255 42 31 / .5); background: rgb(255 42 31 / .12); }
.role--supervisor { color: #93c5fd; border-color: rgb(147 197 253 / .4); background: rgb(147 197 253 / .08); }
.role--corresponding-author { color: #c4b5fd; border-color: rgb(196 181 253 / .4); background: rgb(196 181 253 / .08); }
.role--top-contributor { color: #4ade80; border-color: rgb(74 222 128 / .4); background: rgb(74 222 128 / .08); }
.role--coding-and-analysis { color: #fbbf24; border-color: rgb(251 191 36 / .4); background: rgb(251 191 36 / .08); }
.fc .fc[hidden], .fc[hidden] { display: none !important; }
.hand-rings { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.connect-stage { position: sticky; }

/* phones: interview animation = two square windows side by side */
@media (max-width: 900px) {
  .feat .feat-vis:has(canvas[data-anim="copilot"]) { aspect-ratio: 1.78 / 1 !important; }
}

/* ------------------------------------------------------------------
   Buttons: sliding fill + rolling label (reference style)
   ------------------------------------------------------------------ */
.rb { isolation: isolate; overflow: hidden; --mx: 0px; --my: 0px; translate: var(--mx) var(--my);
  transition: color .45s cubic-bezier(.65,0,.35,1), box-shadow .45s cubic-bezier(.65,0,.35,1), border-color .45s, translate .35s cubic-bezier(.2,.8,.2,1), scale .2s ease; }
.rb::before { display: none !important; }
.rb:active { scale: .96; }
.rb > :not(.bt-fill) { position: relative; z-index: 1; }
.bt-fill { position: absolute !important; inset: 0; z-index: 0 !important; pointer-events: none; clip-path: inset(0 100% 0 0); transition: clip-path .55s cubic-bezier(.65,0,.35,1); }
.bt-fill.out { clip-path: inset(0 0 0 100%); }
.bt-fill.snap { transition: none; }
.rb:hover .bt-fill, .rb:focus-visible .bt-fill { clip-path: inset(0 0 0 0); }
.bt-roll { display: inline-block; overflow: hidden; position: relative; line-height: 1.25; vertical-align: middle; padding-bottom: 1px; }
.bt-roll i { display: inline-block; font-style: normal; transition: transform .55s cubic-bezier(.65,0,.35,1); transition-delay: calc(var(--i) * 16ms); }
.rb:hover .bt-roll i, .rb:focus-visible .bt-roll i { transform: translateY(-100%); }
.bt-a, .bt-b { display: block; white-space: pre; }
.bt-b { position: absolute; left: 0; top: 100%; }
.bt-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* fill colours for this site: red buttons fill white, outlined buttons fill light */
.btn-primary.rb .bt-fill, .papers-btn.rb .bt-fill, .fc .btn-dark.rb .bt-fill { background: #fff; }
.btn-primary.rb:hover, .papers-btn.rb:hover, .fc .btn-dark.rb:hover { color: var(--signal); background: var(--signal); }
.btn-quiet.rb .bt-fill, .btn-small.rb .bt-fill, .fc .btn-line.rb .bt-fill { background: var(--snow); }
.btn-quiet.rb:hover, .btn-small.rb:hover, .fc .btn-line.rb:hover { color: #1d1a1a; border-color: var(--snow); background: transparent; }
.papers-btn.rb { overflow: visible; }
.papers-btn.rb .bt-fill { inset: 0; }
.papers-btn.rb .papers-btn-label { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) { .bt-fill, .bt-roll i { transition: none; } }
.papers-btn.rb > .papers-btn-glow { position: absolute; z-index: -1; }
/* certificates */
.certs-text { max-width: var(--measure); color: #c4c4c2; line-height: 1.65; text-align: justify; hyphens: auto; }
.certs-btn { margin-top: 1.6rem; gap: .5rem; }

/* certificates grid */
#certificates.block { grid-template-columns: minmax(0, 1fr); }
.certs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1rem; margin-top: 2rem; }
.cert {
  display: flex; flex-direction: column; gap: .55rem; padding: .9rem; text-decoration: none; color: inherit; min-width: 0;
  background: linear-gradient(160deg, rgb(255 42 31 / .06) 0%, rgb(255 42 31 / 0) 40%), linear-gradient(180deg, rgb(24 20 20 / .62), rgb(16 13 13 / .7));
  border: 1px solid rgb(255 255 255 / .1); transition: transform .35s cubic-bezier(.2,.8,.2,1), border-color .3s;
}
.cert:hover { transform: translateY(-4px); border-color: rgb(255 42 31 / .5); }
.cert-img { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #f3f1ee; border: 1px solid rgb(255 255 255 / .08); }
.cert-img img { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.cert:hover .cert-img img { transform: scale(1.04); }
.cert-meta { display: flex; justify-content: space-between; align-items: center; margin-top: .3rem; font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; }
.cert-kind { color: var(--signal-hi); }
.cert--award .cert-kind { color: #fbbf24; }
.cert--lead .cert-kind { color: #93c5fd; }
.cert-date { color: var(--granite); }
.cert-title { font-size: 1.15rem; font-weight: 700; line-height: 1.2; color: var(--snow); }
.cert--award { border-color: rgb(251 191 36 / .45); box-shadow: 0 0 0 1px rgb(251 191 36 / .15), 0 24px 50px -30px rgb(251 191 36 / .35); }
.cert--award .cert-title { color: #fde68a; }
.cert-issuer { font-size: .85rem; color: #c4c4c2; }
.cert-feat { font-size: .82rem; line-height: 1.45; color: var(--granite); }
.cert-open { margin-top: auto; padding-top: .5rem; font-family: var(--mono); font-size: .78rem; color: var(--snow); }
.cert:hover .cert-open { color: var(--signal-hi); }
@media (min-width: 1100px) { .cert--award { grid-column: span 2; } .cert--award .cert-img { aspect-ratio: 16 / 9; } }
.cert[hidden] { display: none !important; }
/* best paper award on the main page */
.cert-feature { margin-top: 2rem; max-width: 46rem; }
.cert--hero .cert-img { aspect-ratio: 16 / 10; }
.cert-feature + .research-cta { margin-top: 1.6rem; }

/* certificates: white text, typed in on view */
.certs-text, .certs-text strong { color: #f4f3f1; }
.cert .cert-title, .cert .cert-issuer, .cert .cert-feat, .cert .cert-date, .cert .cert-open { color: #f4f3f1; }
.cert--award .cert-title, .cert .cert-kind { color: #f4f3f1; }
.cert .cert-feat { opacity: .85; }
.tc-ready .tc-ch { visibility: hidden; }
.tc-ready .tc-ch.on { visibility: visible; }
/* award card: red glow instead of gold */
.cert--award { border-color: rgb(255 42 31 / .55); box-shadow: 0 0 0 1px rgb(255 42 31 / .2), 0 0 60px -10px rgb(255 26 13 / .45), 0 30px 70px -30px rgb(255 26 13 / .55); }
.cert--award:hover { border-color: rgb(255 42 31 / .8); box-shadow: 0 0 0 1px rgb(255 42 31 / .35), 0 0 80px -8px rgb(255 26 13 / .6), 0 34px 80px -28px rgb(255 26 13 / .65); }
/* award card: very subtle red glow */
.cert--award { border-color: rgb(255 42 31 / .35); box-shadow: 0 0 18px -8px rgb(255 26 13 / .25); }
.cert--award:hover { border-color: rgb(255 42 31 / .5); box-shadow: 0 0 22px -8px rgb(255 26 13 / .3); }
/* award card text: typed like code (monospace + cursor) */
.cert[data-type="code"] .cert-title, .cert[data-type="code"] .cert-issuer, .cert[data-type="code"] .cert-feat { font-family: var(--mono); letter-spacing: -.01em; }
.cert[data-type="code"] .cert-title { font-size: 1.05rem; font-weight: 700; }
.cert[data-type="code"] .cert-issuer { font-size: .82rem; }
.cert[data-type="code"] .cert-feat { font-size: .78rem; line-height: 1.6; }
.tc-caret { display: inline-block; width: .55em; height: 1.05em; vertical-align: -.18em; margin-left: 1px; background: var(--signal-hi); animation: caret 1s steps(1) infinite; }
.tc-caret.done { display: none; }
/* featured paper on the main page */
.research-feature { max-width: 30rem; margin: 2.2rem 0 0; }
.research-feature-k { font-family: var(--mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--granite); margin-bottom: .8rem; }
.research-feature-k span { color: var(--signal-hi); }
.research-feature + .research-cta { margin-top: 1.8rem; }
@media (max-width: 680px) { .research-feature { max-width: none; } }
.research-feature { max-width: 22rem; }
.research-feature .fc .story-t { font-size: 14.5px; }
.research-feature .fc-face { padding: 14px; gap: 11px; }
.research-feature .fc-abs { font-size: 13.5px; }
@media (max-width: 680px) { .research-feature { max-width: 20rem; } }
/* featured paper + button centred */
.research-feature { margin-left: auto; margin-right: auto; }
.research-feature-k { text-align: center; }
.research-feature + .research-cta { justify-content: center; }

/* mini paper pages: white sheet with dark journal text (card stays dark) */
.fc .pc-paper { background: #ecebe8; border-color: rgb(255 255 255 / .12); }
.fc .pc-paper .fit::after { background: linear-gradient(rgb(236 235 232 / 0), #ecebe8); }
.fc .ppr { background: #fff; border-color: #ddd; color: #1a1a1a; box-shadow: 0 12px 26px -18px rgb(0 0 0 / .6); }
.fc .ppr-t, .fc .ppr-abs { color: #1a1a1a; }
.fc .ppr-j { color: #666; border-bottom-color: #bbb; }
.fc .ppr-sk i { background: #e6e6e6; }
.fc .ppr-fig { border-color: #eee; }
.fc .ppr-fig figcaption, .fc .ppr-foot { color: #666; }
.fc .ppr-foot { border-top-color: #ddd; }

/* flashcard back: buttons never squash; long abstracts scroll inside the card */
.fc-back .story-foot { display: grid; grid-template-columns: 1fr; gap: 10px; }
.fc-back .story-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.fc-back .story-btns .btn { width: 100%; min-width: 0; padding: 0 10px; justify-content: center; }
.fc-back .story-btns .btn:only-child { grid-column: 1 / -1; }
.fc--long .fc-abs { font-size: 13px; line-height: 1.5; max-height: 26em; overflow-y: auto; padding-right: 6px; scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / .2) transparent; }
.fc--long .ppr-full { max-height: 150px; overflow: hidden; }
/* flashcard buttons: fixed icon size, consistent height */
.fc .btn { height: 40px; min-height: 40px; font-size: 14.5px; gap: 7px; }
.fc .btn svg { width: 12px !important; height: 12px !important; flex: none; }
.fc .story-ok { gap: 8px; }
.fc .tick { width: 14px; height: 14px; border-radius: 50%; background: #0ecb81; display: inline-grid; place-items: center; flex: none; }
.fc .tick::after { content: ""; width: 6px; height: 3px; border: solid #fff; border-width: 0 0 1.5px 1.5px; transform: translateY(-1px) rotate(-45deg); }
.fc .story-ok--acc .tick { background: #d97706; }

/* letters of recommendation */
#lor.block { grid-template-columns: minmax(0, 1fr); }
.lor-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1rem; margin-top: 2rem; max-width: 58rem; }
.lor-card {
  position: relative; display: flex; flex-direction: column; gap: .5rem; padding: 1.6rem 1.5rem 1.4rem; overflow: hidden;
  background: linear-gradient(160deg, rgb(255 42 31 / .06) 0%, rgb(255 42 31 / 0) 40%), linear-gradient(180deg, rgb(24 20 20 / .62), rgb(16 13 13 / .7));
  border: 1px solid rgb(255 255 255 / .1); transition: border-color .3s, transform .35s cubic-bezier(.2,.8,.2,1);
}
.lor-card:hover { border-color: rgb(255 42 31 / .45); transform: translateY(-3px); }
.lor-q { position: absolute; top: -1.6rem; right: 1rem; font-family: "Tinos", Georgia, serif; font-size: 8rem; line-height: 1; color: rgb(255 42 31 / .18); pointer-events: none; }
.lor-kind { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--signal-hi); }
.lor-name { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 800; font-stretch: 62%; line-height: 1.05; color: #f4f3f1; margin-top: .2rem; }
.lor-role { font-size: .92rem; line-height: 1.5; color: #f4f3f1; opacity: .85; }
.lor-rel { font-family: var(--mono); font-size: .78rem; color: var(--granite); margin-top: .2rem; }
.lor-status { margin-top: .9rem; display: inline-flex; align-items: center; gap: .5rem; font-family: var(--mono); font-size: .75rem; color: #c4c4c2; }
.lor-status i { width: 7px; height: 7px; border-radius: 50%; background: #fbbf24; }
.lor-btn { margin-top: 1.6rem; gap: .5rem; }

/* Certificates (PC): centred composition */
@media (min-width: 901px) {
  #certificates .block-body { display: flex; flex-direction: column; align-items: center; text-align: center; }
  #certificates h2 { text-align: center; }
  #certificates .statement { max-width: none; margin-left: auto; margin-right: auto; text-align: center; }
  #certificates .certs-text { max-width: 52rem; text-align: justify; text-align-last: center; }
  #certificates .cert-feature { width: 100%; max-width: 46rem; margin-left: auto; margin-right: auto; text-align: left; }
  #certificates .research-cta { justify-content: center; }
}
/* contact links with logos */
.socials a.soc { display: inline-flex; align-items: center; gap: .55rem; }
.socials a.soc svg { width: 1.15em; height: 1.15em; flex: none; transition: transform .25s cubic-bezier(.2,.8,.2,1), color .2s; }
.socials a.soc:hover svg { transform: translateY(-2px) scale(1.08); }
.socials a.soc:hover { color: var(--snow); }

/* ------------------------------------------------------------------
   Typeface update: Big Shoulders Display (headlines) + Space Grotesk (text)
   ------------------------------------------------------------------ */
:root { --font: "Space Grotesk", "Archivo", system-ui, sans-serif; --display: "Big Shoulders Display", "Archivo", system-ui, sans-serif; }
body { font-family: var(--font); }
.wordmark, .statement, .timeline h3, .work-title, .connect-title, .proj-title, .feat-title, .pubs-title,
.lor-name, .lede, .block h2, .mail, .cert-title:not([data-type] *), .rt-title {
  font-family: var(--display); font-stretch: normal; letter-spacing: .005em;
}
.statement { font-weight: 800; line-height: .98; }
.feat-title, .pubs-title { font-weight: 900; letter-spacing: .01em; }
.wordmark { font-weight: 800; font-size: 1.7rem; letter-spacing: .02em; text-transform: uppercase; }
.block h2 { font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.lede { font-weight: 700; letter-spacing: .01em; }
.mail { font-weight: 800; }
.research-term .rt-lede { font-family: var(--font); }
.rt-title { font-weight: 800; text-transform: uppercase; letter-spacing: .02em; }
@media (max-width: 760px) { .wordmark { font-size: 1.3rem; } }
@media (max-width: 380px) { .wordmark { font-size: 1.1rem; } }
/* hero name keeps its original typeface so the photo composition is unchanged */
.hero-word, .hero-name { font-family: "Archivo", system-ui, sans-serif; }

/* YouTube needs the player to be at least 200x200 and inside the page to play: keep it invisible, behind everything */
@keyframes mb-nudge { 0%,100% { box-shadow: 0 0 0 0 rgb(255 42 31 / .5); } 50% { box-shadow: 0 0 0 6px rgb(255 42 31 / 0); } }

/* sound toggle: small speaker key */
.sound-btn {
  position: fixed; z-index: 60; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  width: 38px; height: 38px; display: grid; place-items: center; padding: 0; cursor: pointer;
  color: #8e8e8e; background: rgb(16 13 13 / .8); border: 1px solid rgb(255 255 255 / .14); border-radius: 9px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: color .2s, border-color .2s, transform .15s;
}
.sound-btn svg { width: 19px; height: 19px; }
.sound-btn:hover { color: #fff; border-color: rgb(255 255 255 / .35); }
.sound-btn:active { transform: scale(.92); }
.sound-btn.on { color: #fff; }
/* speaker key: nearly transparent */
.sound-btn { background: transparent; border-color: rgb(255 255 255 / .1); -webkit-backdrop-filter: none; backdrop-filter: none; color: rgb(255 255 255 / .55); }
.sound-btn.on { color: rgb(255 255 255 / .85); }
.sound-btn:hover { background: rgb(255 255 255 / .04); border-color: rgb(255 255 255 / .25); color: #fff; }

/* ------------------------------------------------------------------
   Phones: Freyr + COAR visuals, no overlapping
   ------------------------------------------------------------------ */
@media (max-width: 560px) {
  .feat .proj-vis--chart { aspect-ratio: 1 / 1 !important; }
  .fx-head { top: 10px; left: 10px; right: 64px; gap: .4rem; flex-wrap: nowrap; }
  .fx-src { display: none; }
  .fx-price { margin-left: auto; font-size: .78rem; }
  .fx-agent { top: 34px; left: 10px; right: 64px; padding: .3rem .55rem; border-radius: 999px;
    background: rgb(15 13 13 / .7); border: 1px solid rgb(255 255 255 / .08); width: max-content; max-width: calc(100% - 74px); }
  .fx-agent b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fx-pos { top: 66px; left: 10px; font-size: .64rem; padding: .2rem .45rem; max-width: calc(100% - 74px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .feat .proj-vis--coar { aspect-ratio: 1 / 1.08 !important; }
}

/* ------------------------------------------------------------------
   Organisation: numbered sections, section index, phone menu
   ------------------------------------------------------------------ */
.sec-num { font-family: var(--mono); font-size: .72em; font-weight: 400; letter-spacing: .04em; color: var(--signal-hi); margin-right: .7em; vertical-align: .08em; }
.block h2::before { display: none; }
.rt-title .sec-num { font-size: .32em; vertical-align: .9em; }
.certs h2, .lor h2 { }

/* desktop section index */
.sec-rail { position: fixed; right: 1.1rem; top: 50%; transform: translateY(-50%); z-index: 40; display: flex; flex-direction: column; gap: .55rem; transition: opacity .4s; }
.sec-rail.away { opacity: 0; pointer-events: none; }
.sec-rail a { display: flex; align-items: center; justify-content: flex-end; gap: .6rem; height: 14px; text-decoration: none; }
.sec-rail i { width: 6px; height: 6px; border-radius: 50%; background: rgb(255 255 255 / .22); transition: background .25s, transform .25s; flex: none; }
.sec-rail a.on i { background: var(--signal-hi); transform: scale(1.5); box-shadow: 0 0 8px rgb(255 42 31 / .7); }
.sr-label { font-family: var(--mono); font-size: .68rem; color: #c4c4c2; white-space: nowrap; opacity: 0; transform: translateX(6px); transition: opacity .25s, transform .25s; pointer-events: none; background: rgb(16 13 13 / .8); padding: .15rem .45rem; }
.sec-rail:hover .sr-label, .sec-rail a.on .sr-label { opacity: 1; transform: none; }
.sec-rail:not(:hover) a:not(.on) .sr-label { opacity: 0; }
.sec-rail a.on .sr-label { color: #fff; }
@media (max-width: 1100px) { .sec-rail { display: none; } }

/* phone menu */
.menu-btn { display: none; }
@media (max-width: 760px) {
  .menu-btn { display: inline-grid; place-content: center; gap: 5px; width: 40px; height: 38px; margin-left: .6rem; padding: 0; cursor: pointer; background: transparent; border: 1px solid rgb(255 255 255 / .18); position: relative; z-index: 71; }
  .menu-btn span { display: block; width: 18px; height: 1.5px; background: #fff; transition: transform .3s; }
  .menu-open .menu-btn span:first-child { transform: translateY(3.25px) rotate(45deg); }
  .menu-open .menu-btn span:last-child { transform: translateY(-3.25px) rotate(-45deg); }
  .site-header .btn-small { margin-left: auto; }
}
.menu-sheet { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; justify-content: center; padding: 5rem 1.6rem 2rem;
  background: rgb(18 15 15 / .96); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); opacity: 0; transition: opacity .3s; }
.menu-sheet.on { opacity: 1; }
.menu-sheet nav { display: flex; flex-direction: column; gap: .2rem; }
.menu-sheet nav a { display: flex; align-items: baseline; gap: .9rem; padding: .55rem 0; font-family: var(--display, "Archivo"); font-size: 2.2rem; font-weight: 800; line-height: 1; color: #f4f3f1; text-decoration: none; border-bottom: 1px solid rgb(255 255 255 / .07);
  transform: translateY(14px); opacity: 0; transition: transform .45s cubic-bezier(.2,.8,.2,1), opacity .45s, color .2s; }
.menu-sheet.on nav a { transform: none; opacity: 1; }
.menu-sheet nav a:nth-child(2) { transition-delay: .03s; } .menu-sheet nav a:nth-child(3) { transition-delay: .06s; } .menu-sheet nav a:nth-child(4) { transition-delay: .09s; }
.menu-sheet nav a:nth-child(5) { transition-delay: .12s; } .menu-sheet nav a:nth-child(6) { transition-delay: .15s; } .menu-sheet nav a:nth-child(7) { transition-delay: .18s; } .menu-sheet nav a:nth-child(8) { transition-delay: .21s; }
.menu-sheet nav a span { font-family: var(--mono); font-size: .8rem; font-weight: 400; color: var(--signal-hi); }
.menu-sheet nav a:active { color: var(--signal-hi); }
.ms-foot { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; margin-top: 1.8rem; font-family: var(--mono); font-size: .8rem; }
.ms-foot a { color: #c4c4c2; text-decoration: none; }
html.menu-open { overflow: hidden; }
h2[data-num]::before { content: attr(data-num); display: inline-block !important; width: auto !important; height: auto !important; background: none !important;
  font-family: var(--mono); font-size: .72em; font-weight: 400; letter-spacing: .04em; color: var(--signal-hi); margin-right: .7em; vertical-align: .08em; }
.rt-title[data-num]::before { font-size: .3em; vertical-align: 1em; }
@media (max-width: 420px) { .site-header .btn-small { padding: 0 .7rem; font-size: .78rem; } }
.menu-open .site-header { z-index: 80 !important; background: transparent !important; }
.menu-sheet { justify-content: flex-start; overflow-y: auto; padding-top: calc(5.5rem + env(safe-area-inset-top, 0px)); }
.menu-sheet nav { margin-top: auto; } .ms-foot { margin-bottom: auto; }
.menu-open .site-header { background: rgb(18 15 15 / .98) !important; }
/* phones: header fits name + Download CV + menu without clipping */
.site-header .btn-small { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 760px) { .wordmark { min-width: 0; overflow: hidden; text-overflow: ellipsis; } .menu-btn { flex-shrink: 0; } }
@media (max-width: 420px) {
  .wordmark { font-size: 1.02rem; letter-spacing: .01em; }
  .site-header .btn-small { padding: 0 .6rem; font-size: .74rem; min-height: 34px; }
  .menu-btn { width: 36px; height: 34px; margin-left: .45rem; }
}
@media (max-width: 350px) { .wordmark { font-size: .9rem; } }
@media (max-width: 420px) {
  .wordmark { overflow: visible; text-overflow: clip; font-size: 1.05rem; }
}

/* anything marked hidden is always truly hidden (never an invisible click-blocking layer) */
[hidden] { display: none !important; }

/* phone menu: translucent side panel (~60% of the screen), hero stays visible */
.menu-sheet {
  inset: 0 0 0 auto; width: min(60vw, 22rem); min-width: 15rem; padding: calc(5rem + env(safe-area-inset-top, 0px)) 1.3rem 1.6rem;
  background: rgb(18 15 15 / .62); -webkit-backdrop-filter: blur(14px) saturate(120%); backdrop-filter: blur(14px) saturate(120%);
  border-left: 1px solid rgb(255 42 31 / .35); box-shadow: -30px 0 60px -30px rgb(0 0 0 / .8);
  opacity: 1; transform: translateX(100%); transition: transform .38s cubic-bezier(.2,.8,.2,1);
  justify-content: flex-start;
}
.menu-sheet.on { transform: none; }
.menu-sheet nav { margin-top: 0; }
.menu-sheet nav a { font-size: 1.45rem; padding: .5rem 0; gap: .7rem; }
.menu-sheet nav a span { font-size: .7rem; }
.ms-foot { flex-direction: column; gap: .7rem; margin-top: 1.5rem; margin-bottom: 0; font-size: .74rem; }
html.menu-open { overflow: hidden; }
.menu-open .site-header { background: transparent !important; }
.menu-sheet { background: linear-gradient(90deg, rgb(18 15 15 / .38), rgb(18 15 15 / .55)); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.menu-sheet nav a { text-shadow: 0 2px 10px rgb(0 0 0 / .8); border-bottom-color: rgb(255 255 255 / .12); }
.ms-foot a { text-shadow: 0 1px 6px rgb(0 0 0 / .9); color: #e2e0dc; }

/* phones: full "Download CV" label, compact name so everything fits */
@media (max-width: 420px) {
  .wordmark { font-size: .98rem; letter-spacing: 0; }
  .site-header .btn-small { padding: 0 .55rem; font-size: .72rem; min-height: 32px; }
  .menu-btn { width: 34px; height: 32px; margin-left: .4rem; }
}
@media (max-width: 365px) { .wordmark { font-size: .86rem; } .site-header .btn-small { padding: 0 .45rem; font-size: .68rem; } }
/* menu panel: half the screen */
.menu-sheet { width: 50vw; min-width: 0; padding-left: 1rem; padding-right: .9rem; }
.menu-sheet nav a { font-size: clamp(1.02rem, 4.6vw, 1.45rem); gap: .5rem; }
.menu-sheet nav a span { font-size: .62rem; }
.ms-foot { font-size: .68rem; }
/* hero: smaller headline + code line */
.hero .lede { font-size: clamp(1.15rem, .95rem + 1vw, 1.75rem); }
.hero .terminal { font-size: .8rem; }
@media (max-width: 760px) { .hero .lede { font-size: 1.15rem; } .hero .terminal { font-size: .74rem; } }

/* skills carousel: 40 skills, two identical tracks scrolling as one seamless loop */
.ticker { display: flex; }
.ticker .ticker-track { flex: none; padding-right: clamp(2.5rem, 4vw, 4.5rem); font-size: clamp(1.1rem, .85rem + 1.1vw, 1.8rem); font-family: var(--font, inherit); font-weight: 600;
  animation: ticker-loop 140s linear infinite; }
@keyframes ticker-loop { to { transform: translateX(-100%); } }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track .tk svg { width: 1.1em; height: 1.1em; }
@media (prefers-reduced-motion: reduce) { .ticker .ticker-track { animation: none; } }

/* ------------------------------------------------------------------
   Services: main-page teaser + catalogue page
   ------------------------------------------------------------------ */
#services.block { grid-template-columns: minmax(0, 1fr); }
.svc-chips { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: .6rem; margin: 1.8rem 0 .4rem; max-width: 60rem; }
.svc-chips li { display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem; border: 1px solid rgb(255 255 255 / .1);
  background: linear-gradient(160deg, rgb(255 42 31 / .06), rgb(255 42 31 / 0) 45%), rgb(16 13 13 / .55); color: #f4f3f1; font-weight: 600; }
.svc-chips li span { font-family: var(--mono); font-size: .72rem; color: var(--signal-hi); }

.svc-page .pubs-head { max-width: 64rem; }
.svc-group { margin-top: clamp(2.5rem, 6vw, 4rem); scroll-margin-top: 6rem; }
.svc-gh { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.2rem; padding-bottom: .9rem; margin-bottom: 1.2rem; border-bottom: 1px solid rgb(255 255 255 / .1); }
.svc-gh h2 { font-family: var(--display, inherit); font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem); font-weight: 800; color: #f4f3f1; line-height: 1; }
.svc-gh p { color: var(--granite); font-size: .95rem; }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1rem; }
.svc { display: flex; flex-direction: column; gap: .7rem; padding: 1.3rem 1.25rem 1.15rem; min-width: 0;
  background: linear-gradient(160deg, rgb(255 42 31 / .06) 0%, rgb(255 42 31 / 0) 40%), linear-gradient(180deg, rgb(24 20 20 / .62), rgb(16 13 13 / .72));
  border: 1px solid rgb(255 255 255 / .1); transition: border-color .3s, transform .35s cubic-bezier(.2,.8,.2,1); }
.svc:hover { border-color: rgb(255 42 31 / .45); transform: translateY(-3px); }
.svc-top { display: flex; justify-content: space-between; gap: .6rem; font-family: var(--mono); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; }
.svc-cat { color: var(--signal-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc-time { color: var(--granite); white-space: nowrap; }
.svc-name { font-size: 1.22rem; font-weight: 700; line-height: 1.2; color: #f4f3f1; }
.svc-desc { font-size: .9rem; line-height: 1.55; color: #c4c4c2; }
.svc-pts { list-style: none; padding: 0; display: grid; gap: .3rem; margin-top: .1rem; }
.svc-pts li { position: relative; padding-left: 1.1rem; font-size: .84rem; color: #a9a7a4; }
.svc-pts li::before { content: "✓"; position: absolute; left: 0; color: #0ecb81; font-size: .8rem; }
.svc-foot { margin-top: auto; padding-top: .9rem; border-top: 1px solid rgb(255 255 255 / .08); display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.svc-price { display: flex; flex-direction: column; line-height: 1.1; }
.svc-price span { font-family: var(--mono); font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; color: var(--granite); }
.svc-price b { font-family: var(--mono); font-size: 1.05rem; color: #f4f3f1; }
.svc-btn { min-height: 36px; padding: 0 .9rem; font-size: .82rem; }
.svc-group[hidden] { display: none !important; }

.svc-how { margin-top: clamp(3rem, 7vw, 5rem); padding-top: 2rem; border-top: 1px solid rgb(255 255 255 / .1); }
.svc-how h2 { font-family: var(--display, inherit); font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem); font-weight: 800; color: #f4f3f1; margin-bottom: 1.4rem; }
.svc-how ol { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 1rem; }
.svc-how li { display: flex; gap: .8rem; padding: 1rem; border: 1px solid rgb(255 255 255 / .08); background: rgb(16 13 13 / .5); }
.svc-how li b { font-family: var(--mono); font-size: .8rem; color: var(--signal-hi); }
.svc-how li span { display: flex; flex-direction: column; gap: .25rem; font-size: .88rem; color: #a9a7a4; line-height: 1.45; }
.svc-how li strong { color: #f4f3f1; font-size: .98rem; }
.svc-custom { margin-top: 1.6rem; color: #c4c4c2; }
.svc-custom a { color: var(--signal-hi); }
.svc-chips { max-width: 72rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16.5rem), 1fr)); }
.svc-chips li { font-size: .92rem; padding: .75rem .95rem; }

/* ------------------------------------------------------------------
   Services: per-card animation, IDs, WhatsApp, cart
   ------------------------------------------------------------------ */
.svc-anim { display: block; width: calc(100% + 2.5rem); height: 96px; margin: -1.3rem -1.25rem .3rem; background: rgb(10 8 8 / .55); border-bottom: 1px solid rgb(255 255 255 / .06); }
.svc-top { align-items: center; }
.svc-id { font-family: var(--mono); font-size: .66rem; letter-spacing: .04em; padding: .12rem .4rem; border: 1px solid rgb(255 42 31 / .5); color: #ff6a5f; margin-right: .5rem; flex: none; }
.svc-top .svc-cat { flex: 1; min-width: 0; }
.svc.in-cart { border-color: rgb(14 203 129 / .55); }
.svc-acts { display: inline-flex; gap: .4rem; }
.svc-add, .svc-wa { display: inline-flex; align-items: center; gap: .35rem; height: 34px; padding: 0 .75rem; font-family: var(--mono); font-size: .74rem; cursor: pointer; text-decoration: none; transition: background .2s, border-color .2s, color .2s; }
.svc-add { background: transparent; color: #efeeec; border: 1px solid rgb(255 255 255 / .25); }
.svc-add:hover { border-color: #fff; }
.svc.in-cart .svc-add { color: #0ecb81; border-color: rgb(14 203 129 / .6); }
.svc-wa { background: #1fa855; color: #fff; border: 1px solid #1fa855; }
.svc-wa::before { content: ""; width: 13px; height: 13px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2Z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2Z'/%3E%3C/svg%3E") center / contain no-repeat; }
.svc-wa:hover { background: #25d366; border-color: #25d366; }

.svc-open { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; margin-top: 2rem; padding: 1.1rem 1.3rem;
  border: 1px dashed rgb(255 42 31 / .5); background: rgb(255 42 31 / .05); }
.svc-open p { color: #c4c4c2; max-width: 52rem; line-height: 1.55; }
.svc-open strong { color: #fff; }
.svc-custom-btn { font-family: var(--mono); font-size: .82rem; padding: .7rem 1.1rem; background: var(--signal); color: #fff; border: 0; cursor: pointer; white-space: nowrap; }
.svc-custom-btn:hover { background: var(--signal-hi); }

.cart-fab { position: fixed; z-index: 65; right: 1rem; bottom: calc(4rem + env(safe-area-inset-bottom, 0px)); width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--signal); color: #fff; border: 0; box-shadow: 0 12px 28px -10px rgb(255 26 13 / .7); transition: transform .2s; }
.cart-fab svg { width: 24px; height: 24px; }
.cart-fab .cart-n { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #fff; color: #1d1a1a; font-family: var(--mono); font-size: .7rem; display: grid; place-items: center; }
.cart-fab:not(.has) .cart-n { background: #3a3434; color: #c4c4c2; }
.cart-fab.bump { animation: cart-bump .45s cubic-bezier(.2,.8,.2,1); }
@keyframes cart-bump { 30% { transform: scale(1.18); } }

.cart-panel { position: fixed; z-index: 75; top: 0; right: 0; bottom: 0; width: min(26rem, 100vw); display: flex; flex-direction: column; gap: .8rem; overflow-y: auto;
  padding: calc(1.2rem + env(safe-area-inset-top, 0px)) 1.2rem calc(1.4rem + env(safe-area-inset-bottom, 0px));
  background: rgb(18 15 15 / .94); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-left: 1px solid rgb(255 42 31 / .35);
  transform: translateX(100%); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.cart-panel.on { transform: none; }
.cp-head { display: flex; justify-content: space-between; align-items: center; }
.cp-head h2 { font-family: var(--display, inherit); font-size: 1.8rem; font-weight: 800; color: #fff; }
.cp-x { width: 36px; height: 36px; background: transparent; border: 1px solid rgb(255 255 255 / .2); color: #fff; cursor: pointer; }
.cp-list { list-style: none; padding: 0; display: grid; gap: .5rem; }
.cp-list li { display: grid; grid-template-columns: auto 1fr auto; gap: .7rem; align-items: center; padding: .65rem .7rem; border: 1px solid rgb(255 255 255 / .1); background: rgb(255 255 255 / .03); }
.cp-id { font-family: var(--mono); font-size: .68rem; color: #ff6a5f; }
.cp-nm { color: #f4f3f1; font-size: .9rem; line-height: 1.3; }
.cp-nm small { display: block; font-family: var(--mono); font-size: .72rem; color: var(--granite); margin-top: .15rem; }
.cp-list button { background: transparent; border: 0; color: var(--granite); cursor: pointer; font-size: .9rem; }
.cp-list button:hover { color: #fff; }
.cp-empty { color: var(--granite); font-size: .88rem; line-height: 1.5; }
.cp-l { font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--granite); margin-top: .4rem; }
.cp-note, .cp-name { width: 100%; padding: .7rem .8rem; background: rgb(255 255 255 / .04); border: 1px solid rgb(255 255 255 / .14); color: #fff; font: inherit; font-size: .92rem; resize: vertical; }
.cp-note:focus, .cp-name:focus { outline: none; border-color: rgb(255 42 31 / .6); }
.cp-send { display: flex; align-items: center; justify-content: center; gap: .6rem; margin-top: .6rem; padding: .95rem 1rem; background: #1fa855; color: #fff; text-decoration: none; font-weight: 700; }
.cp-send svg { width: 20px; height: 20px; }
.cp-send:hover { background: #25d366; }
.cp-fine { font-size: .75rem; color: var(--granite); text-align: center; }
.cart-panel[hidden] { display: none !important; }
@media (max-width: 560px) { .svc-acts { width: 100%; } .svc-add, .svc-wa { flex: 1; justify-content: center; } }
@media (max-width: 760px) {
  .svc-page .pubs-filter { flex-wrap: nowrap; overflow-x: auto; margin-right: calc(-1 * var(--pad)); padding-right: var(--pad); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .svc-page .pubs-filter::-webkit-scrollbar { display: none; }
  .svc-page .pf { flex: none; white-space: nowrap; }
}

/* ---------- services v3: taller visuals, new cart icon, 3-column phones ---------- */
.svc-anim { height: 118px; background: radial-gradient(120% 90% at 50% 0%, rgb(255 42 31 / .07), transparent 60%), rgb(10 8 8 / .65); }

.cart-fab { width: 50px; height: 50px; background: rgb(20 17 17 / .78); color: #fff; border: 1.5px solid rgb(255 42 31 / .7);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 0 0 4px rgb(255 42 31 / .08), 0 14px 30px -12px rgb(0 0 0 / .9); }
.cart-fab:hover { border-color: var(--signal-hi); box-shadow: 0 0 0 5px rgb(255 42 31 / .14), 0 0 22px -4px rgb(255 26 13 / .6); }
.cart-fab svg { width: 22px; height: 22px; }
.cart-fab .cart-n { background: var(--signal); color: #fff; top: -4px; right: -4px; box-shadow: 0 0 0 2px #1d1a1a; }
.cart-fab:not(.has) .cart-n { display: none; }

@media (max-width: 640px) {
  .svc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .svc { padding: 0 0 6px; gap: 4px; cursor: pointer; }
  .svc:hover { transform: none; }
  .svc-anim { width: 100%; height: 62px; margin: 0 0 2px; }
  .svc-top { padding: 0 6px; }
  .svc-cat, .svc-time, .svc-desc, .svc-pts, .svc-price span { display: none; }
  .svc-id { font-size: .56rem; padding: .05rem .25rem; margin: 0; }
  .svc-name { padding: 0 6px; font-size: .7rem; line-height: 1.2; min-height: 2.4em; }
  .svc-foot { margin-top: auto; padding: 4px 6px 0; border-top: 1px solid rgb(255 255 255 / .06); flex-direction: column; align-items: stretch; gap: 4px; }
  .svc-price b { font-size: .58rem; letter-spacing: -.02em; }
  .svc-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 100%; }
  .svc-add, .svc-wa { height: 24px; padding: 0; font-size: 0; justify-content: center; gap: 0; }
  .svc-add::before { content: "+"; font-size: .95rem; line-height: 1; }
  .svc.in-cart .svc-add::before { content: "✓"; font-size: .75rem; }
  .svc-wa::before { width: 12px; height: 12px; }
  .svc-gh h2 { font-size: 1.35rem; }
  .svc-gh p { font-size: .82rem; }
}
.svc-sheet { position: fixed; inset: 0; z-index: 78; display: flex; align-items: flex-end; background: rgb(0 0 0 / 0); transition: background .3s; }
.svc-sheet.on { background: rgb(0 0 0 / .55); }
.svc-sheet[hidden] { display: none !important; }
.ss-card { position: relative; width: 100%; max-height: 85vh; overflow-y: auto; padding: 1.3rem 1.2rem calc(1.3rem + env(safe-area-inset-bottom, 0px));
  background: #1b1717; border-top: 1px solid rgb(255 42 31 / .45); border-radius: 14px 14px 0 0; transform: translateY(100%); transition: transform .32s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; gap: .7rem; }
.svc-sheet.on .ss-card { transform: none; }
.ss-x { position: absolute; top: .8rem; right: .8rem; width: 32px; height: 32px; background: transparent; color: #fff; border: 1px solid rgb(255 255 255 / .2); }
.ss-meta { display: flex; align-items: center; gap: .5rem; font-family: var(--mono); font-size: .68rem; color: var(--granite); text-transform: uppercase; letter-spacing: .05em; }
.ss-card h3 { font-size: 1.3rem; font-weight: 700; color: #fff; padding-right: 2.5rem; }
.ss-desc { color: #c4c4c2; line-height: 1.55; font-size: .92rem; }
.ss-price { font-family: var(--mono); font-size: 1.15rem; color: #fff; display: flex; flex-direction: column; }
.ss-price span { font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; color: var(--granite); }
.ss-acts { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.ss-add { height: 44px; background: transparent; color: #fff; border: 1px solid rgb(255 255 255 / .3); font-family: var(--mono); font-size: .82rem; }
.ss-acts .svc-wa { height: 44px; justify-content: center; font-size: .82rem; }

/* phones: 3-column cards that still show description + price at a glance */
@media (max-width: 640px) {
  .svc-desc { display: block; padding: 0 6px; font-size: .58rem; line-height: 1.38; color: #b9b7b4; }
  .svc-price span { display: block; font-size: .46rem; letter-spacing: .06em; }
  .svc-price b { font-size: .64rem; color: #fff; }
  .svc-price { gap: 1px; }
  .svc-time { display: block; font-size: .5rem; letter-spacing: .02em; }
  .svc-top { display: flex; justify-content: space-between; align-items: center; gap: 2px; }
  .svc-name { min-height: 0; font-size: .7rem; }
  .svc-anim { height: 70px; }
}
@media (max-width: 360px) { .svc-desc { font-size: .54rem; } .svc-name { font-size: .64rem; } }
/* phones: 2 columns (readable description + price) */
@media (max-width: 640px) {
  .svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .svc { padding-bottom: 8px; gap: 5px; }
  .svc-anim { height: 84px; }
  .svc-top { padding: 0 8px; }
  .svc-id { font-size: .6rem; }
  .svc-time { font-size: .56rem; }
  .svc-name { padding: 0 8px; font-size: .84rem; }
  .svc-desc { padding: 0 8px; font-size: .7rem; line-height: 1.45; }
  .svc-foot { padding: 6px 8px 0; }
  .svc-price span { font-size: .52rem; }
  .svc-price b { font-size: .78rem; }
  .svc-add, .svc-wa { height: 30px; }
}
@media (max-width: 360px) { .svc-desc { font-size: .66rem; } .svc-name { font-size: .78rem; } }

/* ------------------------------------------------------------------
   Service visuals v4: Lucide line icons (lucide.dev, ISC) drawn in by stroke animation
   ------------------------------------------------------------------ */
.svc-anim { display: none !important; }
.svc-vis {
  position: relative; display: grid; place-items: center; height: 118px; margin: -1.3rem -1.25rem .3rem; overflow: hidden;
  border-bottom: 1px solid rgb(255 255 255 / .07);
  background:
    radial-gradient(circle at 50% 55%, rgb(255 255 255 / .035), transparent 60%),
    radial-gradient(rgb(255 255 255 / .09) 1px, transparent 1.2px) 0 0 / 14px 14px,
    #121010;
}
.svc-vis::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgb(18 16 16 / .9)); pointer-events: none; }
.svc-vis .si { position: relative; z-index: 1; width: 52px; height: 52px; color: #ece9e5; overflow: visible; }
.svc-vis .si > * { stroke-dasharray: 1; stroke-dashoffset: 1; animation: si-draw 7s cubic-bezier(.65,0,.35,1) infinite; }
.svc-vis .si > *:last-child { stroke: var(--signal-hi); }
.svc-vis .si > *:nth-child(2) { animation-delay: .12s; } .svc-vis .si > *:nth-child(3) { animation-delay: .24s; }
.svc-vis .si > *:nth-child(4) { animation-delay: .36s; } .svc-vis .si > *:nth-child(5) { animation-delay: .48s; }
.svc-vis .si > *:nth-child(6) { animation-delay: .6s; }  .svc-vis .si > *:nth-child(n+7) { animation-delay: .72s; }
@keyframes si-draw { 0% { stroke-dashoffset: 1; } 22%, 82% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -1; } }

/* thin ring with one travelling marker */
.sv-ring { position: absolute; width: 84px; height: 84px; border-radius: 50%; border: 1px solid rgb(255 255 255 / .08); animation: sv-spin 9s linear infinite; }
.sv-ring i { position: absolute; top: -2.5px; left: calc(50% - 2.5px); width: 5px; height: 5px; border-radius: 50%; background: var(--signal-hi); }
@keyframes sv-spin { to { transform: rotate(360deg); } }
.sv-code { position: absolute; z-index: 2; left: 10px; bottom: 8px; font-family: var(--mono); font-size: .6rem; letter-spacing: .08em; color: rgb(255 255 255 / .38); }

/* idle motions (each card gets one, so neighbours differ) */
.svc-vis[data-m="float"] .si { animation: m-float 4s ease-in-out infinite; }
.svc-vis[data-m="tilt"] .si  { animation: m-tilt 5s ease-in-out infinite; }
.svc-vis[data-m="pulse"] .si { animation: m-pulse 3.2s ease-in-out infinite; }
.svc-vis[data-m="sway"] .si  { animation: m-sway 4.6s ease-in-out infinite; }
.svc-vis[data-m="orbit"] .sv-ring { animation-duration: 4.5s; }
@keyframes m-float { 50% { transform: translateY(-5px); } }
@keyframes m-tilt  { 50% { transform: rotate(-7deg); } }
@keyframes m-pulse { 50% { transform: scale(1.07); } }
@keyframes m-sway  { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* hover: re-draw quickly + ring tightens */
.svc:hover .sv-ring { border-color: rgb(255 42 31 / .35); }
.svc:hover .si { color: #fff; }

@media (max-width: 640px) {
  .svc-vis { height: 84px; margin: 0 0 2px; }
  .svc-vis .si { width: 38px; height: 38px; }
  .sv-ring { width: 62px; height: 62px; }
  .sv-code { display: none; }
}
@media (prefers-reduced-motion: reduce) { .svc-vis .si, .svc-vis .si > *, .sv-ring { animation: none !important; stroke-dashoffset: 0; } }
.sv-code { display: none !important; }

/* ------------------------------------------------------------------
   Live mini product UIs inside service cards
   ------------------------------------------------------------------ */
.svc-vis.has-mu { height: 168px; padding: 10px; display: block; background: radial-gradient(rgb(255 255 255 / .06) 1px, transparent 1.2px) 0 0 / 14px 14px, #110f0f; }
.svc-vis.has-mu::after { display: none; }
.mu { --f: 9.5px; position: relative; height: 100%; display: flex; flex-direction: column; overflow: hidden; border-radius: 7px; background: #171414;
  border: 1px solid rgb(255 255 255 / .1); box-shadow: 0 18px 30px -18px rgb(0 0 0 / .9), inset 0 1px 0 rgb(255 255 255 / .04);
  font-family: var(--mono); font-size: var(--f); line-height: 1.55; color: #d9d6d1; }
.mu-bar { flex: none; display: flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; background: #1f1b1b; border-bottom: 1px solid rgb(255 255 255 / .06); }
.mu-bar i { width: 7px; height: 7px; border-radius: 50%; background: #ff5f57; } .mu-bar i:nth-child(2) { background: #febc2e; } .mu-bar i:nth-child(3) { background: #28c840; }
.mu-bar span { margin-left: 8px; font-size: .9em; color: #8e8b87; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mu-body { position: relative; flex: 1; min-height: 0; padding: 7px 9px; overflow: hidden; display: flex; flex-direction: column; }
.mu-caret { display: inline-block; width: .55em; height: 1.05em; vertical-align: -.2em; margin-left: 1px; background: #d9d6d1; animation: caret 1s steps(1) infinite; }

/* terminal */
.mu-term .mu-body { justify-content: flex-end; }
.ml { white-space: pre; overflow: hidden; text-overflow: ellipsis; animation: ml-in .25s ease-out; }
.ml-p { color: #ff5a4f; } .ml-o { color: #a9a6a2; } .ml-ok { color: #3ddc97; } .ml-warn { color: #f5c451; } .ml-err { color: #ff6b5f; font-weight: 700; }
@keyframes ml-in { from { opacity: 0; transform: translateY(3px); } }

/* code editor */
.mu-tabs { flex: none; display: flex; height: 22px; background: #1f1b1b; border-bottom: 1px solid rgb(255 255 255 / .06); }
.mu-tabs span { display: flex; align-items: center; padding: 0 10px; color: #8e8b87; font-size: .92em; }
.mu-tabs span.on { color: #fff; background: #171414; border-top: 1.5px solid #ff2a1f; }
.mc-row { display: flex; gap: 9px; white-space: pre; } .mc-row i { width: 1.2em; text-align: right; font-style: normal; color: #5b5753; flex: none; }
.mc-row span { overflow: hidden; text-overflow: ellipsis; }
.hk-kw { color: #ff7a6e; } .hk-str { color: #e8c37a; } .hk-num { color: #8cc8ff; } .hk-fn { color: #d6b3ff; } .hk-del { color: #ff6b5f; background: rgb(255 70 60 / .1); } .hk-add { color: #3ddc97; background: rgb(61 220 151 / .1); }
.mc-out { margin-top: auto; padding-top: 5px; border-top: 1px dashed rgb(255 255 255 / .1); }
.mc-o { color: #a9a6a2; animation: ml-in .25s ease-out; } .mc-o.ok { color: #3ddc97; }

/* chat */
.mu-chat .mu-body { justify-content: flex-end; gap: 4px; font-family: var(--font, system-ui); font-size: calc(var(--f) + .5px); }
.cb { max-width: 82%; padding: 4px 8px; border-radius: 10px; line-height: 1.35; animation: cb-in .3s cubic-bezier(.2,.8,.2,1); }
.cb-u { align-self: flex-end; background: #ff2a1f; color: #fff; border-bottom-right-radius: 3px; }
.cb-b { align-self: flex-start; background: #2a2525; color: #e9e6e2; border-bottom-left-radius: 3px; }
.cb-typing { display: flex; gap: 3px; padding: 6px 9px; } .cb-typing i { width: 4px; height: 4px; border-radius: 50%; background: #8e8b87; animation: cb-dot 1s infinite; }
.cb-typing i:nth-child(2) { animation-delay: .15s; } .cb-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes cb-in { from { opacity: 0; transform: translateY(6px) scale(.96); } }
@keyframes cb-dot { 50% { opacity: .2; transform: translateY(-2px); } }

/* dashboard */
.md-k { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.md-k div { padding: 3px 6px; border-radius: 4px; background: rgb(255 255 255 / .04); }
.md-k span { display: block; font-size: .85em; color: #8e8b87; } .md-k b { font-size: 1.35em; color: #fff; font-variant-numeric: tabular-nums; }
.md-k div:nth-child(2) b { color: #3ddc97; }
.md-c { position: relative; flex: 1; min-height: 0; margin-top: 6px; }
.md-c svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.md-line { fill: none; stroke: #ff2a1f; stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; }
.md-c.in .md-line { transition: stroke-dashoffset 1.6s cubic-bezier(.65,0,.35,1); stroke-dashoffset: 0; }
.md-area { opacity: 0; } .md-c.in .md-area { opacity: 1; transition: opacity 1.2s .6s; }
.md-alert { fill: #ff2a1f; stroke: #fff; stroke-width: .6; vector-effect: non-scaling-stroke; opacity: 0; } .md-c.in .md-alert { opacity: 1; transition: opacity .3s 1.5s; }
.md-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 3px; }
.md-bars i { flex: 1; height: 0; border-radius: 2px 2px 0 0; background: rgb(255 255 255 / .22); transition: height .8s cubic-bezier(.2,.8,.2,1); }
.md-bars i.hi { background: #ff2a1f; }
.md-c.in .md-bars i { height: var(--h); } .md-c.in .md-bars i:nth-child(n) { transition-delay: calc(var(--d, 0) * 1s); }

/* pipeline steps */
.mu-steps .mu-body { gap: 2px; }
.st { display: grid; grid-template-columns: 12px 1fr auto; gap: 7px; align-items: center; color: #6f6b67; }
.st i { width: 9px; height: 9px; border-radius: 50%; border: 1.3px solid #4a4542; }
.st.run { color: #fff; } .st.run i { border-color: #ff2a1f; border-right-color: transparent; animation: st-spin .7s linear infinite; }
.st.done { color: #cfccc8; } .st.done i { border: 0; background: #3ddc97; position: relative; }
.st.done i::after { content: ""; position: absolute; left: 2.6px; top: 1.6px; width: 3px; height: 5px; border: solid #0f2a1e; border-width: 0 1.4px 1.4px 0; transform: rotate(45deg); }
.st.done.last { color: #3ddc97; font-weight: 700; }
.st em { font-style: normal; font-size: .85em; color: #6f6b67; }
@keyframes st-spin { to { transform: rotate(360deg); } }

/* data table */
.mu-table table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.mu-table th { text-align: left; font-weight: 400; color: #6f6b67; font-size: .88em; padding: 0 4px 3px; border-bottom: 1px solid rgb(255 255 255 / .08); }
.mu-table td { padding: 2.5px 4px; border-bottom: 1px solid rgb(255 255 255 / .04); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background 1s; }
.mu-table tr.new td { background: rgb(255 42 31 / .14); }
.pl { font-weight: 600; padding: 0 5px; border-radius: 3px; font-size: .9em; }
.pl-ok { color: #3ddc97; background: rgb(61 220 151 / .12); } .pl-bad { color: #ff6b5f; background: rgb(255 70 60 / .14); } .pl-mid { color: #f5c451; background: rgb(245 196 81 / .12); }

/* website + cursor */
.mu-site .mu-body { background: #f6f4f1; color: #161313; font-family: var(--font, system-ui); padding: 8px 10px; }
.mu-site .ms-url { color: #c9c5c0; }
.ms-nav { display: flex; align-items: center; gap: 6px; opacity: 0; transition: opacity .4s; } .ms-nav b { width: 14px; height: 6px; border-radius: 2px; background: #161313; margin-right: auto; } .ms-nav span { width: 16px; height: 3px; border-radius: 2px; background: #c9c5c0; }
.ms-h { margin-top: 7px; font-family: var(--display, inherit); font-weight: 800; font-size: 1.9em; line-height: 1; opacity: 0; transform: translateY(6px); transition: .5s cubic-bezier(.2,.8,.2,1); max-width: 62%; }
.ms-p { margin-top: 6px; display: grid; gap: 3px; opacity: 0; transition: opacity .5s; } .ms-p i { height: 3px; width: 50%; border-radius: 2px; background: #d6d2cc; } .ms-p i + i { width: 38%; }
.ms-btn { margin-top: 7px; align-self: flex-start; font: 600 .95em var(--font, system-ui); color: #fff; background: #161313; border: 0; border-radius: 5px; padding: 4px 9px; opacity: 0; transition: opacity .4s, transform .15s, background .2s; pointer-events: none; }
.ms-art { position: absolute; right: 10px; top: 30px; width: 30%; height: 55%; border-radius: 6px; background: linear-gradient(135deg, #ff2a1f, #7a0c06); opacity: 0; transform: scale(.94); transition: .6s cubic-bezier(.2,.8,.2,1); }
.mu-cur { position: absolute; width: 13px; height: 13px; left: 85%; top: 95%; opacity: 0; transition: left .9s cubic-bezier(.65,0,.35,1), top .9s cubic-bezier(.65,0,.35,1), opacity .3s; z-index: 3; }
.ms-toast { position: absolute; right: 8px; bottom: 8px; font: 600 .9em var(--font, system-ui); color: #0f2a1e; background: #3ddc97; padding: 3px 8px; border-radius: 5px; opacity: 0; transform: translateY(6px); transition: .35s cubic-bezier(.2,.8,.2,1); }
.mu-body.s1 .ms-nav { opacity: 1; } .mu-body.s2 .ms-h { opacity: 1; transform: none; } .mu-body.s2 .ms-art { opacity: 1; transform: none; }
.mu-body.s3 .ms-p, .mu-body.s3 .ms-btn { opacity: 1; }
.mu-body.s4 .mu-cur { opacity: 1; left: 22%; top: 76%; }
.mu-body.click .ms-btn { transform: scale(.93); background: #ff2a1f; }
.mu-body.s5 .ms-toast { opacity: 1; transform: none; }

/* phone app */
.mu-phone { flex-direction: row; align-items: center; justify-content: center; gap: 14px; background: transparent; border: 0; box-shadow: none; }
.mp-dev { position: relative; width: 82px; height: 100%; border-radius: 14px; border: 2px solid #3a3434; background: #0c0a0a; padding: 14px 6px 18px; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.mp-notch { position: absolute; top: 4px; left: 50%; width: 26px; height: 5px; margin-left: -13px; border-radius: 3px; background: #2a2525; }
.mp-top { font-weight: 700; color: #fff; font-size: .95em; }
.mp-list { display: grid; gap: 3px; }
.mp-row { display: flex; align-items: center; gap: 4px; padding: 3px 4px; border-radius: 4px; background: #1d1919; font-size: .78em; color: #d9d6d1; animation: cb-in .35s cubic-bezier(.2,.8,.2,1); white-space: nowrap; overflow: hidden; }
.mp-row i { flex: none; width: 6px; height: 6px; border-radius: 50%; background: #ff2a1f; }
.mp-toast { position: absolute; left: 5px; right: 5px; bottom: 16px; font-size: .72em; text-align: center; padding: 3px; border-radius: 4px; color: #0f2a1e; background: #3ddc97; opacity: 0; transform: translateY(6px); transition: .35s; }
.mp-dev.t .mp-toast { opacity: 1; transform: none; }
.mp-tab { position: absolute; left: 0; right: 0; bottom: 4px; display: flex; justify-content: center; gap: 10px; } .mp-tab i { width: 5px; height: 5px; border-radius: 50%; background: #3a3434; } .mp-tab i.on { background: #ff2a1f; }
.mp-side { display: flex; flex-direction: column; gap: 2px; } .mp-side span { color: #fff; font-weight: 700; } .mp-side b { font-weight: 400; color: #3ddc97; font-size: .85em; }
.mp-side b::before { content: "● "; }

@media (max-width: 640px) {
  .svc-vis.has-mu { height: 128px; padding: 6px; }
  .mu { --f: 7.2px; border-radius: 5px; }
  .mu-bar { height: 15px; padding: 0 5px; } .mu-bar i { width: 5px; height: 5px; }
  .mu-tabs { height: 16px; } .mu-body { padding: 5px 6px; }
  .mp-dev { width: 64px; border-radius: 11px; } .mp-side { display: none; }
  .ms-art { display: none; } .ms-h { max-width: 100%; }
}
.svc-vis.has-mu { display: block !important; place-items: initial; }
.svc-vis.has-mu > .mu { width: 100%; }

/* FAQ */
#faq.block { grid-template-columns: minmax(8rem, .55fr) minmax(0, 3fr); }
.qa { border-top: 1px solid rgb(255 255 255 / .1); max-width: 56rem; }
.qa:last-child { border-bottom: 1px solid rgb(255 255 255 / .1); }
.qa summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.05rem 0; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary h3 { font-size: clamp(1rem, .95rem + .3vw, 1.2rem); font-weight: 600; color: #f4f3f1; }
.qa summary::after { content: "+"; font-family: var(--mono); font-size: 1.3rem; color: var(--signal-hi); transition: transform .3s; flex: none; }
.qa[open] summary::after { transform: rotate(45deg); }
.qa p { padding: 0 0 1.2rem; color: #c4c4c2; line-height: 1.65; max-width: 48rem; }
@media (max-width: 760px) { #faq.block { grid-template-columns: minmax(0, 1fr); } }

/* optional support card (contact section) */
.support { display: flex; flex-wrap: wrap; align-items: center; gap: 1.4rem 2rem; margin-top: 2.6rem; padding: 1.3rem 1.4rem; max-width: 52rem;
  border: 1px solid rgb(255 255 255 / .1); background: linear-gradient(160deg, rgb(255 42 31 / .05), transparent 45%), rgb(16 13 13 / .6); }
.sp-text { flex: 1 1 22rem; min-width: 0; display: flex; flex-direction: column; gap: .55rem; }
.sp-k { font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--granite); } .sp-k span { color: var(--signal-hi); }
.support h3 { font-size: 1.15rem; font-weight: 700; color: #f4f3f1; }
.sp-text > p:not(.sp-k) { color: #b9b7b4; font-size: .9rem; line-height: 1.6; }
.sp-net { font-family: var(--mono); font-size: .78rem !important; } .sp-net b { color: #26a17b; }
.sp-addr { display: flex; align-items: stretch; gap: 0; border: 1px solid rgb(255 255 255 / .14); max-width: 100%; }
.sp-addr code { flex: 1; min-width: 0; padding: .55rem .7rem; font-family: var(--mono); font-size: .76rem; color: #efeeec; overflow-wrap: anywhere; user-select: all; }
.sp-copy { flex: none; padding: 0 .9rem; font-family: var(--mono); font-size: .74rem; color: #fff; background: rgb(255 255 255 / .06); border: 0; border-left: 1px solid rgb(255 255 255 / .14); cursor: pointer; }
.sp-copy:hover { background: rgb(255 42 31 / .25); }
.sp-warn { font-size: .74rem !important; color: #f5c451 !important; }
.sp-qr { flex: none; width: 148px; height: 148px; padding: 8px; background: #fff; border-radius: 8px; }
@media (max-width: 560px) { .sp-qr { margin: 0 auto; } }
.support-sec .support { margin-top: 0; }
.support-sec h2 { }
