:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --page: #171815;
  --case: #23241f;
  --case-edge: #3a3b32;
  --screen: #1d201b;
  --ink: #f2eee4;
  --muted: #a6a79a;
  --faint: #6f7366;
  --amber: #edb86a;
  --mint: #a8c8a0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 280px;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
}

button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--amber); outline-offset: 5px; }

.tuner {
  width: min(100%, 31rem);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: max(1.25rem, env(safe-area-inset-top)) 1rem max(1.25rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.1rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  margin: 0;
  color: var(--ink);
  font-size: 1.65rem;
  font-weight: 750;
  letter-spacing: -.065em;
  text-decoration: none;
}
.wordmark span { color: var(--amber); }

.local-badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .02em;
}
.local-badge > span {
  width: .4rem;
  height: .4rem;
  border-radius: 50%;
  background: var(--mint);
}

.device {
  padding: 1rem;
  border: 1px solid var(--case-edge);
  border-radius: 1.75rem;
  background: var(--case);
  box-shadow: 0 1.5rem 4rem #0003, inset 0 1px #fff1;
}

.device-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .15rem .15rem 1rem;
}

.eyebrow {
  margin: 0;
  color: var(--ink);
  font-size: .75rem;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.status {
  color: var(--muted);
  font-size: .65rem;
  text-align: right;
}

.display {
  position: relative;
  overflow: hidden;
  padding: 1.4rem 1rem 1rem;
  border: 1px solid #3b4234;
  border-radius: 1rem;
  background: var(--screen);
  box-shadow: inset 0 .25rem 1.25rem #0003;
  text-align: center;
}

.meter {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: var(--amber);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: .8rem;
}
.meter-track {
  flex: 1;
  height: 1.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
}
.meter-track i {
  width: 2px;
  height: .6rem;
  border-radius: 2px;
  background: #5b5948;
}
.meter-track i:nth-child(3n + 1) { height: 1rem; }
.meter-track i:nth-child(11) { height: 1.5rem; }
.meter-track i.centre {
  width: 3px;
  background: var(--mint);
  box-shadow: 0 0 .65rem #a8c8a044;
}

.note {
  min-height: 1.05em;
  margin-top: .4rem;
  color: var(--amber);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: clamp(6rem, 30vw, 9rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.09em;
}
.reading {
  margin: .35rem 0 0;
  color: var(--ink);
  font-size: .85rem;
}
.frequency {
  margin: .45rem 0 0;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
}
.frequency span { color: var(--amber); }

.wave-placeholder {
  height: 2.75rem;
  margin-top: 1rem;
  display: grid;
  align-items: center;
}
.wave-placeholder span {
  display: block;
  height: 1px;
  background: #454a3e;
}

.strings {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .4rem;
  margin-top: 1rem;
}
.string {
  min-width: 0;
  padding: .65rem .1rem .55rem;
  border: 1px solid #414239;
  border-radius: .65rem;
  color: var(--ink);
  text-align: center;
}
.string > span {
  display: block;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 1rem;
  font-weight: 600;
}
.string small {
  display: block;
  margin-top: .15rem;
  color: var(--faint);
  font-size: .56rem;
}

.privacy {
  margin: .95rem 0 .05rem;
  color: var(--muted);
  font-size: .68rem;
  text-align: center;
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0 .2rem;
  color: var(--faint);
  font-size: .65rem;
}
footer p { margin: 0; }
footer > span { white-space: nowrap; }
footer a { text-underline-offset: .2em; }

noscript {
  display: block;
  max-width: 28rem;
  margin: 2rem auto;
  padding: 0 1rem;
  color: var(--ink);
  text-align: center;
}

@media (max-width: 360px) {
  .tuner { padding-inline: .7rem; }
  .device { padding: .75rem; border-radius: 1.35rem; }
  .display { padding-inline: .65rem; }
  .status { max-width: 7rem; }
  .strings { gap: .25rem; }
  footer { align-items: flex-start; }
  footer p { max-width: 12rem; }
}

@media (min-width: 700px) {
  .tuner { padding-block: 2.5rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .local-badge > span { animation: arrive .5s ease-out both; }
  @keyframes arrive { from { opacity: 0; } }
}
