/* ================================================================
   MELDLY — Design System
   Industrial / nautical instrumentation aesthetic
   Near-black + muted teal + antique gold
   ================================================================ */

:root {
  /* Palette ---------------------------------------------------- */
  --abyss-0:  oklch(0.10 0.015 220);   /* deepest */
  --abyss-1:  oklch(0.13 0.018 220);
  --abyss-2:  oklch(0.16 0.020 220);   /* primary bg */
  --abyss-3:  oklch(0.20 0.022 215);
  --abyss-4:  oklch(0.26 0.025 210);
  --abyss-5:  oklch(0.34 0.028 205);

  --teal:     oklch(0.62 0.060 200);   /* muted antique teal */
  --teal-dim: oklch(0.48 0.045 200);
  --teal-low: oklch(0.30 0.030 200);

  --gold:     oklch(0.74 0.090 85);    /* antique gold */
  --gold-dim: oklch(0.58 0.070 80);
  --gold-low: oklch(0.40 0.050 80);

  --bone:     oklch(0.94 0.008 90);
  --bone-dim: oklch(0.78 0.010 90);
  --bone-low: oklch(0.58 0.012 90);

  --rule:     oklch(1 0 0 / 0.08);
  --rule-strong: oklch(1 0 0 / 0.16);

  /* Type ------------------------------------------------------- */
  --font-display: "Oswald", "Barlow Condensed", "Helvetica Neue", sans-serif;
  --font-body:    "IBM Plex Sans", "Helvetica Neue", system-ui, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Geometry --------------------------------------------------- */
  --rail: 72px;
  --header-h: 56px;
  --max-w: 1280px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--abyss-2);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

::selection { background: var(--gold-low); color: var(--bone); }

/* Mono labels (instrumentation) ------------------------------- */
.mono {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bone-low);
  font-weight: 400;
}

.mono-sm {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-low);
  font-weight: 400;
}

.mono-teal { color: var(--teal); }
.mono-gold { color: var(--gold); }

/* Display headlines ------------------------------------------- */
.display {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 0.95;
  text-transform: uppercase;
}

/* ================================================================
   Background — abyssal gradient + particle field
   ================================================================ */

.abyss-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, oklch(0.22 0.025 210) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 50% 110%, oklch(0.08 0.02 220) 0%, transparent 70%),
    linear-gradient(180deg, var(--abyss-2) 0%, var(--abyss-1) 50%, var(--abyss-0) 100%);
}

.particles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ================================================================
   Top nav — instrument strip
   ================================================================ */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 100;
  background: linear-gradient(180deg, oklch(0.10 0.018 220 / 0.92) 0%, oklch(0.10 0.018 220 / 0.78) 100%);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 0.5px solid var(--rule);
  display: flex;
  align-items: center;
  padding: 0 24px 0 calc(var(--rail) + 8px);
  gap: 32px;
}

.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 18px; font-weight: 500; letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bone);
}
.nav-brand .mark {
  width: 18px; height: 18px;
  position: relative;
  display: inline-block;
}
.nav-brand .mark::before,
.nav-brand .mark::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
}
.nav-brand .mark::after {
  border-color: var(--teal);
  inset: 4px;
  transform: rotate(45deg) scale(0.7);
}

.nav-links {
  display: flex; gap: 4px;
  margin-left: auto;
  align-items: center;
}
.nav-link {
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--bone-dim);
  padding: 8px 12px;
  border-radius: 4px;
  transition: color .15s, background .15s;
  cursor: pointer;
  position: relative;
}
.nav-link:hover { color: var(--bone); background: oklch(1 0 0 / 0.04); }
.nav-link.active { color: var(--gold); }
.nav-link.active::after {
  content: ""; position: absolute;
  left: 12px; right: 12px; bottom: 2px; height: 1px;
  background: var(--gold);
}

.lang-toggle {
  display: flex;
  border: 0.5px solid var(--rule-strong);
  border-radius: 4px;
  overflow: hidden;
  margin-left: 16px;
}
.lang-toggle button {
  appearance: none; border: 0; background: transparent;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
  color: var(--bone-low);
  padding: 5px 8px; cursor: pointer;
  text-transform: uppercase;
}
.lang-toggle button.on {
  background: var(--gold);
  color: var(--abyss-0);
}

/* ================================================================
   Left depth rail
   ================================================================ */

.rail {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--rail);
  z-index: 90;
  border-right: 0.5px solid var(--rule);
  background: oklch(0.10 0.018 220 / 0.6);
  display: flex; flex-direction: column;
  align-items: center;
  padding: 16px 0;
  font-family: var(--font-mono);
  font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--bone-low);
}
.rail .rail-cap {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.3em;
  margin-top: 8px;
  color: var(--teal-dim);
}
.rail .rail-depth {
  margin-top: auto; margin-bottom: 12px;
  text-align: center;
  display: flex; flex-direction: column; gap: 4px;
}
.rail .rail-depth .num {
  font-family: var(--font-display); font-size: 22px;
  font-weight: 500; letter-spacing: 0.02em;
  color: var(--gold); line-height: 1;
}
.rail .rail-depth .lbl {
  font-size: 8.5px; letter-spacing: 0.18em;
  color: var(--bone-low);
}
.rail .rail-ticks {
  position: absolute;
  top: var(--header-h); bottom: 80px;
  left: 50%; width: 1px;
  background: linear-gradient(180deg,
    transparent 0%,
    var(--rule-strong) 6%,
    var(--rule-strong) 94%,
    transparent 100%);
}
.rail .rail-tick {
  position: absolute; left: -4px; width: 9px; height: 1px;
  background: var(--rule-strong);
}
.rail .rail-tick.major { width: 14px; left: -6px; background: var(--bone-low); }
.rail .rail-cursor {
  position: absolute; left: -3px; width: 7px; height: 7px;
  border: 1px solid var(--gold);
  background: var(--abyss-0);
  transform: translateY(-50%) rotate(45deg);
  transition: top .08s linear;
}

/* ================================================================
   Page container
   ================================================================ */

.page {
  position: relative;
  z-index: 10;
  padding-left: var(--rail);
  padding-top: var(--header-h);
  min-height: 100vh;
}

.section {
  position: relative;
  padding: 96px 64px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  border-top: 0.5px solid var(--rule);
  padding-top: 14px;
  margin-bottom: 56px;
  gap: 32px;
}
.section-head .section-num {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold);
}
.section-head .section-meta {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--bone-low);
}

/* ================================================================
   Buttons
   ================================================================ */

.btn {
  appearance: none;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.16em; text-transform: uppercase;
  border: 0.5px solid var(--gold);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--gold); color: var(--abyss-0); }
.btn .arrow {
  display: inline-block;
  transition: transform .2s;
}
.btn:hover .arrow { transform: translateX(3px); }

.btn-ghost {
  border-color: var(--rule-strong);
  color: var(--bone);
}
.btn-ghost:hover {
  background: oklch(1 0 0 / 0.06);
  color: var(--bone);
  border-color: var(--bone-dim);
}

/* ================================================================
   Footer
   ================================================================ */

.footer {
  position: relative;
  z-index: 10;
  margin-left: var(--rail);
  border-top: 0.5px solid var(--rule);
  padding: 48px 64px 32px;
  background: var(--abyss-0);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.4fr;
  gap: 48px;
  max-width: var(--max-w);
  margin: 0 auto 48px;
}
.footer h4 {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); font-weight: 400;
  margin: 0 0 16px;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer ul a {
  font-size: 13px; color: var(--bone-dim);
  transition: color .15s;
}
.footer ul a:hover { color: var(--gold); }
.footer-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-top: 24px;
  border-top: 0.5px solid var(--rule);
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--bone-low);
}

/* ================================================================
   Cards / panels
   ================================================================ */

.panel {
  border: 0.5px solid var(--rule);
  background: linear-gradient(180deg, oklch(0.18 0.022 215 / 0.5), oklch(0.13 0.018 220 / 0.6));
  padding: 32px;
  position: relative;
  transition: border-color .2s, transform .2s;
}
.panel:hover {
  border-color: var(--gold-low);
}
.panel::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px;
  width: 16px; height: 16px;
  border-top: 1px solid var(--gold);
  border-left: 1px solid var(--gold);
  opacity: 0.6;
}
.panel::after {
  content: "";
  position: absolute;
  bottom: -1px; right: -1px;
  width: 16px; height: 16px;
  border-bottom: 1px solid var(--gold);
  border-right: 1px solid var(--gold);
  opacity: 0.6;
}

/* ================================================================
   Forms
   ================================================================ */

.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--bone-low);
}
.field input, .field textarea, .field select {
  appearance: none;
  background: transparent;
  border: 0; border-bottom: 0.5px solid var(--rule-strong);
  padding: 12px 0;
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 16px;
  outline: none;
  transition: border-color .2s;
  resize: vertical;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-bottom-color: var(--gold);
}
.field textarea { min-height: 96px; }
.field.error input, .field.error textarea {
  border-bottom-color: oklch(0.65 0.15 25);
}
.field-err {
  font-family: var(--font-mono); font-size: 10px;
  color: oklch(0.7 0.15 25);
  letter-spacing: 0.1em; text-transform: uppercase;
}

/* ================================================================
   Utilities
   ================================================================ */

.gold { color: var(--gold); }
.teal { color: var(--teal); }
.dim { color: var(--bone-dim); }
.low { color: var(--bone-low); }

.flex { display: flex; }
.col { flex-direction: column; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.gap-16 { gap: 16px; } .gap-24 { gap: 24px; } .gap-32 { gap: 32px; }
.gap-48 { gap: 48px; } .gap-64 { gap: 64px; }

/* Responsive --------------------------------------------------- */
@media (max-width: 880px) {
  :root { --rail: 0px; --header-h: 52px; }
  .rail { display: none; }
  .nav { padding-left: 16px; gap: 12px; }
  .nav-links { gap: 0; }
  .nav-link { padding: 8px 8px; font-size: 9.5px; }
  .section { padding: 64px 24px; }
  .footer { padding: 32px 24px; margin-left: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}


/* ================================================================
   Hero pitch marquee — slow horizontal scroll of the manifesto
   ================================================================ */
@keyframes pitch-marquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}
.pitch-marquee-track {
  animation: pitch-marquee 90s linear infinite;
  will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
  .pitch-marquee-track { animation: none; }
}
