/* ==========================================================================
   Lyra shared site styles
   Source of truth: Figma "Lyra Sites" (node 68:348)

   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.
   -------------------------------------------------------------------------- */

.language-picker:not([hidden]),
.language-preview label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.language-picker {
  margin-block-start: 32px;
  font-size: var(--fs-small);
}

.language-picker select,
.language-preview select {
  font: inherit;
  color: var(--color-fg);
  background: var(--color-bg);
  border: 1px solid var(--color-rule);
  border-radius: 6px;
  padding: 8px;
  max-width: 100%;
}

.language-preview {
  padding: 16px var(--gutter);
  border-block-end: 1px solid var(--color-rule);
  font-size: 14px;
  line-height: 1.5;
}

.language-preview p { margin-block-end: 12px; }
.language-preview [hidden] { display: none; }
.language-preview .language-picker { margin: 0; }
.language-preview__controls { display: flex; flex-wrap: wrap; gap: 16px 32px; }
html[data-locale]:not([data-locale="en"]) .hero__headline { white-space: normal; }
[data-i18n="note"] { white-space: pre-line; }

@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;
  --color-secondary: rgba(0, 0, 0, 0.05);
  --color-secondary-hover: rgba(0, 0, 0, 0.1);

  /* 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 covers the offer note and footer links. */
  --fs-small: 13px;
  --lh-small: 16px;

  /* The Figma body and headline styles use native spacing. The 13px caption
     style carries the design's explicit -0.08px tracking. */
  --ls-headline: 0;
  --ls-body: 0;
  --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: 56px;
  --space-eyebrow-headline: 24px;
  --space-logo-copy: 48px;
  --space-headline-subhead: 4px;
  --space-copy-offer: 40px;
  --space-cta-note: 20px;
  --space-hero-media: 64px;
  --space-media-footer: 48px;
  --space-page-bottom: 96px;
}

/* 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: 96px;
    --space-eyebrow-headline: 28px;
    --space-logo-copy: 56px;
    --space-copy-offer: 56px;
    --space-hero-media: 80px;
    --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: 140px;
    --space-eyebrow-headline: 32px;
    --space-logo-copy: 60px;
    --space-copy-offer: 60px;
    --space-hero-media: 108px;
    --space-media-footer: 80px;
    --space-page-bottom: 237px;
  }
}

/* --------------------------------------------------------------------------
   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;
    --color-secondary: rgba(255, 255, 255, 0.12);
    --color-secondary-hover: rgba(255, 255, 255, 0.18);
  }
}

/* --------------------------------------------------------------------------
   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,
h2,
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 two that happen to match. */
.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 {
  max-width: var(--subhead-max);
}

.hero__logo-row {
  width: 100%;
  height: 60px;
}

.hero__logo {
  width: 60px;
  height: 60px;
  margin-left: -6px;
}

.hero__copy {
  margin-top: var(--space-logo-copy);
}

.hero__headline {
  font-size: var(--fs-headline);
  line-height: var(--lh-headline);
  font-weight: 400;
  letter-spacing: var(--ls-headline);
}

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

.hero__offer {
  margin-top: var(--space-copy-offer);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

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

.hero__status {
  margin-top: 8px;
  color: var(--color-muted);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  letter-spacing: var(--ls-small);
}

.hero__status:empty {
  display: none;
}

/* --------------------------------------------------------------------------
   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;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 120ms ease;
}

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

.button--secondary {
  background: var(--color-secondary);
  color: var(--color-fg);
}

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

.button:disabled,
.button[aria-disabled="true"] {
  cursor: default;
  opacity: 0.45;
}

.button:disabled:hover,
.button[aria-disabled="true"]:hover {
  background: var(--color-invert);
}

@media (min-width: 640px) {
  .hero__headline {
    white-space: nowrap;
  }
}

@media (prefers-color-scheme: dark) {
  .hero__logo {
    filter: invert(1);
  }
}

/* --------------------------------------------------------------------------
   Privacy
   -------------------------------------------------------------------------- */

.privacy {
  padding-block: var(--space-page-top) var(--space-page-bottom);
}

.privacy__back {
  color: var(--color-muted);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  letter-spacing: var(--ls-small);
  text-decoration: none;
}

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

.privacy__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);
}

.privacy__content {
  display: grid;
  gap: 48px;
  max-width: 640px;
  margin-top: 64px;
}

.privacy__content section {
  display: grid;
  gap: 16px;
}

.privacy__content h2 {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 600;
  letter-spacing: var(--ls-body);
}

.privacy__content p,
.privacy__content a {
  color: var(--color-muted);
}

.privacy__content a:hover {
  color: var(--color-fg);
}

.privacy__toggle {
  justify-self: start;
  padding: 10px 20px;
  border: 0;
  border-radius: 100px;
  background: var(--color-invert);
  color: var(--color-on-invert);
  font: inherit;
  cursor: pointer;
  transition: background-color 120ms ease;
}

.privacy__toggle:hover:not(:disabled) {
  background: var(--color-invert-hover);
}

.privacy__toggle:disabled {
  cursor: default;
  opacity: 0.55;
}

.privacy__status {
  min-height: var(--lh-body);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  letter-spacing: var(--ls-small);
}

.legal-page__date,
.legal-page__draft,
.legal-page__summary,
.legal-page__nav,
.purchase-card__policies {
  max-width: 640px;
  color: var(--color-muted);
}

.legal-page__date {
  margin-top: 16px;
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  letter-spacing: var(--ls-small);
}

.legal-page__draft {
  margin-top: 24px;
  padding: 14px 18px;
  border: 1px solid var(--color-rule);
  border-radius: 12px;
  color: var(--color-fg);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

.legal-page__summary {
  margin-top: 32px;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

.legal-page__list,
.legal-page__links {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
  color: var(--color-muted);
}

.legal-page__nav,
.purchase-card__policies {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 64px;
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

.legal-page__nav a,
.purchase-card__policies a {
  color: var(--color-muted);
  text-decoration: none;
}

.legal-page__nav a:hover,
.purchase-card__policies a:hover {
  color: var(--color-fg);
}

/* --------------------------------------------------------------------------
   Download, purchase, and Checkout return pages
   -------------------------------------------------------------------------- */

.status-page,
.purchase-page,
.license-page {
  padding-bottom: var(--space-page-bottom);
}

.status-card,
.purchase-card,
.license-card {
  max-width: 640px;
}

.status-card__action {
  margin-top: var(--space-copy-offer);
}

.purchase-card__copy {
  max-width: var(--subhead-max);
}

.purchase-card__agreement {
  max-width: 640px;
  margin-top: 32px;
  color: var(--color-muted);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

.purchase-card__policies {
  margin-top: 12px;
}

.purchase-form {
  display: grid;
  gap: 24px;
  margin-top: var(--space-copy-offer);
}

.license-form,
.license-completion,
.license-result {
  display: grid;
  gap: 20px;
  margin-top: var(--space-copy-offer);
  max-width: 560px;
}

.license-form[hidden],
.license-completion[hidden],
.license-result[hidden] {
  display: none;
}

.license-field {
  display: grid;
  gap: 8px;
  color: var(--color-muted);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

.license-field input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--color-rule);
  border-radius: 12px;
  background: var(--color-bg);
  color: var(--color-fg);
  font: inherit;
  font-size: var(--fs-body);
}

.license-field input:focus {
  border-color: var(--color-fg);
  outline: 2px solid transparent;
}

.license-completion h2,
.license-result h2 {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

.license-completion p,
.license-result p,
.license-card__support {
  color: var(--color-muted);
}

.license-key-row {
  display: grid;
  gap: 16px;
  justify-items: start;
}

.license-key-row code {
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 14px;
  border-radius: 12px;
  background: var(--color-secondary);
  color: var(--color-fg);
}

.license-card__support {
  max-width: 560px;
  margin-top: 64px;
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

.license-card__support a {
  color: inherit;
}

.purchase-options {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
}

.purchase-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--color-rule);
  border-radius: 16px;
  cursor: pointer;
}

.purchase-option:has(input:checked) {
  border-color: var(--color-fg);
}

.purchase-option:has(input:disabled) {
  cursor: default;
  opacity: 0.55;
}

.purchase-option input {
  margin: 3px 0 0;
  accent-color: var(--color-fg);
}

.purchase-option__copy {
  display: grid;
  gap: 2px;
}

.purchase-option__name,
.purchase-option__price {
  font-weight: 600;
}

.purchase-option__description {
  color: var(--color-muted);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  letter-spacing: var(--ls-small);
}

.purchase-form__submit {
  justify-self: start;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.media {
  margin-top: var(--space-hero-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;
  }
}
