:root {
  color-scheme: light;
  --ink: #262220;
  --ink-soft: #6b625b;
  --paper: #f6f2ea;
  --border: rgba(38, 34, 32, 0.14);
  --accent: #a85d3b;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Roboto, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4rem;
  padding: 3rem 1.25rem;
}

.hero {
  display: grid;
  justify-items: center;
  gap: 1.75rem;
  text-align: center;
  max-width: 30rem;
}

.hero h1 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: clamp(2.6rem, 7vw, 3.6rem);
  letter-spacing: 0.03em;
  color: var(--ink);
}

.tagline {
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(0.95rem, 2vw, 1.05rem);
}

.tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.tool-card {
  display: grid;
  gap: 0.3rem;
  width: 14rem;
  padding: 0 0 1.1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.4);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.tool-card:hover,
.tool-card:focus-visible {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.7);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(38, 34, 32, 0.1);
}

.tool-media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 7.875rem;
  min-width: 0;
  min-height: 0;
  background: linear-gradient(160deg, rgba(38, 34, 32, 0.05), rgba(38, 34, 32, 0.09));
  border-bottom: 1px solid var(--border);
}

.tool-media img {
  width: 100%;
  height: 100%;
  min-width: 0;
  object-fit: cover;
  object-position: center 42%;
}

.metronome-icon svg {
  width: auto;
  height: 6.6rem;
  min-height: 0;
  overflow: visible;
}

.mini-device-shadow {
  fill: rgba(61, 31, 15, 0.16);
}

.mini-device-case {
  filter: drop-shadow(0 6px 10px rgba(61, 31, 15, 0.2));
}

.mini-scale-ticks line {
  stroke: rgba(246, 241, 232, 0.24);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.mini-pendulum-rod,
.mini-pendulum-pivot {
  fill: #f6f1e8;
}

.mini-pendulum-weight {
  fill: var(--accent);
}

.mini-pendulum-swing {
  transform-origin: 120px 246px;
  animation: mini-swing 1.3s ease-in-out infinite;
}

@keyframes mini-swing {
  0%,
  100% {
    transform: rotate(-15deg);
  }
  50% {
    transform: rotate(15deg);
  }
}

/* A small static replica of the /tuner/ strobe wheel, frozen green as if
   reading a perfectly in-tune A4 — built from the same half-circle wedge
   construction (see the inline script at the end of the page), just with
   far fewer segments since it only needs to read clearly at icon size. */
.tuner-icon-svg {
  height: 6.6rem;
  width: auto;
  display: block;
  overflow: visible;
}

.tuner-icon-case {
  filter: drop-shadow(0 4px 7px rgba(61, 31, 15, 0.22));
}

.tuner-icon-wedges path {
  fill: #6f8f52;
}

.tuner-icon-wedges-alt path {
  fill: #8fae6a;
}

.tuner-icon-base {
  fill: url(#homeTunerCaseGradient);
}

.tuner-icon-hub {
  fill: #f6f1e8;
}

/* A blue "A4" label layered on top of the icon (last in paint order), so
   the tool reads as a tuner at a glance rather than a generic dial. */
.tuner-icon-a4 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  font-size: 54px;
  fill: #3f7fc9;
  paint-order: stroke fill;
  stroke: #f6f1e8;
  stroke-width: 6px;
  stroke-linejoin: round;
}

/* A small static replica of the /tuner/ needle gauge, frozen green as if
   reading a perfectly centered, in-tune note — the ticks and pointer are
   generated by the inline script at the end of the page. */
.needle-icon-svg {
  height: 6.6rem;
  width: auto;
  display: block;
  overflow: visible;
}

.needle-icon-case {
  filter: drop-shadow(0 4px 7px rgba(61, 31, 15, 0.22));
}

.needle-icon-tick {
  stroke: rgba(246, 241, 232, 0.32);
  stroke-width: 2;
  stroke-linecap: round;
}

.needle-icon-tick-major {
  stroke: rgba(246, 241, 232, 0.62);
  stroke-width: 3;
}

.needle-icon-arc {
  fill: none;
  stroke: #6f8f52;
  stroke-width: 6;
  stroke-linecap: round;
}

.needle-icon-pointer {
  fill: #6f8f52;
  animation: needle-icon-color 2.4s ease-in-out infinite;
}

/* Swings the needle around the centered "in tune" position, the same
   way the /metronome/ card's pendulum swings — and the fill animation
   below is timed to match, so the needle reads green as it passes
   through the middle and amber out at the extremes. */
.needle-icon-swing {
  transform-origin: 150px 150px;
  animation: needle-icon-swing 2.4s ease-in-out infinite;
}

@keyframes needle-icon-swing {
  0%,
  100% {
    transform: rotate(-13deg);
  }
  50% {
    transform: rotate(13deg);
  }
}

@keyframes needle-icon-color {
  0%,
  50%,
  100% {
    fill: #c6892c;
  }
  25%,
  75% {
    fill: #6f8f52;
  }
}

.needle-icon-hub {
  fill: #f6f1e8;
}

.needle-icon-accidental {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  font-size: 30px;
  fill: rgba(246, 241, 232, 0.5);
  text-anchor: middle;
}

/* The "A4" the needle is reading — blue with a cream outline so it stays
   legible over the dark dial, matching the strobe-tool icons' A4 badge. */
.needle-icon-a4 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  font-size: 24px;
  fill: #3f7fc9;
  text-anchor: middle;
  paint-order: stroke fill;
  stroke: #f6f1e8;
  stroke-width: 4px;
  stroke-linejoin: round;
}

/* ---- Chromatic Strobe Tuner card: three overlapping strobe-disc "fans" —
   the same pointed-vertex wedge shape /strobetuner/'s real discs use (see
   buildFanTrio) — each labelled with a different chromatic neighbour so
   the icon reads as "every note", distinct from the Octave Strobe Tuner
   card's single dome-shaped wheel. ---- */
.fan-trio {
  position: relative;
}

.fan-icon {
  position: absolute;
  width: 60%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 4px 7px rgba(61, 31, 15, 0.22));
}

.fan-icon-top {
  top: -8%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
}

.fan-icon-left {
  top: 34%;
  left: 3%;
  z-index: 1;
}

.fan-icon-right {
  top: 34%;
  right: 3%;
  z-index: 2;
}

.fan-wedges path {
  fill: #6f8f52;
}

.fan-wedges-alt path {
  fill: #8fae6a;
}

.fan-scale-ticks line {
  stroke: rgba(246, 241, 232, 0.4);
  stroke-width: 2;
  stroke-linecap: round;
}

.fan-scale-label {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: 16px;
  fill: rgba(246, 241, 232, 0.55);
  text-anchor: middle;
}

.fan-hub {
  fill: #f6f1e8;
}

/* Each fan's note label — smaller than the Octave Strobe card's single
   "A" badge since three of these share the same card. */
.fan-note-label {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  font-size: 34px;
  fill: #3f7fc9;
  text-anchor: middle;
  paint-order: stroke fill;
  stroke: #f6f1e8;
  stroke-width: 4px;
  stroke-linejoin: round;
}

.tool-name {
  margin-top: 0.85rem;
  padding: 0 1.4rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--ink);
}

.tool-desc {
  padding: 0 1.4rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.footer {
  font-size: 0.85rem;
}

.footer a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.1rem;
  transition: color 160ms ease, border-color 160ms ease;
}

.footer a:hover,
.footer a:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
  }

  .mini-pendulum-swing,
  .needle-icon-swing,
  .needle-icon-pointer {
    animation: none;
  }
}
