@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #ffffff;
  --surface: #f4f4f4;
  --surface-2: #e0e0e0;
  --fg: #161616;
  --muted: #525252;
  --muted-2: #8c8c8c;
  --border: #e0e0e0;
  --border-strong: #161616;
  --accent: #0f62fe;
  --accent-hover: #0050e6;
  --accent-2: #0f62fe;
  --danger: #da1e28;
  --warn: #f1c21b;
  --ok: #24a148;

  --font-display: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, Menlo, monospace;

  --radius: 2px;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 72px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--fg);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.5;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  position: relative;
  perspective: 1200px;
}

a { color: inherit; text-decoration: none; }
.container { position: relative; z-index: 2; }
.container { width: min(1240px, calc(100% - 48px)); margin: 0 auto; }

body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
}
body::before {
  z-index: 0;
  background:
    repeating-linear-gradient(to right, rgba(15, 98, 254, 0.06) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(to bottom, rgba(15, 98, 254, 0.05) 0 1px, transparent 1px 64px),
    radial-gradient(circle at 12% 18%, rgba(15, 98, 254, 0.12), transparent 38%),
    radial-gradient(circle at 88% 76%, rgba(0, 110, 255, 0.08), transparent 42%);
  transform: translateZ(-220px) scale(1.2);
  animation: gridDrift 14s linear infinite;
}
body::after {
  z-index: 1;
  background:
    linear-gradient(120deg, transparent 0 35%, rgba(15, 98, 254, 0.09) 50%, transparent 65%) 0 0 / 420px 420px,
    linear-gradient(300deg, transparent 0 40%, rgba(36, 161, 72, 0.08) 54%, transparent 70%) 0 0 / 480px 480px;
  mix-blend-mode: multiply;
  animation: dataSweep 11s linear infinite;
}

@keyframes gridDrift {
  0% { transform: translate3d(0, 0, -220px) scale(1.2); }
  50% { transform: translate3d(-22px, -18px, -220px) scale(1.22); }
  100% { transform: translate3d(-44px, -36px, -220px) scale(1.2); }
}
@keyframes dataSweep {
  from { background-position: 0 0, 0 0; }
  to { background-position: 520px 240px, -460px 260px; }
}
.page-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
}
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  font-weight: 400;
}
.nav-links { display: flex; gap: 18px; color: var(--muted); font-size: 14px; }
.nav-links a:hover { color: var(--accent); }

.hero {
  padding: var(--space-7) 0 var(--space-6);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: var(--space-5);
  align-items: start;
}
.kicker {
  font-family: var(--font-mono);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}
h1 {
  margin: var(--space-3) 0;
  font-size: clamp(42px, 6vw, 72px);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.subline { font-size: clamp(18px, 2.4vw, 24px); color: var(--fg); max-width: 720px; }
.copy { color: var(--muted); max-width: 720px; font-size: 17px; }

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: var(--space-4) 0;
}
.badge {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--fg);
}

.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  padding: 12px 18px;
  font-weight: 600;
  border-radius: var(--radius);
  transition: transform .25s ease, border-color .25s ease, background .25s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.btn.primary { background: var(--accent); color: #ffffff; border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.secondary { background: var(--bg); color: var(--accent); border-color: var(--accent); }

.panel {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  transform-style: preserve-3d;
}
.hero-visual { padding: 14px; }
.hero-photo {
  margin: 0;
  padding: 12px;
  overflow: hidden;
  position: relative;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  min-height: 460px;
  max-height: 620px;
  object-fit: cover;
  object-position: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: block;
}
.visual-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
}
.module {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius);
  padding: 10px;
  min-height: 128px;
}
.module h4 {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.node-line { height: 2px; background: var(--border); margin: 11px 0; position: relative; }
.node-line::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); position: absolute; top: -3px; right: 10%; box-shadow: 0 0 0 4px rgba(15, 98, 254, 0.12); }
.alarm { display: flex; justify-content: space-between; font-size: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.tag { font-family: var(--font-mono); font-size: 11px; padding: 3px 7px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); background: var(--surface); }
.status-dot { width: 9px; height: 9px; border-radius: 999px; display: inline-block; margin-right: 6px; }

.section { padding: var(--space-6) 0; }
.section h2 {
  margin: 0 0 16px;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -0.02em;
}
.section-lead { color: var(--muted); max-width: 850px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.card {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius);
  padding: 18px;
  transform-style: preserve-3d;
  transition: transform .3s ease, border-color .25s ease, background .25s ease, box-shadow .3s ease;
  box-shadow: 0 10px 34px rgba(6, 18, 38, 0.08);
}
.card:hover {
  transform: translateY(-4px) translateZ(18px);
  border-color: var(--border-strong);
  background: var(--surface);
  box-shadow: 0 26px 56px rgba(6, 18, 38, 0.18);
}
.card h3 { margin-top: 0; margin-bottom: 10px; font-size: 20px; }
.card p { margin: 0; color: var(--muted); }

.proof .card { padding: 14px; min-height: 116px; }
.proof strong { font-size: 28px; display: block; letter-spacing: -0.02em; margin-bottom: 6px; }

.project-card { padding: 0; overflow: hidden; }
.project-head { padding: 18px; border-bottom: 1px solid var(--border); }
.project-body { padding: 18px; }
.project-visual {
  height: 220px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: radial-gradient(circle at 70% 20%, rgba(15, 98, 254, 0.16), transparent 40%), var(--surface);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
}
.flow {
  position: absolute;
  inset: 14px;
  border: 1px solid var(--border);
  background:
    repeating-linear-gradient(to right, rgba(15, 98, 254, 0.12) 0 1px, transparent 1px 36px),
    repeating-linear-gradient(to bottom, rgba(15, 98, 254, 0.10) 0 1px, transparent 1px 36px);
}
.flow::before, .flow::after {
  content: '';
  position: absolute;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
  width: 70%;
  left: 10%;
  animation: pulseline 5s linear infinite;
}
.flow > .node {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(15, 98, 254, 0.13), 0 0 18px rgba(15, 98, 254, 0.45);
  animation: nodePulse 2.8s ease-in-out infinite;
}
.flow > .node.n1 { left: 12%; top: 26%; animation-delay: .1s; }
.flow > .node.n2 { left: 62%; top: 36%; animation-delay: .9s; }
.flow > .node.n3 { left: 38%; top: 70%; animation-delay: 1.5s; }
.flow > .node.n4 { left: 79%; top: 58%; animation-delay: 2s; }

@keyframes nodePulse {
  0%, 100% { transform: scale(1); opacity: .9; }
  50% { transform: scale(1.45); opacity: .55; }
}
.flow::before { top: 30%; }
.flow::after { top: 64%; animation-delay: 1.7s; }
@keyframes pulseline {
  0% { transform: translateX(-10%); opacity: 0.1; }
  50% { opacity: 0.8; }
  100% { transform: translateX(20%); opacity: 0.1; }
}

.timeline {
  position: relative;
  margin-top: 24px;
  padding-left: 24px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}
.event {
  position: relative;
  margin-bottom: 16px;
}
.event::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(15, 98, 254, 0.16);
}
.event .card { margin-left: 8px; }
.meta { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.list { margin: 0; padding-left: 18px; color: var(--fg); }
.list li { margin-bottom: 6px; }

.stack-group { margin-bottom: 16px; }
.stack-group h4 { margin: 0 0 10px; font-size: 16px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  border: 1px solid var(--border);
  padding: 7px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--fg);
  background: var(--surface);
}

.footer {
  border-top: 1px solid var(--border);
  margin-top: var(--space-6);
  padding: 24px 0;
  color: var(--muted);
  font-size: 13px;
}

.launcher-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.screen-link { display: block; }
.small { font-size: 13px; color: var(--muted); }
.tiny { font-size: 12px; color: var(--muted-2); }

.project-detail-hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
  align-items: stretch;
}
.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.gallery-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}
.gallery-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border);
}
.gallery-card figcaption {
  padding: 10px 12px;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.spec-list {
  margin: 0;
  padding-left: 16px;
}
.spec-list li {
  margin-bottom: 8px;
}

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .45s ease, transform .45s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 1180px) {
  .hero { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .project-detail-hero { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .container { width: min(1180px, calc(100% - 36px)); }
  .hero { gap: 24px; }
  .project-visual { height: 200px; }
}

@media (max-width: 834px) {
  .section h2 { font-size: clamp(28px, 7vw, 38px); }
  .proof strong { font-size: 24px; }
}

@media (max-width: 744px) {
  .hero-photo img { min-height: 320px; max-height: 460px; }
  .visual-grid { grid-template-columns: 1fr; }
  .module { min-height: 112px; }
}

@media (max-width: 840px) {
  .container { width: min(1240px, calc(100% - 28px)); }
  .nav-links { display: none; }
  .grid-3, .launcher-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .gallery-grid, .detail-grid { grid-template-columns: 1fr; }
  .section { padding: 42px 0; }
  .hero { padding-top: 44px; }
}

@media (max-width: 430px) {
  .btn { width: 100%; }
  .actions { width: 100%; }
  .badge { width: 100%; }
  .card, .project-head, .project-body { padding: 14px; }
}

@media (prefers-reduced-motion: reduce), (max-width: 768px) {
  body::before,
  body::after,
  .flow::before,
  .flow::after,
  .flow > .node {
    animation: none !important;
  }
  .card:hover {
    transform: translateY(-2px);
  }
}
