/* Lalawave — ripple tank
   A dark instrument-panel aesthetic: hairline rules, monospace labels,
   old-style serif for prose. No web fonts, no external requests. */

:root {
  --ink:        #0a0e12;
  --ink-lift:   #0e141a;
  --panel:      #11171d;
  --line:       #1d262e;
  --line-warm:  #2a2118;
  --text:       #c4cfd6;
  --text-dim:   #6d7d89;
  --text-faint: #46545f;
  --amber:      #ffb74d;
  --amber-deep: #d98520;
  --teal:       #3fd0d8;

  --mono: "SFMono-Regular", "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;

  --gut: clamp(1.25rem, 4vw, 3.5rem);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  /* a faint warm pool of light behind the tank, so the page is not flat black */
  background-image:
    radial-gradient(120vw 70vh at 50% -10%, rgba(255,183,77,.055), transparent 62%),
    radial-gradient(90vw 60vh at 12% 100%, rgba(63,208,216,.035), transparent 60%);
  background-attachment: fixed;
}

/* Film grain — pure SVG turbulence, no image file to fetch. */
.grain {
  position: fixed;
  inset: -50%;
  pointer-events: none;
  z-index: 9;
  opacity: .16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

/* ── masthead ─────────────────────────────────────────────────────── */

.masthead {
  padding: clamp(2rem, 6vw, 4.25rem) var(--gut) 0;
  animation: rise .7s cubic-bezier(.2,.7,.3,1) both;
}

.brand { display: flex; align-items: center; gap: .85rem; }

.brand__mark { color: var(--amber); display: block; opacity: .9; }
.brand__mark svg { display: block; overflow: visible; }
.brand__mark path {
  stroke-dasharray: 64;
  animation: draw 1.6s cubic-bezier(.4,0,.2,1) .15s both;
}

.brand__name {
  margin: 0;
  font-size: clamp(1.5rem, 4.5vw, 2.15rem);
  font-weight: 500;
  letter-spacing: .34em;
  text-transform: lowercase;
  color: #e8eef2;
}

.brand__sub {
  margin: .9rem 0 0;
  font-size: .74rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.brand__sub .sep { color: var(--amber-deep); opacity: .55; padding: 0 .15em; }

/* ── the bench ────────────────────────────────────────────────────── */

.bench {
  display: flex;
  gap: 1.1rem;
  padding: clamp(1.75rem, 5vw, 3rem) var(--gut) 0;
  animation: rise .7s cubic-bezier(.2,.7,.3,1) .1s both;
}

/* vertical label down the left edge — instrument, not web page */
.bench__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-top: .35rem;
  flex: 0 0 auto;
}
.rail__label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: .62rem;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.rail__rule { flex: 1; width: 1px; background: linear-gradient(var(--line), transparent); }

.bench__stage { flex: 1; min-width: 0; }

.tank-wrap {
  position: relative;
  border: 1px solid var(--line);
  background: var(--ink-lift);
  /* the tank sits in its own well */
  box-shadow: 0 24px 70px -30px rgba(0,0,0,.95), inset 0 0 0 1px rgba(255,255,255,.012);
}

#tank {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 42 / 26;
  cursor: crosshair;
  touch-action: none;
}

.tank-hint {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  padding: .7rem .95rem;
  font-size: .66rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-faint);
  background: linear-gradient(transparent, rgba(10,14,18,.92) 55%);
  transition: opacity .5s;
  pointer-events: none;
}
.tank-hint.is-gone { opacity: 0; }

/* readout strip under the tank */
.readout {
  display: flex;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-top: 0;
}
.readout__cell {
  flex: 1 1 0;
  min-width: 88px;
  padding: .62rem .85rem;
  border-right: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: .5rem;
}
.readout__cell:last-child { border-right: 0; }
.readout__cell b {
  font-weight: 500;
  font-size: .95rem;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}
.readout__cell i {
  font-style: normal;
  font-size: .6rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ── console ──────────────────────────────────────────────────────── */

.console {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
  padding: clamp(1.75rem, 4vw, 2.75rem) var(--gut) 0;
  animation: rise .7s cubic-bezier(.2,.7,.3,1) .2s both;
}

.group__title {
  margin: 0 0 1.05rem;
  font-size: .64rem;
  font-weight: 500;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--line);
}

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips--ghost { margin-top: .6rem; }

.chip {
  font: inherit;
  font-size: .72rem;
  letter-spacing: .09em;
  padding: .5rem .9rem;
  color: var(--text-dim);
  background: var(--panel);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: color .18s, border-color .18s, background .18s, transform .12s;
}
.chip:hover { color: var(--text); border-color: #33414c; }
.chip:active { transform: translateY(1px); }
.chip.is-on {
  color: var(--ink);
  background: var(--amber);
  border-color: var(--amber);
  font-weight: 500;
}
.chip--ghost { background: transparent; }
.chip--ghost.is-on { color: var(--ink); background: var(--teal); border-color: var(--teal); }
.chip:focus-visible { outline: 1px solid var(--amber); outline-offset: 2px; }

/* sliders */
.dials { display: grid; gap: 1.15rem; }

.dial {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: .3rem .9rem;
}
.dial__name {
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.dial__val {
  font-size: .72rem;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 4.2em;
}
.dial input { grid-column: 1 / -1; }

input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  background: transparent;
  cursor: pointer;
  margin: 0;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 1px;
  background: var(--line);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 3px;
  height: 15px;
  margin-top: -7px;
  background: var(--amber);
  border: 0;
  border-radius: 0;
  box-shadow: 0 0 10px rgba(255,183,77,.45);
  transition: height .15s, box-shadow .15s;
}
input[type=range]:hover::-webkit-slider-thumb,
input[type=range]:focus::-webkit-slider-thumb { height: 21px; margin-top: -10px; }
input[type=range]::-moz-range-track { height: 1px; background: var(--line); }
input[type=range]::-moz-range-thumb {
  width: 3px; height: 15px;
  background: var(--amber);
  border: 0; border-radius: 0;
  box-shadow: 0 0 10px rgba(255,183,77,.45);
}
input[type=range]:focus-visible { outline: 1px solid var(--amber); outline-offset: 4px; }

/* ── prose ────────────────────────────────────────────────────────── */

.prose {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(1.75rem, 4vw, 3.25rem);
  padding: clamp(3rem, 8vw, 5.5rem) var(--gut) 0;
  max-width: 1500px;
}

.prose h2 {
  margin: 0 0 1rem;
  font-family: var(--mono);
  font-size: .64rem;
  font-weight: 500;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--amber-deep);
}

.prose p, .notes {
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.72;
  color: var(--text-dim);
}
.prose p { margin: 0 0 1rem; }
.prose__col > p:last-child { margin-bottom: 0; }

.eq {
  font-family: var(--mono) !important;
  font-size: .95rem !important;
  color: var(--text);
  padding: .9rem 1rem;
  border-left: 2px solid var(--line-warm);
  background: rgba(255,183,77,.028);
}
.eq--small { font-size: .78rem !important; }
.eq i { color: var(--amber); font-style: italic; }

.notes { margin: 0; padding-left: 1.1rem; }
.notes li { margin-bottom: .85rem; }
.notes li:last-child { margin-bottom: 0; }
.notes b { color: var(--text); font-weight: 600; }
.notes::marker { color: var(--amber-deep); }

/* ── footer ───────────────────────────────────────────────────────── */

.footer {
  margin-top: clamp(3.5rem, 9vw, 6rem);
  padding: 1.6rem var(--gut) 2.6rem;
  border-top: 1px solid var(--line);
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.footer__dot { color: var(--amber-deep); }

/* ── motion ───────────────────────────────────────────────────────── */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes draw {
  from { stroke-dashoffset: 64; }
  to   { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (max-width: 620px) {
  .bench__rail { display: none; }
  .bench { padding-right: var(--gut); }
}
