/* stringtuner - dark like the plugin window, green when you're in tune */

:root {
  --bg: #0f1113;
  --panel: #171b1f;
  --raised: #1f2429;
  --line: #2c3238;
  --text: #ece9e2;
  --dim: #8a929a;
  --green: #3ee08f;
  --amber: #ffb23e;
  --red: #ff5b4f;

  --heading: "Space Grotesk", "Segoe UI", Helvetica, Arial, sans-serif;
  --body: "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--green); }

main, .masthead, .footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ------------------------------------------------------------------ masthead */

.masthead { padding: 56px 16px 16px; text-align: center; }

h1 {
  margin: 0;
  font-family: var(--heading);
  font-size: clamp(56px, 12vw, 112px);
  line-height: 1;
  letter-spacing: -0.03em;
}

h1 span { color: var(--green); }

.subtitle { margin: 10px 0 0; color: var(--dim); font-size: 18px; }

/* ------------------------------------------------------------------ sections */

section { padding: 40px 0; }

h2 {
  margin: 0 0 16px;
  font-family: var(--heading);
  font-size: 30px;
}

h3 { margin: 0 0 8px; font-family: var(--heading); font-size: 19px; }

.small { color: var(--dim); font-size: 14px; }

code {
  background: var(--raised);
  padding: 1px 6px;
  border-radius: 4px;
  word-break: break-all;
}

/* ------------------------------------------------------------------ hero */

.hero {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 40px;
  align-items: center;
}

.hero > *, .cards > *, .instrument-list > * { min-width: 0; }

.lead { font-family: var(--heading); font-size: 22px; line-height: 1.4; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 8px; }

.button {
  display: inline-block;
  padding: 11px 22px;
  border: 1.5px solid var(--green);
  border-radius: 8px;
  background: var(--green);
  color: var(--bg);
  font: 700 15px var(--heading);
  letter-spacing: 0.06em;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 0.15s, background 0.15s, color 0.15s;
}

.button:hover, .button:focus-visible { box-shadow: 0 0 18px rgba(62, 224, 143, 0.45); }

.button.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.button.ghost:hover, .button.ghost:focus-visible { border-color: var(--green); color: var(--green); }

.window { margin: 0; }
.window img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ------------------------------------------------------------------ the browser tuner */

.tuner {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
}

.tuner-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.tuner-top label { color: var(--dim); font-size: 14px; }

.tuner-top select,
.tuner-top input {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raised);
  color: var(--text);
  font: inherit;
}

.tuner-top select { min-width: 0; flex: 1 1 200px; }
.tuner-top input { width: 84px; }
.tuner-top .button { margin-left: auto; }

.tuner-body {
  display: grid;
  grid-template-columns: 160px 1fr;
  grid-template-rows: auto auto auto;
  gap: 12px 24px;
  margin: 22px 0 18px;
  align-items: center;
}

.note {
  grid-row: 1 / 4;
  font: 700 96px/1 var(--heading);
  color: var(--dim);
  text-align: center;
}

.note #note-octave { font-size: 32px; }
.tuner[data-state="in"] .note { color: var(--green); }
.tuner[data-state="near"] .note { color: var(--amber); }
.tuner[data-state="far"] .note { color: var(--red); }

.meter { position: relative; height: 64px; }

.scale {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  justify-content: space-between;
  border-top: 2px solid var(--line);
  padding-top: 4px;
  color: var(--dim);
  font-size: 12px;
}

.zone {
  position: absolute;
  left: 48%;
  width: 4%;
  top: 0;
  bottom: 22px;
  background: rgba(62, 224, 143, 0.12);
  border-left: 2px solid var(--text);
  transform: translateX(-1px);
}

.needle {
  position: absolute;
  left: 50%;
  top: 4px;
  bottom: 22px;
  width: 5px;
  margin-left: -2.5px;
  border-radius: 3px;
  background: var(--dim);
  transition: left 0.08s linear, background 0.15s;
  opacity: 0.3;
}

.tuner[data-state] .needle { opacity: 1; }
.tuner[data-state="in"] .needle { background: var(--green); }
.tuner[data-state="near"] .needle { background: var(--amber); }
.tuner[data-state="far"] .needle { background: var(--red); }

.strobe {
  height: 34px;
  border-radius: 8px;
  background-color: var(--raised);
  background-image: repeating-linear-gradient(115deg, var(--line) 0 14px, transparent 14px 28px);
  background-size: 200% 100%;
}

.tuner[data-state="in"] .strobe { background-image: repeating-linear-gradient(115deg, var(--green) 0 14px, transparent 14px 28px); }
.tuner[data-state="near"] .strobe { background-image: repeating-linear-gradient(115deg, var(--amber) 0 14px, transparent 14px 28px); }
.tuner[data-state="far"] .strobe { background-image: repeating-linear-gradient(115deg, var(--red) 0 14px, transparent 14px 28px); }

.reading { margin: 0; color: var(--dim); font-size: 15px; }

.strings { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

.string {
  min-width: 72px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--raised);
  text-align: center;
}

.string b { display: block; font: 700 20px var(--heading); }
.string span { color: var(--dim); font-size: 12px; }
.string.lit { border-color: var(--amber); background: rgba(255, 178, 62, 0.12); }
.string.lit.in { border-color: var(--green); background: rgba(62, 224, 143, 0.12); }

/* ------------------------------------------------------------------ instruments, cards, specs */

.instrument-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.instrument {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
}

.instrument h3 { font-size: 16px; margin: 0; }
.instrument p { margin: 2px 0 0; color: var(--dim); font-size: 14px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
}

.card p, .card ol { margin: 0; }
.card ol { padding-left: 20px; }

.specs { padding-left: 20px; }
.specs li { margin-bottom: 8px; }

.footer {
  padding: 32px 16px 48px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.credit { font-family: var(--heading); font-size: 18px; }
.studio img { max-width: 100%; height: auto; }

/* ------------------------------------------------------------------ phones */

@media (max-width: 820px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .tuner-body { grid-template-columns: minmax(0, 1fr); }
  .note { grid-row: auto; font-size: 72px; }
  .tuner-top .button { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .needle { transition: none; }
}
