/* ============================================================
   RATIO — PROJECT HUB
   A black-and-white design system — softened, professional.
   No color. No noise. Just structure and signal.
   ============================================================ */

:root{
  --bg:        #0a0a0a;
  --bg-soft:   #101010;
  --bg-lift:   #161616;
  --fg:        #e9e9e9;
  --muted:     #a2a2a2;
  --dim:       #7c7c7c;
  --faint:     #555;

  --line:          rgba(255,255,255,.08);
  --line-soft:     rgba(255,255,255,.05);
  --line-strong:   rgba(255,255,255,.22);

  --glass:      rgba(16,16,16,.82);
  --glare:      rgba(255,255,255,.055);

  --radius:       18px;
  --radius-sm:    12px;
  --radius-xs:    8px;

  --card-inset:  inset 0 1px 0 rgba(255,255,255,.06);
  --shadow-lift: 0 26px 60px -30px rgba(0,0,0,.55);
  --shadow-modal:0 40px 120px -40px rgba(0,0,0,.72);
  --title-shadow:0 24px 70px rgba(0,0,0,.45);

  --display:  'Space Grotesk', system-ui, sans-serif;
  --mono:     'JetBrains Mono', ui-monospace, monospace;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* Light mode — the same system, inverted. */
body.light{
  --bg:        #f4f4f2;
  --bg-soft:   #ebebe8;
  --bg-lift:   #e3e3df;
  --fg:        #111110;
  --muted:     #5a5a58;
  --dim:       #838381;
  --faint:     #b4b4b1;

  --line:          rgba(17,17,16,.1);
  --line-soft:     rgba(17,17,16,.055);
  --line-strong:   rgba(17,17,16,.28);

  --glass:      rgba(244,244,242,.82);
  --glare:      rgba(17,17,16,.045);

  --card-inset:  inset 0 1px 0 rgba(255,255,255,.55);
  --shadow-lift: 0 26px 60px -30px rgba(0,0,0,.16);
  --shadow-modal:0 40px 120px -40px rgba(0,0,0,.26);
  --title-shadow:0 24px 70px rgba(0,0,0,.12);
}

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

html{
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--faint) transparent;
}

body{
  background: var(--bg);
  color: var(--fg);
  font-family: var(--display);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .5s var(--ease-out), color .5s var(--ease-out);
}

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

::-webkit-scrollbar{ width: 9px; }
::-webkit-scrollbar-track{ background: transparent; }
::-webkit-scrollbar-thumb{
  background: var(--faint);
  border-radius: 99px;
  border: 2px solid var(--bg);
}

a{ color: inherit; text-decoration: none; }
button{ font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
em{ font-style: normal; font-weight: 500; }
strong{ font-weight: 600; }

.mono{ font-family: var(--mono); }
.blink{ animation: blink 1.1s steps(1) infinite; }
@keyframes blink{ 50%{ opacity: 0; } }

/* ============================ CANVAS / OVERLAYS ============================ */
#scene{
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Soft vignette that lets the 3D recede behind the content. */
.scene-shade{
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(135% 105% at 50% 20%, transparent 28%, var(--bg) 88%);
}

.noise{
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: .045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.progress{
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: 0 0;
  z-index: 70;
  opacity: .8;
}

/* ============================ CURSOR ============================ */
.cursor, .cursor-ring{
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  pointer-events: none;
  border-radius: 50%;
  display: none;
}

body.cursor-active .cursor,
body.cursor-active .cursor-ring{ display: block; }

.cursor{
  width: 8px; height: 8px;
  background: var(--fg);
}

.cursor-ring{
  width: 34px; height: 34px;
  border: 1px solid var(--fg);
  opacity: .45;
  transition: opacity .25s;
}

body.cursor-active{ cursor: none; }
body.cursor-active a, body.cursor-active button{ cursor: none; }
body.cursor-big .cursor-ring{ opacity: .85; }

/* ============================ HEADER ============================ */
header{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 30px;
  color: #fff;                     /* fixed white for difference blend */
  mix-blend-mode: difference;      /* auto-inverts over black AND white */
  transition: transform .45s var(--ease-out), padding .45s var(--ease-out);
}
header.scrolled{ padding-block: 12px; }
header.hidden-header{ transform: translateY(-110%); }

.brand{
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--mono);
}
.brand-mark{
  width: 28px; height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.brand-mark svg{
  width: 20px; height: 20px;
  transition: transform .4s var(--ease-out);
}
.brand-mark:hover svg{ transform: rotate(30deg); }
.brand-name{
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .24em;
}
.brand-sup{ font-size: 9px; opacity: .55; }

.nav{
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,.06);
  border-radius: 99px;
  padding: 3px;
}
.nav a{
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 99px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  color: rgba(255,255,255,.5);
  white-space: nowrap;
  transition: background .3s, color .3s;
}
.nav a::after{ display: none; }
.nav a:hover{ background: rgba(255,255,255,.12); color: #fff; }
.nav a.active{ background: #fff; color: #000; }
.nav-num{ font-size: 9px; opacity: .45; }
.nav a.active .nav-num{ opacity: .7; }

.header-right{
  display: flex;
  align-items: center;
  gap: 18px;
}
.sys-status{
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: .7;
}
.dot{
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse{
  0%, 100%{ box-shadow: 0 0 0 0 rgba(255,255,255,.45); }
  50%{ box-shadow: 0 0 0 6px rgba(255,255,255,0); }
}

.mode-toggle{
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 99px;
  padding: 7px 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  will-change: transform;
  transition: background .3s, color .3s, border-color .3s;
}
.mode-toggle:hover{ background: #fff; color: #000; border-color: #fff; }
.mode-label{ opacity: .5; }
.mode-value{ font-weight: 700; }

/* ============================ SECTIONS ============================ */
.section{
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 150px 30px 70px;
  scroll-margin-top: 40px;
}

.section-head{
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
  margin-bottom: 58px;
}
.section-index{
  font-size: 11px;
  color: var(--dim);
  letter-spacing: .24em;
  border: 1px solid var(--line-soft);
  border-radius: 99px;
  padding: 4px 11px;
}
.section-title{
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 500;
  letter-spacing: .04em;
}
.section-count{
  margin-left: auto;
  font-size: 11px;
  color: var(--dim);
  letter-spacing: .2em;
}

/* ============================ HERO ============================ */
.hero{
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 130px 30px 30px;
}

.hero-top{
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 11px;
  letter-spacing: .22em;
  color: var(--muted);
  padding-top: 10px;
}
.hero-coord{ font-size: 10px; color: var(--dim); text-align: right; }

.hero-title{
  position: relative;
  z-index: 2;
  text-align: center;
  margin: 5vh 0 3vh;
  user-select: none;
  filter: drop-shadow(var(--title-shadow));
}
.hero-title-line{
  display: block;
  font-size: clamp(72px, 15vw, 186px);
  font-weight: 600;
  line-height: .92;
  letter-spacing: -.03em;
  color: transparent;
  -webkit-text-stroke: 1px var(--fg);
  transition: color 1s var(--ease-out);
}
/* When scrolling away, RATIO fills solid on top of the stroke. */
.hero-title.filled .hero-title-line{
  color: var(--fg);
  animation: titleBreathe 8s ease-in-out infinite;
}
@keyframes titleBreathe{
  0%,100%{ transform: scale(1); }
  50%{ transform: scale(1.008); }
}

.hero-bottom{
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 52px;   /* keep clear of the telemetry row below */
}
.hero-sub{
  font-size: clamp(15px, 1.8vw, 19px);
  max-width: 520px;
  color: var(--muted);
  line-height: 1.65;
}
.hero-cta{ display: flex; gap: 12px; flex-wrap: wrap; }

.btn{
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .18em;
  padding: 14px 26px;
  border-radius: 99px;
  will-change: transform;
  transition: background .35s, color .35s, border-color .35s, transform .15s var(--ease-out);
}
.btn-solid{
  background: var(--fg);
  color: var(--bg);
  border: 1px solid var(--fg);
}
.btn-solid:hover{ background: var(--bg); color: var(--fg); }
.btn-ghost{
  border: 1px solid var(--line-strong);
  color: var(--fg);
}
.btn-ghost:hover{ border-color: var(--fg); background: var(--fg); color: var(--bg); }

.telemetry{
  position: absolute;
  left: 30px;
  bottom: 30px;
  display: flex;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
}
.tel{
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 99px;
  background: var(--glass);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.tel-k{ color: var(--dim); }
.tel-v{ color: var(--fg); font-weight: 500; }

.scroll-hint{
  position: absolute;
  right: 34px;
  bottom: 34px;
  font-size: 9px;
  letter-spacing: .3em;
  color: var(--dim);
  writing-mode: vertical-rl;
  animation: drift 2.8s ease-in-out infinite;
}
@keyframes drift{
  0%,100%{ transform: translateY(-4px); opacity: .45; }
  50%{ transform: translateY(6px); opacity: 1; }
}

/* ============================ MARQUEE ============================ */
.marquee{
  position: relative;
  z-index: 2;
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding-block: 15px;
  opacity: .9;
}
.marquee-track{
  display: flex;
  width: max-content;
  animation: marquee 30s linear infinite;
}
.marquee:hover .marquee-track{ animation-play-state: paused; }
.marquee-group{
  display: flex;
  gap: 2.75rem;
  padding-right: 2.75rem;
  align-items: center;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .3em;
  color: var(--dim);
  white-space: nowrap;
}
.marquee-group span:nth-child(even){ color: var(--faint); font-size: 10px; }
@keyframes marquee{ to{ transform: translateX(-50%); } }

/* ============================ MANIFESTO ============================ */
.manifesto-text{
  font-size: clamp(26px, 4.2vw, 48px);
  font-weight: 400;
  line-height: 1.24;
  letter-spacing: -.015em;
  max-width: 1000px;
  margin-bottom: 90px;
}
.manifesto-text .reveal{ display: block; margin-bottom: .38em; }
.manifesto-text em, .manifesto-text strong{ font-weight: 600; }

.manifesto-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.mg-cell{
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 30px;
  box-shadow: var(--card-inset);
  transition: background .4s, border-color .4s, transform .4s var(--ease-out);
}
.mg-cell:hover{
  background: var(--bg-lift);
  border-color: var(--line-strong);
  transform: translateY(-3px);
}
.mg-index{
  font-size: 10px;
  color: var(--dim);
  letter-spacing: .22em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  margin-bottom: 20px;
}
.mg-cell h3{
  font-size: 17px;
  font-weight: 500;
  letter-spacing: .02em;
  margin-bottom: 12px;
}
.mg-cell p{ font-size: 14px; color: var(--muted); max-width: 36ch; }

/* ============================ PROJECTS ============================ */
.filters{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}
.filter{
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  padding: 9px 18px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--muted);
  transition: background .3s, color .3s, border-color .3s;
}
.filter:hover{ border-color: var(--fg); color: var(--fg); }
.filter.active{
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.filter-count{ font-size: 9px; opacity: .5; }

.grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.reveal-wrap{
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.reveal-wrap.in{ opacity: 1; transform: none; }
.reveal-wrap.hidden{
  opacity: 0;
  transform: scale(.95);
  transition: opacity .3s ease, transform .3s ease;
}
.reveal-wrap.hidden .card{ pointer-events: none; }

/* --- Project card --- */
.card{
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  padding: 28px;
  background: linear-gradient(180deg, var(--bg-lift), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--card-inset);
  transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .12s ease-out, border-color .4s, box-shadow .4s;
  will-change: transform;
  overflow: hidden;
}
.card::after{ /* soft sheen that follows the cursor */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(440px circle at var(--mx, 50%) var(--my, 50%), var(--glare), transparent 55%);
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
}
.card:hover{
  border-color: var(--line-strong);
  box-shadow: var(--card-inset), var(--shadow-lift);
  z-index: 2;
}
.card:hover::after{ opacity: 1; }

.card-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
}
.card-index{ color: var(--dim); }
.card-status{
  padding: 4px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  color: var(--fg);
}
.card-status[data-status="LIVE"]{ border-style: solid; }
.card-status[data-status="RESEARCH"]{ border-style: dashed; color: var(--muted); }
.card-status[data-status="ARCHIVED"]{
  border-style: solid;
  color: var(--dim);
  text-decoration: line-through;
  text-decoration-color: var(--faint);
}

.card-title{
  font-size: clamp(28px, 2.6vw, 36px);
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.05;
}
.card-handler{
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  letter-spacing: .14em;
}
.card-blurb{
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
}

.card-tags{
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
}
.tag{
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .14em;
  color: var(--dim);
  border: 1px solid var(--line-soft);
  border-radius: 99px;
  padding: 4px 9px;
}

.card-open{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--fg);
}
.card-open .arrow{
  display: inline-block;
  transition: transform .35s var(--ease-out);
}
.card:hover .card-open .arrow{ transform: translateX(6px); }

/* ============================ HANDLERS ============================ */
.handler-list{
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.handler-row{
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 20px 26px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  transition: background .4s, padding-left .45s var(--ease-out);
}
.handler-row:last-child{ border-bottom: none; }
.handler-row:hover{
  background: var(--fg);
  color: var(--bg);
  padding-left: 34px;
}
.handler-avatar{
  width: 46px; height: 46px;
  border: 1px solid currentColor;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .05em;
}
.handler-name{ font-size: 18px; font-weight: 500; letter-spacing: .02em; }
.handler-role{
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .12em;
  margin-top: 3px;
}
.handler-row:hover .handler-role{ color: var(--bg); opacity: .65; }
.handler-projects{
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--dim);
  text-align: right;
}
.handler-row:hover .handler-projects{ color: var(--bg); opacity: .65; }

/* ============================ FOOTER ============================ */
.footer{
  position: relative;
  z-index: 2;
  padding: 100px 30px 40px;
  overflow: hidden;
}
.footer-big{
  font-size: clamp(110px, 27vw, 320px);
  font-weight: 600;
  line-height: .85;
  letter-spacing: -.03em;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-strong);
  text-align: center;
  user-select: none;
  margin-bottom: 40px;
  opacity: .45;
  transition: opacity .6s;
}
.footer-big:hover{ opacity: .9; }
.footer-row{
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--muted);
}
.footer-links{ margin-top: 16px; color: var(--dim); }
.footer-links a:hover{ color: var(--fg); text-decoration: underline; text-underline-offset: .3em; }

/* ============================ MODAL ============================ */
.modal{
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s var(--ease-out), visibility .4s;
}
.modal.open{ opacity: 1; visibility: visible; }

.modal-backdrop{
  position: absolute;
  inset: 0;
  background: var(--glass);
  backdrop-filter: blur(12px) saturate(.7);
  -webkit-backdrop-filter: blur(12px) saturate(.7);
}

.modal-panel{
  position: relative;
  width: min(720px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  box-shadow: var(--shadow-modal);
  padding: 42px 44px 32px;
  transform: translateY(20px) scale(.985);
  transition: transform .45s var(--ease-out);
}
.modal.open .modal-panel{ transform: none; }
.modal-panel::-webkit-scrollbar{ width: 7px; }

.modal-close{
  position: absolute;
  top: 20px; right: 22px;
  width: 40px; height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .3s, color .3s, transform .3s var(--ease-out);
  z-index: 2;
}
.modal-close:hover{ background: var(--fg); color: var(--bg); transform: rotate(90deg); }

.modal-meta{
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--dim);
  margin-bottom: 28px;
  padding-right: 50px;
}
.modal-meta .meta-status{
  color: var(--fg);
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  padding: 3px 11px;
}
.modal-meta .meta-status[data-status="ARCHIVED"]{ text-decoration: line-through; color: var(--dim); }

.modal-title{
  font-size: clamp(40px, 6.5vw, 60px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: .01em;
  margin-bottom: 12px;
}
.modal-handler{
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--dim);
  margin-bottom: 32px;
}
.modal-handler b{ color: var(--fg); font-weight: 500; }

.modal-desc{
  font-size: 16px;
  line-height: 1.8;
  color: var(--muted);
  max-width: 58ch;
  margin-bottom: 36px;
}

.modal-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.modal-col{
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 26px;
}
.modal-col h4{
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .26em;
  color: var(--dim);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-col h4::after{ content: ""; flex: 1; height: 1px; background: var(--line); }
.modal-func li{
  list-style: none;
  font-size: 14px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line-soft);
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.modal-func li:last-child{ border-bottom: none; }
.modal-func .fn{
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg);
}
.modal-func .fn::before{ content: "›"; margin-right: 10px; color: var(--dim); }
.ideal-tags{ display: flex; flex-wrap: wrap; gap: 9px; }
.ideal{
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--fg);
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  padding: 8px 14px;
  transition: background .25s, color .25s;
}
.ideal:hover{ background: var(--fg); color: var(--bg); }

.modal-stats{
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--dim);
}
.modal-stats b{ color: var(--fg); font-weight: 500; }

.modal-nav{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.modal-nav button{
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .2em;
  padding: 11px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  transition: background .3s, color .3s, border-color .3s;
}
.modal-nav button:hover{ border-color: var(--fg); background: var(--fg); color: var(--bg); }
.modal-nav .nav-next{ margin-left: auto; }

body.modal-open{ overflow: hidden; }

/* ============================ TOAST + FLASH ============================ */
.toast{
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(10px);
  z-index: 90;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .2em;
  padding: 12px 22px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: var(--glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .35s, transform .35s var(--ease-out);
  pointer-events: none;
  white-space: nowrap;
}
.toast.show{ opacity: 1; transform: translateX(-50%) translateY(0); }

.flash{
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #fff;
  pointer-events: none;
  animation: flashAnim .55s ease-out forwards;
}
@keyframes flashAnim{ from{ opacity: 1; } to{ opacity: 0; } }

/* ============================ PROJECT PAGE ============================ */
.project-page-body{
  max-width: 860px;
  margin: 0 auto;
  padding: 120px 30px 80px;
}

.project-hero{ margin-bottom: 60px; }
.project-meta{
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .22em;
  color: var(--dim);
  margin-bottom: 18px;
}
.p-status{
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  padding: 4px 12px;
  color: var(--fg);
}
.p-status[data-status="ARCHIVED"]{ text-decoration: line-through; color: var(--dim); }
.project-title{
  font-size: clamp(48px, 8vw, 80px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: .01em;
  margin-bottom: 12px;
}
.project-handler{
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--dim);
}
.project-handler b{ color: var(--fg); font-weight: 500; }

.project-section{ margin-bottom: 52px; }
.project-desc{
  font-size: clamp(17px, 2.2vw, 20px);
  line-height: 1.8;
  color: var(--muted);
  max-width: 62ch;
}

.project-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.project-col{
  background: var(--bg-soft);
  padding: 28px;
}
.project-col h4{
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .26em;
  color: var(--dim);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.project-col h4::after{ content: ""; flex: 1; height: 1px; background: var(--line); }
.project-col li{
  list-style: none;
  font-size: 14px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line-soft);
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.project-col li:last-child{ border-bottom: none; }
.project-col .fn{ font-family: var(--mono); color: var(--fg); }
.project-col .ideal{
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  padding: 8px 14px;
  margin: 0 8px 8px 0;
  transition: background .25s, color .25s;
}
.project-col .ideal:hover{ background: var(--fg); color: var(--bg); }

/* handler custom content area */
.project-content{ }
.project-content:not(.has-content){ display: none; }
.project-content h3{
  font-size: 17px;
  font-weight: 500;
  letter-spacing: .04em;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.project-content p{
  font-size: 15px;
  line-height: 1.75;
  color: var(--muted);
  margin-bottom: 18px;
}
.handler-demo{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.demo-box{
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 12px);
  padding: 18px;
}
.demo-label{
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .2em;
  color: var(--dim);
  margin-bottom: 8px;
}
.demo-value{
  display: block;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.handler-note{
  background: var(--bg-lift);
  border-left: 3px solid var(--line-strong);
  padding: 18px 22px;
  margin-top: 22px;
}
.note-label{
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .22em;
  color: var(--dim);
  margin-bottom: 10px;
}
.handler-note p{ margin: 0; font-size: 14px; color: var(--muted); line-height: 1.7; }
.handler-text{ font-size: 14px; color: var(--muted); line-height: 1.75; }
.handler-code{
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 12px);
  padding: 22px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  overflow-x: auto;
  margin-bottom: 22px;
}
.handler-table{
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 12px;
  margin-bottom: 22px;
}
.handler-table th,
.handler-table td{
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.handler-table th{
  font-size: 9px;
  letter-spacing: .2em;
  color: var(--dim);
  font-weight: 500;
}
.handler-table td:last-child{ color: var(--fg); font-weight: 500; }

.project-stats{
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--dim);
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.project-stats .stat{ display: flex; flex-direction: column; gap: 4px; }
.project-stats .stat-k{ color: var(--dim); }
.project-stats .stat-v{ color: var(--fg); font-weight: 500; }

.project-page .footer{
  padding: 60px 30px 40px;
}
.project-page .footer a{ text-decoration: none; }
.project-page .footer a:hover{ text-decoration: underline; text-underline-offset: .3em; }

@media (max-width: 860px){
  .project-page-body{ padding: 100px 20px 60px; }
  .handler-demo{ grid-template-columns: 1fr 1fr; }
}

/* ============================ REVEAL ============================ */
.reveal{
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.reveal.in{ opacity: 1; transform: none; }

/* ============================ RESPONSIVE ============================ */
@media (max-width: 860px){
  .nav{ display: none; }
  .hero-top, .hero-bottom{ flex-direction: column; align-items: flex-start; }
  .hero-coord{ text-align: left; }
  .telemetry{ position: static; margin-top: 26px; flex-wrap: wrap; }
  .scroll-hint{ display: none; }
  .section{ padding: 110px 22px 44px; }
  .hero{ padding: 120px 22px 30px; }
  .modal-panel{ padding: 34px 24px 26px; }
  .handler-row{ grid-template-columns: 52px 1fr; }
  .handler-projects{ grid-column: 1 / -1; text-align: left; }
  header{ padding: 14px 20px; }
  .sys-status{ display: none; }
}

/* ============================ REDUCED MOTION ============================ */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{
    animation-duration: .001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001s !important;
  }
  .cursor, .cursor-ring{ display: none !important; }
  body.cursor-active, body.cursor-active a, body.cursor-active button{ cursor: auto; }
}
