/* ==========================================================================
   style.css — "terminal + neon glass" design for the portfolio.

   Contents
     1. Colour tokens (dark only)                   7. Projects
     2. Base + layout                               8. Experience timeline
     3. Header + navigation                         9. Credentials + badges
     4. Buttons, tags, glass cards                 10. Contact + footer
     5. Intro (boot) screen                        11. Case-study pages
     6. Hero + about                               12. Edit mode, motion, print

   Every colour comes from the variables in section 1. Text colours were
   checked for WCAG AA contrast against the background they sit on (the
   ratios are noted next to them).
   ========================================================================== */


/* 1. COLOUR TOKENS -------------------------------------------------------
   Palette C, dark only. The base colours are set once; everything derived
   (borders, tints, glows, grid dots, hero rain) is mixed from --accent /
   --accent-2 further down, so changing an accent updates them all.
   Contrast ratios (WCAG) are noted next to the text colours.            */

:root {
  color-scheme: dark;
  --bg:            #070b14;
  --bg-2:          #0b1120;   /* alternating section tint                 */
  --surface-solid: #0f1626;   /* card colour where blur is unavailable    */
  --text:          #e6edf7;   /* 16.7:1 on --bg                           */
  --text-muted:    #93a4bd;   /*  7.8:1 on --bg                           */
  --accent:        #5aa9ff;   /*  8.0:1 on --bg                           */
  --accent-2:      #2dd4bf;   /* 10.6:1 on --bg                           */
  --on-accent:     #04101f;   /* text on an --accent fill, 7.8:1          */
  --accent-3:      #ffd166;   /* amber, private TODO notes only           */
  --todo:          #ffd166;
  --shadow:        0 12px 32px rgba(0, 0, 0, 0.35);
  --rain-opacity:  0.14;
  --soft-pct:      10%;       /* strength of accent tints behind text     */
  /* link hover: a lighter shade of the same accent */
  --accent-hover:  color-mix(in srgb, var(--accent) 70%, #ffffff);
}

/* Derived tokens: mixed from the accents above, never hard-coded */
:root {
  --surface:       color-mix(in srgb, var(--accent) 4%, color-mix(in srgb, var(--surface-solid) 72%, transparent));
  --surface-2:     color-mix(in srgb, var(--text) 5%, transparent);
  --border:        color-mix(in srgb, var(--accent) 18%, transparent);
  --border-strong: color-mix(in srgb, var(--accent) 40%, transparent);
  --accent-soft:   color-mix(in srgb, var(--accent) var(--soft-pct), transparent);
  --accent-2-soft: color-mix(in srgb, var(--accent-2) var(--soft-pct), transparent);
  --grid-dot:      color-mix(in srgb, var(--accent) 10%, transparent);
  --rain-a:        color-mix(in srgb, var(--accent) 60%, transparent);
  --rain-b:        color-mix(in srgb, var(--accent-2) 60%, transparent);
  --glow:          0 0 18px color-mix(in srgb, var(--accent) 10%, transparent);
  --glow-strong:   0 0 26px color-mix(in srgb, var(--accent) 18%, transparent);
  --text-glow:     none;
  --todo-soft:     color-mix(in srgb, var(--todo) 10%, transparent);
  --focus:         var(--accent);
  /* used ONLY on the hero name and the section-heading underlines */
  --gradient:      linear-gradient(90deg, var(--accent), var(--accent-2));

  --font-mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-prose: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --step--1: 0.8125rem;
  --step-0:  1rem;
  --step-1:  1.2rem;
  --step-2:  clamp(1.35rem, 1.1rem + 1vw, 1.7rem);
  --step-3:  clamp(1.6rem, 1.1rem + 2vw, 2.3rem);
  --step-4:  clamp(1.9rem, 1rem + 4vw, 3.4rem);   /* fits a 320px phone  */

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.5rem;  --space-6: 2rem;   --space-7: 3rem;    --space-8: 5rem;

  --radius:    14px;
  --radius-sm: 8px;
  --blur:      14px;
  --page-max:  72rem;
  --read-max:  42rem;
  --header-h:  4rem;
}

/* 2. BASE + LAYOUT ------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;          /* never scroll sideways on phones */
  font-family: var(--font-prose);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  /* Dot grid + two soft glows behind everything */
  background-image:
    radial-gradient(circle at 15% 0%, var(--accent-soft), transparent 40rem),
    radial-gradient(circle at 90% 30%, var(--accent-2-soft), transparent 36rem),
    radial-gradient(var(--grid-dot) 1px, transparent 1px);
  background-size: auto, auto, 22px 22px;
  background-attachment: fixed;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }

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

h1, h2, h3 { line-height: 1.2; margin: 0 0 var(--space-4); font-family: var(--font-mono); letter-spacing: -0.01em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
p  { margin: 0 0 var(--space-4); }
ul, ol { margin: 0 0 var(--space-4); padding-left: 1.25rem; }
li { margin-bottom: var(--space-2); }
strong { color: var(--text); }

.container { width: 100%; max-width: var(--page-max); margin: 0 auto; padding: 0 var(--space-4); }
@media (min-width: 48rem) { .container { padding: 0 var(--space-6); } }

.section { padding: var(--space-8) 0 var(--space-7); }

.muted { color: var(--text-muted); }

.sr-only {
  position: absolute !important; 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: var(--space-4); top: -4rem; z-index: 200;
  padding: var(--space-2) var(--space-4);
  background: var(--accent); color: var(--on-accent);
  font-family: var(--font-mono); font-weight: 700; border-radius: var(--radius-sm);
}
.skip-link:focus { top: var(--space-2); }

/* Small mono labels, e.g. "EXPERIENCE" over a stat */
.label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* "$ cat about.txt" — the command line above each heading */
.prompt, .cmd {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-muted);
  margin: 0 0 var(--space-2);
}
.prompt::before, .cmd::before { content: "$ "; color: var(--accent); font-weight: 700; }

.section-head { margin-bottom: var(--space-6); max-width: var(--read-max); }
.section-head h2 { display: inline-block; position: relative; padding-bottom: var(--space-2); }
.section-head h2::after {   /* gradient underline */
  content: ""; position: absolute; left: 0; bottom: 0; width: 3rem; height: 3px;
  border-radius: 3px; background: var(--gradient); box-shadow: var(--glow);
}
.section-head p { color: var(--text-muted); }


/* 3. HEADER + NAVIGATION ------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; gap: var(--space-3); height: 100%; }

.brand {
  font-family: var(--font-mono); font-weight: 700; font-size: 0.95rem;
  text-decoration: none; margin-right: auto; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.brand-user { color: var(--accent); }
.brand-path { color: var(--accent-2); }
.brand::after { content: "_"; color: var(--accent); animation: blink 1.1s steps(1) infinite; }

.nav-list { display: flex; gap: var(--space-1); list-style: none; margin: 0; padding: 0; }
.nav-list li { margin: 0; }
.nav-list a {
  display: block; padding: var(--space-2) var(--space-3);
  font-family: var(--font-mono); font-size: 0.85rem;
  color: var(--text-muted); text-decoration: none; border-radius: var(--radius-sm);
}
.nav-list a:hover { color: var(--text); background: var(--surface-2); }
.nav-list a[aria-current] { color: var(--accent); background: var(--accent-soft); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 2.75rem; height: 2.75rem; flex: none;        /* 44px touch target */
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--accent); }
.icon-btn svg { width: 1.2rem; height: 1.2rem; }


.menu-toggle { display: none; }

@media (max-width: 52rem) {
  .menu-toggle { display: inline-grid; }
  .site-nav {
    display: none;
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--surface-solid); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .site-nav.is-open { display: block; }
  .nav-list { flex-direction: column; padding: var(--space-3) var(--space-4); }
  .nav-list a { padding: var(--space-3); font-size: 1rem; }
  .no-js .menu-toggle { display: none; }
  .no-js .site-nav { position: static; display: block; border: 0; box-shadow: none; }
}


/* 4. BUTTONS, TAGS, GLASS CARDS ------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 2.75rem; padding: var(--space-2) var(--space-5);
  font-family: var(--font-mono); font-size: 0.85rem; font-weight: 700;
  letter-spacing: 0.04em; text-decoration: none;
  border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.btn svg { width: 1rem; height: 1rem; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--glow); }
.btn-primary:hover { color: var(--on-accent); box-shadow: var(--glow-strong); transform: translateY(-2px); }
.btn-secondary { background: var(--surface); color: var(--accent-2); border-color: var(--border-strong); }
.btn-secondary:hover { color: var(--accent-2); border-color: var(--accent-2); transform: translateY(-2px); }

.tags { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.tag {
  margin: 0; padding: 0.15rem 0.6rem;
  font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--text-muted); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px;
}
.tag-accent { color: var(--accent); border-color: var(--border-strong); background: var(--accent-soft); }

/* Glassmorphism card: translucent fill + blur + thin neon border */
.glass,
.panel, .skills > div, .facts > div, .project-card, .tl-item, .spec-sheet, .contact-card, .badge-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .panel, .skills > div, .facts > div, .project-card, .tl-item, .spec-sheet, .contact-card, .badge-card {
    background: var(--surface-solid);
  }
}

/* Fake window title bar with three dots, used on terminal cards */
.term-bar {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted);
}
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--text-muted); opacity: 0.45; }
.term-bar .term-loc { margin-left: auto; }
.term-bar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 30rem) { .term-bar .term-title { display: none; } }


/* 5. INTRO (BOOT) SCREEN ---------------------------------------------------
   Shown once per browser session on the home page, for at most ~1.5s.
   The inline script in <head> adds .intro to <html> only when the visitor
   has not seen it yet AND does not prefer reduced motion. The fade-out is
   pure CSS, so the overlay goes away even if JavaScript fails later.
   main.js lets visitors skip it (button, any key, click).               */

.boot { display: none; }
.intro .boot {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  padding: var(--space-4);
  background: var(--bg);
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px);
  background-size: 22px 22px;
  animation: boot-out 0.25s ease-in 1s forwards;   /* gone by ~1.25s */
}
.intro .boot.is-done { display: none; }
.boot-box { width: min(34rem, 100%); overflow: hidden; }
.boot-lines { padding: var(--space-4) var(--space-5); font-family: var(--font-mono); font-size: 0.85rem; }
.boot-lines p { margin: 0 0 var(--space-2); opacity: 0; animation: boot-line 0.12s ease-out forwards; }
.boot-lines p:nth-child(1) { animation-delay: 0.05s; }
.boot-lines p:nth-child(2) { animation-delay: 0.2s; }
.boot-lines p:nth-child(3) { animation-delay: 0.35s; }
.boot-lines p:nth-child(4) { animation-delay: 0.5s; }
.boot-lines p:nth-child(5) { animation-delay: 0.65s; }
.boot-ok { color: var(--accent); }
.boot-cmd { color: var(--accent-2); }
.boot-bar { height: 3px; margin: 0 var(--space-5) var(--space-4); background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.boot-bar span { display: block; height: 100%; width: 0; background: var(--accent); animation: boot-fill 0.9s linear forwards; }
.boot-skip {
  display: block; margin: 0 var(--space-5) var(--space-4) auto;
  font: inherit; font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--text-muted); background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: var(--space-1) var(--space-3); min-height: 2rem; cursor: pointer;
}
.boot-skip:hover { color: var(--text); border-color: var(--border-strong); }

@keyframes boot-line { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@keyframes boot-fill { to { width: 100%; } }
@keyframes boot-out  { to { opacity: 0; visibility: hidden; } }
@keyframes blink     { 50% { opacity: 0; } }


/* 6. HERO + ABOUT -------------------------------------------------------- */

.hero { position: relative; padding: var(--space-7) 0 var(--space-6); overflow: hidden; }
.hero-rain {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: var(--rain-opacity); pointer-events: none;
  /* fade the rain out towards the bottom */
  -webkit-mask-image: linear-gradient(#000 40%, transparent);
          mask-image: linear-gradient(#000 40%, transparent);
}
.hero .container { position: relative; }

.hero-grid { display: grid; gap: var(--space-6); align-items: center; }
@media (min-width: 56rem) { .hero-grid { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); } }

.term-window { min-width: 0; }
.term-body { padding: var(--space-5); }
@media (min-width: 48rem) { .term-body { padding: var(--space-6); } }

.term-body .cmd { margin-top: var(--space-4); }
.term-body .cmd:first-child { margin-top: 0; }
.out { margin: 0 0 var(--space-2); font-family: var(--font-mono); }

#hero-name {
  font-size: var(--step-4); margin: 0 0 var(--space-2);
  background: var(--gradient); -webkit-background-clip: text; background-clip: text;
  color: transparent;
  overflow-wrap: anywhere;
}

.hero-role { font-size: var(--step-0); color: var(--text-muted); }
.hero-role b { color: var(--text); }

.status-line { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; margin: 0 0 var(--space-2); }
.status-line li {
  margin: 0; padding: 0.2rem 0.65rem;
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2);
}
.status-line b { color: var(--accent); font-weight: 600; }

.hero-lead { font-family: var(--font-prose); color: var(--text-muted); max-width: 38rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); }
.cursor::after { content: "▌"; color: var(--accent); animation: blink 1.1s steps(1) infinite; }

/* Portrait in a glass frame with a glowing status badge */
.portrait { position: relative; margin: 0 auto; max-width: 20rem; width: 100%; padding: var(--space-3); }
/* Phones: photo first and smaller, so the face shows without scrolling */
@media (max-width: 55.99rem) { .portrait { order: -1; max-width: 13rem; } }
.portrait img { width: 100%; border-radius: calc(var(--radius) - 6px); }   /* shown in its own colours */
.portrait::before {  /* neon corner accent */
  content: ""; position: absolute; inset: -1px; border-radius: var(--radius); padding: 1px;
  background: var(--accent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0.7; pointer-events: none;
}
.portrait figcaption {
  position: absolute; left: 50%; bottom: var(--space-5); transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: var(--space-2); white-space: nowrap;
  padding: 0.3rem 0.8rem; font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700;
  color: var(--accent); background: var(--surface-solid);
  border: 1px solid var(--border-strong); border-radius: 999px; box-shadow: var(--glow);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }

/* Key facts under the hero */
.facts { display: grid; gap: var(--space-4); margin: var(--space-6) 0 0; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.facts > div { padding: var(--space-4) var(--space-5); position: relative; overflow: hidden; }
.facts > div::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: var(--accent); }
.facts dt { margin-bottom: var(--space-1); }
.facts dd { margin: 0; font-family: var(--font-mono); font-size: var(--step-1); font-weight: 700; color: var(--accent); }
.facts small { display: block; font-family: var(--font-mono); font-size: 0.75rem; font-weight: 400; color: var(--text-muted); margin-top: var(--space-1); }

/* About text + skills */
.about-grid { display: grid; gap: var(--space-6); }
@media (min-width: 60rem) { .about-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; } }
.about-card { padding: var(--space-5) var(--space-6); }
.about-text p { color: var(--text-muted); max-width: var(--read-max); }
.about-text p:last-child { margin-bottom: 0; }
.about-text strong { color: var(--accent); }

.skills { display: grid; gap: var(--space-3); margin: 0; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.skills > div { padding: var(--space-4); transition: border-color 0.2s ease, transform 0.2s ease; }
.skills > div:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.skills dt { color: var(--accent-2); margin-bottom: var(--space-3); }
.skills dd { margin: 0; }


/* 7. PROJECTS ------------------------------------------------------------ */

.project-list {
  display: grid; gap: var(--space-5); list-style: none; padding: 0; margin: 0;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  counter-reset: project;
}
.project-card {
  position: relative; display: flex; flex-direction: column; gap: var(--space-3);
  margin: 0; padding: var(--space-5);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.project-card:hover, .project-card:focus-within { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow), var(--glow); }
.project-card .num { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent-2); }
.project-card .num::before { counter-increment: project; content: "0" counter(project) " // "; }
.project-card h3 { margin: 0; font-size: var(--step-1); }
.project-card h3 a { color: var(--text); text-decoration: none; }
/* The title link covers the whole card, so the card is one big click target */
.project-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.project-card h3 a:focus-visible { outline: none; }
.project-card:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
.project-card p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }
.project-card .project-result { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text); }
.project-card .project-result::before { content: "> "; color: var(--accent); }
.project-card .read-more { margin-top: auto; }

.read-more { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700; color: var(--accent); }


/* 8. EXPERIENCE TIMELINE ------------------------------------------------- */

.timeline-filter { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-5); }
.filter-btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 2.75rem; padding: var(--space-2) var(--space-4);
  font: inherit; font-family: var(--font-mono); font-size: 0.8rem;
  color: var(--text-muted); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; cursor: pointer;
}
.filter-btn:hover { color: var(--text); border-color: var(--border-strong); }
.filter-btn[aria-pressed="true"] { color: var(--on-accent); background: var(--accent); border-color: var(--accent); box-shadow: var(--glow); }
.filter-btn span { width: 0.6rem; height: 0.6rem; border-radius: 50%; border: 2px solid var(--accent-2); }
.filter-btn .lg-network { background: var(--accent); border-color: var(--accent); }
.filter-btn .lg-other   { border-color: var(--text-muted); }
.filter-btn .lg-all     { border-style: dashed; border-color: currentColor; }
.filter-btn[aria-pressed="true"] span { border-color: var(--on-accent); }

.timeline { position: relative; list-style: none; margin: 0; padding: 0 0 0 1.75rem; }
.timeline::before {  /* the glowing vertical line */
  content: ""; position: absolute; left: 0.45rem; top: 0.5rem; bottom: 0.5rem; width: 2px;
  background: var(--border-strong);
}
.tl-item { position: relative; margin: 0 0 var(--space-4); padding: var(--space-4) var(--space-5); }
.tl-item[hidden] { display: none; }
.tl-item::before {  /* node on the line; colour = category */
  content: ""; position: absolute; left: calc(-1.75rem + 0.1rem); top: 1.35rem;
  width: 0.9rem; height: 0.9rem; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--text-muted);
}
.tl-item.is-network::before  { background: var(--accent); border-color: var(--accent); }
.tl-item.is-security::before { border-color: var(--accent-2); }
.tl-when { display: block; font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent-2); margin-bottom: var(--space-1); }
.tl-item h3 { margin-bottom: var(--space-1); }
.tl-item h3 .muted { font-weight: 400; font-size: 0.85em; }
.tl-org { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-muted); margin-bottom: var(--space-3); }
.tl-item ul { color: var(--text-muted); font-size: 0.95rem; margin-bottom: var(--space-2); }
.tl-item ul:last-child { margin-bottom: 0; }


/* 9. CREDENTIALS + VERIFIED BADGES --------------------------------------- */

.badges-block { margin-bottom: var(--space-6); }
.badges-block[hidden] { display: none; }
.badges-block h3 { color: var(--accent); }
.badge-grid {
  display: grid; gap: var(--space-4); list-style: none; margin: 0; padding: 0;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
}
.badge-card { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); margin: 0; padding: var(--space-5) var(--space-4); text-align: center; }
.badge-card img { width: 6.5rem; height: 6.5rem; object-fit: contain; margin-bottom: var(--space-2); filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.25)); }
/* Light backing for badges that look muddy on dark cards (badge "chip": true) */
.badge-card img.badge-chip { background: #f6f8f7; padding: 0.55rem; border-radius: 14px; box-sizing: content-box; width: 5.6rem; height: 5.6rem; }
.badge-card .badge-name { font-family: var(--font-mono); font-weight: 700; line-height: 1.3; }
.badge-card .badge-meta { font-size: 0.85rem; color: var(--text-muted); }
.badge-card .badge-verify { margin-top: auto; font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700; }

.cred-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.panel { padding: var(--space-5); min-width: 0; }
.panel h3 { font-size: 1rem; color: var(--accent-2); }
.panel-wide { grid-column: 1 / -1; }
.cred-list { list-style: none; margin: 0; padding: 0; }
.cred-list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3);
  margin: 0; padding: var(--space-2) 0; border-bottom: 1px dashed var(--border);
}
.cred-list li:last-child { border-bottom: 0; }
.cred-name { min-width: 0; overflow-wrap: anywhere; }
.cred-sub { display: block; font-size: 0.85rem; color: var(--text-muted); }
.cred-meta { flex: none; font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); text-align: right; }
.cred-meta.is-strong { color: var(--accent); font-weight: 700; }
.achievements { display: grid; gap: 0 var(--space-6); }
@media (min-width: 48rem) { .achievements { grid-template-columns: 1fr 1fr; } }


/* 10. CONTACT + FOOTER ---------------------------------------------------- */

.contact-grid { display: grid; gap: var(--space-6); align-items: start; }
@media (min-width: 56rem) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.contact-card .term-body { padding: var(--space-5); }
.contact-list { list-style: none; margin: 0; padding: 0; font-family: var(--font-mono); font-size: 0.9rem; }
.contact-list li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: var(--space-3); margin: 0; padding: var(--space-2) 0; }
.contact-list a, .contact-list span:last-child { overflow-wrap: anywhere; }
.contact-list .label { color: var(--accent-2); align-self: center; }

.site-footer { padding: var(--space-6) 0; border-top: 1px solid var(--border); font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); }


/* 11. CASE-STUDY PAGES ---------------------------------------------------- */

.case-header { padding: var(--space-7) 0 var(--space-6); }
.case-header h1 { font-size: var(--step-3); max-width: 46rem; }
.case-summary { max-width: var(--read-max); color: var(--text-muted); font-size: 1.05rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; margin: 0 0 var(--space-5); font-family: var(--font-mono); font-size: 0.8rem; }
.breadcrumb li { margin: 0; color: var(--text-muted); }
.breadcrumb li + li::before { content: "/ "; color: var(--accent); }

.case-layout { display: grid; gap: var(--space-6); padding-bottom: var(--space-8); }
@media (min-width: 62rem) {
  .case-layout { grid-template-columns: 17rem minmax(0, 1fr); align-items: start; }
  .spec-sheet { position: sticky; top: calc(var(--header-h) + var(--space-4)); }
}
.spec-sheet { padding: var(--space-5); }
.spec-sheet h2 { font-size: 0.85rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em; }
.spec-sheet h2::before { content: "// "; color: var(--accent-2); }
.spec-sheet dl { margin: 0; }
.spec-sheet dt { margin-top: var(--space-3); color: var(--accent-2); }
.spec-sheet dd { margin: var(--space-1) 0 0; font-family: var(--font-mono); font-size: 0.85rem; }

.case-body { min-width: 0; max-width: 46rem; }
.case-body section { margin-bottom: var(--space-7); }
.case-body h2 { font-size: var(--step-2); padding-bottom: var(--space-2); border-bottom: 1px solid var(--border); }
.case-body h2::before { content: "## "; color: var(--accent); }
.case-body h3 { margin-top: var(--space-5); color: var(--accent-2); font-size: 1.05rem; }
.case-body p, .case-body li { color: var(--text-muted); }
.case-body li strong, .case-body p strong { color: var(--text); }

.result-callout {
  margin: 0 0 var(--space-5); padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border-strong); border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm); background: var(--accent-soft);
}
.result-callout p { margin: 0; color: var(--text); }

.table-scroll { overflow-x: auto; margin: 0 0 var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.tool-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tool-table th, .tool-table td { padding: var(--space-3) var(--space-4); text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.tool-table thead th { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-2); background: var(--surface-2); }
.tool-table tbody th { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text); white-space: nowrap; }
.tool-table td { color: var(--text-muted); }
.tool-table tr:last-child > * { border-bottom: 0; }

.figure { margin: 0 0 var(--space-6); }
.figure figcaption { margin-top: var(--space-2); font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); }
.figure figcaption::before { content: "fig. "; color: var(--accent); }
.diagram { padding: var(--space-4); overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.diagram svg { min-width: 40rem; width: 100%; }
@media (max-width: 47.99rem) {
  .diagram::after { content: "← scroll →"; display: block; text-align: center; margin-top: var(--space-2); font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }
}
/* Diagram drawing classes (shapes live in each case-study page) */
.dg-box      { fill: var(--surface-solid); stroke: var(--border-strong); stroke-width: 1.25; }
.dg-box-acc  { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.4; }
.dg-zone     { fill: none; stroke: var(--accent-2); stroke-width: 1; stroke-dasharray: 4 4; opacity: 0.7; }
.dg-line     { fill: none; stroke: var(--text-muted); stroke-width: 1.25; }
.dg-line-acc { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.dg-arrow    { fill: var(--text-muted); }
.dg-arrow-acc{ fill: var(--accent); }
.dg-title    { fill: var(--text); font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; }
.dg-text     { fill: var(--text-muted); font-family: var(--font-mono); font-size: 10.5px; }
.dg-zone-lbl { fill: var(--accent-2); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.dg-acc-text { fill: var(--accent); font-family: var(--font-mono); font-size: 10.5px; }

.case-nav { display: grid; gap: var(--space-4); margin-top: var(--space-7); }
@media (min-width: 40rem) { .case-nav { grid-template-columns: 1fr 1fr; } }
.case-nav a {
  display: block; padding: var(--space-4) var(--space-5); text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 0.9rem; transition: border-color 0.2s ease, transform 0.2s ease;
}
.case-nav a:hover { border-color: var(--border-strong); transform: translateY(-2px); color: var(--text); }
.case-nav .next { text-align: right; }
.case-nav .label { display: block; color: var(--accent); margin-bottom: var(--space-1); }

.load-error {
  max-width: var(--page-max); margin: var(--space-6) auto; padding: var(--space-4) var(--space-5);
  border: 1px solid var(--accent-3); border-radius: var(--radius-sm); background: var(--todo-soft);
  font-family: var(--font-mono); font-size: 0.9rem;
}


/* 12. EDIT MODE, MOTION, PRINT -------------------------------------------- */

/* Private notes: hidden on the public site, shown in edit mode (?edit or localhost) */
.todo, .placeholder { display: none; }
.edit-mode .todo {
  display: block; margin: var(--space-3) 0; padding: var(--space-3) var(--space-4);
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--todo);
  background: var(--todo-soft); border: 1px dashed var(--todo); border-radius: var(--radius-sm);
}
.edit-mode span.todo { display: inline; margin: 0 0 0 var(--space-2); padding: 0 var(--space-2); }
.edit-mode .todo::before { content: "TODO  "; font-weight: 700; }
.edit-mode .placeholder {
  display: grid; place-items: center; min-height: 8rem; margin: var(--space-4) 0; padding: var(--space-4);
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); text-align: center;
  border: 1px dashed var(--todo); border-radius: var(--radius-sm); background: var(--todo-soft);
}
.placeholder strong { display: block; margin-bottom: var(--space-2); color: var(--todo); }

.edit-bar { display: none; }
.edit-mode .edit-bar {
  position: fixed; right: var(--space-4); bottom: var(--space-4); z-index: 150;
  display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center;
  max-width: calc(100% - 2rem); padding: var(--space-2) var(--space-4);
  font-family: var(--font-mono); font-size: 0.75rem;
  background: var(--surface-solid); border: 1px solid var(--todo); border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.edit-bar a { color: var(--todo); }

/* Scroll reveal: sections fade up, then their cards follow in a short stagger */
@media (prefers-reduced-motion: no-preference) {
  .reveal-ready .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
  .reveal-ready .reveal.is-visible { opacity: 1; transform: none; }
  .reveal-ready .reveal .stagger > * { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
  .reveal-ready .reveal.is-visible .stagger > * { opacity: 1; transform: none; }
  .reveal.is-visible .stagger > :nth-child(2) { transition-delay: 0.06s; }
  .reveal.is-visible .stagger > :nth-child(3) { transition-delay: 0.12s; }
  .reveal.is-visible .stagger > :nth-child(4) { transition-delay: 0.18s; }
  .reveal.is-visible .stagger > :nth-child(5) { transition-delay: 0.24s; }
  .reveal.is-visible .stagger > :nth-child(n+6) { transition-delay: 0.3s; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal, .reveal .stagger > * { opacity: 1 !important; transform: none !important; }
}

@media print {
  :root {
    --bg: #fff; --surface: #fff; --surface-solid: #fff; --surface-2: #fff; --text: #000; --text-muted: #333;
    --border: #bbb; --border-strong: #999; --accent: #000; --accent-2: #000; --on-accent: #fff;
    --grid-dot: transparent; --shadow: none; --glow: none;
  }
  body { background: #fff; }
  .site-header, .hero-rain, .boot, .hero-actions, .menu-toggle, .edit-bar, .timeline-filter, .case-nav { display: none !important; }
  .tl-item[hidden] { display: block !important; }
  #hero-name { color: #000; background: none; }
  .glass, .panel, .skills > div, .facts > div, .project-card, .tl-item, .spec-sheet, .badge-card { backdrop-filter: none; box-shadow: none; }
}
