/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, ul, ol, li, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, video, picture { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }

.social-symbols {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.social-icon {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: currentColor;
}

html {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.35;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  transition: background-color var(--dur-base) var(--ease),
              color var(--dur-base) var(--ease);
  overflow-x: clip;
}

html { overflow-x: clip; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Type primitives */
.eyebrow {
  font-family: var(--font-ui);
  display: inline-block;
  font-size: var(--type-eyebrow);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-eye);
  color: var(--ink-secondary);
  margin-bottom: var(--space-5);
  text-transform: uppercase;
}
.headline-hero {
  font-family: var(--font-display);
  font-size: var(--type-hero);
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-hero);
  line-height: 0.96;
  color: var(--ink);
  word-break: keep-all;
  line-break: strict;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.headline-section {
  font-family: var(--font-display);
  font-size: var(--type-section);
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-tight);
  line-height: 0.98;
  color: var(--ink);
  max-width: 18ch;
  word-break: keep-all;
  line-break: strict;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.lead {
  font-size: var(--type-lead);
  font-weight: var(--weight-regular);
  line-height: 1.38;
  color: var(--ink-secondary);
  max-width: 36ch;
}

.body {
  font-size: var(--type-body);
  line-height: 1.48;
  color: var(--ink-secondary);
}

/* Buttons */
.btn {
  font-family: var(--font-ui);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 48px;
  padding: 0 30px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0;
  transition: transform var(--dur-fast) var(--ease),
              background-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              box-shadow var(--dur-base) var(--ease);
  white-space: nowrap;
  isolation: isolate;
}
.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08),
              0 0 0 0 rgba(15, 18, 22, 0);
}
.btn--primary:hover {
  background: #050505;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.10),
              0 10px 22px rgba(15, 18, 22, 0.18);
}
.btn--primary:active { transform: translateY(0) scale(0.97); }

.btn--secondary {
  color: var(--link);
  padding: 0;
  height: auto;
  background: transparent;
  font-size: var(--type-body);
  gap: 2px;
}
.btn--secondary::after {
  content: "›";
  display: inline-block;
  font-weight: var(--weight-medium);
  transform: translateX(0);
  transition: transform var(--dur-fast) var(--ease);
  margin-left: 6px;
}
.btn--secondary:hover { color: var(--link); }
.btn--secondary:hover::after { transform: translateX(4px); }

/* Hide any trailing › in markup that was previously inline */
.btn--secondary > span.btn-arrow { display: none; }

/* On dark theme inversion */
[data-theme="dark"] .btn--primary {
  background: var(--ink-on-dark);
  color: var(--bg-dark);
}
[data-theme="dark"] .btn--secondary { color: #2997ff; }

/* Containers */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: var(--section-pad-y);
}

/* All post-hero sections sit above the sticky hero so they scroll up over it */
main > section:not(.hero) {
  position: relative;
  z-index: 2;
}

.section__head {
  text-align: center;
  margin-inline: auto;
  margin-bottom: var(--space-9);
  max-width: 720px;
}

.section__head .lead {
  margin-inline: auto;
  margin-top: var(--space-5);
}

.section__head .headline-section {
  margin-inline: auto;
}

/* Reveal animation primitives. Default = rise + fade. Variants via
   data-reveal="left|right|scale|none" on the element. Stagger via
   data-reveal-delay (ms) — applied as transition-delay. */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur-slow) var(--ease),
              transform var(--dur-slow) var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.reveal[data-reveal="left"]  { transform: translateX(-24px); }
.reveal[data-reveal="right"] { transform: translateX(24px); }
.reveal[data-reveal="scale"] { transform: scale(0.965); transform-origin: center bottom; }
.reveal[data-reveal="none"]  { transform: none; }
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Focus ring — keyboard-only, never on click. Same shape as the
   element thanks to currentColor + offset, so it adapts to themes. */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent-rooy);
  outline-offset: 3px;
  border-radius: 6px;
  transition: outline-offset var(--dur-fast) var(--ease);
}
.btn:focus-visible,
.nav__lang:focus-visible,
.prog__nav:focus-visible { outline-offset: 4px; border-radius: var(--radius-pill); }
[data-theme="dark"] :focus-visible { outline-color: var(--rooy-bright); }

/* Selection — matches brand */
::selection {
  background: rgba(31, 166, 122, 0.22);
  color: var(--ink);
}
[data-theme="dark"] ::selection {
  background: rgba(79, 232, 184, 0.32);
  color: var(--ink-on-dark);
}

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

/* English wraps later: each ch is narrower than a CJK glyph, so the
   18ch/35ch/13ch widths designed for Chinese force English to break early.
   Widen the line-length budget so the authored <br /> stays the only break. */
[data-lang="en"] .headline-section,
[data-lang="en"] .pov__title,
[data-lang="en"] .lock__title,
[data-lang="en"] .prog__headline { max-width: 30ch; }

[data-lang="en"] .pov__body,
[data-lang="en"] .lock__body,
[data-lang="en"] .prog__body { max-width: 54ch; }

[data-lang="en"] .meet__sub { max-width: 28ch; }
[data-lang="en"] .closing__quote { max-width: 22ch; }

@media (max-width: 640px) {
  [data-lang="en"] .closing__quote { max-width: 18ch; }
  [data-lang="en"] .closing__sub { max-width: 36ch; }
}

/* Email signup dialog. Native <dialog> with a small custom shell. */
.signup {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  max-width: min(440px, calc(100vw - 32px));
  width: 100%;
  border-radius: clamp(16px, 1.6vw, 22px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}
.signup::backdrop {
  background: rgba(8, 10, 14, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.signup[open] {
  animation: signup-in var(--dur-slow, 280ms) var(--ease, cubic-bezier(.2,.7,.2,1));
}
@keyframes signup-in {
  from { transform: translateY(12px) scale(0.98); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.signup__form {
  position: relative;
  background: var(--bg, #fff);
  border-radius: inherit;
  padding: clamp(28px, 3.6vw, 40px) clamp(24px, 3vw, 36px) clamp(24px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: var(--font-body);
}

.signup__close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-secondary, #666);
  cursor: pointer;
  border-radius: 999px;
  transition: background-color var(--dur-fast, 140ms) ease;
}
.signup__close:hover { background: rgba(0,0,0,0.05); color: var(--ink); }

.signup__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 2vw, 28px);
  font-weight: var(--weight-display, 600);
  letter-spacing: var(--tracking-tight, -0.01em);
  line-height: 1.1;
}
.signup__sub {
  margin: 0 0 6px;
  color: var(--ink-secondary, #666);
  font-size: 15px;
  line-height: 1.45;
}

.signup__field { display: block; }
.signup__input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: #fafafa;
  transition: border-color var(--dur-fast, 140ms) ease,
              background-color var(--dur-fast, 140ms) ease;
}
.signup__input:focus {
  outline: none;
  border-color: var(--ink);
  background: #fff;
}

.signup__submit {
  width: 100%;
  margin-top: 4px;
}

.signup__success {
  margin: 0;
  text-align: center;
  font-size: 15px;
  color: var(--ink);
  padding: 12px 0 2px;
  animation: signup-success-pop 600ms var(--ease) both;
}
@keyframes signup-success-pop {
  0%   { opacity: 0; transform: translateY(6px) scale(0.96); }
  60%  { opacity: 1; transform: translateY(0)   scale(1.02); }
  100% { opacity: 1; transform: translateY(0)   scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .signup__success { animation: none; }
}
