/* Plain HTML pages of groovelockapp.com (guide, privacy, topic pages). Generated pages link this file; the
   metronome itself is the Flutter app at /. System fonts only: the site makes no third-party requests.
   Colours follow lib/app/theme.dart: #FF6900 with black on it (dark), #C25000 with white on it (light). */

:root {
  color-scheme: dark light;
  --bg: #121212;
  --surface: #1e1c1d;
  --text: #e6e1e5;
  --muted: #b5adb3;
  --line: #3a3638;
  --accent: #ff6900;
  --on-accent: #000;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fafafa;
    --surface: #fff;
    --text: #1c1b1f;
    --muted: #57525a;
    --line: #dedade;
    --accent: #c25000;
    --on-accent: #fff;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

.top {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.3px;
  text-decoration: none;
}

.brand img {
  border-radius: 8px;
}

.button,
.top .open {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.top .open {
  padding: 8px 14px;
  font-size: 15px;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 16px 32px;
}

h1 {
  font-size: clamp(28px, 6vw, 40px);
  line-height: 1.15;
  margin: 28px 0 12px;
}

h2 {
  font-size: 23px;
  line-height: 1.25;
  margin: 36px 0 8px;
  scroll-margin-top: 72px;
}

h3 {
  font-size: 18px;
  margin: 24px 0 4px;
}

.lead {
  font-size: 19px;
  color: var(--muted);
}

ul,
ol {
  padding-left: 22px;
}

li {
  margin: 4px 0;
}

.box {
  margin: 20px 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.toc {
  columns: 2 220px;
  padding-left: 18px;
}

.cta {
  margin: 36px 0 8px;
}

.note {
  color: var(--muted);
  font-size: 15px;
}

footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}

footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 0;
  list-style: none;
}

footer li {
  margin: 0;
}

/* Tables (note names on /random-note-generator/). */
.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 100%;
}

th,
td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 600;
}

/* Interactive tools (web/note-generator.js). */
.tool {
  margin: 20px 0 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.tool-string {
  min-height: 1.65em;
  margin: 0;
  color: var(--muted);
  text-align: center;
}

/* The note in a circle: the whole circle is the "new note" button. --d is its diameter; the font shrinks with
   longer names (A, C♯, Ges, Sol♯) so every name fits. */
.note-circle {
  --d: min(64vw, 260px);
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--d);
  height: var(--d);
  margin: 4px auto 14px;
  padding: 0;
  border: 3px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 80ms ease-out;
}

.note-circle:active {
  transform: scale(0.97);
}

.tool-note {
  font-size: calc(var(--d) * 0.5);
  font-weight: 800;
  line-height: 1;
}

.tool-note[data-len="2"] {
  font-size: calc(var(--d) * 0.38);
}

.tool-note[data-len="3"] {
  font-size: calc(var(--d) * 0.3);
}

.tool-note[data-len="4"] {
  font-size: calc(var(--d) * 0.24);
}

.tool-tap {
  text-align: center;
}

/* Auto mode: time left until the next note. */
.tool-progress {
  width: 100%;
  max-width: 240px;
  height: 4px;
  margin: 6px auto 16px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
  visibility: hidden;
}

.tool-progress.active {
  visibility: visible;
}

.tool-progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}

.tool-row .tool-label:not(:first-child) {
  min-width: 0;
}

.tool-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 10px 0;
}

.tool-center {
  justify-content: center;
}

.tool button {
  font: inherit;
  cursor: pointer;
}

.tool .button {
  border: 0;
  padding: 12px 26px;
}

.ghost {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-weight: 600;
}

.ghost[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.ghost.round {
  width: 40px;
  height: 40px;
  padding: 0;
}

.tool button:focus-visible,
.tool select:focus-visible,
.tool input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tool-panel {
  margin-top: 16px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.tool-label {
  min-width: 112px;
  color: var(--muted);
  font-size: 15px;
}

.tool-bpm {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tool input[type="number"] {
  width: 64px;
  padding: 7px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  text-align: center;
}

.tool select {
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.tool-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  font-size: 15px;
}

.tool-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.seg button {
  padding: 7px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

.seg button:last-child {
  border-right: 0;
}

.seg button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

.tool-hint {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 14px;
}

.tool-keys {
  margin-top: 14px;
}

/* Settings: collapsed by default; the summary line says what is set. */
.tool-settings {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.tool-settings summary {
  padding: 12px 0 4px;
  font-weight: 700;
  cursor: pointer;
}

.tool-summary {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.tool-settings .tool-panel:first-of-type {
  margin-top: 4px;
  border-top: 0;
}

/* Full screen: the same section fixed over the page, only the note, its controls and the answer. */
html.tool-focus,
html.tool-focus body {
  overflow: hidden;
}

.tool.focus {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  overflow-y: auto;
  border: 0;
  border-radius: 0;
  background: var(--bg);
  cursor: pointer;
}

.tool.focus:focus {
  outline: none;
}

.tool.focus {
  --d-focus: min(80vw, 50vh);
}

.tool.focus .note-circle {
  --d: var(--d-focus);
}

/* The Auto countdown, as wide as the circle and thicker, readable from a music stand. */
.tool.focus .tool-progress {
  max-width: var(--d-focus);
  height: 6px;
  border-radius: 3px;
}

.tool.focus .tool-string {
  font-size: 19px;
}

.tool.focus .tool-settings,
.tool.focus noscript {
  display: none;
}

.tool.focus .fretboard {
  width: 100%;
  max-width: 760px;
}

/* Phone held sideways: note on the left, controls and answer on the right. */
@media (orientation: landscape) and (max-height: 560px) {
  .tool.focus {
    display: grid;
    grid-auto-flow: row dense;
    grid-template-columns: auto minmax(0, 1fr);
    align-content: center;
    align-items: center;
    column-gap: 28px;
  }

  .tool.focus > * {
    grid-column: 1;
    justify-self: center;
    text-align: center;
  }

  .tool.focus .tool-tap {
    display: none;
  }

  .tool.focus > .tool-actions,
  .tool.focus > .fretboard {
    grid-column: 2;
  }

  .tool.focus {
    --d-focus: min(42vw, 58vh);
  }
}

@media (hover: none) {
  .tool-keys {
    display: none;
  }
}

.fretboard {
  margin: 8px 0 4px;
}

.fretboard svg {
  display: block;
  width: 100%;
  height: auto;
}

.fb-string {
  stroke: var(--muted);
  stroke-width: 1.5;
}

.fb-fret {
  stroke: var(--line);
  stroke-width: 2;
}

.fb-nut {
  stroke: var(--text);
  stroke-width: 5;
}

.fb-inlay {
  fill: var(--line);
}

.fb-mark {
  fill: var(--accent);
}

.fb-mark.other {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  opacity: 0.55;
}

.fb-num {
  fill: var(--muted);
  font-size: 13px;
  text-anchor: middle;
}

/* Rows above set display: flex, which would override the hidden attribute. */
.tool [hidden] {
  display: none !important;
}

/* Small phones (320 pt): the header button needs the room, the icon alone is enough for the brand. */
@media (max-width: 380px) {
  .brand {
    font-size: 0;
  }
}
