/* ==========================================================================
   Mohamed Thameezudeen — personal site
   ========================================================================== */

:root {
  /* light theme: warm paper, ink text, leaf-green accent */
  --bg: #f4f2ec;
  --bg-2: #ebe8df;
  --panel: #fbfaf7;
  --panel-2: #ffffff;
  --viz: #efede5;
  --line: rgba(16, 19, 18, .11);
  --line-2: rgba(16, 19, 18, .24);
  --text: #111413;
  --muted: #535c57;
  --dim: #6f7772;
  --acc: #1b7f3b;
  --acc-soft: rgba(27, 127, 59, .08);
  --acc-ink: #ffffff;
  --amber: #b85c00;
  --red: #ff5f57;
  --shadow: 0 1px 0 rgba(16, 19, 18, .03), 0 18px 40px -26px rgba(16, 19, 18, .28);

  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --gutter: clamp(1.1rem, 4vw, 3rem);
  --max: 1280px;
  --radius: 18px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(1rem, .95rem + .25vw, 1.125rem);
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

::selection { background: var(--acc); color: var(--acc-ink); }

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p, dl, dd { margin: 0; }
img, svg, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

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

.wrap { width: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.mono { font-family: var(--mono); }
.acc { color: var(--acc); }
.amber { color: var(--amber); }

/* scrollbar */
html { scrollbar-color: #c2beb2 var(--bg); }

/* ---------- Boot overlay ---------- */
.boot {
  position: fixed; inset: 0; z-index: 100;
  display: none; place-items: center;
  background: var(--bg);
  transition: transform .7s var(--ease), opacity .5s ease;
}
.js .boot { display: grid; }
.boot.done { transform: translateY(-100%); opacity: .4; pointer-events: none; }
.boot-inner { width: min(30rem, 86vw); font-family: var(--mono); font-size: .85rem; }
.boot-log { min-height: 7.5em; color: var(--muted); }
.boot-log p { margin: 0 0 .25em; }
.boot-log b { color: var(--acc); font-weight: 500; }
.boot-bar { height: 2px; background: var(--line); margin-top: 1rem; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; background: var(--acc); transition: width .25s linear; box-shadow: 0 0 12px var(--acc); }
.boot-skip { margin-top: .9rem; color: var(--dim); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Chrome: progress, cursor glow ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60; pointer-events: none; }
.progress i { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: var(--acc); }

.cursor-glow {
  position: fixed; left: 0; top: 0; z-index: 1;
  width: 560px; height: 560px; margin: -280px 0 0 -280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(27, 127, 59, .07), transparent 62%);
  pointer-events: none; opacity: 0; transition: opacity .5s ease;
  will-change: transform;
}
.cursor-glow.on { opacity: 1; }

.leaf-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
main { position: relative; z-index: 1; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .9rem var(--gutter);
  transition: padding .3s ease;
}
/* the blur lives on a pseudo-element so the fixed mobile menu isn't trapped inside it */
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(244, 242, 236, .82);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
  opacity: 0; transition: opacity .3s ease;
}
.nav.scrolled { padding-block: .65rem; }
.nav.scrolled::before { opacity: 1; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-family: var(--mono); font-size: .9rem; }
.brand-mark {
  display: grid; place-items: center; width: 2rem; height: 2rem;
  background: var(--acc); color: var(--acc-ink); border-radius: 7px;
  font-weight: 700; font-size: .8rem; letter-spacing: -.02em;
}
.brand-text b { color: var(--acc); animation: blink 1.1s steps(1) infinite; }

.nav-links { display: flex; gap: .2rem; margin-left: auto; font-family: var(--mono); font-size: .78rem; }
.nav-links a {
  position: relative; padding: .5rem .75rem; color: var(--muted); border-radius: 999px;
  transition: color .2s ease, background .2s ease;
}
.nav-links a span { color: var(--dim); margin-right: .4em; font-size: .68rem; transition: color .2s ease; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: rgba(16, 19, 18, .05); }
.nav-links a.active span, .nav-links a:hover span { color: var(--acc); }

.nav-status {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--mono); font-size: .74rem; white-space: nowrap;
  padding: .45rem .8rem; border: 1px solid var(--line-2); border-radius: 999px;
  transition: border-color .2s ease, color .2s ease;
}
.nav-status:hover { border-color: var(--acc); color: var(--acc); }
.nav-status i, .hero-kicker .dot, .viz-pill i, .vf-rec i {
  width: .5rem; height: .5rem; border-radius: 50%; background: var(--acc);
  box-shadow: 0 0 0 0 rgba(27, 127, 59, .6); animation: ping 2s infinite;
  flex: none; display: inline-block;
}
.nav-toggle { display: none; width: 2.5rem; height: 2.5rem; position: relative; margin-left: auto; }
.nav-toggle i { position: absolute; left: .55rem; right: .55rem; height: 2px; background: var(--text); transition: transform .3s var(--ease), top .3s var(--ease); }
.nav-toggle i:first-child { top: .95rem; }
.nav-toggle i:last-child { top: 1.45rem; }
.nav-toggle[aria-expanded="true"] i:first-child { top: 1.2rem; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] i:last-child { top: 1.2rem; transform: rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  padding: .85rem 1.3rem; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(16, 19, 18, .02);
  font-family: var(--mono); font-size: .84rem; font-weight: 500; white-space: nowrap;
  transition: border-color .25s ease, background .25s ease, color .25s ease, transform .25s var(--ease);
  will-change: transform;
}
.btn svg { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn svg.fill { fill: currentColor; stroke: none; }
.btn:hover { border-color: var(--acc); color: var(--acc); background: var(--acc-soft); }
.btn--solid { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); font-weight: 700; }
.btn--solid:hover { background: #249a49; border-color: #249a49; color: var(--acc-ink); box-shadow: 0 0 40px rgba(27, 127, 59, .35); }
.btn--block { width: 100%; }

.link {
  display: inline-flex; align-items: center; gap: .35rem;
  font-family: var(--mono); font-size: .82rem; color: var(--acc);
  border-bottom: 1px solid rgba(27, 127, 59, .35); padding-bottom: .1rem;
  transition: border-color .2s ease, gap .2s ease;
}
.link svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.link:hover { border-color: var(--acc); }
.link:hover svg { transform: translate(2px, -2px); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding-top: 5rem; overflow: hidden; isolation: isolate;
}
.hero-grid {
  position: absolute; inset: 0; z-index: -3;
  background:
    radial-gradient(42% 52% at 82% 18%, rgba(27, 127, 59, .16), transparent 70%),
    radial-gradient(36% 46% at 8% 78%, rgba(201, 180, 88, .18), transparent 70%),
    radial-gradient(30% 36% at 48% 46%, rgba(109, 187, 90, .10), transparent 70%);
}
.hero-body { padding-bottom: clamp(1.5rem, 4vh, 3rem); }

.hero-kicker {
  display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem;
  font-family: var(--mono); font-size: clamp(.68rem, .62rem + .3vw, .82rem);
  color: var(--muted); letter-spacing: .04em; text-transform: uppercase;
  margin-bottom: clamp(.6rem, 2vh, 1.4rem);
}
.hero-kicker em { color: var(--dim); font-style: normal; }

.hero-name {
  font-size: clamp(2.6rem, 12vw, 11.5rem);
  font-weight: 800; font-stretch: 75%;
  line-height: .9; letter-spacing: -.005em; text-transform: uppercase;
  white-space: nowrap;
  margin-left: -.03em;
}
.hero-line { display: block; width: max-content; }
.hero-line--outline {
  /* variable fonts have overlapping contours, so a plain transparent stroke shows seams inside
     the letters. Stroke first, then fill with the page colour to leave a clean outline. */
  color: var(--bg); letter-spacing: .012em;
  -webkit-text-stroke: clamp(2px, .026em, 5px) var(--acc);
  paint-order: stroke fill;
  transition: color .5s ease, text-shadow .5s ease;
}
.hero-name:hover .hero-line--outline { color: var(--acc); text-shadow: 0 0 80px rgba(27, 127, 59, .35); }

.hero-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 34rem); gap: 1.5rem 3rem; align-items: start;
  margin-top: clamp(1.2rem, 3.5vh, 2.4rem);
}
.hero-role { font-family: var(--mono); font-size: clamp(1rem, .8rem + 1vw, 1.5rem); font-weight: 500; white-space: nowrap; min-height: 1.6em; }
.hero-role .prompt { color: var(--acc); }
.caret { display: inline-block; width: .55em; height: 1.1em; margin-left: .15em; background: var(--acc); vertical-align: -.18em; animation: blink 1.05s steps(1) infinite; }
.hero-lede { color: var(--muted); max-width: 34rem; }
.hero-lede strong { color: var(--text); font-weight: 600; }

.hero-cta { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: clamp(1.2rem, 3vh, 2rem); }

.hud {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line); margin-top: clamp(.5rem, 2vh, 1.5rem);
}
.hud > div { padding: 1rem 1.2rem 1.3rem 0; }
.hud > div + div { padding-left: 1.2rem; border-left: 1px solid var(--line); }
.hud dt { font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin-bottom: .3rem; }
.hud dd { font-size: .95rem; font-weight: 500; }

/* ---------- Marquee ---------- */
.marquee {
  border-block: 1px solid var(--line); background: var(--bg-2);
  overflow: hidden; padding: 1rem 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex; align-items: center; gap: 2rem; width: max-content;
  animation: marquee 38s linear infinite;
  font-size: clamp(1.1rem, 1rem + 1vw, 1.8rem); font-weight: 600; font-stretch: 85%;
  text-transform: uppercase; letter-spacing: -.01em; white-space: nowrap;
}
.marquee-track span:nth-child(4n+1) { color: var(--bg-2); -webkit-text-stroke: 2px var(--muted); paint-order: stroke fill; }
.marquee-track i { color: var(--acc); font-style: normal; font-size: .7em; }
.marquee:hover .marquee-track { animation-play-state: paused; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(4.5rem, 11vw, 9rem) 0; position: relative; z-index: 2; }

.sec-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.sec-idx { font-family: var(--mono); font-size: .8rem; color: var(--acc); }
.sec-head h2 { font-size: clamp(2rem, 1.3rem + 3.4vw, 4rem); font-weight: 700; font-stretch: 80%; line-height: 1; letter-spacing: -.03em; text-transform: uppercase; }
.sec-rule { flex: 1; height: 1px; background: var(--line); align-self: center; min-width: 1rem; }
.sec-tag { font-family: var(--mono); font-size: .78rem; color: var(--dim); white-space: nowrap; }

/* reveal */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease) var(--d, 0s), transform .8s var(--ease) var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.about-copy p { color: var(--muted); max-width: 40rem; }
.about-copy p + p { margin-top: 1.1em; }
.about-copy .about-big {
  color: var(--text); font-size: clamp(1.7rem, 1.2rem + 2.2vw, 3rem); font-weight: 600; font-stretch: 88%;
  line-height: 1.08; letter-spacing: -.025em; margin-bottom: 1.6rem; max-width: 18em;
}
.about-big em { font-style: normal; color: var(--acc); }

.stats { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); box-shadow: var(--shadow); }
.stats li { padding: 1.4rem 1.3rem 1.5rem; border-bottom: 1px solid var(--line); }
.stats li:nth-child(odd) { border-right: 1px solid var(--line); }
.stats li:nth-last-child(-n+2) { border-bottom: 0; }
.stats b { display: block; font-size: clamp(2.4rem, 1.6rem + 2.6vw, 3.8rem); font-weight: 800; font-stretch: 78%; line-height: 1; letter-spacing: -.03em; color: var(--text); font-variant-numeric: tabular-nums; }
.stats b sup { font-size: .32em; font-weight: 600; color: var(--acc); margin-left: .25em; vertical-align: top; position: relative; top: .5em; letter-spacing: 0; }
.stats li > span { display: block; margin-top: .7rem; font-size: .84rem; line-height: 1.45; color: var(--muted); }

.skills { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-top: clamp(2.5rem, 6vw, 4.5rem); background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.skill-col { background: var(--bg); padding: 1.4rem 1.3rem 1.6rem; }
.skill-col h3, .mini { font-family: var(--mono); font-size: .7rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin-bottom: 1rem; }
.skill-col h3::before, .mini::before { content: "▸ "; color: var(--acc); }

.chips, .tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips li {
  font-family: var(--mono); font-size: .78rem; padding: .35rem .7rem;
  border: 1px solid var(--line-2); border-radius: 999px; color: var(--text);
  transition: border-color .2s ease, color .2s ease, background .2s ease, transform .2s ease;
}
.chips li:hover { border-color: var(--acc); color: var(--acc); background: var(--acc-soft); transform: translateY(-2px); }
.tags li { font-family: var(--mono); font-size: .7rem; padding: .22rem .55rem; border-radius: 6px; background: rgba(16, 19, 18, .05); color: var(--muted); }

/* ---------- Terminal ---------- */
.term {
  border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden;
  /* the terminal stays a dark window: it re-declares the palette for everything inside it */
  --bg: #0c1510; --panel: #111d16; --panel-2: #16251c;
  --line: rgba(225, 245, 230, .1); --line-2: rgba(225, 245, 230, .2);
  --text: #e9f3ec; --muted: #9fb3a6; --dim: #66796c;
  --acc: #9be58a; --acc-soft: rgba(155, 229, 138, .14); --acc-ink: #0c1510; --amber: #ffc46b;
  color: var(--text);
  background: #0c1510;
  box-shadow: 0 40px 70px -34px rgba(12, 21, 16, .55), 0 0 0 1px rgba(12, 21, 16, .2);
}
.term-bar { display: flex; align-items: center; gap: 1rem; padding: .7rem 1rem; background: var(--panel-2); border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: .74rem; color: var(--muted); }
.term-dots { display: inline-flex; gap: .4rem; }
.term-dots i { width: .7rem; height: .7rem; border-radius: 50%; background: var(--red); }
.term-dots i:nth-child(2) { background: #febc2e; }
.term-dots i:nth-child(3) { background: #28c840; }
.term-title { flex: 1; text-align: center; }
.term-hint kbd { font: inherit; color: var(--acc); border: 1px solid var(--line-2); border-radius: 4px; padding: .05rem .35rem; }

.term-body {
  height: clamp(20rem, 52vh, 30rem); overflow-y: auto; padding: 1.1rem 1.2rem 1.3rem;
  font-family: var(--mono); font-size: clamp(.76rem, .7rem + .25vw, .9rem); line-height: 1.65;
  cursor: text; scrollbar-color: #35493b transparent;
  background: repeating-linear-gradient(transparent 0 3px, rgba(255, 255, 255, .02) 3px 4px);
}
.term-out > div { margin-bottom: .9rem; white-space: pre-wrap; word-break: break-word; }
.term-out .cmd { margin-bottom: .15rem; color: var(--text); }
.term-out .cmd b, .term-prompt { color: var(--acc); font-weight: 500; }
.term-out .res { color: #c3d3c8; }
.term-out .res a { color: var(--acc); border-bottom: 1px dashed rgba(155, 229, 138, .5); }
.term-out .k { color: var(--acc); }
.term-out .a { color: var(--amber); }
.term-out .d { color: var(--dim); }
.term-out .w { color: var(--text); font-weight: 500; }
.term-out .err { color: #ff8a84; }
.term-out pre { margin: 0; font: inherit; line-height: 1.2; color: var(--acc); }
.neo { display: flex; flex-wrap: wrap; gap: .6rem 2rem; align-items: center; white-space: normal; }
.neo dl { display: grid; grid-template-columns: auto 1fr; gap: 0 .9rem; }
.neo dt { color: var(--acc); }
.swatches { display: flex; gap: 0; margin-top: .5rem; grid-column: 1 / -1; }
.swatches i { width: 1.6rem; height: .9rem; }

.term-line { display: flex; align-items: center; gap: .6rem; }
.term-prompt { white-space: nowrap; }
.term-input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; caret-color: var(--acc); padding: 0; }
.term-chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: .8rem 1rem; border-top: 1px solid var(--line); background: var(--panel); }
.term-chips button {
  font-family: var(--mono); font-size: .74rem; padding: .32rem .7rem; border: 1px solid var(--line-2); border-radius: 6px; color: var(--muted);
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.term-chips button:hover { color: var(--acc); border-color: var(--acc); background: var(--acc-soft); }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-top: 1.25rem; }
.card {
  --mx: 50%; --my: 50%;
  position: relative; display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  overflow: hidden; transform-style: preserve-3d; box-shadow: var(--shadow);
  transition: border-color .3s ease, transform .35s var(--ease), opacity .8s var(--ease) var(--d, 0s);
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .35s ease;
  background: radial-gradient(520px circle at var(--mx) var(--my), rgba(27, 127, 59, .11), transparent 45%);
}
.card:hover { border-color: rgba(27, 127, 59, .35); }
.card:hover::before { opacity: 1; }
.card > * { position: relative; z-index: 1; }
.card-copy { padding: 1.5rem 1.5rem 1.6rem; display: flex; flex-direction: column; flex: 1; }
.card-copy > p:not(.card-flag):not(.card-sub) { color: var(--muted); font-size: .95rem; }
.card-flag { font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; color: var(--muted); margin-bottom: .8rem; }
.card h3 { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.5rem); font-weight: 700; font-stretch: 82%; line-height: 1; letter-spacing: -.03em; }
.card-sub { color: var(--text); font-weight: 500; margin: .45rem 0 .9rem; }
.card .tags { margin-top: 1.1rem; }
.card-links { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: auto; padding-top: 1.3rem; }

.card--feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.card--feature .card-copy { padding: clamp(1.5rem, 3vw, 2.6rem); }
.card--feature h3 { font-size: clamp(2.4rem, 1.5rem + 4vw, 4.6rem); }
.card--feature .viz { min-height: 22rem; height: 100%; border-bottom: 0; border-left: 1px solid var(--line); }

/* project visuals */
.viz { position: relative; height: 13.5rem; overflow: hidden; background: var(--viz); border-bottom: 1px solid var(--line); font-family: var(--mono); }
.viz-pill { position: absolute; top: .9rem; left: 1rem; display: inline-flex; align-items: center; gap: .45rem; font-size: .66rem; letter-spacing: .12em; color: var(--acc); z-index: 2; }
.viz-read { position: absolute; top: .8rem; right: 1rem; font-size: .8rem; color: var(--text); z-index: 2; font-variant-numeric: tabular-nums; }

/* Sentra viewfinder */
.viz-sentra {
  background:
    radial-gradient(ellipse 60% 50% at 30% 65%, rgba(27, 127, 59, .07), transparent 70%),
    linear-gradient(rgba(16, 19, 18, .05) 1px, transparent 1px) 0 0 / 100% 28px,
    linear-gradient(90deg, rgba(16, 19, 18, .05) 1px, transparent 1px) 0 0 / 28px 100%,
    var(--viz);
}
.vf { position: absolute; width: 1.4rem; height: 1.4rem; border: 2px solid var(--line-2); }
.vf-tl { top: 1rem; left: 1rem; border-right: 0; border-bottom: 0; }
.vf-tr { top: 1rem; right: 1rem; border-left: 0; border-bottom: 0; }
.vf-bl { bottom: 1rem; left: 1rem; border-right: 0; border-top: 0; }
.vf-br { bottom: 1rem; right: 1rem; border-left: 0; border-top: 0; }
.vf-rec { position: absolute; top: 1.15rem; left: 3rem; display: inline-flex; align-items: center; gap: .45rem; font-size: .66rem; letter-spacing: .12em; color: var(--muted); }
.bbox { position: absolute; border: 1.5px solid var(--acc); border-radius: 3px; background: rgba(27, 127, 59, .05); animation: bbox 5s var(--ease) infinite; }
.bbox em { position: absolute; left: -1.5px; bottom: 100%; font-style: normal; font-size: .64rem; white-space: nowrap; padding: .1rem .4rem; background: var(--acc); color: var(--acc-ink); border-radius: 3px 3px 3px 0; font-weight: 700; }
.b1 { left: 12%; top: 46%; width: 24%; height: 34%; }
.b2 { left: 44%; top: 20%; width: 20%; height: 52%; animation-delay: -1.6s; }
.b3 { left: 70%; top: 52%; width: 19%; height: 24%; border-color: var(--amber); background: rgba(184, 92, 0, .08); animation-delay: -3.1s; }
.b3 em { background: var(--amber); color: #fff; }
.scan { position: absolute; left: 0; right: 0; top: 0; height: 30%; background: linear-gradient(transparent, rgba(27, 127, 59, .09) 85%, rgba(27, 127, 59, .5)); animation: scan 4.2s linear infinite; }
.audio { position: absolute; left: 3rem; right: 3rem; bottom: 1.1rem; display: flex; align-items: center; gap: .8rem; font-size: .68rem; color: var(--muted); }
.audio span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars { display: flex; align-items: center; gap: 2px; height: 1.3rem; flex: none; }
.bars i { width: 3px; height: 100%; background: var(--amber); border-radius: 2px; transform-origin: center; animation: bars 1s ease-in-out infinite; }
.bars i:nth-child(2n) { animation-delay: -.2s; } .bars i:nth-child(3n) { animation-delay: -.45s; } .bars i:nth-child(5n) { animation-delay: -.7s; } .bars i:nth-child(7n) { animation-delay: -.3s; }

/* chart */
.viz-chart svg { position: absolute; inset: 2.2rem 0 0 0; width: 100%; height: calc(100% - 2.2rem); }
.viz-chart { background: linear-gradient(rgba(16, 19, 18, .035) 1px, transparent 1px) 0 0 / 100% 25%, var(--viz); }

/* booking */
.viz-book { padding: 1.1rem 1.3rem; display: flex; flex-direction: column; gap: .5rem; }
.book-head { display: grid; grid-template-columns: repeat(5, 1fr); gap: .45rem; font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); text-align: center; }
.book-grid { flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); grid-auto-rows: 1fr; gap: .45rem; }
.book-grid i { border: 1px solid var(--line-2); border-radius: 7px; position: relative; display: grid; place-items: center; }
.book-grid i.taken { background: repeating-linear-gradient(-45deg, transparent 0 5px, rgba(16, 19, 18, .06) 5px 6px); border-color: var(--line); }
.book-grid i.pick { border-color: var(--acc); background: var(--acc); animation: pick 4s var(--ease) infinite; }
.book-grid i.pick b { font-size: .6rem; font-weight: 700; color: var(--acc-ink); font-style: normal; white-space: nowrap; }

/* clinic */
.viz-clinic { padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: .7rem; }
.roles { display: flex; gap: .35rem; flex-wrap: wrap; }
.roles span { font-size: .64rem; padding: .22rem .55rem; border: 1px solid var(--line-2); border-radius: 999px; color: var(--muted); }
.roles span.on { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); font-weight: 700; }
.appts { display: grid; gap: .35rem; }
.appts li { display: grid; grid-template-columns: 3.2rem 1fr auto; align-items: center; gap: .6rem; font-size: .7rem; padding: .38rem .6rem; border: 1px solid var(--line); border-radius: 7px; background: rgba(16, 19, 18, .02); }
.appts time { color: var(--dim); }
.appts span { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appts b { font-weight: 500; font-size: .62rem; color: var(--muted); }
.appts b.ok { color: var(--acc); } .appts b.wait { color: var(--amber); }

/* membership */
.viz-aaf { display: grid; grid-template-columns: 1.1fr 1fr; gap: .9rem; padding: 1.1rem 1.2rem; align-items: center; }
.aaf-card {
  align-self: stretch; display: flex; flex-direction: column; justify-content: space-between; gap: .4rem;
  padding: .9rem 1rem; border-radius: 12px; color: #fff;
  background: linear-gradient(135deg, #1b7f3b, #2f9e4f 55%, #8fbf5a);
  box-shadow: 0 14px 26px -16px rgba(27, 127, 59, .8);
}
.aaf-org { font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.aaf-card b { font-family: var(--display); font-size: 1.5rem; font-weight: 700; font-stretch: 82%; line-height: 1; }
.aaf-status { display: inline-flex; align-items: center; gap: .4rem; font-size: .66rem; }
.aaf-status i { width: .45rem; height: .45rem; border-radius: 50%; background: #fff; animation: blink 1.6s ease-in-out infinite; }
.aaf-rows { display: grid; gap: .35rem; }
.aaf-rows li { display: flex; justify-content: space-between; align-items: center; font-size: .7rem; padding: .4rem .6rem; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.aaf-rows b { color: var(--muted); } .aaf-rows b.ok { color: var(--acc); }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 0; }
.tl-fill { position: absolute; left: 14.5rem; top: .4rem; bottom: 0; width: 1px; background: var(--line); }
.tl-fill i { position: absolute; inset: 0; background: var(--acc); transform-origin: 50% 0; transform: scaleY(0); box-shadow: 0 0 10px rgba(27, 127, 59, .6); }
.tl-item { display: grid; grid-template-columns: 14.5rem minmax(0, 1fr); padding-bottom: clamp(2rem, 4vw, 3.2rem); position: relative; }
.tl-item::before { content: ""; position: absolute; left: 14.5rem; top: .45rem; width: 11px; height: 11px; margin-left: -5px; border-radius: 50%; background: var(--bg); border: 2px solid var(--acc); z-index: 1; }
.tl-when { font-family: var(--mono); font-size: .8rem; color: var(--text); padding-right: 2rem; }
.tl-when em { display: block; font-style: normal; color: var(--dim); font-size: .72rem; margin-top: .2rem; }
.tl-what { padding-left: clamp(1.5rem, 4vw, 3.5rem); }
.tl-what h3 { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.9rem); font-weight: 700; font-stretch: 85%; line-height: 1.1; letter-spacing: -.02em; }
.tl-what h3 span { color: var(--acc); font-weight: 500; white-space: nowrap; }
.tl-what > ul:not(.tags) { margin-top: .9rem; display: grid; gap: .45rem; max-width: 46rem; }
.tl-what > ul:not(.tags) li { color: var(--muted); padding-left: 1.2rem; position: relative; font-size: .97rem; }
.tl-what > ul:not(.tags) li::before { content: "›"; position: absolute; left: 0; color: var(--acc); font-family: var(--mono); }
.tl-what .tags { margin-top: 1rem; }

.edu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-top: clamp(1rem, 3vw, 2rem); }
.edu-col { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); padding: 1.4rem 1.4rem 1.5rem; }
.edu-item + .edu-item { margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.edu-item b, .cert b { display: block; font-weight: 600; line-height: 1.25; }
.edu-item span { display: block; color: var(--muted); font-size: .92rem; margin-top: .2rem; }
.edu-item em, .cert em { display: block; font-style: normal; font-family: var(--mono); font-size: .72rem; color: var(--dim); margin-top: .35rem; }
.cert { display: flex; align-items: center; gap: .9rem; }
.cert + .cert { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.cert em { color: var(--amber); margin-top: .15rem; }
.ring { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--amber); animation: spin 2.4s linear infinite; flex: none; }

/* ---------- GitHub ---------- */
.gh { display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.gh-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); padding: 1.5rem; }
.gh-top { display: flex; align-items: center; gap: 1rem; }
.gh-avatar { width: 4.5rem; height: 4.5rem; border-radius: 50%; border: 2px solid var(--acc); padding: 3px; background: var(--bg); object-fit: cover; }
.gh-top b { display: block; font-size: 1.15rem; line-height: 1.2; }
.gh-top a { font-family: var(--mono); font-size: .82rem; color: var(--acc); }
.gh-top a:hover { text-decoration: underline; }
.gh-bio { margin-top: 1rem; color: var(--muted); font-size: .95rem; }
.gh-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 1.2rem 0 1.3rem; border-block: 1px solid var(--line); }
.gh-stats > div { padding: .9rem 0; }
.gh-stats > div + div { padding-left: .9rem; border-left: 1px solid var(--line); }
.gh-stats dt { font-family: var(--mono); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.gh-stats dd { font-size: 1.5rem; font-weight: 700; font-stretch: 80%; margin-top: .15rem; }
.gh-src { margin-top: .9rem; font-family: var(--mono); font-size: .66rem; color: var(--dim); text-align: center; }

.gh-contrib { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); padding: 1.5rem; min-width: 0; }
.gh-contrib-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .6rem 1.5rem; margin-bottom: 1.3rem; }
.gh-contrib-head p { color: var(--muted); }
.gh-contrib-head b { font-size: clamp(2rem, 1.4rem + 2vw, 3rem); font-weight: 800; font-stretch: 78%; line-height: 1; letter-spacing: -.02em; color: var(--text); margin-right: .35rem; font-variant-numeric: tabular-nums; }
.gh-scroll { overflow-x: auto; padding-bottom: .4rem; scrollbar-width: thin; }
.gh-months, .gh-grid { display: grid; gap: 3px; min-width: 620px; }
.gh-months { grid-template-columns: repeat(var(--cols, 53), 1fr); font-family: var(--mono); font-size: .62rem; color: var(--dim); margin-bottom: .35rem; height: 1em; }
.gh-months span { white-space: nowrap; }
.gh-grid { grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; min-height: 6rem; }
.gh-grid i, .gh-legend i { aspect-ratio: 1; border-radius: 3px; background: rgba(16, 19, 18, .07); }
.gh-grid i { animation: cellIn .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 12ms); transition: transform .15s ease, outline-color .15s ease; outline: 1.5px solid transparent; }
.gh-grid i.pad { visibility: hidden; }
.gh-grid i:hover { transform: scale(1.35); outline-color: var(--text); position: relative; z-index: 1; }
.gh-grid i[data-level="1"], .gh-legend i[data-level="1"] { background: #bfe3b4; }
.gh-grid i[data-level="2"], .gh-legend i[data-level="2"] { background: #7cc671; }
.gh-grid i[data-level="3"], .gh-legend i[data-level="3"] { background: #2f9e4f; }
.gh-grid i[data-level="4"], .gh-legend i[data-level="4"] { background: #14602c; }
.gh-contrib-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem; margin-top: .9rem; font-family: var(--mono); font-size: .7rem; color: var(--dim); }
.gh-tip { color: var(--muted); }
.gh-legend { display: inline-flex; align-items: center; gap: 3px; }
.gh-legend i { width: .7rem; display: inline-block; }
.gh-mini { display: grid; grid-template-columns: 1fr 1fr; margin-top: 1.2rem; border-top: 1px solid var(--line); }
.gh-mini > div { padding-top: .9rem; }
.gh-mini > div + div { padding-left: .9rem; border-left: 1px solid var(--line); }
.gh-mini dt { font-family: var(--mono); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.gh-mini dd { font-size: 1.5rem; font-weight: 700; font-stretch: 80%; margin-top: .15rem; }
.gh-fail { display: none; color: var(--muted); }
.gh-fail a { color: var(--acc); }
.gh-contrib.failed .gh-scroll, .gh-contrib.failed .gh-contrib-foot, .gh-contrib.failed .gh-mini, .gh-contrib.failed .gh-contrib-head p { display: none; }
.gh-contrib.failed .gh-fail { display: block; }
@keyframes cellIn { from { opacity: 0; transform: scale(.3); } }

/* ---------- Contact ---------- */
.contact {
  position: relative; z-index: 2; margin-top: clamp(5rem, 12vw, 10rem);
  padding-block: clamp(4rem, 10vw, 8rem);
  border-top: 1px solid var(--line);
  background:
    radial-gradient(ellipse 70% 90% at 50% 120%, rgba(27, 127, 59, .13), transparent 70%),
    var(--bg-2);
  overflow: hidden;
}
.contact-kicker { font-family: var(--mono); font-size: .8rem; color: var(--text); text-transform: uppercase; letter-spacing: .08em; }
.contact-kicker em { font-style: normal; color: var(--dim); text-transform: none; letter-spacing: 0; margin-left: .6rem; }
.contact-big {
  font-size: clamp(3rem, 11.5vw, 11rem); font-weight: 800; font-stretch: 75%;
  line-height: .9; letter-spacing: -.01em; text-transform: uppercase; margin: 1.2rem 0 clamp(2rem, 5vw, 3.5rem) -.03em;
}
.contact-big span { color: var(--acc); }
.contact-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 2rem; }
.mail {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: .3rem; text-align: left;
  padding: 1.1rem 1.5rem; border: 1px solid var(--line-2); border-radius: var(--radius); background: rgba(255, 255, 255, .7);
  transition: border-color .25s ease, background .25s ease, transform .25s var(--ease);
  max-width: 100%;
}
.mail:hover { border-color: var(--acc); background: var(--acc-soft); }
.mail-addr { font-family: var(--mono); font-size: clamp(1rem, .8rem + 1.3vw, 1.7rem); font-weight: 500; word-break: break-all; }
.mail-act { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--acc); }
.contact-links { display: flex; flex-wrap: wrap; gap: .6rem; }

/* ---------- Footer ---------- */
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem 2rem; padding-block: 1.6rem; font-size: .8rem; color: var(--dim); position: relative; z-index: 2; }
.footer .mono { font-size: .72rem; }
.footer a:hover { color: var(--acc); }

/* ---------- Keyframes ---------- */
@keyframes blink { 50% { opacity: 0; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(27, 127, 59, .55); } 70%, 100% { box-shadow: 0 0 0 .55rem rgba(27, 127, 59, 0); } }
@keyframes marquee { to { transform: translateX(calc(-50% - 1rem)); } }
@keyframes scan { from { transform: translateY(-100%); } to { transform: translateY(340%); } }
@keyframes bbox { 0%, 100% { transform: translate(0, 0) scale(1); opacity: 1; } 45% { transform: translate(-4px, 3px) scale(1.03); } 50% { opacity: .55; } 55% { opacity: 1; } 80% { transform: translate(3px, -2px) scale(.98); } }
@keyframes bars { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }
@keyframes pick { 0%, 18% { background: transparent; border-color: var(--line-2); } 18.1%, 100% { background: var(--acc); border-color: var(--acc); } 22% { transform: scale(1.12); } 30% { transform: scale(1); } }
@keyframes pickText { 0%, 18% { opacity: 0; } 22%, 100% { opacity: 1; } }
.book-grid i.pick b { animation: pickText 4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav-status { display: none; }
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gh { grid-template-columns: 1fr; }
  .edu { grid-template-columns: 1fr 1fr; }
  .tl-fill, .tl-item::before { left: 11rem; }
  .tl-item { grid-template-columns: 11rem minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .nav-toggle { display: block; z-index: 2; }
  .nav-links {
    position: fixed; inset: 0; margin: 0; z-index: 1;
    flex-direction: column; justify-content: center; gap: .4rem; padding: 5rem var(--gutter) 2rem;
    background: rgba(244, 242, 236, .98);
    font-size: 1.5rem; opacity: 0; visibility: hidden; transform: translateY(-12px);
    transition: opacity .3s ease, transform .3s var(--ease), visibility .3s;
  }
  .nav-links.open { opacity: 1; visibility: visible; transform: none; }
  .nav-links a { padding: .7rem .4rem; border-radius: 10px; border-bottom: 1px solid var(--line); color: var(--text); }
  .nav-links a span { font-size: .8rem; margin-right: .9em; }
  .brand { position: relative; z-index: 2; }

  .hero-row { grid-template-columns: 1fr; }
  .hud { grid-template-columns: 1fr 1fr; }
  .hud > div { padding: .8rem .8rem .9rem 0; }
  .hud > div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .hud > div:nth-child(even) { padding-left: .9rem; }
  .hud > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .hud dd { font-size: .86rem; }

  .about { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .card--feature { grid-template-columns: 1fr; }
  .card--feature .viz { order: -1; min-height: 16rem; height: 16rem; border-left: 0; border-bottom: 1px solid var(--line); }
  .sec-tag { display: none; }

  .tl-fill, .tl-item::before { left: 5px; }
  .tl-item { grid-template-columns: 1fr; padding-left: 1.8rem; }
  .tl-what { padding-left: 0; margin-top: .6rem; }
  .tl-when em { display: inline; margin-left: .6rem; }

  .edu { grid-template-columns: 1fr; }
  .term-hint { display: none; }
  .contact-kicker em { display: block; margin: .5rem 0 0; }
}

@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; }
  .stats li:nth-child(odd) { border-right: 0; }
  .stats li:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .skills { grid-template-columns: 1fr; }
  .hero-role { white-space: normal; }
  .btn { padding: .75rem 1.05rem; font-size: .8rem; }
  .audio { left: 1.2rem; right: 1.2rem; }
  .bbox em { font-size: .56rem; }
  .brand-text { display: none; }
}

/* 16px inputs stop iOS from zooming the page when the terminal is focused */
@media (pointer: coarse) { .term-input { font-size: 16px; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .marquee-track { animation: none; }
  .cursor-glow { display: none; }
}

/* ---------- Experience logos ---------- */
.tl-head { display: flex; align-items: center; gap: .9rem; }
.tl-logo { width: 3rem; height: 3rem; flex: none; border-radius: 10px; border: 1px solid var(--line); background: #fff; object-fit: contain; box-shadow: var(--shadow); }
@media (max-width: 860px) { .hud > div:last-child:nth-child(odd) { grid-column: 1 / -1; padding-left: 0; } }
@media (max-width: 520px) { .tl-head { align-items: flex-start; } .tl-logo { width: 2.5rem; height: 2.5rem; } }

/* ---------- About photo ---------- */
.about-side { display: grid; gap: 1.25rem; min-width: 0; }
.about-photo { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--viz); aspect-ratio: 4 / 5; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; }
