/* ============================================================
   SR-PORTFOLIO v4 — "THE CYBER-BLUEPRINT"
   High-Fidelity Glassmorphism. Glowing HUD borders. Responsive grid.
   ============================================================ */

:root {
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  --max-w: 1140px;
  --nav-h: 70px;
  --tap: 44px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* midnight cyberpunk blueprint (default) */
[data-theme="dark"] {
  --paper: #06090f;          /* Deep obsidian navy */
  --paper-2: rgba(10, 15, 26, 0.72);
  --card: rgba(13, 20, 35, 0.55);   /* Frosted glass */
  --card-hover: rgba(22, 33, 56, 0.75);
  --ink: #f8fafc;            /* Clean white-grey */
  --ink-dim: #94a3b8;        /* Slate cool grey */
  --line: rgba(0, 242, 254, 0.25); /* Glowing cyber border */
  --line-soft: rgba(192, 132, 252, 0.22); /* Glowing purple line */
  --grid: rgba(0, 242, 254, 0.038);  /* Electric matrix grid */
  --accent: #00f2fe;         /* Cyber cyan */
  --accent-2: #c084fc;       /* Neon lavender */
  --accent-ink: #020617;
  --accent-dim: rgba(0, 242, 254, 0.12);
  --accent-2-dim: rgba(192, 132, 252, 0.12);
  --stamp: #22c55e;          /* Electric green success */
  --shadow: rgba(0, 0, 0, 0.6);
  --glow: 0 0 20px rgba(0, 242, 254, 0.35);
  --glow-s: 0 0 10px rgba(0, 242, 254, 0.15);
  --glow-purple: 0 0 20px rgba(192, 132, 252, 0.3);
  --card-solid: #10151f;   /* opaque stand-ins where blur is too costly */
  --panel-solid: #0b1018;
}

/* daylight architect blueprint */
[data-theme="light"] {
  --paper: #f8f7f2;          /* Warm drafting paper */
  --paper-2: rgba(238, 236, 226, 0.88);
  --card: rgba(254, 253, 251, 0.78);
  --card-hover: rgba(246, 244, 234, 0.92);
  --ink: #0f172a;            /* Rich navy-slate ink */
  --ink-dim: #475569;
  --line: rgba(15, 23, 42, 0.2);
  --line-soft: rgba(0, 102, 204, 0.16);
  --grid: rgba(0, 102, 204, 0.05);   /* Blue blueprint grid */
  --accent: #0066cc;         /* Classic draft blue */
  --accent-2: #d97706;       /* Copper accent */
  --accent-ink: #ffffff;
  --accent-dim: rgba(0, 102, 204, 0.08);
  --accent-2-dim: rgba(217, 119, 6, 0.08);
  --stamp: #dc2626;          /* Red verification stamp */
  --shadow: rgba(15, 23, 42, 0.12);
  --glow: 0 0 15px rgba(0, 102, 204, 0.18);
  --glow-s: 0 0 8px rgba(0, 102, 204, 0.08);
  --glow-purple: 0 0 15px rgba(217, 119, 6, 0.15);
  --card-solid: #fbfaf5;
  --panel-solid: #edeadd;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 20px); }

body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  overflow-x: clip;
  transition: background 0.35s ease, color 0.35s ease;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--paper);
  border-left: 1px solid var(--line-soft);
}
::-webkit-scrollbar-thumb {
  background: var(--line);
  border: 2px solid var(--paper);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Grid paper backdrop */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 44px 44px;
}

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

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }
@media (min-width: 640px) { .container { padding: 0 32px; } }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-2); }

/* ================= entrance animations (IO-triggered) ================= */
.fx { opacity: 0; transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: var(--d, 0ms); will-change: transform, opacity; }
.fx.rise    { transform: translateY(30px); }
.fx.swoop-l { transform: translateX(-40px) rotate(-1.5deg); }
.fx.swoop-r { transform: translateX(40px) rotate(1.5deg); }
.fx.in { opacity: 1; transform: none; }

/* ================= scroll progress ================= */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); z-index: 1002; }

/* ================= navigation ================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: var(--nav-h);
  background: var(--paper-2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1.5px solid var(--line);
  transition: all 0.3s ease;
}
.nav-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 20px; height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
@media (min-width: 640px) { .nav-inner { padding: 0 32px; } }

.nav-logo {
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink); letter-spacing: 0.05em;
  white-space: nowrap; display: inline-flex; align-items: center; min-height: var(--tap);
  transition: transform 0.2s;
}
.nav-logo:hover { transform: scale(1.02); }
.nav-logo b { color: var(--accent); font-weight: 700; text-shadow: var(--glow-s); }

.nav-links { display: none; list-style: none; align-items: center; gap: 2px; }
@media (min-width: 860px) { .nav-links { display: flex; } }
.nav-links a {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-dim);
  padding: 8px 12px; border: 1.5px solid transparent;
  transition: all 0.2s var(--ease);
}
.nav-links a:hover, .nav-links a.active {
  color: var(--ink);
  border-color: var(--line);
  background: var(--accent-dim);
  box-shadow: var(--glow-s);
}
.nav-right { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em;
  background: var(--card); color: var(--ink); border: 1.5px solid var(--line);
  min-height: 40px; padding: 0 14px; cursor: pointer;
  box-shadow: 4px 4px 0 var(--shadow);
  transition: all 0.2s var(--ease);
}
.theme-toggle:hover {
  border-color: var(--accent);
  box-shadow: 4px 4px 0 var(--shadow), var(--glow-s);
  transform: translate(-1px, -1px);
}
.theme-toggle:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--shadow); }

.nav-burger {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  background: none; border: none; cursor: pointer;
  min-width: var(--tap); min-height: var(--tap); align-items: center;
}
@media (min-width: 860px) { .nav-burger { display: none; } }
.nav-burger span { width: 22px; height: 2px; background: var(--ink); transition: transform 0.3s var(--ease), opacity 0.3s; }
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed; top: var(--nav-h); left: 0; right: 0; z-index: 99;
  background: var(--paper-2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1.5px solid var(--line);
  display: grid; max-height: 0; overflow: hidden;
  transition: max-height 0.4s var(--ease);
}
.mobile-menu.open { max-height: 380px; }
.mobile-menu a {
  font-family: var(--font-mono); font-size: 0.9rem; color: var(--ink);
  padding: 15px 24px; border-top: 1px dashed var(--line); min-height: var(--tap);
  display: flex; align-items: center;
}
.mobile-menu a small { color: var(--accent); margin-right: 12px; }

/* ================= hero & CLI grid ================= */
.hero {
  min-height: 100vh; /* fallback */
  min-height: 100svh; /* stable on iOS while the URL bar collapses */
  padding: calc(var(--nav-h) + 40px) 0 60px;
  display: flex; flex-direction: column; justify-content: center;
  position: relative;
}
.hero-grid {
  display: grid;
  gap: 40px;
  align-items: center;
  width: 100%;
}
@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 44px;
  }
}

.cross { position: absolute; width: 18px; height: 18px; opacity: 0.4; pointer-events: none; }
.cross::before, .cross::after { content: ""; position: absolute; background: var(--line); }
.cross::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.cross::after { top: 50%; left: 0; right: 0; height: 1px; }
.cross.c1 { top: 12%; right: 8%; }
.cross.c2 { bottom: 12%; left: 4%; }
.cross.c3 { top: 46%; right: 48%; display: none; }
@media (min-width: 800px) { .cross.c3 { display: block; } }

.hero-file {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; color: var(--ink-dim);
  display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 26px;
  border: 1px dashed var(--line); padding: 9px 14px; width: fit-content;
  background: var(--card);
}
.hero-file b { color: var(--accent); font-weight: 500; text-shadow: var(--glow-s); }

.hero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.8rem, 9vw, 5.6rem);
  line-height: 0.98; letter-spacing: -0.03em; text-transform: uppercase;
  margin-bottom: 12px;
}
.hero h1 .solid { display: block; }
.hero h1 .outline {
  display: block; color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
}
.hero h1 .outline em { font-style: normal; -webkit-text-stroke: 1.5px var(--accent); text-shadow: var(--glow-s); }

.hero-sub {
  margin-top: 18px; font-family: var(--font-mono);
  font-size: clamp(0.85rem, 2.2vw, 1.05rem); color: var(--ink-dim);
}
.hero-sub .prompt { color: var(--accent); }
.hero-sub .typed { color: var(--ink); font-weight: 500; }
.hero-sub .caret { display: inline-block; width: 0.55em; height: 1.05em; background: var(--accent); vertical-align: text-bottom; margin-left: 3px; animation: blink 0.85s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* spec table HUD styling */
.spec {
  margin: 28px 0 32px; max-width: 480px; font-family: var(--font-mono); font-size: 0.8rem;
  display: grid; gap: 8px;
}
.spec .row { display: flex; align-items: baseline; gap: 10px; }
.spec .k { color: var(--ink-dim); letter-spacing: 0.08em; flex-shrink: 0; }
.spec .dots { flex: 1; border-bottom: 1.5px dotted var(--line); transform: translateY(-4px); opacity: 0.7; }
.spec .v { color: var(--ink); text-align: right; }
.spec .v.ok::before { content: "●"; color: var(--stamp); margin-right: 7px; font-size: 0.6rem; vertical-align: 2px; animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: 0.4; } 50% { opacity: 1; } 100% { opacity: 0.4; } }

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ================= CLI Interactive Terminal ================= */
.cli-container {
  font-family: var(--font-mono);
  background: rgba(8, 12, 21, 0.85);
  border: 1.5px solid var(--line);
  box-shadow: 8px 8px 0 var(--shadow);
  display: flex;
  flex-direction: column;
  height: 380px;
  max-width: 100%;
  position: relative;
  /* transform is driven by JS parallax — do not transition it */
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  z-index: 10;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.cli-container:hover {
  border-color: var(--accent);
  box-shadow: 8px 8px 0 var(--shadow), var(--glow);
}
[data-theme="light"] .cli-container {
  background: rgba(254, 253, 250, 0.9);
}

.cli-bar {
  display: flex;
  align-items: center;
  background: var(--paper-2);
  padding: 8px 14px;
  border-bottom: 1.5px solid var(--line);
  font-size: 0.72rem;
  color: var(--ink-dim);
  user-select: none;
}
.cli-dots {
  display: flex;
  gap: 6px;
  margin-right: 14px;
}
.cli-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.cli-dot.red { background: #ff5f56; }
.cli-dot.yellow { background: #ffbd2e; }
.cli-dot.green { background: #27c93f; }

.cli-title {
  flex-grow: 1;
  text-align: center;
  font-weight: 500;
  letter-spacing: 0.05em;
}
.cli-body {
  flex-grow: 1;
  padding: 16px;
  overflow-y: auto;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--ink);
  position: relative;
  scroll-behavior: smooth;
}
.cli-output {
  margin-bottom: 12px;
  white-space: pre-wrap;
}
.cli-output-line {
  margin-bottom: 6px;
  color: var(--ink-dim);
}
.cli-output-line.system {
  color: var(--accent);
}
.cli-output-line.info {
  color: var(--accent-2);
}
.cli-output-line.cmd-echo {
  color: var(--ink);
}
.cli-input-line {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cli-prompt {
  color: var(--accent);
  font-weight: bold;
  user-select: none;
}
.cli-input-line { position: relative; }
/* the real input is an invisible overlay — the mirror span + block caret render the text,
   so it no longer shows twice, and 16px font stops iOS from zoom-jumping on focus */
.cli-input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  background: transparent; border: none; outline: none;
  color: transparent; caret-color: transparent;
  font-family: var(--font-mono);
  font-size: 16px;
  opacity: 0;
}
.cli-caret {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--accent);
  margin-left: 2px;
  animation: cli-blink 1s step-end infinite;
  vertical-align: middle;
}
@keyframes cli-blink { 50% { opacity: 0; } }

.matrix-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 0;
}
.matrix-active .matrix-canvas {
  opacity: 0.15;
}
.matrix-active .cli-output,
.matrix-active .cli-input-line {
  position: relative;
  z-index: 1;
  text-shadow: 0 0 5px rgba(0, 242, 254, 0.8);
}

/* rotating rubber-stamp badge */
.roundel {
  position: absolute; right: 24px; bottom: 90px; width: 118px; height: 118px;
  display: none; pointer-events: none;
}
/* only on wide screens — below this it collides with the terminal column */
@media (min-width: 1200px) { .roundel { display: block; } }
.roundel svg { width: 100%; height: 100%; animation: spin 18s linear infinite; }
.roundel text { font-family: var(--font-mono); font-size: 10px; letter-spacing: 2.5px; fill: var(--ink-dim); }
.roundel .arrow-core { font-size: 26px; fill: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= buttons ================= */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 0.82rem; font-weight: 700; letter-spacing: 0.06em;
  min-height: var(--tap); padding: 12px 24px; cursor: pointer; border: 1.5px solid var(--line);
  transition: all 0.2s var(--ease);
}
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 5px 5px 0 var(--shadow); }
.btn-plain   { background: var(--card); color: var(--ink); box-shadow: 5px 5px 0 var(--shadow); }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--shadow), var(--glow-s); border-color: var(--accent); }
.btn-primary:hover { border-color: var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--shadow); }

/* ================= section headers ================= */
section { padding: 80px 0; }
@media (min-width: 800px) { section { padding: 108px 0; } }

.sec-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 50px;
  border: 1.5px solid var(--line);
  background: var(--paper-2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 18px 24px;
  box-shadow: 6px 6px 0 var(--shadow);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.sec-head:hover {
  border-color: var(--accent);
  box-shadow: 6px 6px 0 var(--shadow), var(--glow-s);
}
.sec-no {
  font-family: var(--font-mono); font-weight: 700;
  font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px var(--accent);
  text-shadow: var(--glow-s);
  flex-shrink: 0;
}
.sec-title { min-width: 0; flex-grow: 1; }
.sec-label { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.22em; color: var(--accent-2); margin-bottom: 2px; }
.sec-title h2 {
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(1.3rem, 4vw, 2.1rem); letter-spacing: -0.01em; line-height: 1.1;
  position: relative; display: inline-block;
}
.sec-title h2::after {
  content: ""; position: absolute; left: 0; bottom: 3px; height: 0.35em; width: 100%;
  background: var(--accent-dim); z-index: -1;
  transform: scaleX(0); transform-origin: left; transition: transform 0.8s var(--ease) 0.2s;
}
.sec-head.in h2::after { transform: scaleX(1); }
.sec-rule { width: 44px; height: 1.5px; background: var(--line); position: relative; flex-shrink: 0; }
.sec-rule::after { content: ""; position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 8px; height: 8px; background: var(--accent); box-shadow: var(--glow-s); }

/* ================= about ================= */
.about-grid { display: grid; gap: 40px; }
@media (min-width: 860px) { .about-grid { grid-template-columns: 1.4fr 1fr; gap: 50px; } }
.about-text p { color: var(--ink-dim); margin-bottom: 18px; font-size: 1rem; }
.about-text p strong { color: var(--ink); }
.about-text .marginalia {
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent-2);
  border-left: 3px solid var(--accent-2); padding-left: 12px; margin-top: 26px; letter-spacing: 0.06em;
}

.field-notes {
  border: 1.5px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 6px 6px 0 var(--shadow);
  transition: all 0.3s var(--ease);
}
.field-notes:hover {
  border-color: var(--accent);
  box-shadow: 6px 6px 0 var(--shadow), var(--glow);
  transform: translateY(-2px);
}
.field-notes h3 {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.2em; color: var(--accent-ink);
  background: var(--accent); padding: 10px 16px; border-bottom: 1.5px solid var(--line);
}
.field-notes ul { list-style: none; }
.field-notes li {
  font-size: 0.86rem; color: var(--ink-dim); padding: 13px 16px;
  border-bottom: 1px dashed var(--line); display: flex; gap: 11px;
  transition: all 0.2s var(--ease);
}
.field-notes li:last-child { border-bottom: none; }
.field-notes li:hover { background: var(--accent-dim); color: var(--ink); padding-left: 20px; }
.field-notes li::before { content: "✓"; font-family: var(--font-mono); color: var(--accent); font-weight: 700; text-shadow: var(--glow-s); }

/* ================= experience (work logs) ================= */
.logbook { display: grid; gap: 34px; position: relative; }
.log {
  position: relative;
  border: 1.5px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 6px 6px 0 var(--shadow);
  transition: all 0.3s var(--ease);
}
.log:hover {
  border-color: var(--accent-2);
  box-shadow: 6px 6px 0 var(--shadow), var(--glow-purple);
  transform: translateY(-2px);
}
.log-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 16px 20px; border-bottom: 1.5px solid var(--line);
  background: var(--paper-2);
}
.log-no { font-family: var(--font-mono); font-size: 0.68rem; color: var(--accent); letter-spacing: 0.16em; }
.log-role { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; text-transform: uppercase; letter-spacing: 0.01em; }
.log-org { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-dim); }
.log-dates {
  margin-left: auto; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em;
  color: var(--ink); border: 1.5px solid var(--line); padding: 4px 10px; background: var(--accent-2-dim);
  white-space: nowrap;
}
.log ul { list-style: none; padding: 18px 20px; display: grid; gap: 10px; }
.log li { display: flex; gap: 12px; color: var(--ink-dim); font-size: 0.92rem; }
.log li::before { content: "—"; color: var(--accent); flex-shrink: 0; font-family: var(--font-mono); }
.log li strong { color: var(--ink); font-weight: 600; }
.log .current-tag {
  position: absolute; top: -13px; right: 16px;
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.14em; font-weight: 700;
  background: var(--accent); color: var(--accent-ink); border: 1.5px solid var(--line);
  padding: 3px 10px; transform: rotate(2deg);
  box-shadow: var(--glow-s);
}

/* ================= projects ================= */
.deck-note { font-family: var(--font-mono); font-size: 0.7rem; color: var(--ink-dim); letter-spacing: 0.12em; margin: -30px 0 34px; }
.deck { display: grid; gap: 28px; }
.sheet {
  border: 1.5px solid var(--line);
  /* no backdrop-filter here: up to 6 sheets overlap while stacking, and
     layered blur repaints every scroll frame — the rgba tint keeps the glass look */
  background: var(--card);
  box-shadow: 7px 7px 0 var(--shadow);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
}
@media (min-width: 760px) {
  .deck { gap: 40px; }
  .deck .sheet { position: sticky; top: calc(var(--nav-h) + 20px + var(--i) * 52px); }
}
.sheet:hover {
  border-color: var(--accent);
  transform: translate(-3px, -3px) rotate(-0.2deg);
  box-shadow: 11px 11px 0 var(--shadow), var(--glow);
}
.sheet-tab {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1.5px solid var(--line); background: var(--paper-2);
}
.sheet-tab .prj { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.16em; color: var(--accent); white-space: nowrap; }
.sheet-tab .name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.02em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-tab .dom { margin-left: auto; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.1em; color: var(--ink-dim); border: 1px dashed var(--line); padding: 3px 9px; white-space: nowrap; }
.sheet-body { padding: 22px 20px 24px; position: relative; }
@media (min-width: 640px) { .sheet-body { padding: 26px 26px 28px; } }
.sheet-body p { color: var(--ink-dim); font-size: 0.95rem; max-width: 660px; }
.sheet-body p strong { color: var(--ink); }
.sheet-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.sheet-tags span {
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--ink);
  border: 1.5px solid var(--line); padding: 4px 10px; background: var(--paper);
  box-shadow: 2px 2px 0 var(--shadow);
  transition: all 0.2s var(--ease);
}
.sheet:hover .sheet-tags span {
  border-color: var(--line-soft);
}
.sheet-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; }
.sheet-links a {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em;
  color: var(--accent); border-bottom: 1.5px dashed var(--accent);
  padding: 8px 0 2px;
  transition: all 0.2s;
}
.sheet-links a:hover {
  color: var(--accent-2);
  border-bottom-color: var(--accent-2);
  text-shadow: var(--glow-s);
}
.sheet-links a.pending { color: var(--ink-dim); border-bottom-color: var(--line); cursor: help; }

/* hologram stamp */
.stamp {
  position: absolute; right: 18px; top: 16px;
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.2em;
  color: var(--stamp); border: 2px solid var(--stamp); padding: 5px 12px;
  transform: rotate(8deg) scale(1.6); opacity: 0;
  transition: transform 0.3s var(--ease), opacity 0.3s;
  pointer-events: none;
}
.sheet:hover .stamp, .sheet.in .stamp { opacity: 0.8; transform: rotate(-6deg) scale(1); transition-delay: 0.2s; }
.stamp.todo { color: var(--ink-dim); border-color: var(--ink-dim); }

/* ================= technical skills & filters ================= */
.marquee-wrap {
  margin: 0 0 44px; overflow: hidden; border-top: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line);
  background: var(--paper-2); padding: 13px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  user-select: none;
}
.marquee { display: flex; width: max-content; animation: marquee 32s linear infinite; }
.marquee-wrap:hover .marquee { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.marquee span {
  font-family: var(--font-mono); font-size: 0.85rem; white-space: nowrap; color: var(--ink-dim);
  padding: 0 18px; border-right: 1px dashed var(--line);
}
.marquee span b { color: var(--accent); font-weight: 400; margin-right: 16px; }

/* Filter Container */
.skills-filter-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}
.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  min-height: var(--tap); /* touch-friendly */
  padding: 8px 16px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink-dim);
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--shadow);
  transition: all 0.2s var(--ease);
}
.filter-btn:hover {
  color: var(--ink);
  border-color: var(--accent);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--shadow);
}
.filter-btn.active {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 4px 4px 0 var(--shadow), var(--glow-s);
}

.inv-grid {
  display: grid;
  border-top: 1.5px solid var(--line);
  border-left: 1.5px solid var(--line);
  background: var(--card);
  box-shadow: 7px 7px 0 var(--shadow);
  overflow: hidden;
}
@media (min-width: 640px) { .inv-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .inv-grid { grid-template-columns: 1fr 1fr 1fr 1fr; } }

.inv-cell {
  padding: 22px 20px;
  border-right: 1.5px solid var(--line);
  border-bottom: 1.5px solid var(--line);
  transition: background-color 0.25s, opacity 0.3s, transform 0.3s;
}
.inv-cell:hover { background: var(--accent-dim); }
.inv-cell.hidden {
  display: none !important;
}

.inv-cell h3 {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.2em; color: var(--accent);
  margin-bottom: 14px; text-transform: uppercase;
}
.inv-cell h3::before { content: "▤ "; }
.inv-cell ul { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; }
.inv-cell li {
  font-family: var(--font-mono); font-size: 0.74rem; color: var(--ink);
  border: 1px solid var(--line-soft); padding: 3px 9px;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s;
}
.inv-cell li:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
  transform: translateY(-1px);
}

/* ================= education ================= */
.edu-grid { display: grid; gap: 26px; }
@media (min-width: 760px) { .edu-grid { grid-template-columns: 1fr 1fr; } }
.edu-card {
  border: 1.5px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 24px;
  box-shadow: 6px 6px 0 var(--shadow); position: relative;
  transition: all 0.3s var(--ease);
}
.edu-card:hover { transform: translate(-2px, -2px); border-color: var(--accent); box-shadow: 9px 9px 0 var(--shadow), var(--glow-s); }
.edu-card .edu-dates { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; color: var(--accent-2); }
.edu-card h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; margin: 10px 0 4px; line-height: 1.3; }
.edu-card p { color: var(--ink-dim); font-size: 0.88rem; }
.edu-card .corner { position: absolute; top: 0; right: 0; width: 0; height: 0; border-style: solid; border-width: 0 24px 24px 0; border-color: transparent var(--accent-2) transparent transparent; }

/* ================= contact ================= */
.contact-grid { display: grid; gap: 40px; }
@media (min-width: 860px) { .contact-grid { grid-template-columns: 1fr 1.15fr; gap: 50px; } }
.contact-info > p { color: var(--ink-dim); margin-bottom: 28px; font-size: 1rem; }

.contact-links {
  list-style: none; display: grid;
  border: 1.5px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 6px 6px 0 var(--shadow);
  transition: border-color 0.3s;
}
.contact-links:hover { border-color: var(--line-soft); }
.contact-links li + li { border-top: 1px dashed var(--line); }
.contact-links a {
  display: flex; align-items: baseline; gap: 14px; color: var(--ink);
  padding: 15px 18px; font-family: var(--font-mono); font-size: 0.8rem;
  min-height: var(--tap);
  transition: all 0.2s;
}
.contact-links a:hover { background: var(--accent-dim); color: var(--accent); padding-left: 24px; }
.contact-links .k { color: var(--ink-dim); font-size: 0.66rem; letter-spacing: 0.16em; width: 74px; flex-shrink: 0; }
.contact-links .v { word-break: break-all; }
.contact-links .todo-v { color: var(--ink-dim); font-style: italic; }

.contact-form {
  display: grid; gap: 16px;
  border: 1.5px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 26px 22px;
  box-shadow: 6px 6px 0 var(--shadow);
  transition: all 0.3s;
}
.contact-form:hover { border-color: var(--line-soft); }
@media (min-width: 640px) { .contact-form { padding: 30px 28px; } }
.form-row { display: grid; gap: 16px; }
@media (min-width: 560px) { .form-row { grid-template-columns: 1fr 1fr; } }
.contact-form label { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.18em; color: var(--ink-dim); display: grid; gap: 7px; }
.contact-form input, .contact-form textarea {
  font-family: var(--font-sans); font-size: 0.95rem; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line); border-bottom: 2px solid var(--ink);
  padding: 12px 14px; width: 100%; border-radius: 0; min-height: var(--tap);
  transition: border-color 0.25s, background 0.25s;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); background: var(--card); }
.contact-form textarea { resize: vertical; min-height: 130px; }
.form-status { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); min-height: 1.4em; }

/* ================= footer ================= */
footer { border-top: 1.5px solid var(--line); padding: 30px 0 40px; background: rgba(0,0,0,0.05); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
footer p { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; color: var(--ink-dim); }

.barcode { height: 34px; width: 150px; background: repeating-linear-gradient(90deg,
  var(--ink) 0 2px, transparent 2px 5px, var(--ink) 5px 9px, transparent 9px 11px,
  var(--ink) 11px 12px, transparent 12px 16px, var(--ink) 16px 19px, transparent 19px 21px);
  opacity: 0.5;
  transition: opacity 0.3s;
}
footer:hover .barcode { opacity: 0.8; }

.back-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  font-family: var(--font-mono); font-size: 0.8rem;
  width: var(--tap); height: var(--tap); cursor: pointer;
  background: var(--card); border: 1.5px solid var(--line); color: var(--ink);
  box-shadow: 4px 4px 0 var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: opacity 0.3s, transform 0.3s var(--ease), visibility 0.3s, border-color 0.2s;
}
.back-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-top:hover { border-color: var(--accent); box-shadow: 4px 4px 0 var(--shadow), var(--glow-s); }
.back-top:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow); }

/* ================= mobile polish & perf ================= */
/* single-column hero: don't force a full viewport height — that centered the
   content and left huge empty bands above and below it on phones */
@media (max-width: 959px) {
  .hero { min-height: auto; justify-content: flex-start; padding-bottom: 48px; }
  .hero-grid { gap: 32px; }
}

/* blur is expensive on phone GPUs — swap glass for solid panels ≤860px */
@media (max-width: 860px) {
  .log, .field-notes, .edu-card, .contact-links, .contact-form, .cli-container, .sec-head, .mobile-menu {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .log, .field-notes, .edu-card, .contact-links, .contact-form, .sheet, .cli-container,
  [data-theme="light"] .cli-container {
    background: var(--card-solid);
  }
  .sec-head, .mobile-menu { background: var(--panel-solid); }
}

@media (max-width: 640px) {
  /* stamps: no room to float over the text on phones — sit in the flow above it */
  .stamp {
    position: static; display: inline-block; margin-bottom: 14px;
  }
  .sheet:hover .stamp, .sheet.in .stamp { transform: rotate(-2deg) scale(1); }
  .cli-container { height: 320px; }
  .cli-body { font-size: 0.75rem; }
  /* iOS zooms into fields rendered under 16px — keep the form at 16px */
  .contact-form input, .contact-form textarea { font-size: 16px; }
  .sec-head { padding: 14px 16px; gap: 12px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .footer-inner { flex-direction: column; text-align: center; }
}

/* 360px-class screens: shed the decorative chips that fight for width */
@media (max-width: 520px) {
  .sec-rule { display: none; }
  .sheet-tab .dom { display: none; }
  .log-dates { margin-left: 0; }
  .spec { font-size: 0.74rem; }
  .hero-file { font-size: 0.62rem; }
}

/* ================= reduced motion ================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .fx { opacity: 1; transform: none; }
  .deck .sheet { position: static !important; }
}
