/* ENYO Metronome — enyotechnologies.com/metronome
   -------------------------------------------------
   Palette is taken from the app's own asset catalog, not invented: the amber is the
   AccentColor from Assets.xcassets, in both its light and dark variants.

   Type is the system stack deliberately. Every device this app runs on resolves
   -apple-system to SF Pro and ui-rounded to SF Rounded — the exact face the in-app
   wordmark and BPM readout use — so the site is set in the app's own lettering for
   the people who will actually read it, with a plain sans fallback everywhere else.
   No webfont request, so nothing to block and nothing to fall back from silently. */

:root {
  --amber: #e8961a;
  --amber-deep: #c97d0c;

  --ground: #fdfaf3;
  --raised: #fffdf9;
  --ink: #15120c;
  --ink-soft: #5c5347;
  --ink-faint: #8d8578;
  --rule: rgba(21, 18, 12, 0.1);
  --rule-strong: rgba(21, 18, 12, 0.16);
  --shadow: 0 1px 2px rgba(21, 18, 12, 0.05), 0 8px 24px rgba(21, 18, 12, 0.05);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --round: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, sans-serif;

  --measure: 68ch;
  --page: 62rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --amber: #ffb340;
    --amber-deep: #ffc46b;

    --ground: #0f0d09;
    --raised: #1a1611;
    --ink: #f6f1e6;
    --ink-soft: #b3aa9a;
    --ink-faint: #857d6f;
    --rule: rgba(246, 241, 230, 0.12);
    --rule-strong: rgba(246, 241, 230, 0.2);
    --shadow: none;
  }
}

/* ---------------------------------------------------------------- base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--amber-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 4px;
}

img {
  max-width: 100%;
  height: auto;
}

/* ---------------------------------------------------------------- layout */

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.band {
  padding-block: clamp(3rem, 8vw, 5.5rem);
  border-top: 1px solid var(--rule);
}

.band-plain {
  padding-block: clamp(3rem, 8vw, 5.5rem);
}

.prose {
  max-width: var(--measure);
}

.prose p {
  color: var(--ink-soft);
}

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

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
}

.wordmark {
  font-family: var(--round);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-decoration: none;
}

.wordmark:hover {
  color: var(--ink);
}

.masthead-links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9375rem;
}

.masthead-links a {
  color: var(--ink-soft);
  text-decoration: none;
}

.masthead-links a:hover {
  color: var(--ink);
  text-decoration: underline;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding-block: clamp(2rem, 6vw, 4.5rem) clamp(3rem, 8vw, 5rem);
}

@media (max-width: 46rem) {
  .hero {
    grid-template-columns: 1fr;
  }
}

.hero-title {
  font-family: var(--round);
  font-size: clamp(2.25rem, 6.5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.022em;
  text-wrap: balance;
  margin: 0 0 1rem;
}

.hero-lede {
  font-size: clamp(1.0625rem, 2.2vw, 1.25rem);
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 2rem;
  max-width: 34ch;
}

.eyebrow {
  font-family: var(--round);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber-deep);
  margin: 0 0 1rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--ink);
  color: var(--ground);
  font-family: var(--round);
  font-size: 1rem;
  font-weight: 700;
  padding: 0.8125rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.cta:hover {
  color: var(--ground);
  transform: translateY(-1px);
}

.cta-note {
  font-size: 0.9375rem;
  color: var(--ink-faint);
}

.platforms {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.platforms li {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-soft);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
}

/* ---------------------------------------------------------------- the metronome */

.device {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.metronome {
  width: min(100%, 17rem);
  height: auto;
  overflow: visible;
}

.mtr-case {
  fill: none;
  stroke: var(--rule-strong);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.mtr-base {
  fill: var(--rule-strong);
}

.mtr-arc {
  fill: none;
  stroke: var(--rule-strong);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 0.5 11;
}

.mtr-rod {
  stroke: var(--amber);
  stroke-width: 7;
  stroke-linecap: round;
}

.mtr-weight {
  fill: var(--ink);
}

.mtr-bob {
  fill: var(--ink);
}

/* One half-swing per beat. 0.5s each way is 120 BPM, and ease-in-out is what gives a
   real pendulum its character: fastest through the middle, slowing into each end. */
.mtr-arm {
  transform-box: view-box;
  transform-origin: 120px 292px;
  animation: swing 0.5s ease-in-out infinite alternate;
}

@keyframes swing {
  from {
    transform: rotate(-12deg);
  }
  to {
    transform: rotate(12deg);
  }
}

.beats {
  display: flex;
  gap: 0.875rem;
}

.beat {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--rule-strong);
  /* Four beats at 0.5s each — the same 2s bar the pendulum walks, so they stay locked. */
  animation: flash 2s linear infinite;
}

.beat:nth-child(1) {
  animation-delay: 0s;
}
.beat:nth-child(2) {
  animation-delay: 0.5s;
}
.beat:nth-child(3) {
  animation-delay: 1s;
}
.beat:nth-child(4) {
  animation-delay: 1.5s;
}

@keyframes flash {
  0% {
    background: var(--amber);
    transform: scale(1.35);
  }
  18%,
  100% {
    background: var(--rule-strong);
    transform: scale(1);
  }
}

.readout {
  font-family: var(--round);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  line-height: 1.1;
}

.readout-bpm {
  font-size: 2.5rem;
  letter-spacing: -0.02em;
}

.readout-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

@media (prefers-reduced-motion: reduce) {
  .mtr-arm {
    animation: none;
  }
  .beat {
    animation: none;
  }
  .beat:first-child {
    background: var(--amber);
  }
  .cta {
    transition: none;
  }
}

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

.section-title {
  font-family: var(--round);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0 0 0.75rem;
}

.section-lede {
  font-size: 1.0625rem;
  color: var(--ink-soft);
  max-width: var(--measure);
  margin: 0 0 2.5rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
}

.card {
  background: var(--raised);
  padding: 1.75rem 1.5rem;
}

.card h3 {
  font-family: var(--round);
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.card p {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  margin: 0;
}

.card-mark {
  display: block;
  width: 1.75rem;
  height: 0.1875rem;
  border-radius: 2px;
  background: var(--amber);
  margin-bottom: 1rem;
}

/* Devices: a plain description list, because that is what it is. */
.devices {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.75rem 2.5rem;
}

.devices div {
  border-top: 2px solid var(--amber);
  padding-top: 0.875rem;
}

.devices dt {
  font-family: var(--round);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.devices dd {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

/* ---------------------------------------------------------------- privacy pull */

.pull {
  border: 1px solid var(--rule-strong);
  border-radius: 14px;
  padding: clamp(1.75rem, 4vw, 2.5rem);
  background: var(--raised);
  box-shadow: var(--shadow);
}

.pull-line {
  font-family: var(--round);
  font-size: clamp(1.25rem, 3vw, 1.625rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.012em;
  text-wrap: balance;
  margin: 0 0 1rem;
}

.pull p {
  color: var(--ink-soft);
  margin: 0 0 0.75rem;
  max-width: var(--measure);
}

.pull p:last-child {
  margin-bottom: 0;
}

/* ---------------------------------------------------------------- documents */

.doc {
  max-width: var(--measure);
  padding-block: clamp(2rem, 6vw, 3.5rem) clamp(3rem, 8vw, 5rem);
}

.doc-title {
  font-family: var(--round);
  font-size: clamp(1.875rem, 5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.doc-meta {
  font-size: 0.875rem;
  color: var(--ink-faint);
  margin: 0 0 2.5rem;
}

.doc h2 {
  font-family: var(--round);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 2.5rem 0 0.75rem;
}

.doc h3 {
  font-family: var(--round);
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 2rem 0 0.5rem;
}

.doc p,
.doc li {
  color: var(--ink-soft);
}

.doc li {
  margin-bottom: 0.5rem;
}

.doc strong {
  color: var(--ink);
  font-weight: 600;
}

.callout {
  border-left: 3px solid var(--amber);
  padding: 0.25rem 0 0.25rem 1.25rem;
  margin: 1.5rem 0;
}

.callout p {
  margin: 0;
}

.spec {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  margin: 1.5rem 0;
}

.spec th,
.spec td {
  text-align: left;
  padding: 0.625rem 1rem 0.625rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.spec th {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.spec td {
  color: var(--ink-soft);
}

.scroll-x {
  overflow-x: auto;
}

/* ---------------------------------------------------------------- footer */

.footer {
  border-top: 1px solid var(--rule);
  padding-block: 2.5rem 3.5rem;
  font-size: 0.9375rem;
  color: var(--ink-faint);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 2rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--ink-soft);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ink);
  text-decoration: underline;
}
