/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --navy-deep: #081b30;
  --navy: #0f2c4c;
  --navy-mid: #163b60;
  --line: rgba(232, 228, 216, 0.14);
  --line-strong: rgba(232, 228, 216, 0.28);
  --paper: #f4f1e8;
  --paper-dim: rgba(244, 241, 232, 0.68);
  --amber: #f2a65a;
  --amber-dim: rgba(242, 166, 90, 0.16);
  --teal: #5fa8a0;
  --teal-dim: rgba(95, 168, 160, 0.16);

  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --max-width: 1120px;
  --radius: 4px;
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--navy);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

/* Blueprint grid backdrop */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, black 70%, transparent 100%);
  opacity: 0.5;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(8, 27, 48, 0.82);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  padding-bottom: 20px;
}

.wordmark {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 18px;
  text-decoration: none;
  color: var(--paper);
}
.wordmark-dot { color: var(--amber); }

.main-nav { display: flex; gap: 32px; }
.main-nav a {
  text-decoration: none;
  font-size: 15px;
  color: var(--paper-dim);
  transition: color 0.15s ease;
}
.main-nav a:hover, .main-nav a:focus-visible { color: var(--paper); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
  padding-top: 96px;
  padding-bottom: 96px;
}

.eyebrow, .section-eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 16px;
}

.hero h1 {
  font-size: 40px;
  line-height: 1.22;
  color: var(--paper);
  margin-bottom: 20px;
}

.hero-lede {
  font-size: 17px;
  color: var(--paper-dim);
  max-width: 46ch;
  margin: 0 0 32px;
}

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

.hero-diagram { display: flex; justify-content: center; }
.diagram-svg { width: 100%; max-width: 420px; height: auto; }

/* diagram styling */
.conn {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1.5;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: draw 1.1s ease forwards;
}
.conn-dashed { stroke-dasharray: 4 5; }
.conn-dashed { animation-delay: 0.5s; }
.node rect {
  fill: var(--navy-mid);
  stroke: var(--line-strong);
  stroke-width: 1;
}
.node-core rect { stroke: var(--paper-dim); }
.node-live rect { stroke: var(--teal); fill: var(--teal-dim); }
.node-pending rect { stroke: var(--paper-dim); stroke-dasharray: 3 4; opacity: 0.75; }
.node-label {
  font-family: var(--font-mono);
  font-size: 13px;
  fill: var(--paper);
}
.node-sublabel {
  font-family: var(--font-mono);
  font-size: 9px;
  fill: var(--paper-dim);
}
.pill rect { fill: transparent; stroke: var(--line-strong); stroke-width: 1; }
.pill-live rect { stroke: var(--teal); }
.pill-live text { fill: var(--teal); }
.pill-pending rect { stroke: var(--paper-dim); }
.pill-pending text { fill: var(--paper-dim); }
.pill text {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-anchor: middle;
  transform: translateY(4px);
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--amber);
  color: var(--navy-deep);
}
.btn-primary:hover { background: #f5b578; }

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--paper);
}
.btn-ghost:hover { border-color: var(--paper-dim); }

.btn-disabled {
  background: transparent;
  border: 1px dashed var(--line-strong);
  color: var(--paper-dim);
  cursor: not-allowed;
}
.btn-disabled:hover { transform: none; }

.btn-small { padding: 10px 18px; font-size: 13px; }

/* ==========================================================================
   Section shared
   ========================================================================== */
section { position: relative; z-index: 1; }

.section-title {
  font-size: 28px;
  color: var(--paper);
  max-width: 30ch;
  margin-bottom: 48px;
}

/* ==========================================================================
   Projects
   ========================================================================== */
.projects { padding: 64px 32px 96px; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--navy-mid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.2s ease;
}
.project-card.in-view { opacity: 1; transform: translateY(0); }
.project-card:hover { border-color: var(--line-strong); }

.project-card-pending { opacity: 0.88; }

.project-card-head { display: flex; flex-direction: column; gap: 12px; }
.project-card h3 { font-size: 19px; color: var(--paper); }

.project-card p { color: var(--paper-dim); margin: 0; font-size: 15px; }

.status-tag {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid;
}
.status-live { color: var(--teal); border-color: var(--teal); background: var(--teal-dim); }
.status-pending { color: var(--paper-dim); border-color: var(--line-strong); }

.project-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--paper-dim);
  font-family: var(--font-mono);
}
.project-meta li::before { content: "· "; color: var(--amber); }

.project-card .btn { margin-top: auto; align-self: flex-start; }

/* ==========================================================================
   Approach
   ========================================================================== */
.approach {
  background: var(--navy-deep);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 80px 0;
}

.approach-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.approach-item h3 {
  font-size: 16px;
  color: var(--amber);
  margin-bottom: 10px;
}
.approach-item p {
  color: var(--paper-dim);
  font-size: 15px;
  margin: 0;
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact {
  padding: 96px 32px;
  text-align: center;
}
.contact .section-title { margin: 0 auto 16px; }
.contact-lede {
  color: var(--paper-dim);
  max-width: 42ch;
  margin: 0 auto 32px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
}
.footer-inner {
  display: flex;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--paper-dim);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 64px; padding-bottom: 64px; }
  .hero h1 { font-size: 32px; }
  .project-grid { grid-template-columns: 1fr; }
  .approach-grid { grid-template-columns: 1fr; gap: 40px; }
  .section-title { font-size: 24px; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 20px; }
  .main-nav { gap: 18px; }
  .hero h1 { font-size: 27px; }
}

/* Focus visibility */
a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}
