/* ─── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

/* ─── TOKENS ────────────────────────────────────────────────── */
:root {
  --bg:        #fafaf9;
  --bg-alt:    #f4f3f1;
  --surface:   #ffffff;
  --border:    #e8e6e1;
  --border-md: #d4d1cb;

  --text:      #1a1917;
  --text-2:    #6b6760;
  --text-3:    #a09d99;

  --accent:    #1a1917;
  --green:     #166534;
  --green-bg:  #f0fdf4;
  --green-bd:  #bbf7d0;

  --ff-serif:  'Instrument Serif', Georgia, serif;
  --ff-sans:   'Geist', system-ui, sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.04);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--ff-sans);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ─── NAV ───────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(250,250,249,0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 40px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
}

.nav-logo-mark {
  display: block;
  width: 20px;
  height: 20px;
  background: var(--text);
  border-radius: 5px;
  position: relative;
  flex-shrink: 0;
}

.nav-logo-mark::after {
  content: '';
  position: absolute;
  inset: 5px;
  background: var(--bg);
  border-radius: 2px;
}

.nav-links {
  display: flex;
  gap: 28px;
  flex: 1;
}

.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.15s;
}

.nav-links a:hover { color: var(--text); }

.nav-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  white-space: nowrap;
}

.status-dot {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34,197,94,0.2);
  animation: pulse-dot 2.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 2px rgba(34,197,94,0.2); }
  50%       { box-shadow: 0 0 0 5px rgba(34,197,94,0.08); }
}

/* ─── HERO ──────────────────────────────────────────────────── */
.hero {
  padding-top: 120px;
  padding-bottom: 0;
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  min-height: 100vh;
}

.hero-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 24px;
}

.hero-title {
  font-family: var(--ff-serif);
  font-size: clamp(40px, 4.5vw, 60px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 24px;
}

.hero-title em {
  font-style: italic;
  color: var(--text-2);
}

.hero-sub {
  font-size: 16px;
  color: var(--text-2);
  line-height: 1.7;
  max-width: 400px;
  margin-bottom: 40px;
  font-weight: 400;
}

.hero-cta {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-primary {
  padding: 11px 24px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--ff-sans);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  letter-spacing: -0.01em;
  transition: opacity 0.15s, transform 0.15s;
  display: inline-block;
}

.btn-primary:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.btn-ghost {
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: color 0.15s, border-color 0.15s;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-2);
}

/* ─── FLOW DIAGRAM ──────────────────────────────────────────── */
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 0 80px;
}

.flow-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
  max-width: 340px;
}

.flow-node {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.flow-node--accent {
  background: var(--text);
  border-color: var(--text);
}

.flow-node--accent .flow-node-label,
.flow-node--accent .flow-node-name {
  color: rgba(255,255,255,0.6);
}

.flow-node--accent .flow-node-name {
  color: #ffffff;
}

.flow-node-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.flow-node-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.flow-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  width: 100%;
}

.flow-line-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.flow-line-track {
  width: 1px;
  height: 28px;
  background: var(--border-md);
  position: relative;
  overflow: hidden;
}

.flow-line-dot {
  width: 3px;
  height: 3px;
  background: var(--text-2);
  border-radius: 50%;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  animation: travel 1.8s ease-in-out infinite;
}

@keyframes travel {
  0%   { top: -4px; opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { top: calc(100% + 4px); opacity: 0; }
}

.flow-line:nth-child(4) .flow-line-dot {
  animation-delay: 0.9s;
}

/* ─── METRICS BAR ───────────────────────────────────────────── */
.metrics-bar {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 0;
}

.metric {
  padding: 28px 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.metric-value {
  font-family: var(--ff-serif);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--text);
}

.metric-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.01em;
}

.metric-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
  margin: 0;
}

/* ─── SECTIONS ──────────────────────────────────────────────── */
.section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 100px 40px;
}

.section--alt {
  background: var(--bg-alt);
  max-width: 100%;
}

.section--alt > * {
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

.section--alt .section-header,
.section--alt .projects-list {
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 40px;
  padding-right: 40px;
}

.section-header {
  margin-bottom: 56px;
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
  display: block;
}

.section-title {
  font-family: var(--ff-serif);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 14px;
}

.section-sub {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.7;
  max-width: 420px;
  font-weight: 400;
}

/* ─── FEATURES ──────────────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.feature {
  background: var(--surface);
  padding: 36px 32px;
  transition: background 0.2s;
}

.feature:hover { background: var(--bg); }

.feature-number {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-3);
  margin-bottom: 20px;
}

.feature-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.015em;
  margin-bottom: 10px;
  line-height: 1.3;
}

.feature-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.65;
  font-weight: 400;
}

/* ─── PROJECTS ──────────────────────────────────────────────── */
.projects-list {
  border: 1px solid var(--border-md);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}

.project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  cursor: pointer;
}

.project-row:last-child { border-bottom: none; }
.project-row:hover { background: var(--bg); }

.project-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.project-meta {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
}

.project-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.badge--green {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-bd);
}

.project-arrow {
  font-size: 16px;
  color: var(--text-3);
  transition: transform 0.15s, color 0.15s;
}

.project-row:hover .project-arrow {
  transform: translateX(3px);
  color: var(--text);
}

/* ─── ARCHITECTURE ──────────────────────────────────────────── */
.arch-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.arch-step {
  background: var(--surface);
  padding: 36px 32px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  transition: background 0.2s;
}

.arch-step:hover { background: var(--bg); }

.arch-step-num {
  display: block;
  font-family: var(--ff-serif);
  font-size: 28px;
  font-weight: 400;
  color: var(--text-3);
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.arch-step-body h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.arch-step-body p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.65;
  font-weight: 400;
}

/* ─── FOOTER ────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.footer-copy {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 400;
}

.footer-host {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
}

/* ─── REVEAL ────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── HERO ENTRANCE ─────────────────────────────────────────── */
.hero-label   { animation: enter 0.5s 0.05s both; }
.hero-title   { animation: enter 0.55s 0.15s both; }
.hero-sub     { animation: enter 0.55s 0.25s both; }
.hero-cta     { animation: enter 0.5s 0.35s both; }
.hero-visual  { animation: enter 0.6s 0.45s both; }

@keyframes enter {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 48px;
    padding-top: 100px;
    min-height: auto;
    padding-bottom: 64px;
  }

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

  .arch-steps {
    grid-template-columns: 1fr;
  }

  .metrics-bar {
    flex-wrap: wrap;
  }

  .metric {
    padding: 20px 32px;
  }

  .metric-divider { display: none; }

  .nav-links { display: none; }

  .section--alt .section-header,
  .section--alt .projects-list {
    padding-left: 24px;
    padding-right: 24px;
  }

  .section { padding: 72px 24px; }
  .nav-inner { padding: 0 24px; }
  .footer-inner { padding: 24px; }
}