/* ============================================================
   Fundemetal — brand design system
   Black & white · hand-drawn line · γ
   ============================================================ */

:root {
  --bg: #f6f4ee;          /* warm paper */
  --paper: #ffffff;
  --ink: #111110;         /* near-black ink */
  --ink-soft: #3a3a36;
  --muted: #6f6e66;
  --line: #14130f;
  --line-soft: rgba(20,19,15,.16);
  --shadow: rgba(20,19,15,.08);

  --font-display: "Newsreader", "Songti SC", Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-hand: "Caveat", "Segoe Script", cursive;

  --max: 1080px;
  --gut: clamp(20px, 5vw, 56px);
  --radius: 14px;
  --ease: cubic-bezier(.16,1,.3,1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0b09;
    --paper: #15130f;
    --ink: #f3f1ea;
    --ink-soft: #c9c6bd;
    --muted: #8d8a80;
    --line: #f3f1ea;
    --line-soft: rgba(243,241,234,.18);
    --shadow: rgba(0,0,0,.45);
  }
}
[data-theme="dark"] {
  --bg: #0c0b09;
  --paper: #15130f;
  --ink: #f3f1ea;
  --ink-soft: #c9c6bd;
  --muted: #8d8a80;
  --line: #f3f1ea;
  --line-soft: rgba(243,241,234,.18);
  --shadow: rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background .5s var(--ease), color .5s var(--ease);
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }

/* hand-drawn eyebrow label */
.eyebrow {
  font-family: var(--font-hand);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  display: inline-block;
  transform: rotate(-2deg);
}

/* ---------- NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px) saturate(140%);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .gamma { width: 30px; height: 30px; color: var(--ink); }
.brand .word {
  font-family: var(--font-display);
  font-size: 1.32rem; font-weight: 500; letter-spacing: .01em;
}
.brand .word span {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 1px;
}
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a {
  font-size: .92rem; color: var(--ink-soft);
  position: relative; transition: color .25s var(--ease);
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 0; height: 1.5px; background: var(--ink); transition: width .3s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }
.theme-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid var(--line); background: transparent;
  color: var(--ink); cursor: pointer; display: grid; place-items: center;
  transition: transform .3s var(--ease), background .3s var(--ease);
}
.theme-btn:hover { transform: rotate(18deg) scale(1.06); }
.theme-btn svg { width: 18px; height: 18px; }
@media (max-width: 640px) { .nav-links a:not(.theme-btn){ display:none; } }

/* ---------- HERO ---------- */
.hero { padding: clamp(56px, 11vw, 120px) 0 clamp(40px, 7vw, 80px); position: relative; }
.hero-grid {
  display: grid; grid-template-columns: 1.25fr .9fr; gap: 40px; align-items: center;
}
@media (max-width: 860px){ .hero-grid { grid-template-columns: 1fr; } }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.04; letter-spacing: -.01em; margin: 14px 0 0;
}
.hero h1 em { font-style: italic; }
.hero .lede {
  margin-top: 22px; max-width: 46ch; color: var(--ink-soft);
  font-size: 1.08rem;
}
.hero .cta-row { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; }

/* hero γ art */
.hero-art { display: grid; place-items: center; }
.gamma-big {
  width: min(320px, 72vw); height: auto; color: var(--ink);
  filter: drop-shadow(0 14px 30px var(--shadow));
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%,100%{ transform: translateY(0) } 50%{ transform: translateY(-10px) } }
.gamma-path {
  fill: none; stroke: currentColor; stroke-width: 7;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: draw 1.6s var(--ease) .15s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* buttons */
.btn {
  font-family: var(--font-sans); font-size: .95rem;
  padding: 12px 22px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: transparent; color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform .25s var(--ease), background .3s var(--ease), color .3s var(--ease);
  will-change: transform;
}
.btn.solid { background: var(--ink); color: var(--bg); }
.btn:hover { transform: translateY(-2px); }
.btn.solid:hover { background: var(--ink-soft); }

/* ---------- SECTION SHELL ---------- */
section { padding: clamp(56px, 9vw, 110px) 0; position: relative; }
.sec-head { max-width: 60ch; margin-bottom: clamp(34px, 5vw, 60px); }
.sec-head h2 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.9rem, 4.4vw, 3rem); line-height: 1.08; margin: 12px 0 0;
}
.sec-head p { color: var(--ink-soft); margin-top: 16px; max-width: 52ch; }
.divider { display:block; width: 100%; height: 26px; color: var(--line); opacity:.7; }

/* ---------- SKILL CARDS ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 860px){ .cards { grid-template-columns: 1fr; } }
.card {
  position: relative; background: var(--paper);
  border-radius: var(--radius); padding: 30px 28px 28px;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
  overflow: hidden;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 22px 44px var(--shadow); }
.card .frame { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--line); pointer-events: none; }
.card .num {
  font-family: var(--font-mono); font-size: .8rem; color: var(--muted);
  letter-spacing: .12em;
}
.card h3 {
  font-family: var(--font-display); font-weight: 500;
  font-size: 1.5rem; margin: 10px 0 4px;
}
.card .role { font-family: var(--font-hand); font-size: 1.25rem; color: var(--muted); margin-bottom: 14px; }
.card p { color: var(--ink-soft); font-size: .96rem; margin: 0 0 18px; }
.card .tag {
  display: inline-block; font-family: var(--font-mono); font-size: .72rem;
  border: 1px solid var(--line-soft); border-radius: 999px; padding: 4px 10px;
  color: var(--muted);
}
.card .glyph { width: 46px; height: 46px; color: var(--ink); margin-bottom: 6px; }
.card a.more { font-size: .88rem; color: var(--ink); border-bottom: 1.5px solid var(--line); padding-bottom: 2px; }

/* ---------- DNA ---------- */
.dna { background: var(--paper); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.dna-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
@media (max-width: 760px){ .dna-grid { grid-template-columns: 1fr; } }
.dna-cell { background: var(--paper); padding: 26px 24px; }
.dna-cell .ix { font-family: var(--font-mono); font-size: .75rem; color: var(--muted); }
.dna-cell h4 { font-family: var(--font-display); font-weight: 500; font-size: 1.18rem; margin: 8px 0 6px; }
.dna-cell p { color: var(--ink-soft); font-size: .9rem; margin: 0; }

/* ---------- PIPELINE ---------- */
.flow { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; }
.step {
  flex: 1 1 200px; position: relative; padding: 26px 22px;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--paper);
}
.step .k { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); letter-spacing: .1em; }
.step h4 { font-family: var(--font-display); font-weight: 500; font-size: 1.25rem; margin: 8px 0 6px; }
.step p { color: var(--ink-soft); font-size: .9rem; margin: 0; }
.step .arrow { position: absolute; right: -14px; top: 50%; transform: translateY(-50%); color: var(--ink); z-index: 2; }
@media (max-width: 760px){ .step .arrow { display: none; } }

/* ---------- FOOTER ---------- */
footer { border-top: 1px solid var(--line-soft); padding: 46px 0 60px; }
.foot-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot-inner .gamma { width: 34px; height: 34px; color: var(--ink); }
.foot-meta { color: var(--muted); font-size: .85rem; font-family: var(--font-mono); }
.foot-links { display: flex; gap: 22px; }
.foot-links a { color: var(--ink-soft); font-size: .9rem; }
.foot-links a:hover { color: var(--ink); }

/* ---------- NAV STAR ---------- */
.star-link {
  color: var(--ink-soft);
  transition: color .25s var(--ease), transform .3s var(--ease);
}
.star-link:hover { color: var(--ink); transform: scale(1.2); }

/* ---------- btn small ---------- */
.btn-small { font-size: .82rem; padding: 8px 16px; }
.btn svg, .star-link svg { display: inline-block; vertical-align: -2px; }

/* ---------- USE A SKILL ---------- */
.use-block {
  background: var(--paper);
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.use-block pre {
  margin: 0; padding: 24px 28px; overflow-x: auto;
  background: transparent; border: none;
}
.use-block code {
  font-family: var(--font-mono); font-size: .88rem; line-height: 1.7;
  color: var(--ink); white-space: pre;
}
.use-block .c { color: var(--muted); } /* comment */
.use-block .s { color: #7a6e4a; } /* string (warm tone for B&W) */
[data-theme="dark"] .use-block .s,
:root:not([data-theme="light"]) .use-block .s { color: #c9b87a; }
.use-note { margin-top: 14px; color: var(--muted); font-size: .88rem; }

.use-links {
  display: flex; gap: 18px; flex-wrap: wrap; margin-top: 26px;
}
.use-links a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--paper);
  font-family: var(--font-display); font-weight: 500; font-size: .95rem;
  color: var(--ink); transition: transform .25s var(--ease), box-shadow .35s var(--ease);
}
.use-links a:hover { transform: translateY(-2px); box-shadow: 0 12px 24px var(--shadow); }
.mono-sm {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em;
  color: var(--muted);
}

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce){
  .reveal { opacity: 1; transform: none; transition: none; }
  .gamma-big { animation: none; }
  .gamma-path { animation: none; stroke-dashoffset: 0; }
  html { scroll-behavior: auto; }
}

/* ---------- formation filter ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin-bottom: 2rem;
}
.filter-btn {
  font-family: var(--font-display); font-size: .82rem; letter-spacing: .03em;
  padding: 8px 18px; border-radius: 999px;
  border: 1.5px solid var(--line); background: transparent;
  color: var(--muted); cursor: pointer;
  transition: all .3s var(--ease);
}
.filter-btn:hover {
  color: var(--ink); border-color: var(--ink);
  transform: translateY(-1px);
}
.filter-btn.active {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.card.hidden { display: none; }

/* ---------- formation legend ---------- */
.form-legend {
  display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: center;
  margin: -1rem 0 1.5rem; font-size: .78rem; color: var(--muted);
}
.filter-hint {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); opacity: .6;
}

/* ---------- stats ---------- */
.stats {
  padding: 3rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stats-grid {
  display: flex; flex-wrap: wrap; gap: 2rem; justify-content: center; align-items: center;
}
.stat-cell { text-align: center; min-width: 140px; }
.stat-num {
  font-family: var(--font-display); font-size: 2.8rem; font-weight: 500;
  color: var(--ink); line-height: 1.1;
}
.stat-label {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); margin-top: .2rem;
}

/* ---------- formations grid ---------- */
.form-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.form-card {
  position: relative; padding: 1.5rem 1.2rem; border: 1.5px solid var(--line);
  border-radius: 12px; background: var(--paper);
  transition: transform .3s var(--ease), box-shadow .35s var(--ease);
}
.form-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px var(--shadow); }
.form-card .k {
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .15em;
  color: var(--muted); margin-bottom: .5rem;
}
.form-card .p {
  font-family: var(--font-display); font-size: .92rem; line-height: 1.55;
  color: var(--ink);
}
.form-card .m {
  font-family: var(--font-mono); font-size: .65rem; letter-spacing: .1em;
  color: var(--muted); margin-top: .75rem; opacity: .5;
}

/* ---------- print ---------- */
@media print {
  .nav, .filter-bar, .form-legend, .use-links, footer .foot-links,
  .theme-btn, .star-link, .btn, .cta-row { display: none !important; }
  .hero { min-height: auto; padding: 1rem 0; }
  .card, .form-card { break-inside: avoid; border-color: #ccc; }
  .stats { border: none; padding: 1rem 0; }
  body { font-size: 11pt; color: #000; background: #fff; }
  .wrap { max-width: 100%; }
}

/* ---------- focus / keyboard ---------- */
:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px;
}
