/* ==========================================================================
   Lyra — shared site styles
   Source of truth: Figma "Lyra Comment Sound Website" (nodes 1:2, 4:113)

   The Figma frame is 1728 wide with 248px gutters around 1232px of content.
   Those exact numbers are reproduced at the L breakpoint; M and S step the
   type and rhythm down. Everything tunable is a custom property at the top
   of each breakpoint block, so re-tuning a breakpoint means editing numbers
   in one place rather than hunting through rules.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Inter — the fallback face for non-Apple platforms.

   Font matching walks the stack left to right, so on macOS and iOS
   -apple-system resolves first and this file is never requested. Only
   Windows, Linux and Android actually download it. 16KB, latin subset,
   self-hosted: no third-party request, nothing to fail at runtime.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/Inter-Regular-latin.woff2") format("woff2");
}

/* --------------------------------------------------------------------------
   Tokens — S is the base; M and L layer on top (mobile-first)
   -------------------------------------------------------------------------- */

:root {
  /* Tells the browser to adapt form controls, scrollbars and the default
     canvas to the active scheme. Without it the scrollbar stays light. */
  color-scheme: light dark;

  /* Color */
  --color-bg: #ffffff;
  --color-fg: #000000;
  --color-muted: rgba(0, 0, 0, 0.5);
  --color-rule: rgba(0, 0, 0, 0.16);
  --color-media: #f5f5f5;
  --color-on-invert: #ffffff;
  --color-invert: #000000;
  --color-invert-hover: #262626;

  /* Type — SF Pro on Apple platforms via -apple-system (no download, and it is
     the real thing on the macOS audience these apps target). Inter is the
     fallback everywhere else: it shares SF's proportions and takes the
     negative tracking gracefully, which Segoe UI does not. */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --fs-headline: 28px;
  --lh-headline: 1.14;
  --fs-body: 16px;
  --lh-body: 20px;

  /* The small style — eyebrow, hero note, footer links. 13/18 with -0.08px
     tracking is Apple's SF Pro Text spec at 13pt, so it sets like native
     macOS text. Constant across breakpoints. */
  --fs-small: 13px;
  --lh-small: 18px;

  /* Tracking. SF tightens as type grows; these follow that curve, anchored on
     the -0.08px at 13px that the design specifies (= -0.006em). Headline is in
     em so it stays proportional as the size steps 28 → 34 → 40 across
     breakpoints; the other two are fixed sizes, so they are stated in px. */
  --ls-headline: -0.032em;
  --ls-body: -0.31px;
  --ls-small: -0.08px;

  /* Layout */
  --gutter: 24px;
  --content-max: 1232px;
  --subhead-max: 521px;
  --media-ratio: 1232 / 680;
  --footer-columns: 2;

  /* Vertical rhythm */
  --space-page-top: 72px;
  --space-eyebrow-headline: 24px;
  --space-headline-subhead: 12px;
  --space-subhead-cta: 48px;
  --space-cta-note: 20px;
  --space-note-media: 48px;
  --space-media-footer: 48px;
  --space-page-bottom: 112px;
}

/* M — small tablets and large phones in landscape */
@media (min-width: 640px) {
  :root {
    --fs-headline: 34px;
    --lh-headline: 1.12;

    --gutter: 48px;
    /* The longest label is ~105px ("Lyra Comment"); four columns at the 640px
       floor are 136px each, so the full footer row survives all of M. */
    --footer-columns: 4;

    --space-page-top: 104px;
    --space-eyebrow-headline: 28px;
    --space-subhead-cta: 64px;
    --space-cta-note: 24px;
    --space-note-media: 64px;
    --space-media-footer: 64px;
    --space-page-bottom: 160px;
  }
}

/* L — desktop. These are the literal Figma values. */
@media (min-width: 1024px) {
  :root {
    --fs-headline: 40px;
    --lh-headline: 44px;

    --gutter: 64px;

    --space-page-top: 148px;
    --space-eyebrow-headline: 32px;
    --space-headline-subhead: 10px;
    --space-subhead-cta: 90px;
    --space-cta-note: 26px;
    --space-note-media: 80px;
    --space-media-footer: 80px;
    --space-page-bottom: 264px;
  }
}

/* --------------------------------------------------------------------------
   Dark scheme — follows the OS setting, no toggle and no JS. Only the colour
   tokens change; every size, space and tracking value is shared.
   -------------------------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #000000;
    --color-fg: #ffffff;

    /* The same 50% and 16% steps as the light scheme, mirrored. */
    --color-muted: rgba(255, 255, 255, 0.5);
    --color-rule: rgba(255, 255, 255, 0.16);

    /* Light mode steps the media block 4% *down* from white (#f5f5f5). A 4%
       step up from black reads as nearly nothing on most displays, so this
       goes to 8% to hold the same apparent separation. */
    --color-media: #141414;

    /* The pill inverts with the page: white on black instead of black on
       white, so it stays the strongest thing in the layout. */
    --color-invert: #ffffff;
    --color-on-invert: #000000;
    --color-invert-hover: #d4d4d4;
  }
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
p,
ul,
figure {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

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

a {
  color: inherit;
}

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

/* --------------------------------------------------------------------------
   Text styles
   -------------------------------------------------------------------------- */

/* One rule because these are one style, not three that happen to match —
   changing it should move the eyebrow, the note, and the footer together. */
.hero__eyebrow,
.hero__note,
.footer-nav__link {
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  letter-spacing: var(--ls-small);
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

/* At a 1728px viewport this resolves to exactly 248px from edge to content,
   matching the Figma frame: (1728 - (1232 + 2*64)) / 2 + 64 = 248. */
.container {
  width: 100%;
  max-width: calc(var(--content-max) + (2 * var(--gutter)));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.main {
  padding-top: var(--space-page-top);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero__eyebrow {
  color: var(--color-muted);
}

.hero__headline {
  margin-top: var(--space-eyebrow-headline);
  font-size: var(--fs-headline);
  line-height: var(--lh-headline);
  font-weight: 400;
  letter-spacing: var(--ls-headline);
  text-wrap: balance;
}

/* The trailing phrase carries a tinted rule rather than a true underline —
   6% of the font size, so it scales with the responsive headline. */
.hero__emphasis {
  text-decoration: underline;
  text-decoration-color: var(--color-rule);
  text-decoration-thickness: 0.06em;
  text-decoration-skip-ink: none;
  text-underline-offset: 0.14em;
}

.hero__subhead {
  margin-top: var(--space-headline-subhead);
  max-width: var(--subhead-max);
  color: var(--color-muted);
  text-wrap: pretty;
}

.hero__actions {
  margin-top: var(--space-subhead-cta);
}

.hero__note {
  margin-top: var(--space-cta-note);
  color: var(--color-muted);
}

/* --------------------------------------------------------------------------
   Button
   -------------------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 100px;
  background: var(--color-invert);
  color: var(--color-on-invert);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 120ms ease;
}

.button:hover {
  background: var(--color-invert-hover);
}

/* --------------------------------------------------------------------------
   Media
   -------------------------------------------------------------------------- */

.media {
  margin-top: var(--space-note-media);
  aspect-ratio: var(--media-ratio);
  background: var(--color-media);
  overflow: hidden;
}

/* Descendant, not child, so an <img> wrapped in <picture> is still sized. */
.media picture {
  display: block;
  width: 100%;
  height: 100%;
}

.media img,
.media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  margin-top: var(--space-media-footer);
  padding-bottom: var(--space-page-bottom);
}

.footer-nav__columns {
  display: grid;
  grid-template-columns: repeat(var(--footer-columns), minmax(0, 1fr));
  column-gap: 0;
  row-gap: 24px;
}

.footer-nav__link {
  display: inline-block;
  /* 10px right / 10px vertical keeps the Figma row box and gives a ~40px
     tall tap target on touch. */
  padding: 10px 10px 10px 0;
  color: var(--color-muted);
  text-decoration: none;
  transition: color 120ms ease;
}

.footer-nav__link:hover {
  color: var(--color-fg);
}

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