/* ==========================================================================
   Inflection Point — design system
   Single source of truth for tokens, components, and responsive behavior.
   ========================================================================== */

/* ---------- tokens ---------- */
:root, [data-theme="dark"] {
  --bg-base:        #1e2635;
  --bg-deep:        #162840;
  --bg-deepest:     #12202e;
  --bg-elevated:    #232c3d;
  --surface-strong: rgba(80, 144, 200, 0.08);
  --surface-border: rgba(80, 144, 200, 0.20);
  --rule:           #2a3848;

  --accent:         #5090c8;
  --accent-bright:  #6aabdc;
  --accent-soft:    #8ab8d4;

  --text-primary:   #eef4ff;
  --text-body:      #d0e0ec;
  --text-secondary: #8aaec4;
  --text-muted:     #4a6878;

  --nav-bg:          rgba(30, 38, 53, 0.72);
  --nav-bg-scrolled: rgba(18, 32, 46, 0.86);
}
[data-theme="light"] {
  --bg-base:        #f4f7fb;
  --bg-deep:        #e9eff6;
  --bg-deepest:     #dde6f0;
  --bg-elevated:    #ffffff;
  --surface-strong: rgba(80, 144, 200, 0.08);
  --surface-border: rgba(80, 144, 200, 0.28);
  --rule:           #cdd8e4;

  --accent:         #2e6fa8;
  --accent-bright:  #1d5a93;
  --accent-soft:    #4a86bd;

  --text-primary:   #0e1a2c;
  --text-body:      #1f2d40;
  --text-secondary: #41566c;
  --text-muted:     #6e8194;

  --nav-bg:          rgba(244, 247, 251, 0.78);
  --nav-bg-scrolled: rgba(233, 239, 246, 0.92);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 400;
  color: var(--text-body);
  background: var(--bg-base);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}
::selection { background: var(--accent); color: var(--bg-deepest); }

a { color: var(--accent); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--accent-bright); }

h1, h2, h3, h4 { color: var(--text-primary); font-weight: 600; line-height: 1.2; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
em { font-style: italic; font-weight: 300; color: var(--accent-bright); }

.accent { color: var(--accent); }
.mono   { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 32px; }

/* ---------- nav ---------- */
nav.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}
nav.nav.scrolled {
  background: var(--nav-bg-scrolled);
  border-bottom-color: var(--rule);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px;
  max-width: 1240px; margin: 0 auto;
}
.brand        { display: flex; align-items: center; gap: 12px; color: var(--text-primary); }
.brand:hover  { color: var(--text-primary); }
.brand-mark   { display: block; flex-shrink: 0; }
.brand-text   { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name   { font-weight: 600; font-size: 15px; letter-spacing: 0.01em; color: var(--text-primary); }
.brand-sub    { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-muted); margin-top: 2px; }

.nav-right    { display: flex; align-items: center; gap: 28px; }
.nav-links    { display: flex; gap: 24px; }
.nav-links a  { font-size: 13px; font-weight: 500; color: var(--text-secondary); letter-spacing: 0.01em; }
.nav-links a:hover { color: var(--accent); }

.theme-toggle {
  background: transparent; border: 1px solid var(--surface-border);
  width: 34px; height: 34px; border-radius: 8px;
  color: var(--text-secondary); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); background: var(--surface-strong); }
.theme-toggle svg   { width: 16px; height: 16px; }
[data-theme="dark"]  .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"]  .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 180px 0 120px;
  background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-base) 80%);
}
.hero-inner { position: relative; z-index: 2; max-width: 880px; }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-secondary);
  margin-bottom: 28px;
  opacity: 0; transform: translateY(8px);
  animation: fadeUp 0.7s 0.05s ease forwards;
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80; box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55);
  animation: pulse 2.4s ease-in-out infinite;
}

.hero-title {
  font-size: clamp(44px, 7vw, 84px);
  font-weight: 700; line-height: 1.04; letter-spacing: -0.025em;
  color: var(--text-primary);
  margin: 0 0 32px;
  opacity: 0; transform: translateY(14px);
  animation: fadeUp 0.8s 0.18s ease forwards;
}
.hero-title .ships  { font-style: italic; font-weight: 300; color: var(--accent-bright); }
.hero-title .period { color: var(--accent); }

.hero-lede {
  font-size: clamp(18px, 1.4vw, 22px);
  line-height: 1.55; max-width: 720px; color: var(--text-body);
  margin-bottom: 40px;
  opacity: 0; transform: translateY(14px);
  animation: fadeUp 0.8s 0.32s ease forwards;
}
.hero-lede strong { font-weight: 600; color: var(--text-primary); }

.hero-meta {
  display: flex; flex-wrap: wrap; gap: 36px;
  padding-top: 24px; border-top: 1px solid var(--rule);
  opacity: 0; transform: translateY(14px);
  animation: fadeUp 0.8s 0.46s ease forwards;
}
.hero-meta-item  { display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.hero-meta-label {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted);
}
.hero-meta-value {
  font-size: 14px; font-weight: 500; color: var(--text-body);
  display: inline-flex; align-items: center; gap: 8px;
}

.inflection-bg {
  position: absolute; top: 50%; right: -160px; transform: translateY(-50%);
  width: 720px; height: 720px;
  pointer-events: none; opacity: 0.10; z-index: 1;
}
.inflection-bg svg { width: 100%; height: 100%; }

/* ---------- section primitives ---------- */
section.block { padding: 110px 0; border-top: 1px solid var(--rule); }
.section-eyebrow {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 500;
  letter-spacing: 0.20em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 16px;
}
.section-title {
  font-size: clamp(32px, 4vw, 48px); font-weight: 700; letter-spacing: -0.02em;
  color: var(--text-primary); margin: 0 0 56px; max-width: 780px;
}
.section-title em { font-style: italic; font-weight: 300; color: var(--accent-bright); }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- approach ---------- */
.approach-grid {
  display: grid; grid-template-columns: 320px 1fr; gap: 80px;
  align-items: start;
}
.approach-callout {
  position: sticky; top: 110px;
  padding: 32px;
  background: var(--surface-strong);
  border: 1px solid var(--surface-border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}
.approach-callout-label {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 500;
  letter-spacing: 0.20em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 18px;
}
.approach-callout-quote {
  font-size: 17px; font-weight: 400; line-height: 1.55;
  color: var(--text-primary); font-style: italic;
}
.approach-body p {
  font-size: 17px; line-height: 1.75; color: var(--text-body);
  margin: 0 0 1.4em;
}
.approach-body p:last-child { margin-bottom: 0; }
.approach-body em { font-style: italic; font-weight: 300; color: var(--accent-bright); }

/* ---------- work cards ---------- */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.work-card {
  position: relative;
  padding: 36px 32px 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
  border-radius: 8px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.work-card:hover { transform: translateY(-3px); border-color: var(--surface-border); box-shadow: 0 18px 40px -24px rgba(0,0,0,0.45); }
.work-card-status {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 18px;
}
.work-card-status .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  animation: pulse 2.6s ease-in-out infinite;
}
.work-card h3 { font-size: 22px; margin: 0 0 14px; color: var(--text-primary); }
.work-card p  { font-size: 15px; line-height: 1.65; color: var(--text-body); margin: 0 0 22px; }
.work-card-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding-top: 18px; border-top: 1px solid var(--rule);
}
.work-card-tag {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 500;
  letter-spacing: 0.10em; color: var(--text-muted);
  padding: 4px 10px; border: 1px solid var(--rule); border-radius: 999px;
}

/* ---------- track list / history ---------- */
.track-list { display: flex; flex-direction: column; gap: 0; }
.track-row {
  display: grid; grid-template-columns: 160px 1fr 1.4fr; gap: 32px;
  padding: 28px 0; border-top: 1px solid var(--rule);
  align-items: baseline;
}
.track-row:last-child { border-bottom: 1px solid var(--rule); }
.track-row:hover .track-role { color: var(--accent); }
.track-period {
  font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 500;
  letter-spacing: 0.10em; color: var(--text-muted);
}
.track-role {
  font-size: 18px; font-weight: 600; color: var(--text-primary);
  transition: color 0.2s ease;
}
.track-role-sub {
  display: block; font-family: 'JetBrains Mono', monospace; font-size: 11px;
  font-weight: 400; letter-spacing: 0.05em; color: var(--text-muted);
  margin-top: 4px; text-transform: none;
}
.track-detail { font-size: 15px; line-height: 1.65; color: var(--text-secondary); }

/* ---------- thesis frame ---------- */
.thesis-frame {
  padding: 56px 56px 48px;
  background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-deep) 100%);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  position: relative;
}
.thesis-question {
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 300; font-style: italic; line-height: 1.4;
  color: var(--text-primary);
  margin: 0 0 48px;
  max-width: 900px;
}
.thesis-question .key { font-style: normal; font-weight: 600; color: var(--accent); }
.thesis-meta {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
  padding-top: 32px; border-top: 1px solid var(--rule);
}
.thesis-meta-item  { display: flex; flex-direction: column; gap: 6px; }
.thesis-meta-label {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-muted);
}
.thesis-meta-value { font-size: 15px; font-weight: 500; color: var(--text-body); }

/* ---------- contact ---------- */
.contact-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
  max-width: 720px;
}
.contact-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 26px;
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
  border-radius: 8px;
  color: var(--text-primary);
  font-weight: 500; font-size: 15px;
  transition: border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}
.contact-link:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.contact-link .arrow {
  font-family: 'JetBrains Mono', monospace; color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}
.contact-link:hover .arrow { color: var(--accent); transform: translate(3px, -3px); }

/* ---------- footer ---------- */
footer.footer {
  padding: 48px 0 56px;
  border-top: 1px solid var(--rule);
  color: var(--text-muted);
}
.footer-inner {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  align-items: center; gap: 24px;
}
.footer-left {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted);
}
.footer-mid   { text-align: center; font-size: 12px; color: var(--text-muted); }
.footer-right {
  display: flex; justify-content: flex-end; align-items: center;
  color: var(--text-muted);
}

/* ---------- animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
  50%      { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
}

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .container   { padding: 0 22px; }
  .nav-inner   { padding: 12px 22px; }
  .nav-links   { gap: 16px; }
  .nav-links a { font-size: 12px; }
  .brand-sub   { display: none; }

  .hero          { padding: 140px 0 80px; }
  .hero-meta     { gap: 22px; }
  .inflection-bg { display: none; }

  section.block   { padding: 80px 0; }
  .section-title  { margin-bottom: 40px; }

  .approach-grid    { grid-template-columns: 1fr; gap: 32px; }
  .approach-callout { position: static; }

  .work-grid { grid-template-columns: 1fr; }

  .track-row { grid-template-columns: 1fr; gap: 8px; padding: 22px 0; }

  .thesis-frame { padding: 36px 28px 32px; }
  .thesis-meta  { grid-template-columns: 1fr; gap: 20px; }

  .contact-grid { grid-template-columns: 1fr; }

  .footer-inner { grid-template-columns: 1fr; text-align: center; gap: 18px; }
  .footer-right { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
