/* LangCode 2027 — workshop site styles
   Plain CSS, no build step.
   Light/dark follows the visitor's system theme, overridable by the toggle
   (html[data-theme="light" | "dark"], persisted in localStorage). */

/* ------------------------------------------------------------------ tokens */

:root {
  --bg: #faf9f7;
  --bg-raise: #ffffff;
  --bg-sink: #f2f0ec;
  --ink: #16202f;
  --ink-soft: #4b5568;
  --ink-faint: #7c8697;
  --accent: #0e7c66;
  --accent-deep: #0a5f4e;
  --accent-soft: #e3f1ec;
  --blue: #1f4e9c;
  --amber: #8a5c00;
  --amber-soft: #fff3d6;
  --line: #e4e1da;
  --line-soft: #edeae4;
  --shadow-s: 0 1px 2px rgba(22, 32, 47, .05), 0 1px 3px rgba(22, 32, 47, .04);
  --shadow-m: 0 2px 4px rgba(22, 32, 47, .05), 0 12px 28px -12px rgba(22, 32, 47, .18);
  --grid-dot: rgba(14, 124, 102, .17);
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: .7rem;
  --ease: cubic-bezier(.22, .68, 0, 1);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg: #0d1117;
    --bg-raise: #151b23;
    --bg-sink: #11161d;
    --ink: #e6edf3;
    --ink-soft: #9aa7b4;
    --ink-faint: #737f8c;
    --accent: #45c4a0;
    --accent-deep: #6fd7b8;
    --accent-soft: #10281f;
    --blue: #79a7e8;
    --amber: #e3b341;
    --amber-soft: #2b2410;
    --line: #262c36;
    --line-soft: #1d232c;
    --shadow-s: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-m: 0 2px 4px rgba(0, 0, 0, .3), 0 14px 30px -14px rgba(0, 0, 0, .7);
    --grid-dot: rgba(69, 196, 160, .13);
  }
}

html[data-theme="dark"] {
  --bg: #0d1117;
  --bg-raise: #151b23;
  --bg-sink: #11161d;
  --ink: #e6edf3;
  --ink-soft: #9aa7b4;
  --ink-faint: #737f8c;
  --accent: #45c4a0;
  --accent-deep: #6fd7b8;
  --accent-soft: #10281f;
  --blue: #79a7e8;
  --amber: #e3b341;
  --amber-soft: #2b2410;
  --line: #262c36;
  --line-soft: #1d232c;
  --shadow-s: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-m: 0 2px 4px rgba(0, 0, 0, .3), 0 14px 30px -14px rgba(0, 0, 0, .7);
  --grid-dot: rgba(69, 196, 160, .13);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.65;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.wrap { max-width: 62rem; margin: 0 auto; padding: 0 1.25rem; }
.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 30;
  background: var(--accent); color: #fff; padding: .45rem .9rem;
  border-radius: .4rem; font-size: .9rem; transition: top .18s var(--ease);
}
.skip-link:focus { top: .6rem; text-decoration: none; }

/* --------------------------------------------------------- reading progress */

#progress {
  position: fixed; inset: 0 auto auto 0; z-index: 20;
  height: 2px; width: 100%;
  transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  will-change: transform;
}

/* ------------------------------------------------------------- top nav bar */

nav.top {
  position: sticky; top: 0; z-index: 15;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
nav.top .wrap {
  display: flex; align-items: center; gap: .35rem;
  padding-top: .5rem; padding-bottom: .5rem;
}
nav.top .brand {
  font-family: var(--mono); font-weight: 700; color: var(--ink);
  margin-right: .6rem; white-space: nowrap; letter-spacing: -.02em;
}
nav.top .brand .y { color: var(--accent); }
nav.top .brand:hover { text-decoration: none; }

.navlinks {
  display: flex; align-items: center; gap: .1rem;
  flex: 1; min-width: 0;
  overflow-x: auto; white-space: nowrap;
  scrollbar-width: none; -ms-overflow-style: none;
  mask-image: linear-gradient(90deg, #000 calc(100% - 1.5rem), transparent);
}
.navlinks::-webkit-scrollbar { display: none; }
.navlinks a {
  position: relative;
  color: var(--ink-soft); font-size: .88rem;
  padding: .3rem .5rem; border-radius: .35rem;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.navlinks a:hover { color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.navlinks a::after {
  content: ""; position: absolute; left: .5rem; right: .5rem; bottom: .06rem;
  height: 1.5px; background: var(--accent); border-radius: 2px;
  transform: scaleX(0); transform-origin: 0 50%;
  transition: transform .25s var(--ease);
}
.navlinks a.active { color: var(--accent); font-weight: 600; }
.navlinks a.active::after { transform: scaleX(1); }

.theme-toggle {
  flex: none; display: grid; place-items: center;
  width: 2rem; height: 2rem; margin-left: .3rem;
  border: 1px solid var(--line); border-radius: .45rem;
  background: var(--bg-raise); color: var(--ink-soft); cursor: pointer;
  transition: color .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  html:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* -------------------------------------------------------------------- hero */

header.hero {
  position: relative; overflow: hidden;
  padding: 4rem 0 2.8rem;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(58rem 22rem at 12% -10%, var(--accent-soft), transparent 70%),
    var(--bg);
}
header.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(46rem 20rem at 20% 0%, #000, transparent 72%);
  -webkit-mask-image: radial-gradient(46rem 20rem at 20% 0%, #000, transparent 72%);
}
header.hero .wrap { position: relative; z-index: 1; }

.kicker {
  font-family: var(--mono); font-size: .82rem; color: var(--accent);
  letter-spacing: .06em; text-transform: lowercase; margin: 0 0 .9rem;
}
h1.title {
  margin: 0 0 .5rem; font-size: clamp(2rem, 5.6vw, 3.1rem);
  line-height: 1.08; letter-spacing: -.025em; font-weight: 700;
}
h1.title .ord { color: var(--accent); }
p.tagline {
  margin: .2rem 0 1.3rem; font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  color: var(--ink-soft); max-width: 46rem; line-height: 1.45;
}
p.tagline b { color: var(--ink); font-weight: 650; }

.status {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .82rem; font-family: var(--mono);
  background: var(--amber-soft); color: var(--amber);
  border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent);
  border-radius: 999px; padding: .28rem .85rem; margin-bottom: 1.3rem;
}
.status .dot {
  width: .45rem; height: .45rem; border-radius: 50%;
  background: currentColor; flex: none;
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 currentColor; }
  60%      { opacity: .55; box-shadow: 0 0 0 .3rem transparent; }
}

.hero-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .3rem; }
.btn {
  display: inline-block; padding: .55rem 1.05rem; border-radius: .5rem;
  font-size: .94rem; border: 1px solid var(--line);
  background: var(--bg-raise); color: var(--ink);
  box-shadow: var(--shadow-s);
  transition: transform .18s var(--ease), border-color .18s var(--ease),
              color .18s var(--ease), box-shadow .18s var(--ease);
}
.btn:hover {
  border-color: var(--accent); color: var(--accent);
  transform: translateY(-2px); box-shadow: var(--shadow-m); text-decoration: none;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }

/* hero terminal line */
.termline {
  margin-top: 2.2rem; font-family: var(--mono); font-size: .88rem;
  color: var(--ink-soft); display: flex; flex-wrap: wrap;
  align-items: baseline; gap: .5rem; min-height: 1.6rem;
}
.termline .c { color: var(--accent); }
.termline .typed { color: var(--ink); }
.termline .caret {
  display: inline-block; width: .5rem; height: 1.05em;
  background: var(--accent); vertical-align: -.16em; margin-left: .1rem;
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.termline .lang {
  font-size: .74rem; color: var(--ink-faint);
  border: 1px solid var(--line); border-radius: .3rem; padding: 0 .35rem;
}

/* --------------------------------------------------- language ribbon (marquee) */

.ribbon {
  border-bottom: 1px solid var(--line);
  background: var(--bg-sink);
  overflow: hidden; padding: .6rem 0;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.ribbon-track {
  display: flex; width: max-content; gap: 0;
  animation: slide 78s linear infinite;
}
.ribbon:hover .ribbon-track { animation-play-state: paused; }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ribbon .item {
  font-family: var(--mono); font-size: .82rem; color: var(--ink-soft);
  padding: 0 1.1rem; white-space: nowrap;
  border-right: 1px solid var(--line);
}
.ribbon .item .tag { color: var(--ink-faint); font-size: .7rem; margin-left: .4rem; }

/* ---------------------------------------------------------------- sections */

section { padding: 3.2rem 0 .8rem; scroll-margin-top: 4.5rem; }
section h2 {
  font-size: 1.5rem; margin: 0 0 .3rem; letter-spacing: -.02em;
  display: flex; align-items: baseline; gap: .5rem;
}
section h2 .hash { color: var(--accent); font-family: var(--mono); font-size: 1.15rem; }
.lede { color: var(--ink-soft); max-width: 46rem; margin: .2rem 0 1.1rem; }
section p { max-width: 46rem; }
.rule {
  height: 1px; border: 0; margin: 0 0 1.4rem;
  background: linear-gradient(90deg, var(--accent), var(--line) 22%, transparent);
}

/* ------------------------------------------------------------ stats strip */

.stats {
  display: grid; gap: .8rem; margin: 1.6rem 0 .4rem;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
}
.stat {
  background: var(--bg-raise); border: 1px solid var(--line);
  border-radius: var(--r); padding: .95rem 1rem;
  transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease);
}
.stat:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-m); }
.stat .n {
  font-family: var(--mono); font-size: 1.6rem; font-weight: 700;
  color: var(--accent); line-height: 1.1; letter-spacing: -.02em;
  display: block;
}
.stat .l { font-size: .84rem; color: var(--ink-soft); display: block; margin-top: .25rem; }

/* --------------------------------------------------------------- axis cards */

.axes { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin: 1.4rem 0 .6rem; }
.axis {
  position: relative; background: var(--bg-raise);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.1rem 1.15rem 1.05rem;
  transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease);
}
.axis:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-m); }
.axis .rn {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .1em;
  color: var(--accent); display: block; margin-bottom: .35rem;
}
.axis h3 { margin: 0 0 .3rem; font-size: 1rem; }
.axis p { margin: 0; font-size: .9rem; color: var(--ink-soft); }

/* ------------------------------------------------------------ pillar cards */

.pillars {
  display: grid; gap: .9rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  margin-top: 1.2rem;
}
.pillar {
  position: relative; overflow: hidden;
  background: var(--bg-raise); border: 1px solid var(--line);
  border-radius: var(--r); padding: 1.05rem 1.15rem;
  transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease);
}
.pillar::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 3px;
  background: var(--accent); transform: scaleX(.22); transform-origin: 0 50%;
  transition: transform .35s var(--ease);
}
.pillar:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-m); }
.pillar:hover::before { transform: scaleX(1); }
.pillar h3 { margin: .25rem 0 .5rem; font-size: 1.02rem; }
.pillar h3 .idx { font-family: var(--mono); color: var(--accent); font-size: .82rem; margin-right: .4rem; }
.pillar ul { margin: 0; padding-left: 1.05rem; }
.pillar li { margin: .3rem 0; font-size: .9rem; color: var(--ink-soft); }

/* -------------------------------------------------------- shared task cards */

.task {
  position: relative;
  background: var(--bg-raise); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r); padding: 1.2rem 1.4rem; margin: 1rem 0;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}
.task:hover { transform: translateY(-2px); box-shadow: var(--shadow-m); }
.task h3 { margin: 0 0 .35rem; font-size: 1.1rem; }
.task h3 .tid { font-family: var(--mono); color: var(--accent); }
.task .meta {
  display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 .7rem;
}
.task .meta span {
  font-family: var(--mono); font-size: .74rem; color: var(--ink-soft);
  background: var(--bg-sink); border: 1px solid var(--line);
  border-radius: .3rem; padding: .1rem .45rem;
}
.task p { margin: .4rem 0; font-size: .94rem; }
.chip {
  display: inline-block; font-family: var(--mono); font-size: .76rem;
  border: 1px dashed var(--line); border-radius: .4rem;
  padding: .18rem .55rem; color: var(--ink-faint); margin-top: .6rem;
}

/* --------------------------------------------------------------- timeline */

ol.timeline { list-style: none; margin: 1.3rem 0 .4rem; padding: 0 0 0 1.4rem; position: relative; max-width: 44rem; }
ol.timeline::before {
  content: ""; position: absolute; left: .32rem; top: .5rem; bottom: .6rem;
  width: 1.5px; background: linear-gradient(180deg, var(--accent), var(--line));
}
ol.timeline li { position: relative; padding: 0 0 1.05rem .35rem; }
ol.timeline li::before {
  content: ""; position: absolute; left: -1.4rem; top: .48rem;
  width: .6rem; height: .6rem; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--accent);
}
ol.timeline li.done::before { background: var(--accent); }
ol.timeline li.done .when { text-decoration: line-through; }
ol.timeline li.done .what { color: var(--ink-soft); }
ol.timeline .when {
  font-family: var(--mono); font-size: .8rem; color: var(--accent);
  display: block; letter-spacing: .01em;
}
ol.timeline .what { font-size: .95rem; }
ol.timeline .flag {
  font-family: var(--mono); font-size: .68rem; color: var(--accent);
  border: 1px solid var(--accent); border-radius: .3rem;
  padding: 0 .3rem; margin-left: .4rem; vertical-align: 1px;
}

/* ------------------------------------------------- people (photo cards) --- */

.orgs {
  display: grid; gap: .8rem;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  margin-top: 1.1rem;
}
.org {
  position: relative;
  background: var(--bg-raise); border: 1px solid var(--line);
  border-radius: var(--r); padding: 1.1rem .9rem 1rem;
  text-align: center;
  transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease);
}
.org:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-m); }

.avatar {
  position: relative; display: block;
  width: 5.5rem; height: 5.5rem; margin: 0 auto .7rem;
  border-radius: 50%; overflow: hidden;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.avatar .ph {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .35s var(--ease);
}
.org:hover .avatar .ph { transform: scale(1.05); }
.avatar .init {
  position: absolute; inset: 0; display: none;
  place-items: center; font-family: var(--mono); font-weight: 700;
  font-size: 1.35rem; letter-spacing: .02em; color: var(--accent);
}
.avatar.no-photo .ph { display: none; }
.avatar.no-photo .init { display: grid; }

.org .nm { display: block; font-weight: 650; font-size: .96rem; color: var(--blue); }
.org .nm a { color: var(--blue); }
.org .role {
  position: absolute; top: .5rem; right: .5rem;
  font-family: var(--mono); font-size: .64rem; color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: .3rem; padding: 0 .32rem;
  text-transform: uppercase; letter-spacing: .05em;
}
.org .ti { display: block; font-size: .82rem; color: var(--ink-soft); margin-top: .22rem; }
.org .af { display: block; font-size: .79rem; color: var(--ink-faint); margin-top: .1rem; }

ul.pc {
  columns: 2; column-gap: 2.2rem; padding-left: 1.15rem;
  margin-top: .9rem; max-width: 50rem;
}
ul.pc li { margin: .3rem 0; font-size: .93rem; break-inside: avoid; }
ul.pc li .affil { color: var(--ink-soft); font-size: .86rem; }
@media (max-width: 40rem) { ul.pc { columns: 1; } }

.callout {
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: var(--r); padding: .85rem 1.05rem; margin: 1.1rem 0 .3rem;
  font-size: .92rem; max-width: 48rem;
}
.callout strong { color: var(--accent-deep); }

/* -------------------------------------------------------------- fact grid */

.facts { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin: 1.2rem 0 .5rem; }
.fact {
  background: var(--bg-raise); border: 1px solid var(--line);
  border-radius: var(--r); padding: .9rem 1.05rem;
  transition: transform .22s var(--ease), border-color .22s var(--ease);
}
.fact:hover { transform: translateY(-2px); border-color: var(--accent); }
.fact dt {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .25rem;
}
.fact dd { margin: 0; font-size: .93rem; color: var(--ink-soft); }
.fact dd b { color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------------- footer */

footer {
  margin-top: 3.4rem; border-top: 1px solid var(--line);
  padding: 1.8rem 0 2.4rem; color: var(--ink-soft); font-size: .88rem;
  background: var(--bg-sink);
}
footer .frow { display: flex; flex-wrap: wrap; gap: .8rem 1.6rem; align-items: baseline; justify-content: space-between; }
footer a { color: var(--ink-soft); }
footer a:hover { color: var(--accent); }
footer .sig { font-family: var(--mono); font-size: .78rem; margin-top: .9rem; color: var(--ink-faint); }
footer { scroll-margin-top: 4.5rem; }
footer .sig .c { color: var(--accent); }

/* ------------------------------------------------------- reveal animation */

[data-reveal] {
  opacity: 0; transform: translateY(14px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
  transition-delay: var(--d, 0ms);
}
[data-reveal].in { opacity: 1; transform: none; }

/* --------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .ribbon-track { animation: none; }
  .termline .caret { animation: none; }
}

/* ---------------------------------------------------------------- narrow */

@media (max-width: 34rem) {
  header.hero { padding: 2.6rem 0 2rem; }
  section { padding: 2.4rem 0 .6rem; }
  .task { padding: 1rem 1.05rem; }
}

/* ----------------------------------------------------------------- print */

@media print {
  nav.top, #progress, .ribbon, .hero-actions, .skip-link, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; font-size: 10.5pt; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  section { padding: 1rem 0; break-inside: avoid; }
  .pillar, .task, .org, .stat, .fact { break-inside: avoid; box-shadow: none; }
}
