:root {
  --bg: #12160f;
  --bg-elev: #1a2116;
  --ink: #f2eee4;
  --muted: #a8b09a;
  --line: rgba(242, 238, 228, 0.12);
  --accent: #d4a35c;
  --accent-soft: rgba(212, 163, 92, 0.18);
  --green: #6f9b6a;
  --danger: #c46a5a;
  --radius: 2px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Outfit", sans-serif;
  --max: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(212, 163, 92, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 20%, rgba(111, 155, 106, 0.1), transparent 50%),
    linear-gradient(165deg, #0e120c 0%, #171c12 45%, #10140e 100%);
  line-height: 1.55;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: #e8c07a;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1.25rem, 4vw, 2.5rem);
  backdrop-filter: blur(10px);
  background: rgba(14, 18, 12, 0.72);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}

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

.hero {
  display: grid;
  grid-template-columns: 1fr;
  min-height: min(100vh, 860px);
  position: relative;
}

.hero-copy {
  padding: clamp(2.5rem, 8vw, 5.5rem) clamp(1.25rem, 4vw, 2.5rem) 2rem;
  max-width: 38rem;
  position: relative;
  z-index: 2;
  animation: rise 0.9s ease-out both;
}

.brand-mark {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0 0 1.25rem;
  color: var(--ink);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  line-height: 1.25;
  margin: 0 0 1rem;
  color: var(--muted);
  max-width: 22ch;
}

.lede {
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 36ch;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

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

.btn-primary {
  background: var(--accent);
  color: #1a1408;
}

.btn-primary:hover {
  background: #e0b36a;
  color: #1a1408;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

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

.btn-open {
  background: var(--accent-soft);
  border-color: rgba(212, 163, 92, 0.45);
  color: var(--accent);
  width: 100%;
}

.btn-open:hover {
  background: rgba(212, 163, 92, 0.28);
  color: #f0d09a;
}

.btn-open[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

.hero-visual {
  position: relative;
  min-height: 42vh;
  overflow: hidden;
  animation: fade-in 1.2s ease 0.15s both;
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(14, 18, 12, 0.92) 0%,
    rgba(14, 18, 12, 0.35) 40%,
    transparent 70%
  );
  pointer-events: none;
}

.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  filter: contrast(1.05) saturate(0.85);
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(280px, 42%) 1fr;
    align-items: stretch;
  }

  .hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 1rem;
  }

  .hero-visual {
    min-height: 100%;
  }

  .hero-visual::after {
    background: linear-gradient(
      to right,
      rgba(14, 18, 12, 0.95) 0%,
      rgba(14, 18, 12, 0.25) 28%,
      transparent 55%
    );
  }
}

.intro,
.proposal,
.experiments,
.compare,
.howto {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1.25rem, 4vw, 2.5rem);
}

.intro h2,
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 600;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.intro p,
.section-head p {
  margin: 0;
  color: var(--muted);
  max-width: 52ch;
}

.section-head {
  margin-bottom: 1.75rem;
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

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

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  animation: rise 0.7s ease both;
}

.card:nth-child(1) {
  animation-delay: 0.05s;
}
.card:nth-child(2) {
  animation-delay: 0.12s;
}
.card:nth-child(3) {
  animation-delay: 0.19s;
}
.card:nth-child(4) {
  animation-delay: 0.26s;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0;
  letter-spacing: -0.02em;
}

.meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.2rem 0 0;
}

.badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.28rem 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.2);
}

.badge.online {
  color: #b6e0b0;
  border-color: rgba(111, 155, 106, 0.55);
  background: rgba(111, 155, 106, 0.15);
}

.badge.offline {
  color: #e0b0a8;
  border-color: rgba(196, 106, 90, 0.45);
  background: rgba(196, 106, 90, 0.12);
}

.badge.inactive {
  color: var(--muted);
  border-color: rgba(168, 176, 154, 0.35);
  background: rgba(168, 176, 154, 0.08);
}

.card-inactive {
  opacity: 0.72;
}

.card-inactive .btn-open[aria-disabled="true"] {
  cursor: not-allowed;
}

.th-note {
  display: block;
  font-weight: 500;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  margin-top: 0.15rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  flex: 1;
}

.proposal {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

.proposal-head {
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
  margin-bottom: 1.25rem;
}

.proposal-visual {
  margin: 0;
  width: 100%;
  background: #0a0d09;
  border-block: 1px solid var(--line);
}

.proposal-visual img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(88vh, 920px);
  object-fit: contain;
  object-position: center top;
  background: #ebe6dc;
}

.proposal-visual figcaption {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem clamp(1.25rem, 4vw, 2.5rem) 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stack li {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.45rem;
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.03);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 720px;
}

th,
td {
  padding: 0.75rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

thead th {
  background: rgba(0, 0, 0, 0.25);
  font-weight: 600;
  font-size: 0.82rem;
}

tbody th {
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.12);
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: none;
}

code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.86em;
}

.code {
  background: #0a0d09;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  overflow-x: auto;
  color: #d9e0c8;
  font-size: 0.95rem;
}

.howto-note {
  color: var(--muted);
  margin-top: 1rem;
}

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem clamp(1.25rem, 4vw, 2.5rem) 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

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

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
