/* ==========================================================
   TOKENS
========================================================== */
:root {
  --bg: #10141a;
  --bg-raised: #171d26;
  --bg-panel: #1c2430;
  --line: #2a3441;
  --line-soft: #232b36;

  --text: #eef1f5;
  --text-muted: #8d97a8;
  --text-faint: #5c6675;

  --presentation: #e8a33d;
  --presentation-soft: rgba(232, 163, 61, 0.12);
  --domain: #5ec8c0;
  --domain-soft: rgba(94, 200, 192, 0.12);
  --data: #9b8cf2;
  --data-soft: rgba(155, 140, 242, 0.12);

  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --font-sans: "Inter", system-ui, sans-serif;

  --radius: 10px;
  --container: 1160px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

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

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

.dim { color: var(--text-faint); }

/* subtle film grain / vignette so the flat dark bg doesn't feel empty */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 900px 500px at 15% -5%, rgba(232,163,61,0.06), transparent 60%),
    radial-gradient(ellipse 800px 500px at 100% 20%, rgba(94,200,192,0.05), transparent 60%),
    radial-gradient(ellipse 700px 600px at 50% 100%, rgba(155,140,242,0.05), transparent 60%);
}

/* ==========================================================
   NAV
========================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(16, 20, 26, 0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
}
.nav-mark {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--text);
  background: linear-gradient(135deg, var(--presentation-soft), var(--domain-soft) 50%, var(--data-soft));
  border: 1px solid var(--line);
}

.nav-links {
  display: flex;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.nav-links a:hover { color: var(--text); }

.nav-cta {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.nav-cta:hover { border-color: var(--presentation); background: var(--presentation-soft); }

@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* ==========================================================
   LAYOUT HELPERS
========================================================== */
main > section {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  margin: 0 auto;
  padding: 120px 24px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  margin: 0 0 14px;
}

.section-sub {
  color: var(--text-muted);
  max-width: 60ch;
  margin: 14px 0 0;
  font-size: 1.02rem;
}

/* ==========================================================
   REVEAL ANIMATION
========================================================== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ==========================================================
   HERO
========================================================== */
.hero { padding-top: 96px; padding-bottom: 80px; }
.hero-inner { max-width: 780px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-faint);
  margin: 0 0 18px;
}

.code-block {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  overflow-x: auto;
  color: var(--text-muted);
  margin: 0 0 40px;
}
.c-kw { color: var(--data); }
.c-str { color: var(--presentation); }
.c-fn { color: var(--domain); }
.c-comment { color: var(--text-faint); }

.hero-title {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.12;
  margin: 0 0 22px;
}
.hl-presentation { color: var(--presentation); }
.hl-domain { color: var(--domain); }
.hl-data { color: var(--data); }

.hero-sub {
  font-size: 1.12rem;
  color: var(--text-muted);
  max-width: 62ch;
  margin: 0 0 36px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 32px; }

.btn {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 13px 22px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  display: inline-block;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--presentation); color: #1a1206; font-weight: 600; }
.btn-primary:hover { background: #f0b158; }
.btn-ghost { border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--domain); color: var(--domain); }

.hero-meta {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-faint);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.hero-meta a { color: var(--text-muted); }
.hero-meta a:hover { color: var(--domain); }
.hero-meta .dot { color: var(--line); }

/* ==========================================================
   LAYERS (signature)
========================================================== */
.layers { padding-top: 40px; }
.layers-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 14px; }

.layer-stack {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  perspective: 1000px;
}

.layer-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 26px;
  transition: transform 0.25s ease, border-color 0.25s ease;
  will-change: transform;
}

.layer-presentation { border-top: 3px solid var(--presentation); }
.layer-domain { border-top: 3px solid var(--domain); }
.layer-data { border-top: 3px solid var(--data); }

.layer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.layer-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}

.layer-glyph { font-size: 1.1rem; }
.layer-presentation .layer-glyph { color: var(--presentation); }
.layer-domain .layer-glyph { color: var(--domain); }
.layer-data .layer-glyph { color: var(--data); }

.layer-card h3 { font-size: 1.15rem; margin-bottom: 10px; }
.layer-card p { color: var(--text-muted); font-size: 0.95rem; margin: 0 0 18px; }

.layer-tech { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.layer-tech li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 4px 10px;
}

@media (max-width: 860px) {
  .layer-stack { grid-template-columns: 1fr; }
}

/* ==========================================================
   LOG / TIMELINE
========================================================== */
.log h2, .stack h2, .modules h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 48px; }

.timeline {
  border-left: 1px solid var(--line);
  padding-left: 40px;
  display: flex;
  flex-direction: column;
  gap: 52px;
}

.release { position: relative; }
.release::before {
  content: "";
  position: absolute;
  left: -45px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--presentation);
  box-shadow: 0 0 0 4px var(--bg);
}
.release:nth-child(2)::before { background: var(--domain); }
.release:nth-child(3)::before { background: var(--data); }

.release-meta { display: flex; align-items: baseline; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.tag-version {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--bg);
  background: var(--text);
  padding: 3px 9px;
  border-radius: 5px;
  font-weight: 700;
}
.release-date { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-faint); }

.release-body h3 { font-size: 1.2rem; margin-bottom: 4px; font-weight: 600; }
.release-loc { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-faint); margin: 0 0 16px; }
.release-body ul { margin: 0; padding-left: 20px; color: var(--text-muted); }
.release-body li { margin-bottom: 8px; }
.release-body li:last-child { margin-bottom: 0; }
.release-body strong { color: var(--text); }

/* ==========================================================
   STACK / DEPENDENCIES
========================================================== */
.deps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.deps-block h3 {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 12px;
  text-transform: lowercase;
}
.deps-block .code-block { margin: 0; }

@media (max-width: 720px) {
  .deps-grid { grid-template-columns: 1fr; }
}

/* ==========================================================
   MODULES / PROJECTS
========================================================== */
.module-group-title {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
  margin: 56px 0 22px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}
.modules .module-group-title:first-of-type { border-top: none; padding-top: 0; }

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.module-card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.module-card:hover { transform: translateY(-3px); }
.module-card[data-layer="presentation"]:hover { border-color: var(--presentation); }
.module-card[data-layer="domain"]:hover { border-color: var(--domain); }
.module-card[data-layer="data"]:hover { border-color: var(--data); }

.module-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }

.module-glyph-wrap {
  width: 38px;
  height: 38px;
  min-width: 38px;
  display: block;
}

.module-glyph {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  width: 38px;
  height: 38px;
  min-width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  overflow: hidden;
}
.module-glyph[hidden] {
  display: none;
}
.module-card[data-layer="presentation"] .module-glyph--fallback { color: var(--presentation); border-color: var(--presentation); }
.module-card[data-layer="domain"] .module-glyph--fallback { color: var(--domain); border-color: var(--domain); }
.module-card[data-layer="data"] .module-glyph--fallback { color: var(--data); border-color: var(--data); }

.module-glyph--icon {
  padding: 0;
  background: var(--bg-panel);
}
.module-glyph--icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.module-headtext h4 { font-size: 1.02rem; margin-bottom: 3px; }
.module-pkg { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-faint); }

.module-desc { color: var(--text-muted); font-size: 0.92rem; margin: 0 0 16px; flex-grow: 1; }

.module-stack { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg-panel);
  border: 1px solid var(--line-soft);
  padding: 3px 9px;
  border-radius: 999px;
}

.module-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.module-role { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-faint); }
.module-link { font-family: var(--font-mono); font-size: 0.8rem; color: var(--domain); }
.module-link:hover { text-decoration: underline; }
.module-link--disabled { color: var(--text-faint); }

/* ==========================================================
   CONTACT / TERMINAL
========================================================== */
.contact { padding-bottom: 140px; }

.terminal {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-raised);
  max-width: 640px;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--line);
}
.dotr { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dotr.red { background: #e5645a; }
.dotr.yellow { background: #e8b93d; }
.dotr.green { background: #5ec87a; }
.terminal-title { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-faint); margin-left: 8px; }

.terminal-body { padding: 22px 24px; font-family: var(--font-mono); font-size: 0.9rem; }
.terminal-body p { margin: 0 0 10px; color: var(--text-muted); }
.terminal-body .prompt { color: var(--domain); margin-right: 8px; }
.terminal-body .out { color: var(--text); padding-left: 22px; }
.terminal-body a:hover { color: var(--presentation); }
.cursor { display: inline-block; animation: blink 1.1s step-end infinite; color: var(--presentation); }
@keyframes blink { 50% { opacity: 0; } }

/* ==========================================================
   FOOTER
========================================================== */
.footer {
  text-align: center;
  padding: 32px 24px 48px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}
.footer code { color: var(--text-muted); }

/* ==========================================================
   FOCUS STATES
========================================================== */
a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--domain);
  outline-offset: 3px;
}
