/* foreglow.net. Design language from the app (docs/foreglow-design.md):
   night canvas with light as its subject, Forecast's fixed sky drift, SF Pro, ivory ink,
   orange only for light. No web fonts, no external requests. */

:root {
  --ground: #081640;
  --skyA: #0C1E5A;
  --skyB: #24418F;
  --night: #031633;
  --ivory: #F5F4F0;
  --ink-2: rgba(245, 244, 240, 0.78);
  --ink-3: rgba(245, 244, 240, 0.62);
  --sand: #FFD6A6;
  --orange: #FF8A00;
  --hair: rgba(245, 244, 240, 0.12);
  --card: rgba(3, 22, 51, 0.42);
  --radius: 22px;
  --pad: 20px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  color: var(--ivory);
  font: 400 17px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Sky: two colour masses, two blobs each, turning once every 28 s with a breath to 1.08,
   under a ground veil at 20 percent (section 6a, SkyPalette.forecastFixed). */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--ground); }
.drift {
  position: absolute; inset: -20%;
  animation: turn 28s linear infinite;
  will-change: transform;
}
.drift i { position: absolute; border-radius: 50%; filter: blur(90px); }
.drift .a1 { width: 60%; height: 60%; left: 2%; top: 8%; background: var(--skyA); }
.drift .a2 { width: 50%; height: 50%; left: 48%; top: 48%; background: var(--skyA); }
.drift .b1 { width: 55%; height: 55%; left: 45%; top: 2%; background: var(--skyB); }
.drift .b2 { width: 45%; height: 45%; left: 6%; top: 52%; background: var(--skyB); }
.veil { position: absolute; inset: 0; background: rgba(8, 22, 64, 0.2); }
@keyframes turn {
  0%   { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(180deg) scale(1.08); }
  100% { transform: rotate(360deg) scale(1); }
}

a { color: var(--sand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff; }
a:focus-visible { outline: 2px solid var(--sand); outline-offset: 3px; border-radius: 6px; }

/* Header and footer */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; max-width: 1080px; margin: 0 auto; padding: 22px var(--pad);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ivory); text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.brand-glyph { width: 30px; height: 30px; }
.nav { display: flex; gap: 22px; font-size: 15px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ivory); color: #20130A; padding: 8px 14px; border-radius: 10px; z-index: 10; }
.skip:focus { left: 12px; }
.nav a, .foot a { color: var(--ink-2); text-decoration: none; }
.nav a:hover, .foot a:hover { color: var(--ivory); }

.foot { width: 100%; max-width: 1080px; margin: 0 auto; padding: 48px var(--pad) 40px; color: var(--ink-3); font-size: 14px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 10px; }
.foot p { margin: 0; }
.foot p a { color: inherit; }

main { flex: 1; width: 100%; margin: 0 auto; padding: 0 var(--pad); }
main.wide { max-width: 1080px; }
main.doc { max-width: 720px; padding-top: 24px; }

/* Landing */
h1, h2, h3 { text-wrap: balance; }
.lede, .sub, .card p, .feature-text p { text-wrap: pretty; }

.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: center; gap: 48px; padding: 40px 0 72px; }
.hero.center { display: block; text-align: center; padding-top: 72px; }
.hero.center .hero-glyph { margin-left: auto; margin-right: auto; }
.hero.center .lede { margin: 0 auto; }
.hero-glyph { width: 104px; height: 104px; margin: 0 0 28px -6px; }
.hero-figure { width: 100%; height: 100%; display: block; }
.eyebrow, .kicker { margin: 0 0 12px; color: var(--sand); font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
h1 { margin: 0 0 20px; font-size: clamp(38px, 5.4vw, 62px); line-height: 1.03; font-weight: 700; letter-spacing: -0.022em; }
.doc h1 { font-size: clamp(32px, 5vw, 40px); margin-bottom: 24px; }
.lede { margin: 0; max-width: 30em; color: var(--ink-2); font-size: clamp(18px, 1.6vw, 21px); line-height: 1.45; }
.cta { margin-top: 32px; display: flex; }
.hero-shot { display: flex; justify-content: center; }

/* Device images: screenshots composited into Apple's official product bezels (transparent WebP). */
.phone { width: min(310px, 74vw); filter: drop-shadow(0 36px 44px rgba(0, 0, 0, 0.45)); }
.phone img, .watch img { display: block; width: 100%; height: auto; }
.watch { width: min(250px, 60vw); filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.45)); }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 8px; }
.shot { margin: 0; display: flex; flex-direction: column; align-items: center; }
.shot .phone { width: min(290px, 100%); }
.shot figcaption { margin-top: 24px; text-align: center; max-width: 280px; }
.shot h3 { margin: 0 0 6px; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.shot p { margin: 0; color: var(--ink-2); font-size: 16px; text-wrap: pretty; }

.badge-placeholder {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 22px 10px 16px; border-radius: 14px;
  border: 1px solid rgba(245, 244, 240, 0.35); background: rgba(0, 0, 0, 0.35);
  color: var(--ivory); font-size: 21px; font-weight: 600; line-height: 1.05; text-align: left;
}
.badge-placeholder svg { width: 26px; height: 26px; }
.badge-placeholder small { display: block; font-size: 11px; font-weight: 500; color: var(--ink-2); letter-spacing: 0.01em; }

.block { padding: 40px 0; }
.block > h2, .feature-text h2 { margin: 0 0 12px; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.08; font-weight: 700; letter-spacing: -0.018em; }
.sub { margin: 0 0 28px; max-width: 38em; color: var(--ink-2); font-size: 18px; }
.sub.after { margin: 20px 0 0; font-size: 16px; color: var(--ink-3); }

.points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.points.two { grid-template-columns: repeat(2, 1fr); margin-top: 24px; }
.card {
  background: var(--card);
  -webkit-backdrop-filter: blur(24px) saturate(1.1); backdrop-filter: blur(24px) saturate(1.1);
  border: 1px solid var(--hair); border-radius: var(--radius); padding: 22px var(--pad);
}
.points h3 { margin: 0 0 8px; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.points p { margin: 0; color: var(--ink-2); font-size: 16px; }
.points .kicker { margin-bottom: 8px; font-size: 12px; }

.feature { display: grid; grid-template-columns: 0.9fr 1.1fr; align-items: center; gap: 56px; padding: 56px 0; }
.feature.flip .feature-shot { order: 2; }
.feature-shot { display: flex; justify-content: center; }
.feature-text p { margin: 0; max-width: 30em; color: var(--ink-2); font-size: 18px; }

.privacy-line a { white-space: nowrap; }
.faq { max-width: 760px; }
.qa { padding: 20px 0; border-top: 1px solid var(--hair); }
.qa:last-child { border-bottom: 1px solid var(--hair); }
.qa h3 { margin: 0 0 6px; font-size: 19px; font-weight: 600; letter-spacing: -0.005em; }
.qa p { margin: 0; color: var(--ink-2); font-size: 16px; }

.closing { text-align: center; padding: 64px 0 24px; }
.closing .cta { justify-content: center; margin-top: 24px; }
.fine { margin: 18px 0 0; font-size: 14px; color: var(--ink-3); }

/* Documents */
.prose { padding: 26px 24px; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h2 { font-size: 20px; font-weight: 700; margin: 30px 0 8px; letter-spacing: -0.01em; }
.prose h3 { font-size: 17px; font-weight: 600; margin: 22px 0 4px; }
.prose p, .prose li { color: rgba(245, 244, 240, 0.88); font-size: 16px; }
.prose p { margin: 0 0 12px; }
.prose ul { padding-left: 20px; margin: 0 0 12px; }
.prose li { margin-bottom: 8px; }
.prose strong { color: var(--ivory); }
.prose .meta { color: var(--ink-3); font-size: 14px; }
.prose .mail { font-size: 20px; font-weight: 600; margin: 4px 0 16px; }
.prose a { overflow-wrap: anywhere; }
.lang { margin: 0 0 8px; font-size: 14px; }
h2.sub-h { font-size: 22px; margin: 36px 0 12px; }
.lang-note { color: var(--ink-3); font-size: 14px; margin-top: 16px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding: 16px 0 48px; text-align: center; }
  .hero-glyph { margin: 0 auto 24px; width: 92px; height: 92px; }
  .lede { margin: 0 auto; }
  .cta { justify-content: center; }
  .points, .points.two { grid-template-columns: 1fr; }
  .feature, .feature.flip { grid-template-columns: 1fr; gap: 32px; padding: 40px 0; }
  .feature .feature-shot, .feature.flip .feature-shot { order: 2; }
  .block { padding: 32px 0; }
  .gallery { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; margin: 8px calc(-1 * var(--pad)) 0; padding: 4px var(--pad) 16px; scroll-padding: 0 var(--pad); scrollbar-width: none; }
  .gallery::-webkit-scrollbar { display: none; }
  .shot { flex: 0 0 min(72vw, 280px); scroll-snap-align: center; }
  .shot .phone { width: 100%; }
  .drift i { filter: blur(60px); }
}

@media (prefers-reduced-motion: reduce) {
  .drift { animation: none; }
}
