/* ============================================================
   Josue Mendes — landing
   Calm, dark, nature-toned. Instrument Serif italics + Geist.
   ============================================================ */

:root {
  --bg: oklch(0.16 0.006 140);
  --bg-2: oklch(0.19 0.008 140);
  --card: oklch(1 0 0 / 0.045);
  --panel: oklch(0.165 0.012 145);
  --line: oklch(1 0 0 / 0.09);
  --line-soft: oklch(1 0 0 / 0.06);
  --ink: oklch(0.93 0.012 120);
  --muted: oklch(0.72 0.015 130);
  --faint: oklch(0.58 0.015 130);
  --moss: oklch(0.78 0.07 135);
  --gold: oklch(0.78 0.09 85);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --monof: "Geist Mono", ui-monospace, "SF Mono", monospace;
  --r: 24px;
  --r-sm: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* ambient glows so glass surfaces have something to refract */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 620px at 12% 16%, oklch(0.34 0.05 150 / 0.22), transparent 65%),
    radial-gradient(1000px 720px at 88% 64%, oklch(0.32 0.045 110 / 0.18), transparent 65%),
    radial-gradient(760px 540px at 45% 110%, oklch(0.32 0.05 85 / 0.12), transparent 65%);
}
@media (pointer: fine) {
  body, a, button { cursor: none; }
}

h1, h2, h3 { font-weight: 400; letter-spacing: -0.02em; text-wrap: balance; }
h1 em, h2 em, h3 em, .quote-main em, .cta h2 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}
p { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--monof); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
img { display: block; }

/* ---------- bubble cursor ---------- */
.cursor-bubble {
  position: fixed; left: -100px; top: -100px; z-index: 999;
  width: 36px; height: 36px; border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  border: 1px solid oklch(1 0 0 / 0.45);
  background: radial-gradient(circle at 34% 28%, oklch(1 0 0 / 0.22), oklch(1 0 0 / 0.04) 62%);
  backdrop-filter: blur(3px) saturate(1.15);
  box-shadow: 0 6px 22px oklch(0 0 0 / 0.28), inset 0 1px 1px oklch(1 0 0 / 0.3);
  opacity: 0;
  transition: width 0.25s ease, height 0.25s ease, opacity 0.35s ease;
}
.cursor-bubble.on { opacity: 1; }
.cursor-bubble.big { width: 58px; height: 58px; }
@media (pointer: coarse) { .cursor-bubble { display: none; } }

/* ---------- buttons / badges ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 26px; border-radius: 999px;
  font-size: 15px; font-weight: 500; line-height: 1;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-light { background: var(--ink); color: oklch(0.2 0.012 145); }
.btn-light:hover { background: oklch(0.99 0.008 120); }
.btn-ghost { border: 1px solid oklch(1 0 0 / 0.22); color: var(--ink); background: oklch(0 0 0 / 0.18); backdrop-filter: blur(6px); }
.btn-ghost:hover { border-color: oklch(1 0 0 / 0.45); }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px;
  font-family: var(--monof); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); background: oklch(1 0 0 / 0.03);
}

.pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--moss);
  display: inline-block; flex: none;
  box-shadow: 0 0 0 0 oklch(0.78 0.07 135 / 0.5);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 oklch(0.78 0.07 135 / 0.45); }
  70% { box-shadow: 0 0 0 9px oklch(0.78 0.07 135 / 0); }
  100% { box-shadow: 0 0 0 0 oklch(0.78 0.07 135 / 0); }
}

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 36px;
  transition: background 0.4s ease, padding 0.4s ease;
}
.nav-left { display: flex; align-items: center; gap: 16px; }
.menu-btn {
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  width: 42px; height: 42px; padding: 0 11px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px;
  background: oklch(0.14 0.01 145 / 0.55); backdrop-filter: blur(10px);
  transition: border-color 0.25s, background 0.25s;
}
.menu-btn span { display: block; height: 1.6px; width: 100%; background: var(--ink); border-radius: 2px; transition: transform 0.3s, opacity 0.2s, width 0.3s; }
.menu-btn span:nth-child(2) { width: 70%; }
.menu-btn:hover { border-color: oklch(0.78 0.07 135 / 0.45); background: oklch(0.16 0.012 145 / 0.75); }
.menu-btn:hover span:nth-child(2) { width: 100%; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.6px) rotate(-45deg); }
.nav.scrolled { background: oklch(0.16 0.012 145 / 0.82); backdrop-filter: blur(14px); padding: 12px 36px; border-bottom: 1px solid var(--line-soft); }
.logo { font-family: var(--sans); font-size: 20px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; display: inline-block; }
.logo .lx { color: var(--moss); }
.logo-studio { font-family: var(--monof); font-size: 10px; font-weight: 500; letter-spacing: 0.36em; text-transform: uppercase; color: var(--faint); padding-left: 10px; border-left: 1px solid var(--line); }
.logo em { font-style: italic; color: var(--moss); }
.nav-pills {
  display: flex; gap: 4px; padding: 6px;
  border: 1px solid var(--line); border-radius: 999px;
  background: oklch(0.14 0.01 145 / 0.55); backdrop-filter: blur(10px);
}
.nav-pills a {
  padding: 8px 18px; border-radius: 999px; font-size: 14.5px; font-weight: 400; color: var(--muted);
  transition: color 0.2s, background 0.2s;
}
.nav-pills a:hover { color: var(--ink); background: oklch(1 0 0 / 0.06); }
.nav-right { display: flex; align-items: center; gap: 14px; }
.lang-switch { display: flex; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: oklch(0.14 0.01 145 / 0.55); backdrop-filter: blur(10px); }
.lang-btn {
  border: 0; background: transparent; color: var(--faint); cursor: pointer;
  font-family: var(--monof); font-size: 11px; letter-spacing: 0.06em;
  padding: 7px 11px; border-radius: 999px; transition: color 0.2s, background 0.2s;
}
.lang-btn:hover { color: var(--ink); }
.lang-btn.active { background: oklch(1 0 0 / 0.1); color: var(--ink); }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  overflow: hidden;
}
#forest { position: absolute; inset: 0; width: 100%; height: 100%; cursor: none; }
.hero-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, oklch(0.1 0.01 145 / 0.62) 0%, transparent 26%),
    linear-gradient(0deg, oklch(0.14 0.012 145 / 0.85) 0%, transparent 32%),
    radial-gradient(ellipse 62% 46% at 50% 44%, oklch(0.08 0.01 145 / 0.26) 0%, transparent 70%);
}
.hero-inner {
  position: relative; z-index: 2; pointer-events: none;
  text-align: center; padding: 140px 24px 0;
  display: flex; flex-direction: column; align-items: center; gap: 26px;
}
.hero-inner .badge { pointer-events: auto; background: oklch(0.12 0.01 145 / 0.5); backdrop-filter: blur(8px); white-space: nowrap; }
.hero h1 {
  text-wrap: wrap;
  font-size: clamp(42px, 5.9vw, 86px); line-height: 1.06;
  text-shadow: 0 2px 30px oklch(0.08 0.01 145 / 0.55), 0 1px 4px oklch(0.08 0.01 145 / 0.5);
}
.hero-sub {
  max-width: 620px; font-size: 18.5px; color: oklch(0.88 0.012 120);
  text-shadow: 0 1px 12px oklch(0.08 0.01 145 / 0.7);
}
.hero-actions { display: flex; gap: 14px; pointer-events: auto; flex-wrap: wrap; justify-content: center; }

.hero-foot {
  position: relative; z-index: 2; pointer-events: none;
  margin-top: auto; padding: 48px 36px 0;
}
.forest-meta {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding-bottom: 18px; flex-wrap: wrap;
}
.hero-hint { max-width: 380px; color: oklch(0.8 0.015 130); text-transform: none; letter-spacing: 0.02em; font-size: 12.5px; line-height: 1.55; text-shadow: 0 1px 8px oklch(0.08 0.01 145 / 0.8); }
.forest-status {
  pointer-events: auto; white-space: nowrap;
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); background: oklch(0.13 0.01 145 / 0.6); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px;
}
.intact-pct { color: var(--ink); min-width: 52px; }
.restore {
  border: 0; cursor: pointer; border-radius: 999px; padding: 6px 13px;
  font-family: var(--monof); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  background: oklch(0.78 0.07 135 / 0.16); color: var(--moss);
  opacity: 0.35; transition: opacity 0.3s, background 0.2s;
}
.forest-status.dirty .restore { opacity: 1; }
.restore:hover { background: oklch(0.78 0.07 135 / 0.3); }

.hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  border-top: 1px solid oklch(1 0 0 / 0.14);
  background: linear-gradient(0deg, oklch(0.12 0.012 145 / 0.72), oklch(0.12 0.012 145 / 0.3));
  backdrop-filter: blur(6px);
  margin: 0 -36px; padding: 28px 36px 30px;
}
.stat { text-align: left; }
.stat-n { font-family: var(--monof); font-size: clamp(28px, 3vw, 40px); font-weight: 400; letter-spacing: -0.01em; }
.stat-l { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ---------- trust ---------- */
.trust { padding: 72px 36px 30px; text-align: center; }
.trust-label { color: var(--faint); margin-bottom: 26px; }
.trust-row {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline;
  gap: 22px 44px; opacity: 0.6;
}
.tm { font-size: 19px; font-weight: 400; letter-spacing: 0.01em; }
.tm-serif { font-family: var(--serif); font-size: 22px; }
.tm-ital { font-family: var(--serif); font-style: italic; font-size: 22px; }
.tm-bold { font-weight: 600; letter-spacing: 0.12em; }
.tm-mono { font-family: var(--monof); font-size: 15px; letter-spacing: 0.06em; }

/* ---------- sections ---------- */
.section { padding: 110px 36px; max-width: 1320px; margin: 0 auto; position: relative; }
#arbeit::before {
  content: ""; position: absolute; left: -8%; top: 8%; width: 44%; aspect-ratio: 1;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, oklch(0.5 0.09 140 / 0.14), transparent 70%);
  filter: blur(40px);
}
#arbeit::after {
  content: ""; position: absolute; right: -6%; bottom: 6%; width: 38%; aspect-ratio: 1;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, oklch(0.55 0.08 85 / 0.1), transparent 70%);
  filter: blur(40px);
}
.section-head { text-align: center; max-width: 760px; margin: 0 auto 64px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.section-head h2 { font-size: clamp(36px, 4.6vw, 60px); line-height: 1.1; }
.section-sub { color: var(--muted); font-size: 18px; max-width: 560px; }

/* ---------- bento ---------- */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 22px; position: relative; z-index: 1; }
.card {
  background: oklch(1 0 0 / 0.045);
  backdrop-filter: blur(20px) saturate(1.1);
  border: 1px solid oklch(1 0 0 / 0.12); border-radius: var(--r);
  box-shadow: 0 24px 60px oklch(0 0 0 / 0.25), inset 0 1px 0 oklch(1 0 0 / 0.09);
  padding: 38px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 14px;
}
.card h3 { font-size: 27px; }
.card-sub { color: var(--muted); font-size: 15.5px; max-width: 46ch; }
.card-a { grid-column: span 5; }
.card-b { grid-column: span 7; }
.card-c { grid-column: span 7; }
.card-d { grid-column: span 5; }

.card-photo { justify-content: space-between; min-height: 540px; }
.card-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.5; }
.card-photo::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, oklch(0.16 0.012 145 / 0.92) 0%, oklch(0.16 0.012 145 / 0.45) 45%, oklch(0.16 0.012 145 / 0.7) 100%);
}
.card-photo > * { position: relative; }
.card-photo-head { display: flex; justify-content: space-between; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.card-photo-head .card-sub { max-width: 34ch; text-align: right; margin-left: auto; }

.glass {
  background: oklch(0.13 0.012 145 / 0.62); backdrop-filter: blur(12px);
  border: 1px solid oklch(1 0 0 / 0.1); border-radius: 18px; padding: 22px;
}

/* panel (card A) */
.panel { background: oklch(0 0 0 / 0.28); backdrop-filter: blur(8px); border: 1px solid oklch(1 0 0 / 0.08); border-radius: 18px; padding: 8px; margin-top: 8px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; color: var(--faint); }
.chip-soft { padding: 4px 10px; border-radius: 999px; background: oklch(0.78 0.07 135 / 0.12); color: var(--moss); }
.panel-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-top: 1px solid var(--line-soft);
  font-size: 14.5px;
}
.panel-row b { font-weight: 500; }
.panel-row .meta { color: var(--faint); margin-left: auto; text-transform: none; letter-spacing: 0.03em; }
.panel-row .status { color: var(--moss); }
.panel-row .status-warm { color: var(--gold); }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot-ok { background: var(--moss); }
.dot-warm { background: var(--gold); }
.panel-ticker {
  display: flex; justify-content: space-between; align-items: center;
  margin: 8px; padding: 13px 14px; border-radius: 12px;
  background: oklch(0 0 0 / 0.35); color: var(--faint);
}
.ticker-v { color: var(--ink); font-size: 14px; }
.ticker-v b { color: var(--moss); font-weight: 500; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; }
.chip { padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); text-transform: none; letter-spacing: 0.04em; }

/* chart (card B) */
.chart-panel { display: flex; flex-direction: column; gap: 10px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--faint); }
.legend { display: flex; gap: 16px; align-items: center; }
.leg { display: inline-flex; align-items: center; gap: 7px; color: var(--faint); }
.leg::before { content: ""; width: 16px; height: 2px; background: var(--ink); }
.leg-base::before { background: transparent; border-top: 2px dashed var(--faint); height: 0; }
.leg-live::before { display: none; }
.leg-live { color: var(--moss); gap: 7px; }
.chart-wrap { position: relative; height: 240px; }
#triChart { width: 100%; height: 100%; }
.chart-tip {
  position: absolute; right: 8%; top: 6%;
  background: oklch(0.12 0.01 145 / 0.92); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 13px;
  display: flex; flex-direction: column; gap: 2px;
  color: var(--muted); text-transform: none; letter-spacing: 0.03em; font-size: 11.5px;
}
.chart-tip b { color: var(--moss); font-weight: 500; }
.chart-x { display: flex; justify-content: space-between; color: var(--faint); padding: 0 4px; }

/* IIS (card C) */
.iis-panel { display: flex; flex-direction: column; gap: 18px; }
.panel-label { color: var(--faint); }
.iis-top { display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.iis-roles { display: flex; gap: 4px; padding: 5px; border: 1px solid var(--line); border-radius: 999px; background: oklch(0.1 0.01 145 / 0.6); flex-wrap: wrap; }
.iis-role {
  border: 0; cursor: pointer; background: transparent; color: var(--faint);
  font-family: var(--sans); font-size: 13.5px; padding: 9px 16px; border-radius: 999px;
  transition: background 0.25s, color 0.25s;
}
.iis-role:hover { color: var(--ink); }
.iis-role.active { background: oklch(1 0 0 / 0.12); color: var(--ink); }
.iis-readout { display: flex; align-items: center; gap: 16px; }
.iis-w { font-family: var(--serif); font-style: italic; font-size: 52px; line-height: 1; min-width: 86px; text-align: right; }
.iis-bar { width: 130px; height: 4px; border-radius: 4px; background: oklch(1 0 0 / 0.1); overflow: hidden; }
.iis-bar i { display: block; height: 100%; width: 100%; background: var(--moss); border-radius: 4px; transition: width 0.6s cubic-bezier(0.3, 0.8, 0.3, 1); }
.gen { border-top: 1px solid var(--line-soft); padding-top: 6px; }
.gen-head { display: flex; justify-content: space-between; padding: 8px 2px; color: var(--faint); }
.gen-count { font-family: var(--monof); font-size: 11px; color: var(--moss); text-transform: uppercase; letter-spacing: 0.08em; }
.gen-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 2px; border-top: 1px solid var(--line-soft);
  font-size: 14.5px; color: var(--muted);
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.gen-row.in { opacity: 1; transform: none; }
.gen-row i { font-style: normal; color: var(--moss); font-size: 13px; }
.gen-row b { color: var(--ink); font-weight: 500; }

/* timeline (card D) */
.link-arrow { color: var(--moss); font-size: 15px; font-weight: 400; border-bottom: 1px solid transparent; transition: border-color 0.2s; align-self: flex-start; }
.link-arrow:hover { border-color: var(--moss); }
.timeline { list-style: none; margin-top: 18px; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 14px; bottom: 14px;
  width: 1px; background: var(--line);
}
.tl-step { display: flex; gap: 18px; padding: 14px 0 14px 26px; position: relative; opacity: 0.32; transition: opacity 0.6s ease; }
.tl-step::before {
  content: ""; position: absolute; left: 2px; top: 22px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--faint); transition: background 0.4s, box-shadow 0.4s;
}
.tl-step.on { opacity: 1; }
.tl-step.on::before { background: var(--moss); box-shadow: 0 0 0 4px oklch(0.78 0.07 135 / 0.16); }
.tl-time { color: var(--faint); padding-top: 3px; flex: none; }
.tl-step b { font-weight: 500; font-size: 16px; display: block; }
.tl-step p { color: var(--muted); font-size: 14px; margin-top: 2px; }

/* ---------- projects ribbon ---------- */
.projects { padding: 30px 0 90px; overflow: hidden; }
.projects-head {
  max-width: 1320px; margin: 0 auto 40px; padding: 0 36px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 18px;
}
.projects-head h2 { font-size: clamp(32px, 4vw, 50px); line-height: 1.1; }
.projects-hint { color: var(--faint); text-transform: none; letter-spacing: 0.04em; font-size: 12px; }

.ribbon { position: relative; width: 100%; -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.ribbon-track { display: flex; gap: 22px; width: max-content; padding: 6px 36px; will-change: transform; }
.ribbon:hover .ribbon-track { animation-play-state: paused; }

.proj-card {
  position: relative; flex: none;
  width: 330px; height: 460px; border-radius: 24px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 26px;
  background: linear-gradient(165deg, oklch(1 0 0 / 0.06), oklch(1 0 0 / 0.02));
  border: 1px solid oklch(1 0 0 / 0.1);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.08);
  transition: border-color 0.4s, transform 0.4s, box-shadow 0.4s;
}
.proj-card:hover { transform: translateY(-6px); border-color: oklch(0.78 0.07 135 / 0.45); box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.12), 0 26px 60px oklch(0 0 0 / 0.4); }
.proj-bg {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0.32; filter: saturate(0.85); transition: opacity 0.5s, transform 6s ease;
  z-index: 0;
}
.proj-card::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, oklch(0.13 0.012 145 / 0.55) 0%, oklch(0.13 0.012 145 / 0.2) 38%, oklch(0.12 0.012 145 / 0.88) 100%);
}
.proj-card:hover .proj-bg { opacity: 0.5; transform: scale(1.06); }
.proj-card > *:not(.proj-bg) { position: relative; z-index: 2; }

.proj-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.proj-tag { color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-size: 10.5px; max-width: 60%; line-height: 1.5; }
.proj-arrow {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid oklch(1 0 0 / 0.25); color: var(--ink);
  display: grid; place-items: center;
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.3s;
}
.proj-card:hover .proj-arrow { background: var(--moss); color: oklch(0.18 0.02 145); border-color: var(--moss); transform: rotate(45deg); }

.proj-num {
  position: absolute; left: 22px; bottom: 116px; z-index: 2;
  font-family: var(--monof); font-weight: 400;
  font-size: 116px; line-height: 0.8; letter-spacing: -0.04em;
  color: oklch(1 0 0 / 0.14); pointer-events: none;
}
.proj-card[data-proj="1"] .proj-num { color: oklch(1 0 0 / 0.22); }

.proj-bottom { display: flex; flex-direction: column; gap: 16px; }
.proj-title { font-size: 22px; font-weight: 500; line-height: 1.12; letter-spacing: -0.01em; text-transform: uppercase; }
.proj-meta { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; color: var(--faint); padding-top: 14px; border-top: 1px solid oklch(1 0 0 / 0.12); text-transform: uppercase; letter-spacing: 0.06em; font-size: 10.5px; }
.proj-meta span:last-child { text-align: right; color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  .ribbon-track { animation: ribbon 46s linear infinite; }
}
@keyframes ribbon { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ribbon { overflow-x: auto; }
}

/* ---------- editorial ---------- */
.editorial { max-width: 1320px; }
.ed-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 70px; align-items: center; }
.editorial-flip .ed-grid { grid-template-columns: 0.95fr 1.05fr; }
.editorial-flip .ed-text { order: 2; }
.editorial-flip .ed-photo { order: 1; }
.ed-text { display: flex; flex-direction: column; gap: 24px; align-items: flex-start; }
.ed-text h2 { font-size: clamp(34px, 4vw, 54px); line-height: 1.1; }
.ed-body { color: var(--muted); font-size: 18px; max-width: 54ch; }
.ed-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.ed-list li { padding-left: 26px; position: relative; color: var(--muted); font-size: 16px; }
.ed-list li::before { content: ""; position: absolute; left: 0; top: 10px; width: 10px; height: 1.5px; background: var(--moss); }
.ed-list strong { color: var(--ink); font-weight: 500; }
.ed-photo { position: relative; margin: 0; }
.ed-photo img { width: 100%; aspect-ratio: 6 / 7; object-fit: cover; border-radius: var(--r); }
.float-chip {
  position: absolute; left: 22px; bottom: 22px; right: auto;
  display: flex; align-items: center; gap: 12px;
  background: oklch(0.13 0.012 145 / 0.78); backdrop-filter: blur(12px);
  border: 1px solid oklch(1 0 0 / 0.12); border-radius: 16px; padding: 13px 18px;
}
.float-chip b { display: block; font-weight: 500; font-size: 14.5px; }
.float-chip small { color: var(--muted); font-size: 12.5px; }
.float-chip em { font-style: normal; color: var(--moss); margin-left: 8px; }

/* ---------- numbers ---------- */
.numbers { position: relative; overflow: hidden; padding: 130px 36px; }
.numbers-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.4; }
.numbers::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--bg) 0%, oklch(0.16 0.012 145 / 0.55) 18%, oklch(0.16 0.012 145 / 0.55) 82%, var(--bg) 100%);
}
.numbers-inner { position: relative; max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.numbers-inner h2 { font-size: clamp(34px, 4.4vw, 56px); }
.numbers-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 36px;
  width: 100%; margin-top: 36px; padding-top: 36px;
  border-top: 1px solid oklch(1 0 0 / 0.16);
}
.num-v { font-family: var(--monof); font-size: clamp(36px, 4vw, 56px); letter-spacing: -0.02em; }
.num p { color: var(--muted); font-size: 14.5px; margin-top: 8px; max-width: 24ch; }

/* ---------- quote ---------- */
.quote-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: center; margin-bottom: 26px; }
.quote-photo { margin: 0; }
.quote-photo img { width: 100%; aspect-ratio: 7 / 5; object-fit: cover; border-radius: var(--r); }
.quote-main p {
  font-family: var(--serif); font-size: clamp(26px, 2.7vw, 38px);
  line-height: 1.3; letter-spacing: -0.01em;
}
.quote-main footer { margin-top: 28px; display: flex; flex-direction: column; gap: 2px; }
.quote-main footer b { font-weight: 500; }
.quote-main footer span { color: var(--muted); font-size: 14.5px; }
.quote-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.qcard {
  background: oklch(1 0 0 / 0.045);
  backdrop-filter: blur(20px) saturate(1.1);
  border: 1px solid oklch(1 0 0 / 0.12); border-radius: var(--r);
  box-shadow: 0 24px 60px oklch(0 0 0 / 0.22), inset 0 1px 0 oklch(1 0 0 / 0.09);
  padding: 30px 34px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
}
.qmark { font-family: var(--serif); font-size: 44px; line-height: 0.6; color: var(--moss); margin-bottom: 6px; }
.qcard b { font-weight: 500; font-size: 17px; }
.qcard p { color: var(--muted); font-size: 15px; }

/* ---------- standards ---------- */
.std-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.std-card {
  background: oklch(1 0 0 / 0.045);
  backdrop-filter: blur(20px) saturate(1.1);
  border: 1px solid oklch(1 0 0 / 0.12); border-radius: var(--r);
  box-shadow: 0 24px 60px oklch(0 0 0 / 0.22), inset 0 1px 0 oklch(1 0 0 / 0.09);
  padding: 32px 28px; transition: border-color 0.3s, transform 0.3s;
}
.std-card:hover { border-color: oklch(1 0 0 / 0.24); transform: translateY(-3px); }
.std-card h4 { font-weight: 500; font-size: 18px; margin-bottom: 10px; }
.std-card p { color: var(--muted); font-size: 14.5px; }

/* ---------- open source / repos ---------- */
.repo-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px 26px;
  max-width: 1120px; margin: 0 auto 30px; padding: 16px 26px;
  background: linear-gradient(165deg, oklch(1 0 0 / 0.06), oklch(1 0 0 / 0.02));
  border: 1px solid oklch(1 0 0 / 0.1); border-radius: 18px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.repo-handle { display: inline-flex; align-items: center; gap: 9px; font-weight: 500; font-size: 15.5px; transition: color 0.2s; }
.repo-handle:hover { color: var(--moss); }
.repo-handle svg { color: var(--ink); }
.repo-stat { color: var(--faint); text-transform: none; letter-spacing: 0.04em; }
.repo-stat b { color: var(--ink); font-weight: 500; }
.repo-all { margin-left: auto; color: var(--moss); font-size: 14px; border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.repo-all:hover { border-color: var(--moss); }

.repo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; max-width: 1120px; margin: 0 auto; }
.repo-card {
  display: flex; flex-direction: column; gap: 14px;
  background: linear-gradient(165deg, oklch(1 0 0 / 0.065), oklch(1 0 0 / 0.02));
  border: 1px solid oklch(1 0 0 / 0.1); border-radius: 22px;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.08);
  padding: 26px 28px; transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.repo-card:hover { border-color: oklch(0.78 0.07 135 / 0.4); transform: translateY(-3px); box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.1), 0 18px 40px oklch(0 0 0 / 0.3); }
.repo-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.repo-ic { color: var(--faint); flex: none; }
.repo-name { font-family: var(--monof); font-size: 15.5px; font-weight: 500; color: var(--moss); letter-spacing: 0.01em; }
.repo-card:hover .repo-name { text-decoration: underline; text-underline-offset: 3px; }
.repo-vis { padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--faint); font-size: 10px; }
.repo-pin { margin-left: auto; color: var(--gold); font-size: 10px; letter-spacing: 0.1em; }
.repo-desc { color: var(--muted); font-size: 14.5px; line-height: 1.55; flex: 1; }
.repo-foot { display: flex; align-items: center; gap: 22px; color: var(--faint); text-transform: none; letter-spacing: 0.03em; }
.repo-lang { display: inline-flex; align-items: center; gap: 7px; }
.repo-lang i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.repo-star { color: var(--muted); }
.repo-star-0 { color: var(--faint); }

/* ---------- cta ---------- */
.cta { position: relative; overflow: hidden; padding: 150px 36px; text-align: center; }
.cta-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.45; }
.cta::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--bg) 0%, oklch(0.14 0.012 145 / 0.5) 20%, oklch(0.14 0.012 145 / 0.6) 80%, oklch(0.15 0.012 145) 100%);
}
.cta-inner { position: relative; max-width: 1040px; margin: 0 auto; }
.cta-grid { display: grid; grid-template-columns: 300px 1fr; gap: 54px; align-items: center; }
.cta-photo { position: relative; aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 24px 60px oklch(0 0 0 / 0.45); }
.cta-content { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; text-align: left; }
.cta h2 { font-size: clamp(34px, 4vw, 56px); line-height: 1.08; text-shadow: 0 2px 24px oklch(0.08 0.01 145 / 0.6); }
.cta-content > p { color: oklch(0.86 0.012 120); font-size: 18px; max-width: 46ch; }
.cta-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: flex-start; }
.cta-note { color: var(--faint); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line-soft); padding: 80px 36px 36px; max-width: 1320px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 44px; }
.footer-brand p { color: var(--muted); font-size: 15px; max-width: 34ch; margin-top: 16px; }
.footer-col { display: flex; flex-direction: column; gap: 11px; }
.footer-col h5 { font-family: var(--monof); font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.footer-col a { color: var(--muted); font-size: 15px; transition: color 0.2s; }
.footer-col a:hover { color: var(--ink); }
.footer-copy { color: var(--faint); margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line-soft); }

/* ---------- custom cursor (glass bubble) ---------- */
.has-cursor, .has-cursor a, .has-cursor button { cursor: none; }
#cursor {
  position: fixed; left: 0; top: 0; z-index: 9999;
  pointer-events: none; opacity: 0; transition: opacity 0.3s ease;
}
#cursor.on { opacity: 1; }
#cursor i {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid oklch(1 0 0 / 0.3);
  background: radial-gradient(circle at 35% 30%, oklch(1 0 0 / 0.1), oklch(0 0 0 / 0.32) 65%);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  box-shadow: 0 6px 22px oklch(0 0 0 / 0.4), inset 0 1px 1px oklch(1 0 0 / 0.2);
  transition: width 0.3s cubic-bezier(0.3, 0.8, 0.3, 1), height 0.3s cubic-bezier(0.3, 0.8, 0.3, 1), border-color 0.3s, background 0.3s;
}
#cursor i::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 4px; height: 4px; border-radius: 50%;
  background: oklch(1 0 0 / 0.85); transform: translate(-50%, -50%);
  transition: background 0.3s;
}
#cursor.link i { width: 52px; height: 52px; border-color: oklch(1 0 0 / 0.5); }
#cursor.brush i {
  width: 120px; height: 120px;
  border-color: oklch(0.78 0.09 85 / 0.55);
  background: radial-gradient(circle, oklch(0.78 0.09 85 / 0.07), oklch(0 0 0 / 0.16) 72%);
}
#cursor.brush i::after { background: oklch(0.85 0.1 85 / 0.95); }
@media (pointer: coarse) { #cursor { display: none; } }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .pulse { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .nav-pills { display: none; }
  .card-a, .card-b, .card-c, .card-d { grid-column: span 12; }
  .card-photo { min-height: 480px; }
  .ed-grid, .editorial-flip .ed-grid { grid-template-columns: 1fr; gap: 40px; }
  .editorial-flip .ed-text { order: 1; }
  .editorial-flip .ed-photo { order: 2; }
  .numbers-grid { grid-template-columns: repeat(2, 1fr); }
  .quote-grid { grid-template-columns: 1fr; gap: 36px; }
  .std-grid { grid-template-columns: repeat(2, 1fr); }
  .repo-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav { padding: 14px 18px; }
  .section { padding: 80px 20px; }
  .hero-foot { padding: 40px 20px 0; }
  .hero-stats { margin: 0 -20px; padding: 22px 20px 24px; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
  .hero-inner .badge { white-space: normal; }
  .stat-l { font-size: 12px; }
  .card { padding: 26px; }
  .card-photo-head .card-sub { text-align: left; margin-left: 0; }
  .std-grid, .quote-cards, .numbers-grid { grid-template-columns: 1fr; }
  .repo-meta { gap: 10px 18px; }
  .repo-all { margin-left: 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .trust-row { gap: 16px 28px; }
  .proj-card { width: 270px; height: 400px; padding: 22px; }
  .proj-num { font-size: 92px; bottom: 100px; }
  .iis-top { flex-direction: column; align-items: flex-start; }
  .numbers, .cta { padding: 100px 20px; }
  .cta-grid { grid-template-columns: 1fr; gap: 32px; justify-items: center; }
  .cta-photo { width: 220px; }
  .cta-content { align-items: flex-start; }
  .nav-pills { display: none; }
  .drawer-panel { width: min(88vw, 400px); }
}

/* ---------- portfolio drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 90; visibility: hidden; pointer-events: none; }
.drawer.open { visibility: visible; pointer-events: auto; }
.drawer-scrim {
  position: absolute; inset: 0; background: oklch(0.06 0.008 145 / 0.6);
  backdrop-filter: blur(3px); opacity: 0; transition: opacity 0.4s ease;
}
.drawer.open .drawer-scrim { opacity: 1; }
.drawer-panel {
  position: absolute; inset: 0 auto 0 0; width: min(84vw, 440px);
  display: flex; flex-direction: column; gap: 30px; padding: 30px 36px 40px;
  background: oklch(0.11 0.012 145 / 0.94); backdrop-filter: blur(20px);
  border-right: 1px solid var(--line);
  box-shadow: 40px 0 80px oklch(0 0 0 / 0.45);
  transform: translateX(-102%); transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.drawer.open .drawer-panel { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-close {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; cursor: pointer; color: var(--muted);
  border: 1px solid var(--line); border-radius: 12px; background: transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.drawer-close:hover { color: var(--ink); border-color: oklch(0.78 0.07 135 / 0.45); background: oklch(1 0 0 / 0.05); }
.drawer-label { color: var(--faint); text-transform: uppercase; letter-spacing: 0.2em; font-size: 11px; }
.drawer-links { display: flex; flex-direction: column; }
.drawer-links a {
  display: flex; align-items: center; gap: 18px; padding: 22px 6px;
  border-top: 1px solid var(--line-soft);
  font-size: clamp(20px, 2.4vw, 27px); font-weight: 500; letter-spacing: -0.01em;
  color: var(--ink); transition: color 0.25s, padding-left 0.3s;
}
.drawer-links a:last-child { border-bottom: 1px solid var(--line-soft); }
.drawer-links .dl-n { font-size: 12px; color: var(--faint); min-width: 24px; transition: color 0.25s; }
.drawer-links .dl-t { flex: 1; }
.drawer-links .dl-arrow { font-size: 18px; color: var(--faint); opacity: 0; transform: translateX(-6px); transition: opacity 0.25s, transform 0.25s, color 0.25s; }
.drawer-links a:hover { color: var(--moss); padding-left: 14px; }
.drawer-links a:hover .dl-n { color: var(--moss); }
.drawer-links a:hover .dl-arrow { opacity: 1; transform: translateX(0); color: var(--moss); }

/* ---------- CV glass modal ---------- */
.cv-modal { position: fixed; inset: 0; z-index: 120; visibility: hidden; pointer-events: none; }
.cv-modal.open { visibility: visible; pointer-events: auto; }
.cv-scrim { position: absolute; inset: 0; background: oklch(0.05 0.008 145 / 0.62); backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.35s ease; }
.cv-modal.open .cv-scrim { opacity: 1; }
.cv-glass {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -46%) scale(0.98);
  width: min(92vw, 860px); height: min(90vh, 1120px);
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 22px; border: 1px solid oklch(1 0 0 / 0.16);
  background: oklch(0.16 0.012 145 / 0.55); backdrop-filter: blur(26px) saturate(1.3);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.18), 0 40px 90px oklch(0 0 0 / 0.55);
  opacity: 0; transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.cv-modal.open .cv-glass { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.cv-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid oklch(1 0 0 / 0.12); }
.cv-title { color: var(--ink); text-transform: uppercase; letter-spacing: 0.18em; font-size: 12px; }
.cv-tools { display: flex; align-items: center; gap: 12px; }
.cv-dl { color: var(--muted); font-size: 11px; letter-spacing: 0.06em; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; transition: color 0.2s, border-color 0.2s, background 0.2s; }
.cv-dl:hover { color: var(--ink); border-color: oklch(0.78 0.07 135 / 0.45); background: oklch(1 0 0 / 0.05); }
.cv-close { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; cursor: pointer; color: var(--muted); border: 1px solid var(--line); border-radius: 11px; background: transparent; transition: color 0.2s, border-color 0.2s, background 0.2s; }
.cv-close:hover { color: var(--ink); border-color: oklch(0.78 0.07 135 / 0.45); background: oklch(1 0 0 / 0.05); }
.cv-body { flex: 1; min-height: 0; background: oklch(0.2 0.008 145 / 0.4); }
.cv-body iframe { width: 100%; height: 100%; border: 0; display: block; }
