/* ============================================================
   Battery-engineer portfolio — monochrome on near-black
   ============================================================ */
:root {
  --bg:        #08090a;
  --bg-2:      #0c0d0f;
  --surface:   #111315;
  --surface-2: #16181b;
  --line:      rgba(244,243,241,0.085);
  --line-2:    rgba(244,243,241,0.16);
  --ink:       #f2f3f4;
  --ink-2:     #b4b8bb;
  --ink-3:     #777b7f;
  --ink-4:     #565a5e;

  /* accent — defaults to mono (white). Overridable via tweaks. */
  --accent:      #f2f3f4;
  --accent-soft: rgba(242,243,244,0.14);
  --accent-glow: rgba(242,243,244,0.28);

  --serif: "Newsreader", Georgia, serif;
  --sans:  "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, monospace;

  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.18, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: 0.005em;
  overflow-x: hidden;
}
/* faint grid texture — no gradients, just a subtle dotted field */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 34px 34px;
  pointer-events: none; z-index: 0;
}
#root { position: relative; z-index: 1; }

::selection { background: var(--accent); color: #08090a; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
.mono { font-family: var(--mono); font-size: 0.74em; letter-spacing: 0.04em; }
.dim  { color: var(--ink-3); }
.italic { font-style: italic; }
.dotsep { display: inline-block; width: 3px; height: 3px; border-radius: 50%;
  background: currentColor; opacity: 0.5; vertical-align: middle; margin: 0 0.5em; }

/* ---------------- nav ---------------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto;
  height: 68px; padding: 0 32px;
  display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 0; }
.brand-mark { display: flex; align-items: center; }
.brand-name { font-family: var(--serif); font-size: 18px; letter-spacing: 0.01em; white-space: nowrap; transform: translateY(1.5px); }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-link {
  position: relative; padding: 8px 14px; color: var(--ink-3);
  font-size: 14px; letter-spacing: 0.02em; transition: color 0.3s var(--ease);
}
.nav-link:hover { color: var(--ink-2); }
.nav-link.current { color: var(--ink); }
.nav-underline {
  position: absolute; left: 14px; right: 14px; bottom: 2px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.nav-link.current .nav-underline { transform: scaleX(1); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.ghost-icon {
  display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 4px; color: var(--ink-3);
  transition: color 0.25s, background 0.25s, border-color 0.25s;
  border: 1px solid transparent;
}
.ghost-icon:hover { color: var(--ink); background: var(--surface); border-color: var(--line); }
.nav-progress { height: 1px; background: transparent; }
.nav-progress > span {
  display: block; height: 100%; background: var(--accent);
  transform-origin: left; transform: scaleX(0);
  transition: transform 0.12s linear; opacity: 0.5;
}

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 18px; border-radius: 3px;
  background: var(--ink); color: #08090a;
  font-size: 14px; font-weight: 500; letter-spacing: 0.01em;
  border: 1px solid var(--ink);
  transition: transform 0.3s var(--ease), background 0.3s, color 0.3s, box-shadow 0.3s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -12px rgba(0,0,0,0.8); }
.btn.outline { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.outline:hover { border-color: var(--ink); background: var(--surface); }
.btn.small { padding: 8px 13px; font-size: 13px; }
.btn svg { display: block; }

.text-link {
  display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2);
  font-size: 14px; transition: color 0.25s, gap 0.25s var(--ease);
}
.text-link:hover { color: var(--ink); gap: 12px; }
.text-link svg { color: var(--accent); }

/* ---------------- kicker ---------------- */
.kicker { display: flex; align-items: center; gap: 12px; color: var(--ink-3); }
.kicker-num { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: 0.08em; }
.kicker-line { width: 26px; height: 1px; background: var(--line-2); }
.kicker-text { font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; }

/* ---------------- tags ---------------- */
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  display: inline-flex; align-items: center; padding: 4px 11px;
  border: 1px solid var(--line-2); border-radius: 100px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.03em;
  color: var(--ink-3); background: transparent;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
button.tag:hover { color: var(--ink-2); border-color: var(--ink-3); }
.tag.active { color: #08090a; background: var(--accent); border-color: var(--accent); }
.filter-count { margin-left: auto; color: var(--ink-4); align-self: center; }

/* ---------------- battery motif ---------------- */
.charge-col { display: flex; gap: 5px; }
.charge-col.v { flex-direction: column-reverse; }
.charge-col.h { flex-direction: row; }
.charge-col.v .seg { width: 26px; height: 7px; }
.charge-col.h .seg { width: 7px; height: 26px; }
.seg {
  border-radius: 1.5px; border: 1px solid var(--line-2);
  background: transparent; transition: background 0.4s var(--ease),
    border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.seg.on {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 10px -2px var(--accent-glow);
}
.battery-glyph { display: inline-flex; align-items: center; gap: 2px; height: 15px; }
.bg-body {
  flex: 1; height: 100%; border: 1.4px solid var(--ink-2); border-radius: 2.5px;
  padding: 1.4px; display: flex; align-items: stretch;
}
.bg-fill { background: var(--accent); border-radius: 1px; transition: width 0.6s var(--ease); }
.bg-cap { width: 2.4px; height: 6px; background: var(--ink-2); border-radius: 0 1.5px 1.5px 0; }

/* ---------------- reveal ---------------- */
.reveal { opacity: 0; transform: translateY(var(--ry, 18px));
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
  html { scroll-behavior: auto; }
}
@media print {
  .reveal, .view-fade { opacity: 1 !important; transform: none !important; animation: none !important; }
}

/* ---------------- layout shell ---------------- */
.view { max-width: var(--maxw); margin: 0 auto; padding: 0 32px 120px; }
.view-fade { animation: viewIn 0.55s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.view-head { padding: 78px 0 46px; max-width: 760px; }
.view-title { font-family: var(--serif); font-weight: 400; letter-spacing: -0.015em;
  font-size: clamp(40px, 6vw, 68px); line-height: 1.02; margin: 18px 0 0; }
.view-sub { color: var(--ink-2); font-size: 18px; margin: 22px 0 0; max-width: 56ch; text-wrap: pretty; }

.section-head { display: flex; align-items: center; justify-content: space-between;
  gap: 20px; margin: 96px 0 34px; }

/* ---------------- HERO: portrait ---------------- */
.hero.portrait { padding: 82px 0 46px; }
.hero-head { display: grid; grid-template-columns: 200px 1fr; gap: 52px; align-items: start; }
.hero-photo-col { display: flex; flex-direction: column; gap: 14px; }
.hero-headtext { align-self: start; }
.hero-body { margin-top: 42px; border-top: 1px solid var(--line-2); padding-top: 34px;
  display: grid; grid-template-columns: 1.02fr 0.98fr; gap: 56px; align-items: start; }
.hero-body .hero-blurb { margin-top: 0; }
.hero-body .now-meta { margin-top: 0; border-top: none; }
.hero-body .now-meta .now-row:first-child { padding-top: 0; }
.hero-photo-wrap { position: relative; }
.hero-photo-wrap image-slot { border: 1px solid var(--line); }
.photo-caption { display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding-top: 4px; }
.photo-caption .mono { letter-spacing: 0.13em; text-transform: uppercase; white-space: nowrap; }
.photo-charge .charge-col { gap: 4px; }
.photo-charge .charge-col.h .seg { width: 13px; height: 5px; }

.hero-right { align-self: center; }
.hero.portrait .hero-name { margin-top: 0; }
.hero-name { font-family: var(--serif); font-weight: 400; margin: 18px 0 0;
  font-size: clamp(54px, 7vw, 96px); line-height: 0.92; letter-spacing: -0.025em; }
.hn-line { display: block; }
.hn-line.italic { color: var(--ink); }
.hero-tagline { font-family: var(--serif); font-style: italic; color: var(--ink-2);
  font-size: clamp(20px, 2.4vw, 26px); margin: 22px 0 0; line-height: 1.3; }
.hero-blurb { color: var(--ink-2); font-size: 17px; line-height: 1.7; margin: 22px 0 0;
  max-width: 54ch; text-wrap: pretty; }
.hero-blurb.center { margin-left: auto; margin-right: auto; text-align: center; }

@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { box-shadow: 0 0 0 6px transparent; } }

/* “now” editorial meta — replaces the boxed status panel */
.now-meta { margin: 34px 0 0; border-top: 1px solid var(--line-2); max-width: 54ch; }
.now-row { display: grid; grid-template-columns: 74px 1fr; gap: 22px; align-items: baseline;
  padding: 16px 0; border-bottom: 1px solid var(--line); }
.now-row:last-child { border-bottom: none; }
.now-label { display: flex; align-items: center; gap: 8px; margin: 0;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); }
.now-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none;
  box-shadow: 0 0 0 0 var(--accent-glow); animation: pulse 2.4s var(--ease) infinite; }
.now-val { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.now-val.serif { font-family: var(--serif); font-size: 20px; line-height: 1.4; color: var(--ink); }

/* HERO: stacked */
.hero.stacked { padding: 70px 0 30px; text-align: center; display: flex;
  flex-direction: column; align-items: center; gap: 14px; }
.hero-stack-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hero-photo-center { margin: 4px 0 10px; }
.hero-photo-center image-slot { border: 1px solid var(--line-2); }
.hero-charge-center { margin-top: 24px; }
.hero-charge-center .charge-col { gap: 5px; }
.hero-charge-center .charge-col.h .seg { width: 16px; height: 6px; }
.hero.stacked .now-meta { text-align: left; margin: 30px auto 0; }

/* HERO: editorial */
.hero.editorial { padding: 70px 0 30px; }
.hero-ed-top { display: grid; grid-template-columns: 1.4fr 0.6fr; gap: 40px; align-items: end; }
.hero-ed-photo { display: flex; align-items: flex-end; gap: 16px; justify-content: flex-end; }
.hero.editorial .hero-name { font-size: clamp(58px, 10vw, 132px); }
.hero-ed-bottom { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px;
  margin-top: 46px; padding-top: 40px; border-top: 1px solid var(--line); align-items: start; }

/* ---------------- home featured ---------------- */
.featured-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.featured-card { cursor: pointer; }
.fc-thumb { overflow: hidden; border: 1px solid var(--line); border-radius: 3px; }
.fc-thumb image-slot { transition: transform 0.6s var(--ease); }
.featured-card:hover .fc-thumb image-slot { transform: scale(1.04); }
.fc-meta { padding: 16px 2px 0; }
.fc-title { font-family: var(--serif); font-weight: 400; font-size: 22px; margin: 8px 0 0; }
.fc-one { color: var(--ink-3); font-size: 14.5px; margin: 7px 0 0; line-height: 1.55; }

/* ---------------- work ---------------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding-bottom: 30px; border-bottom: 1px solid var(--line); margin-bottom: 36px; }
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px 32px; }
.work-card { cursor: pointer; border: 1px solid var(--line); border-radius: 4px;
  overflow: hidden; background: var(--bg-2);
  transition: transform 0.4s var(--ease), border-color 0.4s, box-shadow 0.4s; }
.work-card:hover { transform: translateY(-4px); border-color: var(--line-2);
  box-shadow: 0 24px 50px -28px rgba(0,0,0,0.9); }
.wc-thumb { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.wc-thumb image-slot { transition: transform 0.6s var(--ease); }
.work-card:hover .wc-thumb image-slot { transform: scale(1.05); }
.wc-open { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px;
  display: grid; place-items: center; border-radius: 50%; color: #08090a;
  background: var(--accent); opacity: 0; transform: translateY(-6px) rotate(-20deg);
  transition: opacity 0.3s, transform 0.3s var(--ease); }
.work-card:hover .wc-open { opacity: 1; transform: none; }
.wc-body { padding: 18px 20px 20px; }
.wc-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.wc-title { font-family: var(--serif); font-weight: 400; font-size: 23px; margin: 0; }
.wc-one { color: var(--ink-2); font-size: 14.5px; margin: 9px 0 14px; line-height: 1.55; }

/* detail overlay */
.detail-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(4,5,6,0.72);
  backdrop-filter: blur(6px); display: grid; place-items: center; padding: 32px;
  animation: scrimIn 0.3s var(--ease); }
@keyframes scrimIn { from { opacity: 0; } to { opacity: 1; } }
.detail-panel { width: min(1080px, 100%); max-height: 86vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px;
  display: grid; grid-template-columns: 1.35fr 1fr; animation: panelIn 0.4s var(--ease); }
@keyframes panelIn { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
.detail-close { position: absolute; top: 22px; right: 22px; z-index: 2; width: 38px; height: 38px;
  display: grid; place-items: center; border-radius: 50%; color: var(--ink);
  background: rgba(8,9,10,0.6); border: 1px solid var(--line-2);
  transition: background 0.25s, transform 0.25s; }
.detail-close:hover { background: var(--bg); transform: rotate(90deg); }
.detail-media { border-right: 1px solid var(--line); min-height: 380px; }
.detail-body { padding: 34px 34px 38px; }
.detail-title { font-family: var(--serif); font-weight: 400; font-size: 32px; margin: 10px 0 16px;
  line-height: 1.08; }
.detail-text { color: var(--ink-2); font-size: 15.5px; line-height: 1.7; margin: 20px 0 0; }
.detail-stat { display: flex; align-items: baseline; gap: 9px; margin-top: 26px;
  padding-top: 22px; border-top: 1px solid var(--line); }
.ds-value { font-family: var(--serif); font-size: 40px; color: var(--accent); line-height: 1; }
.ds-unit { color: var(--ink-3); }

/* ---------------- experience timeline ---------------- */
.timeline { position: relative; padding-left: 40px; }
.timeline-spine { position: absolute; left: 6px; top: 6px; bottom: 6px; }
.timeline-spine .charge-col { height: 100%; justify-content: space-between; }
.timeline-spine .seg { width: 6px !important; height: auto !important; flex: 1; }
.exp-item { position: relative; padding: 26px 0 34px; border-bottom: 1px solid var(--line); }
.exp-item:last-child { border-bottom: none; }
.exp-node { position: absolute; left: -36.5px; top: 28px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--bg); border: 1.5px solid var(--accent);
  box-shadow: 0 0 0 4px var(--bg); }
.exp-head { display: flex; align-items: center; gap: 14px; }
.exp-kind { color: var(--accent); letter-spacing: 0.1em; text-transform: uppercase; }
.exp-role { font-family: var(--serif); font-weight: 400; font-size: 27px; margin: 8px 0 4px; }
.exp-org { color: var(--ink-2); font-size: 15px; }
.exp-points { margin: 16px 0 16px; padding: 0; list-style: none; display: grid; gap: 9px; }
.exp-points li { position: relative; padding-left: 20px; color: var(--ink-2); font-size: 15px;
  line-height: 1.6; }
.exp-points li::before { content: ""; position: absolute; left: 2px; top: 10px; width: 8px;
  height: 1px; background: var(--accent); }

/* ---------------- interests ---------------- */
.interest-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.interest-card { background: var(--bg); padding: 38px 34px; position: relative;
  transition: background 0.4s var(--ease); }
.interest-card:hover { background: var(--surface); }
.interest-num { position: absolute; top: 26px; right: 30px; color: var(--ink-4); }
.interest-title { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 0 0 12px; }
.interest-body { color: var(--ink-2); font-size: 15.5px; line-height: 1.7; max-width: 42ch; text-wrap: pretty; }

/* ---------------- footer ---------------- */
.footer { border-top: 1px solid var(--line); margin-top: 40px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 54px 32px 64px;
  display: flex; flex-wrap: wrap; gap: 30px; align-items: flex-end; justify-content: space-between; }
.footer-cta { font-family: var(--serif); font-size: clamp(26px, 4vw, 40px); font-weight: 400;
  line-height: 1.1; letter-spacing: -0.01em; max-width: 16ch; }
.footer-cta a { border-bottom: 1px solid var(--accent); color: var(--accent); transition: opacity 0.25s; }
.footer-cta a:hover { opacity: 0.7; }
.footer-right { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.footer-socials { display: flex; gap: 10px; }
.footer-meta { color: var(--ink-4); font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; }

/* ---------------- responsive ---------------- */
@media (max-width: 940px) {
  .nav-links { display: none; }
  .nav-inner { gap: 16px; }
  .nav-actions { margin-left: auto; }
  .hero-head { grid-template-columns: 1fr; gap: 32px; }
  .hero-body { grid-template-columns: 1fr; gap: 32px; padding-top: 24px; }
  .hero-ed-top, .hero-ed-bottom { grid-template-columns: 1fr; }
  .hero-ed-photo { justify-content: flex-start; }
  .featured-grid { grid-template-columns: 1fr; }
  .work-grid { grid-template-columns: 1fr; }
  .interest-grid { grid-template-columns: 1fr; }
  .detail-panel { grid-template-columns: 1fr; }
  .detail-media { border-right: none; border-bottom: 1px solid var(--line); min-height: 220px; }
}
@media (max-width: 560px) {
  .nav-inner { padding: 0 20px; gap: 10px; }
  .view { padding: 0 20px 90px; }
  .footer-inner { padding: 44px 20px 54px; }
  .brand-name { font-size: 14px; }
  .nav-actions { gap: 6px; }
}

/* bottom mobile tab bar (small screens) */
.mtabs { display: none; }
@media (max-width: 940px) {
  .mtabs { display: flex; position: sticky; bottom: 0; z-index: 40;
    background: color-mix(in oklab, var(--bg) 86%, transparent); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); }
  .mtab { flex: 1; padding: 14px 6px; text-align: center; font-size: 12px; color: var(--ink-3);
    font-family: var(--mono); letter-spacing: 0.05em; }
  .mtab.current { color: var(--ink); box-shadow: inset 0 1px 0 var(--accent); }
}
