/* John Osumi — Midnight & Brass + transit route-line motif
   Foundation: Gemini Direction 1, motif from Direction 4. See DESIGN.md. */

:root {
  --bg: #0F172A;
  --surface: #1E293B;
  --surface-2: #243349;
  --text: #F8FAFC;
  --muted: #94A3B8;
  --accent: #D97706;
  --accent-2: #B45309;
  --line: #334155;
  --glow: rgba(217, 119, 6, 0.15);

  --maxw: 800px;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --section-pad: clamp(4rem, 11vw, 7.5rem);

  --font-head: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  font-size: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 500;
  line-height: 1.16;
  letter-spacing: -0.015em;
  margin: 0;
}

p { margin: 0; }

a { color: inherit; text-decoration: none; }

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

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 0.6rem 1rem;
  font-weight: 600;
  z-index: 200;
  border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--surface);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.brand-mark { height: 24px; width: auto; display: block; }
.brand-frame { fill: var(--muted); }
.brand:hover { color: var(--text); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}
.nav-links a {
  font-size: 0.83rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.nav-links a.nav-cta {
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 5px;
  padding: 0.45rem 0.9rem;
}
.nav-links a.nav-cta:hover {
  background: var(--accent);
  color: var(--bg);
}
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 38px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(4.5rem, 13vw, 9rem) var(--gutter) clamp(3.5rem, 9vw, 6rem);
}
.watermark {
  position: absolute;
  top: 50%;
  right: clamp(0.5rem, 3vw, 2.5rem);
  transform: translateY(-50%);
  height: clamp(12rem, 32vw, 20rem);
  width: auto;
  opacity: 0.5;
  z-index: 0;
  user-select: none;
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }
.kicker {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 1.1rem;
}
.hero h1 {
  font-size: clamp(2.3rem, 6vw, 3.4rem);
  letter-spacing: -0.022em;
  margin-bottom: 1.4rem;
}
.hero-sub {
  color: var(--muted);
  font-size: 1.06rem;
  max-width: 38rem;
  margin-bottom: 1.1rem;
}
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.4rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 5px;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  padding: 0.85rem 1.6rem;
}
.btn-primary:hover { background: var(--accent-2); color: var(--text); }
.btn-ghost {
  color: var(--muted);
  padding: 0.85rem 0.2rem;
}
.btn-ghost:hover { color: var(--accent); }

/* ---------- Sections ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--section-pad) var(--gutter);
  border-top: 1px solid var(--surface);
}
.section-head { margin-bottom: 2.6rem; }
.section-kicker {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 0.7rem;
}
.section h2 { font-size: clamp(1.8rem, 4.5vw, 2.2rem); }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}
.about-portrait img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--surface);
  filter: saturate(0.95);
}
.about-body p { color: var(--muted); margin-bottom: 1.1rem; }
.about-body p strong { color: var(--text); font-weight: 600; }
.expertise {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0;
  margin: 1.8rem 0 0;
}
.expertise li {
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 0.42rem 0.85rem;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.expertise li:hover { color: var(--text); border-color: var(--accent); }

/* ---------- Timeline (route-line motif) ---------- */
.timeline {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0 0 0 2.6rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 2px;
  background: var(--line);
}
.tl-item { position: relative; padding-bottom: 3.5rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute;
  left: -2.6rem;
  top: 0.35rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--muted);
  box-sizing: border-box;
  z-index: 2;
}
.tl-dot.ongoing { background: var(--accent); border-color: var(--accent); }
.tl-dot.active {
  background: var(--accent);
  border: none;
  left: -2.6rem;
  box-shadow: 0 0 0 6px var(--glow);
  animation: stop-pulse 4s ease-in-out infinite;
}
.tl-date {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 0.4rem;
}
.tl-org { font-size: 1.45rem; margin-bottom: 0.15rem; }
.tl-role { color: var(--text); font-weight: 500; font-size: 1.02rem; margin-bottom: 0.7rem; }
.tl-blurb { color: var(--muted); font-size: 0.96rem; max-width: 40rem; }

/* ---------- Experience: career map (concurrency overview) ---------- */
.exp-note { color: var(--muted); font-size: 0.95rem; max-width: 60ch; margin-top: 0.9rem; }
.career-map { margin: 2.4rem 0 3.2rem; }
.career-map svg { width: 100%; height: auto; display: block; }
.career-map figcaption, .career-map-mobile figcaption { color: var(--muted); font-size: 0.78rem; margin-top: 0.9rem; letter-spacing: 0.01em; }
.career-map-mobile { display: none; margin: 2rem 0 2.8rem; }
.career-map-mobile svg { width: 100%; height: auto; display: block; max-width: 380px; }
.cm-rail { stroke: #64748B; stroke-width: 2.5; stroke-opacity: 0.7; fill: none; }
.cm-crail { stroke: #475569; stroke-width: 2; fill: none; stroke-dasharray: 0.01 7; stroke-linecap: round; }
.cm-conn { stroke: #475569; stroke-width: 1.75; stroke-opacity: 0.85; fill: none; }
.cm-merge { stroke: var(--accent); stroke-width: 2.5; stroke-opacity: 0.7; fill: none; stroke-dasharray: 0.01 7; stroke-linecap: round; }
.cm-co { fill: var(--text); font-family: var(--font-body); font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; }
.cm-ro { fill: #CBD5E1; font-family: var(--font-body); font-size: 11.5px; }
.cm-dt { fill: var(--accent); font-family: var(--font-body); font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.cm-tag { fill: var(--muted); }
@media (max-width: 720px) {
  .career-map { display: none; }
  .career-map-mobile { display: block; }
}

@keyframes stop-pulse {
  0% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.3); }
  70% { box-shadow: 0 0 0 11px rgba(217, 119, 6, 0); }
  100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0); }
}

/* ---------- Education ---------- */
.edu-item { }
.edu-org { font-size: 1.45rem; margin-bottom: 0.3rem; }
.edu-degree { color: var(--text); font-weight: 500; }
.edu-date { color: var(--accent); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 0.3rem; }
.edu-extra { color: var(--muted); font-size: 0.92rem; margin-top: 0.8rem; }

/* ---------- Contact ---------- */
.contact { text-align: center; border-top: 1px solid var(--surface); }
.contact-inner { max-width: 36rem; margin: 0 auto; }
.contact .section-kicker { text-align: center; }
.contact h2 { font-size: clamp(1.9rem, 5vw, 2.4rem); margin-bottom: 1rem; }
.contact-sub { color: var(--muted); margin-bottom: 2rem; }
.contact-actions { margin-bottom: 1.8rem; }
.contact-links {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 1.8rem;
  padding: 0;
  margin: 0 0 1.6rem;
}
.contact-links a {
  color: var(--muted);
  font-size: 0.92rem;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.contact-links a:hover { color: var(--accent); border-color: var(--accent); }
.pgp { color: #8090A6; font-size: 0.72rem; }
.pgp code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 0.7rem; overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--surface); }
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.2rem var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer-brand { font-family: var(--font-head); font-size: 0.95rem; }
.footer-social { list-style: none; display: flex; flex-wrap: wrap; gap: 1.2rem; padding: 0; margin: 0; }
.footer-social a { color: var(--muted); font-size: 0.82rem; transition: color 0.2s ease; }
.footer-social a:hover { color: var(--accent); }
.footer-copy { color: #7E8CA0; font-size: 0.78rem; }
.footer-copy a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.footer-copy a:hover { color: var(--accent); }

/* ---------- Legal / prose pages ---------- */
.subnav .nav-inner { justify-content: space-between; }
.subnav .back { color: var(--muted); font-size: 0.85rem; transition: color 0.2s ease; }
.subnav .back:hover { color: var(--accent); }
.legal { max-width: 760px; margin: 0 auto; padding: clamp(3rem, 8vw, 4.5rem) var(--gutter) var(--section-pad); }
.legal h1 { font-size: clamp(2rem, 5vw, 2.6rem); margin-bottom: 0.5rem; }
.legal .updated { color: var(--muted); font-size: 0.85rem; margin-bottom: 2.6rem; }
.legal h2 { font-size: 1.5rem; margin: 2.8rem 0 0.9rem; padding-top: 1.8rem; border-top: 1px solid var(--surface); }
.legal h3 { font-size: 1.2rem; margin: 1.9rem 0 0.6rem; }
.legal h4 { font-family: var(--font-body); font-weight: 600; font-size: 1rem; color: var(--text); margin: 1.5rem 0 0.5rem; }
.legal p { color: #E2E8F0; margin: 0 0 1rem; max-width: 68ch; }
.legal ul { color: #E2E8F0; padding-left: 1.25rem; margin: 0 0 1.2rem; max-width: 68ch; }
.legal li { margin-bottom: 0.55rem; }
.legal strong { color: var(--text); font-weight: 600; }
.legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.legal a:hover { color: var(--accent-2); }
.contact-fineprint { margin-top: 1.7rem; font-size: 0.8rem; }
.contact-fineprint a { color: var(--muted); border-bottom: 1px solid transparent; transition: color 0.2s ease, border-color 0.2s ease; }
.contact-fineprint a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Scroll reveal (progressive enhancement) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    padding: 0.6rem var(--gutter) 1.2rem;
    background: rgba(15, 23, 42, 0.97);
    border-bottom: 1px solid var(--surface);
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.3s ease, visibility 0.3s ease;
  }
  .nav-links.open { max-height: 80vh; overflow-y: auto; visibility: visible; }
  .nav-links a { padding: 0.7rem 0; font-size: 0.95rem; width: 100%; }
  .nav-links a.nav-cta { margin-top: 0.4rem; padding: 0.6rem 1rem; width: auto; }
  .about-grid { grid-template-columns: 1fr; }
  .about-portrait { max-width: 220px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .tl-dot.active { animation: none; }
  * { transition-duration: 0.001ms !important; }
}

/* ---------- Print (CV-friendly: dark theme would otherwise print invisible) ---------- */
@media print {
  :root {
    --bg: #ffffff; --surface: #ffffff; --surface-2: #ffffff;
    --text: #111111; --muted: #333333; --accent: #7a4a00;
    --line: #999999; --glow: transparent;
  }
  body { background: #fff; color: #111; }
  .nav, .nav-toggle, .skip-link, .hero-actions, .contact-actions, .watermark { display: none; }
  a { color: #111; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .section, .hero { border-top-color: #ccc; break-inside: avoid-page; padding-top: 1.5rem; padding-bottom: 1.5rem; }
  .tl-dot { border-color: #7a4a00; }
  .tl-dot.active { animation: none; box-shadow: none; background: #7a4a00; }
  .expertise li { border-color: #ccc; color: #333; background: #fff; }
  .legal p, .legal ul, .legal li { color: #1a1a1a; }
  .legal h2 { border-top-color: #ccc; }
}
