/* NodeFinch bilingual static pages. No external assets or requests.
   Class contract: .page > main + .site-footer;
   landing main: .hero (.hero-text > .signature + h1 + .hero-description +
   .app-store; then .device) + .showcase > .showcase-item (.showcase-text
   > h2 + p; then optional .device; modifiers .showcase-item--duo /
   .device--duo, .showcase-item--text-only) +
   .film (h2 + video.film-wide / video.film-tall, 60 s clip after the hero) +
   .trust > .trust-note + .plans > .plan-grid > .plan (.plan-pro);
   legacy landing classes .features/.feature/.download-status still work;
   document main: .document > .document-header + .policy-section elements.
   Footer: .copyright + .page-links + .language-switch. */

:root {
  color-scheme: light dark;
  --background: #eef3f3;
  --foreground: #152f32;
  --secondary: #466165;
  --accent: #0e7c86;
  /* The base teal is 4.42:1 on mist; deepen text only to meet AA. */
  --accent-text: #0d7983;
  --selection-background: #0e7c86;
  --selection-foreground: #ffffff;
  --surface: #f7fafa;
  --border: #c9d8d9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
    sans-serif;
  font-size: 100%;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-size: 1.0625rem;
}

::selection {
  background: var(--selection-background);
  color: var(--selection-foreground);
}

a {
  color: var(--accent-text);
  text-decoration-line: underline;
  text-decoration-thickness: 0.075em;
  text-underline-offset: 0.22em;
  /* Keep every focused link, including footer links, inside the viewport. */
  scroll-margin-block: 1rem;
}

a:hover {
  text-decoration-thickness: 0.13em;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 5px;
}

.page {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 5vw, 3.5rem)
    clamp(1.5rem, 4vw, 3rem);
  overflow-wrap: anywhere;
}

.hero {
  max-width: 52rem;
  padding-block: clamp(1rem, 3vw, 2rem) 0;
}

.signature {
  margin: 0 0 1.75rem;
  color: var(--foreground);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.5;
}

.signature-purpose {
  color: var(--accent-text);
}

h1,
h2,
p {
  margin-block-start: 0;
}

h1 {
  max-width: 19ch;
  margin-block-end: 1.5rem;
  font-size: clamp(3rem, 5.6vw, 4rem);
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1.14;
  text-wrap: balance;
}

/* Break the Chinese landing H1 only at <wbr> phrase boundaries, never
   mid-word; overflow-wrap on .page still prevents overflow. */
:lang(zh) .hero h1 {
  word-break: keep-all;
}

:lang(zh) h1 {
  max-width: 15em;
  letter-spacing: -0.025em;
  line-height: 1.24;
}

.hero-description {
  max-width: 54ch;
  margin-block-end: 0;
  color: var(--secondary);
  font-size: 1.125rem;
  line-height: 1.75;
  text-wrap: pretty;
}

.features {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem clamp(1.5rem, 4vw, 3.5rem);
  margin-block: clamp(2.75rem, 6vw, 4.5rem) 0;
  padding: 0;
  list-style: none;
}

.feature {
  min-width: 0;
}

.feature h2 {
  margin-block-end: 0.6rem;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.45;
}

.feature p {
  max-width: 65ch;
  margin-block-end: 0;
  color: var(--secondary);
  line-height: 1.7;
  text-wrap: pretty;
}

.download-status {
  max-width: 65ch;
  margin-block: clamp(2.25rem, 5vw, 3.5rem) 0;
  color: var(--secondary);
  font-size: 0.9375rem;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  margin-block-start: clamp(2.5rem, 6vw, 4.5rem);
  color: var(--secondary);
  font-size: 0.875rem;
}

.copyright {
  margin: 0;
}

.language-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.25rem;
  max-width: 100%;
}

.language-switch a {
  display: inline-block;
  padding-block: 0.5rem;
}

.language-switch [aria-current="page"] {
  color: var(--foreground);
  font-weight: 650;
  text-decoration: none;
}

.skip-link {
  position: absolute;
  top: 1rem;
  left: 1rem;
  /* Keep the 3px outline + 5px offset inside the viewport at large text. */
  max-width: calc(100% - 2rem);
  overflow-wrap: anywhere;
  z-index: 10;
  padding: 0.65rem 1rem;
  background: var(--background);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

.document {
  max-width: 65ch;
}

.document-header {
  margin-block-end: 2.5rem;
}

.document-header h1 {
  max-width: 25ch;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.2;
}

.document-intro {
  font-size: 1.125rem;
}

.document-meta {
  color: var(--secondary);
  font-size: 0.875rem;
}

.policy-section {
  margin-block-start: 2.5rem;
}

.policy-section h2 {
  margin-block-end: 0.8rem;
  font-size: 1.35rem;
  line-height: 1.4;
  letter-spacing: -0.015em;
}

.policy-section h3 {
  margin-block: 1.5rem 0.6rem;
  font-size: 1.0625rem;
  line-height: 1.5;
}

.policy-section p,
.policy-section li {
  max-width: 65ch;
  text-wrap: pretty;
}

.policy-section p:last-child {
  margin-block-end: 0;
}

.page-links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.25rem;
}

.page-links a {
  display: inline-block;
  padding-block: 0.5rem;
  min-height: 44px;
}

.page-links [aria-current="page"] {
  color: var(--foreground);
  font-weight: 650;
}

/* Landing v2: hero, alternating device showcase, trust note, plans.
   Device images and the App Store badge are shown unmodified: no shadow,
   rotation, filter or animation. */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(340px, 40%);
  gap: 2.5rem clamp(2rem, 6vw, 5rem);
  align-items: center;
  max-width: none;
}

.hero-text {
  min-width: 0;
}

/* Official badge: 48px tall, at least 12px (1/4 height) clear space. */
.app-store {
  margin: 1.75rem 0 0;
  padding-block: 12px;
  line-height: 0;
}

.app-store a {
  display: inline-block;
  line-height: 0;
}

.app-store img {
  display: block;
  width: auto;
  height: 48px;
}

.device {
  display: block;
  width: 100%;
  max-width: 340px;
  margin: 0;
}

.device img {
  display: block;
  width: 100%;
  height: auto;
}

.showcase {
  display: grid;
  gap: clamp(3.5rem, 8vw, 6rem);
  margin-block: clamp(4rem, 9vw, 7rem) 0;
}

.showcase-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(340px, 40%);
  gap: 2rem clamp(2rem, 6vw, 5rem);
  align-items: center;
}

/* Odd blocks: image left, text right. Even blocks: text left, image right. */
.showcase-item:nth-child(odd) {
  grid-template-columns: min(340px, 40%) minmax(0, 1fr);
}

.showcase-item:nth-child(odd) > .device {
  order: -1;
}

/* Duo block: wider device column (440px desktop, 300px mobile). */
.showcase-item.showcase-item--duo {
  grid-template-columns: minmax(0, 1fr) min(440px, 48%);
}

.showcase-item.showcase-item--duo:nth-child(odd) {
  grid-template-columns: min(440px, 48%) minmax(0, 1fr);
}

.device.device--duo {
  max-width: 440px;
}

/* Until its screenshot exists, a block renders as compact text only. */
.showcase-item.showcase-item--text-only {
  grid-template-columns: minmax(0, 1fr);
}

.showcase-text {
  min-width: 0;
  max-width: 32rem;
}

.showcase-text h2,
.plans h2 {
  margin-block-end: 0.75rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  text-wrap: balance;
}

.showcase-text p {
  max-width: 65ch;
  margin-block-end: 0;
  color: var(--secondary);
  font-size: 1.125rem;
  line-height: 1.7;
  text-wrap: pretty;
}


/* 60-second film after the hero: click to play, never autoplays. */
.film {
  margin-block: clamp(4rem, 9vw, 7rem) 0;
}

.film h2 {
  margin-block-end: 1.25rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.film video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: #0b1415;
}

/* Phones get the 9:16 cut; only the visible one is ever played or loaded. */
.film .film-tall {
  display: none;
}

@media (max-width: 44rem) {
  .film .film-wide {
    display: none;
  }

  .film .film-tall {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 78svh;
    aspect-ratio: 9 / 16;
    margin-inline: auto;
  }
}

/* 1px rule above the trust note, 64px space above and below the rule. */
.trust {
  margin-block-start: 4rem;
  padding-block-start: 4rem;
  border-block-start: 1px solid var(--border);
}

.trust-note {
  max-width: 46ch;
  margin-block: 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.6;
  text-wrap: pretty;
}

.plans {
  margin-block-start: clamp(3.5rem, 8vw, 5.5rem);
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-block-start: 1.5rem;
}

.plan {
  min-width: 0;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.plan-pro {
  border: 2px solid var(--accent);
}

.plan h3 {
  margin-block: 0 0.6rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.4;
}

.plan p {
  max-width: 65ch;
  margin-block: 0;
  color: var(--secondary);
  line-height: 1.7;
  text-wrap: pretty;
}

.plan p + p {
  margin-block-start: 0.9rem;
}

.plan .plan-summary {
  color: var(--foreground);
}

.plan-terms {
  font-size: 0.9375rem;
}

@media (max-width: 44rem) {
  .hero,
  .showcase-item,
  .showcase-item:nth-child(odd),
  .showcase-item.showcase-item--duo,
  .showcase-item.showcase-item--duo:nth-child(odd) {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Mobile: text above image. */
  .showcase-item:nth-child(odd) > .device {
    order: 0;
  }

  .device {
    max-width: 260px;
    margin-inline: auto;
  }

  .device.device--duo {
    max-width: 300px;
  }

  .plan-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .features {
    grid-template-columns: minmax(0, 1fr);
    max-width: 38rem;
    row-gap: 1.75rem;
  }

  h1 {
    max-width: 17ch;
    /* Keep the usual mobile scale, but avoid oversized fragments at 200% text. */
    font-size: clamp(2rem, 14vw, 3rem);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #0b1415;
    --foreground: #eef3f3;
    --secondary: #b7c8ca;
    --accent: #3fc1c9;
    --accent-text: #3fc1c9;
    --selection-background: #3fc1c9;
    --selection-foreground: #0b1415;
    --surface: #122022;
    --border: #2a3d40;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Shared 44px keyboard/touch link targets. */

.language-switch a,
.document a {
  min-height: 44px;
}

.document a {
  display: inline-block;
  padding-block: 0.5rem;
  /* Leave room for the focus outline when keyboard navigation scrolls links. */
  scroll-margin-block: 1rem;
}
