@font-face {
  font-family: Caveat;
  src: url('assets/fonts/caveat-400.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
/* Caveat has no Greek or Japanese, so the handwritten notes fall back to the closest
   handwriting that does: Mynerve for Greek and Yomogi for kana. Each is cut down to those
   characters, loads only on a page that uses them, and is scaled to Caveat's size. */
@font-face {
  font-family: Mynerve;
  src: url('assets/fonts/mynerve-greek.woff2') format('woff2');
  font-display: swap;
  unicode-range: U+0370-03FF;
  size-adjust: 80%;
}
@font-face {
  font-family: Yomogi;
  src: url('assets/fonts/yomogi-kana.woff2') format('woff2');
  font-display: swap;
  unicode-range: U+3000-30FF, U+4E00-9FFF, U+FF00-FFEF;
  size-adjust: 80%;
}

:root {
  --hand: Caveat, Mynerve, Yomogi, cursive;
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-synthesis: none;
  color: #1d1d1f;
  background: #fbfbfd;
  -webkit-font-smoothing: antialiased;
  --blue: #0071e3;
  --muted: #6e6e73;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  /* The iPhone notch and home indicator, with viewport-fit=cover. Backgrounds run under them;
     content containers keep at least this far from each edge. */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overscroll-behavior: none; }
body, h1, h2, h3, p { margin: 0; }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
::selection { color: #004c99; background: #d9eaff; }
:where(a, button):focus-visible { outline: 3px solid #0071e366; outline-offset: 5px; border-radius: 3px; }
.content-width { width: min(calc(100% - 112px), 1200px); margin-inline: auto; }

.opening { position: relative; isolation: isolate; min-height: 100svh; padding-top: var(--safe-top); display: grid; grid-template-rows: auto 1fr auto; }

/* Broad, feathered folds of light stay below the content, with no animated blur. */
.daylight { position: absolute; z-index: -1; inset: 24% 0 0; overflow: hidden; pointer-events: none; }
.daylight-wash {
  position: absolute;
  inset: -12% -15% -20%;
  background:
    radial-gradient(ellipse 85% 14% at 52% 63%, #fbfbfd 25%, #fbfbfd00 100%),
    radial-gradient(ellipse 88% 24% at 26% 64%, #d4e2fa80 0%, #e4e3f738 54%, #fbfbfd00 100%),
    radial-gradient(ellipse 74% 22% at 78% 80%, #dcece57a 0%, #e4e8f526 56%, #fbfbfd00 100%);
  transform: rotate(-9deg);
}

.header { display: flex; align-items: center; justify-content: flex-end; min-height: 88px; border-bottom: 1px solid #1d1d1f0d; }
.header nav { display: flex; align-items: center; gap: 34px; font-size: 12px; }
.availability { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.nav-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; }
a:hover { color: var(--blue); }

main { display: grid; place-items: center; min-height: 400px; padding: 34px 32px 0; }
main:focus { outline: none; }
.composition { width: min(100%, 680px); text-align: center; }
h1 { font-size: clamp(40px, 4vw, 54px); font-weight: 600; line-height: 1.1; letter-spacing: -.045em; text-wrap: balance; }
.intro { margin-top: 19px; font-size: 18px; line-height: 1.5; color: var(--muted); }
.waitlist { position: relative; max-width: 500px; margin: 35px auto 0; padding-bottom: 116px; }
.form-controls { display: flex; align-items: start; gap: 10px; }
.form-controls input { appearance: none; width: 100%; min-width: 0; height: 56px; padding: 0 23px; border: 1px solid #d6d6dc; border-radius: 999px; background: #ffffffed; color: #1d1d1f; font-size: 16px; box-shadow: 0 2px 5px #1d1d1f03; transition: border-color 160ms, box-shadow 160ms; }
.form-controls input::placeholder { color: #76767c; opacity: 1; }
.form-controls input:hover { border-color: #b3b3ba; }
.form-controls input:focus { border-color: var(--blue); outline: 3px solid #0071e32b; outline-offset: 2px; box-shadow: 0 2px 8px #0071e308; }
.join-control { position: relative; flex: none; width: 148px; }
.join-control button { appearance: none; width: 100%; height: 56px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--blue); color: #fff; font-size: 15px; font-weight: 500; cursor: pointer; transition: background-color 160ms, transform 160ms var(--ease-out); }
.join-control button:disabled { cursor: default; }
.join-control button:focus-visible { border-radius: 999px; }
.join-control button:active:not(:disabled) { background: #005bb7; transform: scale(.98); }
/* The note sits in the space under the field, beside the arrow, so it never pushes the page down. */
.form-note { position: absolute; left: 0; width: 100%; margin-top: 17px; max-width: calc(100% - 165px); min-height: 36px; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }
.form-note:empty { display: none; }
/* The privacy line holds the note's slot until there's something to announce. */
.waitlist:has(#form-note:not(:empty), noscript > .form-note) .form-privacy { display: none; }
.form-privacy { text-wrap: balance; }
.form-privacy a { white-space: nowrap; text-decoration: underline; text-underline-offset: 2px; }
/* Focus lands on the note after joining only to keep the reader's place; it isn't a control. */
.form-note:focus { outline: none; }

/* The arrow tip stays 10px below the actual button at every breakpoint. */
.invitation { position: absolute; top: calc(100% + 8px); right: 0; width: 150px; color: #406b9e; pointer-events: none; user-select: none; font-family: var(--hand); font-size: 24px; line-height: 1.05; }
.invitation svg { display: block; width: 150px; height: 106px; overflow: visible; }
.invitation path { stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
/* One line in every language, centred under the arrow's tip even when it's wider than the arrow. */
.invitation span { display: block; width: max-content; margin: -1px 0 0 50%; translate: -50% 0; white-space: nowrap; transform: rotate(6deg); }

.footer-meta { min-height: 64px; display: flex; justify-content: space-between; align-items: center; gap: 24px; border-top: 1px solid #1d1d1f10; font-size: 11px; color: var(--muted); }
.legal-links { display: flex; align-items: center; justify-content: center; gap: 28px; }
.legal-links a { display: inline-flex; align-items: center; min-height: 44px; }
.copyright { text-align: right; }
/* More of the letter bodies now sit above the fold; the baseline remains cropped. */
.footer-art { width: 100%; height: calc(100vw * 171 / 640 * .86); overflow: hidden; }
.footer-art img { display: block; width: 100%; height: auto; opacity: .14; }

.document-header { justify-content: space-between; }
.back-link { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 12px; }
.document-header [aria-current="page"] { color: var(--muted); }
.document-main { display: block; min-height: 0; padding: 80px max(24px, var(--safe-right)) 96px max(24px, var(--safe-left)); }
.legal-document { max-width: 620px; margin-inline: auto; text-align: center; }
.legal-document h1 { font-size: clamp(36px, 4vw, 48px); }
.document-date { margin-top: 18px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.document-intro { max-width: 450px; margin: 22px auto 48px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.document-section + .document-section { margin-top: 38px; }
.document-section h2 { margin-bottom: 12px; font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -.025em; }
.document-section p { font-size: 14px; line-height: 1.8; color: #55555c; text-wrap: pretty; }
.document-section p + p { margin-top: 12px; }
.document-page .daylight { inset: auto 0 0; height: min(620px, 85vw); }
/* Japanese has no spaces, so break lines between phrases instead of inside words where the browser can. */
:lang(ja) { word-break: auto-phrase; line-break: strict; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
#bot-check { max-width: 100%; margin-top: 12px; }
.skip-link { position: absolute; left: calc(16px + var(--safe-left)); top: calc(12px + var(--safe-top)); padding: 12px; background: white; z-index: 2; transform: translateY(calc(-180% - var(--safe-top))); }
.skip-link:focus { transform: translateY(0); }

@media (hover: hover) {
  .join-control button:hover:not(:disabled) { background: #0066cc; transform: translateY(-1px); }
  .join-control button:active:not(:disabled) { transform: scale(.98); }
}

@media (prefers-reduced-motion: no-preference) {
  .composition { animation: arrive 600ms var(--ease-out) both; }
  .daylight-wash { animation: daylight-arrive 1600ms var(--ease-out) both; }
  .invitation path { stroke-dasharray: 1; animation: ink 750ms 300ms var(--ease-out) both; }
}
@keyframes arrive { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes daylight-arrive { from { opacity: 0; transform: translate3d(-2%, 4%, 0) rotate(-7deg); } to { opacity: 1; transform: translate3d(0, 0, 0) rotate(-9deg); } }
@keyframes ink { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

@media (max-width: 900px) {
  .content-width { width: calc(100% - 64px); }
  .header nav { gap: 24px; }
}
@media (max-width: 600px) {
  .content-width { width: calc(100% - 48px); }
  .header { min-height: 80px; }
  .availability { display: none; }
  main { min-height: 520px; padding: 46px 24px 0; }
  .composition { max-width: 380px; }
  h1 { font-size: clamp(36px, 9vw, 45px); line-height: 1.08; letter-spacing: -.04em; max-width: 330px; margin-inline: auto; }
  .intro { font-size: 15px; margin-top: 17px; }
  .waitlist { margin-top: 29px; padding-bottom: 112px; }
  .form-controls { flex-direction: column; gap: 11px; }
  .join-control { width: 100%; }
  .form-controls input, .join-control button { height: 54px; }
  .join-control button { font-size: 16px; }
  .form-note { font-size: 11px; text-align: left; max-width: calc(100% - 158px); line-height: 1.6; }
  .invitation { font-size: 22px; }
  .footer-meta { min-height: 68px; font-size: 11px; gap: 12px; }
  .daylight { inset: 35% 0 0; }
  .daylight-wash { inset: -12% -60% -20%; }
  .footer-meta { display: grid; grid-template-columns: 1fr auto; padding-block: 14px; gap: 0 12px; }
  .footer-meta > p:first-child { grid-column: 1; }
  .footer-meta .legal-links { grid-column: 1 / -1; grid-row: 2; gap: 24px; justify-content: flex-start; }
  .copyright { grid-column: 2; grid-row: 1; }
  .document-header .legal-links { gap: 18px; }
  .document-main { min-height: 0; padding: 64px 24px 72px; }
  .legal-document h1 { max-width: none; font-size: 36px; }
  .document-intro { font-size: 14px; margin-bottom: 40px; }
  .document-section h2 { font-size: 19px; }
  .document-section + .document-section { margin-top: 32px; }
}
@media (max-width: 360px) {
  .content-width { width: calc(100% - 40px); }
  main { padding-inline: 20px; }
  .intro { font-size: 14px; }
  .form-note { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (prefers-contrast: more) {
  .intro, .form-note, .footer-meta, .availability, .document-section p, .document-date, .document-intro { color: #454549; }
  .form-controls input { border-color: #777; background: #fff; }
}
