/* ================= Coentia — dark / technical theme ================= */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

:root {
  --bg:        #070b10;
  --bg-soft:   #0b111a;
  --surface:   #0e1520;
  --surface-2: #131c29;
  --border:    #1b2534;
  --border-hi: #29394e;
  --text:      #e7eef5;
  --muted:     #93a3b6;
  --dim:       #5f7086;
  --accent:    #4ade80;
  --accent-soft: rgba(74, 222, 128, 0.12);
  --amber:     #f0c27b;
  --rust:      #e0673a;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --maxw: 1100px;
}

html { scroll-behavior: smooth; }

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

/* faint engineering grid behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(147, 163, 182, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(147, 163, 182, 0.05) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: radial-gradient(1200px 640px at 50% 0%, #000 0%, transparent 78%);
  mask-image: radial-gradient(1200px 640px at 50% 0%, #000 0%, transparent 78%);
  pointer-events: none;
}

::selection { background: var(--accent); color: #04120a; }

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2.4rem); }

/* ---------------- nav ---------------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 11, 16, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; height: 58px; }
.brand { font-family: var(--mono); font-weight: 700; font-size: 1.02rem; color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.brand::after { content: "_"; color: var(--accent); animation: blink 1.1s steps(1) infinite; }
.nav-links { display: flex; align-items: center; gap: 1.4rem; font-family: var(--mono); font-size: 0.8rem; }
.nav-links a { color: var(--muted); text-decoration: none; transition: color 0.15s; }
.nav-links a:hover { color: var(--accent); }
.nav-links .nav-cta { color: var(--accent); border: 1px solid var(--border-hi); padding: 0.3rem 0.7rem; border-radius: 6px; }
.nav-links .nav-cta:hover { background: var(--accent-soft); border-color: var(--accent); }
.status { display: flex; align-items: center; gap: 0.5rem; font-family: var(--mono); font-size: 0.72rem; color: var(--dim); white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; animation: ping 2.4s ease-out infinite; }

@keyframes blink { 50% { opacity: 0; } }
@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.45); }
  70%  { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* ---------------- hero ---------------- */
.hero { padding-block: clamp(3.5rem, 9vh, 6rem) clamp(2.5rem, 6vh, 4rem); }
.hero-grid { display: grid; gap: 3rem; align-items: center; }
@media (min-width: 980px) { .hero-grid { grid-template-columns: 1.05fr 0.95fr; } }

.kicker { font-family: var(--mono); font-size: 0.8rem; color: var(--accent); margin-bottom: 1.1rem; }
h1 { font-size: clamp(2.3rem, 5.2vw, 3.6rem); line-height: 1.06; letter-spacing: -0.03em; font-weight: 700; }
h1 .hl { color: var(--accent); }
.lede { margin-top: 1.2rem; color: var(--muted); font-size: 1.02rem; max-width: 56ch; }

.hero-meta { margin-top: 1.6rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
  font-family: var(--mono); font-size: 0.72rem; color: var(--muted);
  border: 1px solid var(--border-hi); border-radius: 999px;
  padding: 0.28rem 0.75rem; background: var(--surface);
}

.hero-cta { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.8rem; }
.btn {
  font-family: var(--mono); font-weight: 700; font-size: 0.88rem;
  text-decoration: none; padding: 0.8rem 1.4rem; border-radius: 8px;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s, color 0.15s, background 0.15s;
}
.btn-solid { background: var(--accent); color: #052012; }
.btn-solid:hover { transform: translateY(-1px); box-shadow: 0 10px 28px -10px rgba(74, 222, 128, 0.5); }
.btn-ghost { border: 1px solid var(--border-hi); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------------- terminal ---------------- */
.terminal {
  border: 1px solid var(--border-hi); border-radius: 10px;
  background: #0a0f17; overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7);
}
.term-bar {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.9rem; background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 0.72rem; color: var(--dim);
}
.term-dots { display: flex; gap: 6px; }
.term-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-hi); }
.term-title { flex: 1; text-align: center; }
.term-body {
  padding: 1.1rem 1.2rem; min-height: 305px;
  font-family: var(--mono); font-size: 0.76rem; line-height: 1.75; color: #a9b8c9;
}
.t-line { white-space: pre-wrap; word-break: break-word; }
.t-line.gap { height: 1em; }
.t-prompt { color: var(--accent); font-weight: 700; }
.t-line.cmd .t-text { color: var(--text); }
.t-ok { color: var(--accent); }
.t-cursor {
  display: inline-block; width: 0.55em; height: 1.05em;
  background: var(--accent); vertical-align: -0.15em;
  animation: blink 1.1s steps(1) infinite;
}

/* ---------------- spec bar ---------------- */
.specs { border-block: 1px solid var(--border); background: rgba(14, 21, 32, 0.5); }
.specs-grid { display: grid; grid-template-columns: repeat(5, 1fr); }
.spec { padding: 1.4rem 1.2rem; border-left: 1px solid var(--border); }
.spec:first-child { border-left: 0; }
.spec strong { display: block; font-family: var(--mono); font-size: 1.5rem; font-weight: 700; color: var(--accent); letter-spacing: -0.03em; }
.spec span { font-family: var(--mono); font-size: 0.68rem; color: var(--dim); text-transform: uppercase; letter-spacing: 0.1em; }

@media (max-width: 860px) {
  .specs-grid { grid-template-columns: 1fr 1fr; }
  .spec { border-left: 0; }
  .spec:nth-child(even) { border-left: 1px solid var(--border); }
  .spec:nth-child(n+3) { border-top: 1px solid var(--border); }
  .spec:last-child { grid-column: 1 / -1; border-left: 0; }
}

/* ---------------- sections ---------------- */
.section { padding-block: clamp(3.2rem, 8vh, 5.5rem); scroll-margin-top: 70px; }
.sec-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1.4rem; }
.sec-index { font-family: var(--mono); font-size: 0.78rem; color: var(--dim); }
.sec-head h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); letter-spacing: -0.02em; font-weight: 700; }
.sec-head::after { content: ""; flex: 1; height: 1px; background: var(--border); align-self: center; }
.sec-lede { color: var(--muted); max-width: 68ch; margin-bottom: 2rem; font-size: 0.98rem; }

/* ---------------- cards ---------------- */
.cards { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
@media (min-width: 880px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--surface); padding: 1.6rem 1.5rem; display: flex; flex-direction: column; gap: 0.8rem; }
.card-idx { font-family: var(--mono); font-size: 0.72rem; color: var(--accent); }
.card h3 { font-size: 1.12rem; letter-spacing: -0.01em; }
.card p { color: var(--muted); font-size: 0.92rem; flex: 1; }
.chip {
  font-family: var(--mono); font-size: 0.74rem; line-height: 1.7;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.7rem 0.85rem; color: var(--muted); overflow-x: auto;
}
.chip .c-p { color: var(--accent); font-weight: 700; }
.chip .c-a { color: var(--amber); }
.chip .c-d { color: var(--dim); }

/* ---------------- mesh figure ---------------- */
.mesh { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg-soft); }
.mesh-bar {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.6rem 1rem; background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 0.72rem; color: var(--dim);
}
.mesh-bar .fig { color: var(--accent); }
.mesh-live { margin-left: auto; display: flex; align-items: center; gap: 0.4rem; color: var(--accent); }
.mesh svg { display: block; width: 100%; height: auto; }
.mesh-note { margin-top: 1.4rem; color: var(--muted); max-width: 70ch; font-size: 0.95rem; }

/* ---------------- deploy table ---------------- */
.tbl-wrap { border: 1px solid var(--border); border-radius: 10px; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; min-width: 620px; font-size: 0.9rem; }
.tbl th {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--dim); text-align: left;
  padding: 0.8rem 1rem; border-bottom: 1px solid var(--border-hi); background: var(--surface);
}
.tbl td { padding: 0.95rem 1rem; border-bottom: 1px solid var(--border); color: var(--muted); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td:first-child { font-family: var(--mono); font-size: 0.8rem; color: var(--accent); white-space: nowrap; }
.tbl tbody tr { transition: background 0.15s; }
.tbl tbody tr:hover { background: var(--surface); }
.note { margin-top: 1.3rem; font-size: 0.9rem; color: var(--muted); border-left: 2px solid var(--accent); padding-left: 1rem; }

/* ---------------- roadmap ---------------- */
.roadmap { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.rm-row {
  display: grid; grid-template-columns: 150px 1fr auto; gap: 1.2rem;
  align-items: start; padding: 1.2rem 1.4rem;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.rm-row:last-child { border-bottom: 0; }
.rm-name { font-family: var(--mono); font-size: 0.82rem; color: var(--accent); padding-top: 0.2rem; }
.rm-row h3 { font-size: 1.02rem; margin-bottom: 0.25rem; }
.rm-row p { color: var(--muted); font-size: 0.9rem; }
.badge {
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 0.25rem 0.65rem; border-radius: 999px;
  border: 1px solid; white-space: nowrap;
}
.badge-amber { color: var(--amber); border-color: rgba(240, 194, 123, 0.35); background: rgba(240, 194, 123, 0.08); }
.badge-green { color: var(--accent); border-color: rgba(74, 222, 128, 0.35); background: var(--accent-soft); }
.rm-cta { margin-top: 1.3rem; font-family: var(--mono); font-size: 0.85rem; }
.rm-cta a { color: var(--accent); text-decoration: none; }
.rm-cta a:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .rm-row { grid-template-columns: 1fr; gap: 0.5rem; }
  .badge { justify-self: start; }
}

/* ---------------- form ---------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.2rem; max-width: 760px; }
.field { display: flex; flex-direction: column; gap: 0.45rem; }
.field.full { grid-column: 1 / -1; }
.field label {
  font-family: var(--mono); font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim);
}
input, select, textarea {
  width: 100%; background: var(--bg-soft);
  border: 1px solid var(--border-hi); border-radius: 8px;
  color: var(--text); font: inherit; font-size: 0.92rem;
  padding: 0.7rem 0.85rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--dim); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { min-height: 120px; resize: vertical; }
select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235f7086' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.8rem center;
  padding-right: 2.2rem; color: var(--muted);
}
.check {
  grid-column: 1 / -1; display: flex; gap: 0.65rem;
  align-items: flex-start; font-size: 0.9rem; color: var(--muted); cursor: pointer;
}
.check input { width: 15px; height: 15px; margin-top: 0.25rem; accent-color: var(--accent); flex: none; }
.form-grid button {
  grid-column: 1 / -1; justify-self: start;
  font-family: var(--mono); font-weight: 700; font-size: 0.88rem;
  background: var(--accent); color: #052012; border: none;
  padding: 0.8rem 1.5rem; border-radius: 8px; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.form-grid button:hover { transform: translateY(-1px); box-shadow: 0 10px 28px -10px rgba(74, 222, 128, 0.5); }

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

/* ---------------- about ---------------- */
.about-grid { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .about-grid { grid-template-columns: 1fr 1.4fr; } }
.about-intro { display: flex; flex-direction: column; gap: 1rem; }
.about-intro p { color: var(--muted); font-size: 0.95rem; }
.about-intro strong { color: var(--text); }
.timeline { border-left: 1px solid var(--border-hi); }
.tl-row { position: relative; padding: 0 0 1.4rem 1.6rem; }
.tl-row:last-child { padding-bottom: 0; }
.tl-row::before {
  content: ""; position: absolute; left: -4.5px; top: 0.5rem;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--accent);
}
.tl-year { font-family: var(--mono); font-size: 0.74rem; color: var(--accent); }
.tl-row p { color: var(--muted); font-size: 0.9rem; margin-top: 0.2rem; }

/* ---------------- footer ---------------- */
footer { border-top: 1px solid var(--border); padding: 1.6rem 0 2.2rem; font-family: var(--mono); font-size: 0.74rem; color: var(--dim); }
.foot { display: flex; flex-wrap: wrap; gap: 0.8rem 2rem; justify-content: space-between; }

/* ---------------- reveal & motion ---------------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.on { opacity: 1; transform: none; }

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

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