/* ===========================================================
   SEPEHR REZAEI · portfolio · terminal/dev aesthetic
   =========================================================== */

:root {
  /* dark (default) */
  --bg: #0a0e0a;
  --bg-elev: #0f1410;
  --bg-card: #11171210;
  --line: #1f2a1f;
  --line-strong: #2a3a2a;
  --text: #d6e0d4;
  --text-dim: #8a9886;
  --text-mute: #4f5a4d;
  --accent: #7cf03d;
  --accent-soft: rgba(124, 240, 61, 0.12);
  --accent-glow: rgba(124, 240, 61, 0.35);
  --study: #5fb8ff;
  --study-soft: rgba(95, 184, 255, 0.14);
  --warn: #f0c64a;
  --crt-scan: rgba(124, 240, 61, 0.02);

  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-display: "Space Mono", "JetBrains Mono", monospace;

  --maxw: 1240px;
  --pad: clamp(20px, 4vw, 56px);
  --radius: 4px;
}

[data-theme="light"] {
  --bg: #f5f3ec;
  --bg-elev: #efece2;
  --bg-card: #11171205;
  --line: #d8d3c2;
  --line-strong: #b8b29a;
  --text: #181a17;
  --text-dim: #5a5d4f;
  --text-mute: #9a9b8a;
  --accent: #2d7a18;
  --accent-soft: rgba(45, 122, 24, 0.10);
  --accent-glow: rgba(45, 122, 24, 0.25);
  --study: #1f5fb0;
  --study-soft: rgba(31, 95, 176, 0.12);
  --warn: #a87a00;
  --crt-scan: rgba(0, 0, 0, 0.015);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  background-image:
    linear-gradient(var(--crt-scan) 50%, transparent 50%);
  background-size: 100% 3px;
}

::selection { background: var(--accent); color: var(--bg); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea { font: inherit; color: inherit; background: none; border: none; outline: none; }

.mono { font-family: var(--font-mono); }
.dim { color: var(--text-dim); }
.mute { color: var(--text-mute); }
.accent { color: var(--accent); }
.upper { text-transform: uppercase; letter-spacing: 0.08em; }
.sr { position: absolute; left: -9999px; }

/* ---------- LAYOUT ---------- */
.app {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
  position: relative;
}

section { padding: clamp(72px, 10vw, 140px) 0 24px; position: relative; scroll-margin-top: 90px; }

.section-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 14px;
  margin-bottom: 36px;
}
.section-header .marker { color: var(--accent); font-weight: 700; }
.section-header h2 {
  font-family: var(--font-mono);
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.section-header .meta {
  margin-left: auto;
  color: var(--text-mute);
  font-size: 12px;
}

/* ---------- NAVBAR ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px var(--pad);
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
.nav-brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

.nav-links { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav-links a {
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text-dim);
  border-radius: var(--radius);
  transition: color .15s, background .15s;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); background: var(--accent-soft); }

.nav-actions { display: flex; gap: 6px; align-items: center; }
.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-dim);
  transition: all .15s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.icon-btn svg { width: 16px; height: 16px; }

/* mobile menu */
.menu-toggle { display: none; }

/* ---------- HERO ---------- */
.hero {
  padding: clamp(40px, 6vw, 80px) 0 24px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: stretch;
  min-height: clamp(560px, 80vh, 760px);
}

.hero-left { display: flex; flex-direction: column; justify-content: center; gap: 28px; }
.hero-handle {
  font-size: 13px;
  color: var(--text-dim);
  display: flex; align-items: center; gap: 10px;
}
.hero-handle .prompt { color: var(--accent); }
.hero-name {
  font-family: var(--font-display);
  font-size: clamp(40px, 7vw, 88px);
  line-height: 1;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.hero-name .glyph {
  display: inline-block;
  color: var(--accent);
}
.hero-title {
  font-size: clamp(15px, 1.6vw, 18px);
  color: var(--text-dim);
}
.hero-title b { color: var(--text); font-weight: 600; }
.hero-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--text-mute);
  font-size: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.hero-meta-row .item { display: flex; align-items: center; gap: 8px; }
.hero-meta-row .key { color: var(--accent); }

.hero-cta {
  display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap;
}
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  transition: all .15s ease;
  position: relative;
}
.btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn.primary {
  background: var(--accent);
  color: #0a0e0a;
  border-color: var(--accent);
  font-weight: 600;
}
.btn.primary:hover { background: transparent; color: var(--accent); }

/* hero right — terminal window */
.term {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: flex; flex-direction: column;
  font-size: 13px;
  box-shadow: 0 10px 60px -20px var(--accent-glow), 0 0 0 1px var(--line) inset;
}
.term-chrome {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: color-mix(in oklab, var(--bg) 70%, var(--bg-elev));
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--text-mute);
}
.term-chrome .dots { display: flex; gap: 6px; }
.term-chrome .dots span {
  width: 11px; height: 11px; border-radius: 50%;
  border: 1px solid var(--line-strong);
}
.term-chrome .dots span:nth-child(1) { background: #ff5f57aa; border-color: #ff5f57aa; }
.term-chrome .dots span:nth-child(2) { background: #febc2ea0; border-color: #febc2ea0; }
.term-chrome .dots span:nth-child(3) { background: #28c84099; border-color: #28c84099; }
.term-chrome .title { margin: 0 auto; }
.term-chrome .status { color: var(--text-mute); }

.term-body {
  padding: 18px 18px 24px;
  flex: 1;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}
.term-body .line { display: block; min-height: 1.55em; }
.term-body .prompt { color: var(--accent); }
.term-body .cmd { color: var(--text); }
.term-body .out { color: var(--text-dim); }
.term-body .dim { color: var(--text-mute); }
.term-body .err { color: var(--warn); }
.cursor {
  display: inline-block;
  width: 0.55ch;
  background: var(--accent);
  color: transparent;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.term-input-row {
  display: flex !important;
  align-items: center;
  gap: 4px;
}
.term-input-wrap {
  flex: 1;
  position: relative;
  display: inline-block;
  cursor: text;
  line-height: inherit;
}
.term-typed {
  font: inherit;
  color: var(--text);
  white-space: pre;
}
.term-input-hidden {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: text;
  font: inherit;
  border: none;
  outline: none;
  background: transparent;
  padding: 0;
}

/* photo card */
.photo-wrap {
  position: relative;
  display: grid; place-items: end center;
}
.photo-frame {
  position: absolute;
  inset: -16px;
  border: 1px dashed var(--line);
  pointer-events: none;
}
.photo {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 600 / 769;
  background-image: url('assets/photo.png');
  background-size: cover;
  background-position: center top;
  border-radius: 6px;
  filter: grayscale(0.2) contrast(1.05);
  box-shadow: 0 30px 80px -30px var(--accent-glow);
}
[data-theme="light"] .photo { filter: none; }

/* ---------- ABOUT ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 56px;
  align-items: start;
}
.about-portrait {
  position: sticky; top: 100px;
}
.about-comment {
  font-size: 15px;
  line-height: 1.75;
  max-width: 60ch;
  color: var(--text-dim);
}
.about-comment p { margin-bottom: 1em; }
.about-comment p::before {
  content: "// ";
  color: var(--accent);
  margin-right: 4px;
}
.about-comment p b { color: var(--text); font-weight: 600; }

/* ---------- TIMELINE ---------- */
.timeline {
  position: relative;
  user-select: none;
}
.tl-scrubber {
  margin: 0 0 36px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-elev);
}
.tl-scrubber-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  margin-bottom: 14px;
  font-size: 12px;
}
.tl-scrubber-head .label { color: var(--text-mute); letter-spacing: 0.06em; }
.tl-scrubber-head .yearnow { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--accent); }
.tl-track {
  position: relative;
  height: 56px;
  cursor: grab;
}
.tl-track:active { cursor: grabbing; }
.tl-axis {
  position: absolute; left: 0; right: 0; top: 28px;
  height: 1px; background: var(--line);
}
.tl-tick {
  position: absolute; top: 22px;
  width: 1px; height: 12px; background: var(--line-strong);
  transform: translateX(-0.5px);
}
.tl-tick.major { height: 18px; top: 19px; }
.tl-tick-label {
  position: absolute; top: 38px;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--text-mute);
  white-space: nowrap;
}
.tl-bar {
  position: absolute;
  top: 6px; height: 18px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 3px;
  cursor: pointer;
  transition: transform .15s, background .15s;
  overflow: hidden;
  display: flex; align-items: center;
  padding: 0 6px;
  font-size: 10px;
  color: var(--accent);
  white-space: nowrap;
}
.tl-bar:hover { transform: translateY(-2px); background: color-mix(in oklab, var(--accent) 30%, transparent); }
.tl-bar.active { background: var(--accent); color: var(--bg); font-weight: 600; }
.tl-bar.study {
  background: var(--study-soft);
  border-color: var(--study);
  color: var(--study);
}
.tl-bar.study:hover { background: color-mix(in oklab, var(--study) 30%, transparent); }
.tl-bar.study.active { background: var(--study); color: var(--bg); }
.tl-legend {
  display: flex;
  gap: 18px;
  font-size: 11px;
  color: var(--text-mute);
  margin-top: 10px;
  flex-wrap: wrap;
}
.tl-legend .swatch {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
  border: 1px solid currentColor;
}
.tl-legend .work { color: var(--accent); }
.tl-legend .study { color: var(--study); }
.tl-legend .work .swatch { background: var(--accent-soft); }
.tl-legend .study .swatch { background: var(--study-soft); }
.tl-cursor {
  position: absolute; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  transform: translateX(-1px);
  pointer-events: none;
}
.tl-cursor::before, .tl-cursor::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent;
}
.tl-cursor::before { top: -6px; border-top: 6px solid var(--accent); }
.tl-cursor::after { bottom: -6px; border-bottom: 6px solid var(--accent); }

/* timeline cards */
.tl-list { display: grid; gap: 12px; }
.tl-card {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 20px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-elev);
  transition: border-color .2s, transform .2s, opacity .25s;
  cursor: pointer;
  align-items: start;
}
.tl-card:hover { border-color: var(--accent); }
.tl-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 12px 40px -20px var(--accent-glow); }
.tl-card.dimmed { opacity: 0.32; }
.tl-card .date { font-size: 12px; color: var(--text-mute); }
.tl-card .date .now { color: var(--accent); font-weight: 600; }
.tl-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.tl-card .company { color: var(--accent); font-weight: 600; }
.tl-card .body { font-size: 13px; color: var(--text-dim); margin-top: 8px; display: none; line-height: 1.7; }
.tl-card .body ul { list-style: none; padding: 0; }
.tl-card .body li { padding-left: 18px; position: relative; }
.tl-card .body li::before {
  content: ">"; color: var(--accent); position: absolute; left: 0; top: 0;
}
.tl-card.active .body { display: block; }
.tl-card .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.tag {
  font-size: 10px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.tl-card .loc { font-size: 11px; color: var(--text-mute); text-align: right; }

/* ---------- EDUCATION ---------- */
.edu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.edu-card {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-elev);
  position: relative;
  overflow: hidden;
}
.edu-card::before {
  content: "";
  position: absolute; top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--accent);
  opacity: 0.4;
}
.edu-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.edu-card .deg { color: var(--accent); font-size: 13px; margin-bottom: 14px; }
.edu-card .meta { font-size: 11px; color: var(--text-mute); margin-bottom: 12px; display: flex; gap: 14px; flex-wrap: wrap; }
.edu-card .courses { display: flex; flex-wrap: wrap; gap: 4px; }
.edu-card .note { font-size: 12px; color: var(--text-dim); font-style: italic; }

/* ---------- SKILLS ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.skill-group {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-elev);
  transition: border-color .2s;
}
.skill-group:hover { border-color: var(--line-strong); }
.skill-group h3 {
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.skill-group h3::before { content: "$"; color: var(--accent); }
.skill-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text-dim);
  transition: all .15s;
}
.chip:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- PROJECTS ---------- */
.proj-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.proj-toolbar .count { color: var(--text-mute); font-size: 12px; }
.proj-toolbar .spacer { flex: 1; }
.filter-pill {
  font-size: 12px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--text-dim);
  transition: all .15s;
}
.filter-pill.active, .filter-pill:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  perspective: 1200px;
}
.proj-card {
  position: relative;
  padding: 22px 24px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-elev);
  transition: border-color .2s, box-shadow .2s;
  transform-style: preserve-3d;
  will-change: transform;
  overflow: hidden;
}
.proj-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 40%);
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
.proj-card:hover { border-color: var(--accent); box-shadow: 0 30px 80px -40px var(--accent-glow); }
.proj-card:hover::before { opacity: 1; }
.proj-card > * { transform: translateZ(0); position: relative; }
.proj-card .head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 6px;
}
.proj-card .status {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid var(--line);
  color: var(--text-mute);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.proj-card .status.shipped { color: var(--accent); border-color: var(--accent); }
.proj-card .status.in-progress { color: var(--warn); border-color: var(--warn); }
.proj-card .status.paused { color: var(--text-mute); }

.proj-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
  transform: translateZ(20px);
}
.proj-card .sub {
  font-size: 12px;
  color: var(--text-mute);
  margin-bottom: 14px;
}
.proj-card .sub .y { color: var(--accent); }
.proj-card .blurb { font-size: 13px; color: var(--text-dim); line-height: 1.65; margin-bottom: 14px; }
.proj-card .stack { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; }
.proj-card .actions { display: flex; gap: 8px; align-items: center; }
.proj-card .actions a { font-size: 12px; color: var(--accent); display: flex; align-items: center; gap: 4px; }
.proj-card .actions a:hover { text-decoration: underline; }
.proj-card .admin-actions { margin-left: auto; display: flex; gap: 4px; }
.proj-card .admin-actions button {
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text-dim);
  transition: all .15s;
}
.proj-card .admin-actions button:hover { color: var(--accent); border-color: var(--accent); }
.proj-card .admin-actions button.danger:hover { color: #ff6b6b; border-color: #ff6b6b; }

.proj-card.add {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 240px;
  border-style: dashed;
  color: var(--text-mute);
  text-align: center;
  cursor: pointer;
}
.proj-card.add:hover { color: var(--accent); }
.proj-card.add .plus { font-size: 32px; line-height: 1; margin-bottom: 8px; }

/* ---------- PROJECT CAROUSEL ---------- */
.proj-card.has-carousel { padding-top: 0; }
.carousel {
  position: relative;
  margin: 0 -24px 18px;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, color-mix(in oklab, var(--accent) 8%, var(--bg)) 0%, var(--bg-elev) 100%);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  transform: translateZ(0);
}
.carousel-track {
  position: absolute; inset: 0;
  display: flex;
  transition: transform .45s cubic-bezier(.4, 0, .2, 1);
  will-change: transform;
}
.carousel-slide {
  flex: 0 0 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}
.carousel-slide.placeholder {
  background-color: var(--bg-elev);
  background-image:
    repeating-linear-gradient(135deg, var(--line) 0 1px, transparent 1px 14px);
}
.carousel-slide.placeholder::after {
  content: attr(data-label);
  color: var(--text-mute);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--bg);
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
}
.carousel-btn {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  backdrop-filter: blur(6px);
  color: var(--text);
  border: 1px solid var(--line);
  opacity: 0; transition: opacity .2s, transform .2s, background .2s;
  z-index: 2;
}
.proj-card:hover .carousel-btn { opacity: 1; }
.carousel-btn:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }
.carousel-btn svg { width: 14px; height: 14px; }
.carousel-dots {
  position: absolute;
  left: 0; right: 0; bottom: 10px;
  display: flex; justify-content: center; gap: 5px;
  z-index: 2;
}
.carousel-dots button {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-mute);
  opacity: 0.5;
  transition: all .2s;
}
.carousel-dots button.active {
  background: var(--accent);
  opacity: 1;
  width: 18px; border-radius: 3px;
}
.carousel-count {
  position: absolute; top: 8px; right: 10px;
  font-size: 10px;
  color: var(--text-mute);
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  backdrop-filter: blur(6px);
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid var(--line);
  z-index: 2;
}
.proj-card.has-carousel h3 { padding: 0 0; }
.proj-card.has-carousel > .head { padding: 0; }

/* image-upload field */
.imgs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.img-thumb {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 4px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg);
  overflow: hidden;
}
.img-thumb button {
  position: absolute; top: 3px; right: 3px;
  width: 18px; height: 18px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  display: grid; place-items: center;
  line-height: 1;
}
.img-thumb button:hover { background: #ff5555; }
.img-drop {
  border: 1px dashed var(--line);
  border-radius: 4px;
  padding: 14px;
  font-size: 12px;
  color: var(--text-mute);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.img-drop:hover, .img-drop.over { border-color: var(--accent); color: var(--accent); }
.img-drop input { display: none; }

/* admin login + modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 100%;
  max-width: 560px;
  overflow: hidden;
  box-shadow: 0 30px 100px -20px rgba(0,0,0,0.6);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg) 60%, var(--bg-elev));
  font-size: 13px;
}
.modal-head .title { color: var(--accent); font-weight: 600; }
.modal-head button { color: var(--text-mute); padding: 4px 8px; }
.modal-head button:hover { color: var(--accent); }
.modal-body { padding: 24px; }

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.field input, .field textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  font-family: var(--font-mono);
  transition: border-color .15s;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 80px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

.login-prompt {
  text-align: left;
  font-size: 14px;
}
.login-prompt .pre { color: var(--text-dim); margin-bottom: 18px; }
.login-prompt .pre .acc { color: var(--accent); }
.login-hint { font-size: 11px; color: var(--text-mute); margin-top: 10px; font-style: italic; }

.admin-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 3px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.admin-badge .pulse-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); animation: pulse 1.8s ease-in-out infinite;
}

/* ---------- CONTACT ---------- */
.contact-wrap {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 36px;
  align-items: start;
}
.contact-term { border: 1px solid var(--line); border-radius: 8px; background: var(--bg-elev); overflow: hidden; }
.contact-term .term-body { padding: 22px 24px; }
.contact-term .term-body .row { display: flex; gap: 14px; margin-bottom: 8px; }
.contact-term .term-body .k { color: var(--text-mute); width: 90px; flex-shrink: 0; }
.contact-term .term-body .v { color: var(--text); }
.contact-term .term-body .v a:hover { color: var(--accent); text-decoration: underline; }

.contact-cta {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}
.contact-cta h3 { font-size: 18px; margin-bottom: 8px; letter-spacing: -0.01em; }
.contact-cta p { color: var(--text-dim); font-size: 13px; margin-bottom: 18px; }

/* ---------- FOOTER ---------- */
footer {
  border-top: 1px dashed var(--line);
  margin-top: 80px;
  padding: 24px 0 40px;
  font-size: 11px;
  color: var(--text-mute);
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}
footer .build {
  font-family: var(--font-mono);
  display: flex; gap: 8px; align-items: center;
}
footer .build::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ---------- BOOT OVERLAY ---------- */
.boot {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 1000;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: 40px clamp(20px, 6vw, 80px);
  font-size: 13px;
  color: var(--text-dim);
  pointer-events: none;
  opacity: 1;
  transition: opacity .4s ease;
}
.boot.done { opacity: 0; }
.boot .line { min-height: 1.6em; }
.boot .ok { color: var(--accent); }

/* ---------- MOBILE ---------- */
@media (max-width: 880px) {
  .nav-links {
    position: fixed;
    inset: 60px 0 0 0;
    flex-direction: column;
    background: var(--bg);
    padding: 24px var(--pad);
    gap: 4px;
    margin-left: 0;
    border-top: 1px solid var(--line);
    transform: translateY(-110%);
    transition: transform .25s ease;
    z-index: 49;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a {
    font-size: 16px;
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
  }
  .menu-toggle { display: grid; place-items: center; }

  .hero { grid-template-columns: 1fr; min-height: auto; gap: 32px; }
  .hero-left { order: 2; }
  .hero-right { order: 1; }
  .photo-wrap { justify-items: start; }
  .photo { max-width: 220px; }

  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .about-portrait { position: static; max-width: 160px; }

  .tl-card { grid-template-columns: 1fr; gap: 4px; padding: 16px; }
  .tl-card .loc { text-align: left; }
  .tl-card .date { order: -1; }
  .tl-scrubber { padding: 14px; }
  .tl-track { height: 70px; }
  .tl-bar { font-size: 9px; padding: 0 4px; }

  .edu-grid { grid-template-columns: 1fr; }
  .contact-wrap { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .hero-name { font-size: 48px; }
  .term-body { padding: 14px; font-size: 12px; }
  .section-header h2 { font-size: 18px; }
  .section-header .meta { display: none; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ==========================================================
   ADMIN PANEL — /admin
   ========================================================== */

/* ── Login page ─────────────────────────────────────────── */
.admin-login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}
.admin-login-card {
  width: 100%;
  max-width: 440px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-elev);
  overflow: hidden;
  box-shadow: 0 20px 80px -20px var(--accent-glow);
}
.admin-login-body {
  padding: 28px 28px 24px;
}
.admin-login-body h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.admin-login-body h1 .acc { color: var(--accent); }
.admin-login-body .lead {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 22px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  line-height: 1.9;
}
.admin-login-body .lead .prompt { color: var(--accent); margin-right: 6px; }

/* ── Layout ─────────────────────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────── */
.admin-sidebar {
  border-right: 1px solid var(--line);
  background: var(--bg-elev);
  display: flex;
  flex-direction: column;
  padding: 0 0 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
}
.admin-brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  flex-shrink: 0;
}
.admin-brand .sub {
  display: block;
  font-size: 10px;
  color: var(--text-mute);
  font-weight: 400;
}
.admin-nav-section {
  font-size: 10px;
  color: var(--text-mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 16px 4px;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 16px;
  font-size: 13px;
  color: var(--text-dim);
  border-radius: 0;
  text-align: left;
  transition: color .15s, background .15s;
  text-decoration: none;
}
.admin-nav-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.admin-nav-item:hover { color: var(--text); background: var(--accent-soft); }
.admin-nav-item.active { color: var(--accent); background: var(--accent-soft); }
.admin-sidebar-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.who {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 4px;
  font-size: 12px;
  color: var(--text-dim);
}
.who > div { line-height: 1.5; }
.who > div > div:last-child { font-size: 10px; color: var(--text-mute); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  background-image: url('assets/photo.png');
  background-size: cover;
  background-position: center top;
  flex-shrink: 0;
}

/* ── Main content ───────────────────────────────────────── */
.admin-main {
  padding: 32px clamp(20px, 3vw, 48px);
  background: var(--bg);
  min-width: 0;
}
.admin-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.crumbs {
  font-size: 11px;
  color: var(--text-mute);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.crumbs .sep { color: var(--line-strong); }
.admin-top h1 {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.admin-top h1 .pre { color: var(--accent); margin-right: 6px; }
.admin-top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Stats grid ─────────────────────────────────────────── */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.admin-stat {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-elev);
}
.admin-stat .lbl { font-size: 10px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.admin-stat .num { font-family: var(--font-display); font-size: 32px; font-weight: 700; color: var(--accent); line-height: 1; margin-bottom: 6px; }
.admin-stat .diff { font-size: 11px; color: var(--text-mute); }
.admin-stat.warn .num { color: var(--warn); }
.admin-stat.mute .num { color: var(--text-dim); }

/* ── Cards ──────────────────────────────────────────────── */
.admin-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-elev);
  overflow: hidden;
}
.admin-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg) 50%, var(--bg-elev));
  flex-wrap: wrap;
}
.admin-card-head .title { font-size: 12px; color: var(--text-dim); letter-spacing: 0.04em; }
.admin-card-head .sp { flex: 1; }

/* ── Table ──────────────────────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 10px;
  color: var(--text-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: color-mix(in oklab, var(--accent) 3%, transparent); }

.thumb {
  width: 52px; height: 36px;
  border-radius: 3px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg);
  border: 1px solid var(--line);
}
.thumb.placeholder {
  background-image: repeating-linear-gradient(135deg, var(--line) 0 1px, transparent 1px 10px);
}
.title-cell .t { font-weight: 600; color: var(--text); margin-bottom: 2px; }
.title-cell .s { font-size: 11px; color: var(--text-mute); }
.status-pill {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid var(--line);
  color: var(--text-mute);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-pill.shipped { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.status-pill.in-progress { color: var(--warn); border-color: var(--warn); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions button {
  font-size: 11px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text-dim);
  transition: all .15s;
}
.row-actions button:hover { color: var(--accent); border-color: var(--accent); }
.row-actions button.danger:hover { color: #ff6b6b; border-color: #ff6b6b; }

/* ── Search ─────────────────────────────────────────────── */
.admin-search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-dim);
  min-width: 180px;
}
.admin-search svg { width: 13px; height: 13px; flex-shrink: 0; }
.admin-search input {
  border: none;
  background: transparent;
  font-size: 12px;
  color: var(--text);
  width: 100%;
  outline: none;
  font-family: var(--font-mono);
}
.admin-search input::placeholder { color: var(--text-mute); }

/* ── Empty state ────────────────────────────────────────── */
.admin-empty {
  text-align: center;
  padding: 40px 20px !important;
  color: var(--text-mute);
  font-size: 13px;
}
.admin-empty .big { font-size: 28px; margin-bottom: 10px; }

/* ── Mobile sidebar ─────────────────────────────────────── */
@media (max-width: 720px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 0 12px;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    gap: 4px;
  }
  .admin-brand { border-bottom: none; padding: 12px 8px; white-space: nowrap; }
  .admin-brand .sub { display: none; }
  .admin-nav-section { display: none; }
  .admin-nav-item { padding: 8px 10px; white-space: nowrap; }
  .admin-sidebar-foot { margin-top: 0; border-top: none; padding: 0; display: flex; align-items: center; margin-left: auto; }
  .who { display: none; }
  .admin-main { padding: 20px 16px; }
  .hide-mobile { display: none; }
}

/* ── Content section editors ────────────────────────────────── */
.editor-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  padding: 20px;
}
.admin-flash {
  padding: 10px 14px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 13px;
}
.cat-name-input {
  background: transparent;
  border: none;
  border-bottom: 1px dashed var(--line);
  color: var(--text);
  font-size: 12px;
  font-family: var(--font-mono);
  padding: 2px 6px;
  outline: none;
  min-width: 120px;
}
.cat-name-input:focus { border-color: var(--accent); }
.tag-input-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  cursor: text;
  min-height: 42px;
  align-items: center;
  transition: border-color .15s;
}
.tag-input-wrap:focus-within { border-color: var(--accent); }
.tag-input-wrap input {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-family: var(--font-mono);
  outline: none;
  min-width: 120px;
  flex: 1;
}
.tag-input-wrap input::placeholder { color: var(--text-mute); }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in oklab, var(--accent) 40%, transparent);
  color: var(--accent);
  border-radius: 3px;
  font-size: 11px;
  font-family: var(--font-mono);
  white-space: nowrap;
}
.tag-chip button {
  color: var(--accent);
  font-size: 14px;
  line-height: 1;
  padding: 0;
  opacity: 0.5;
  display: flex;
  align-items: center;
}
.tag-chip button:hover { opacity: 1; }
