/* Umber website: the app's own dark look.
   Colors come from Shared/TideTheme.swift in the app. Teal is Focus, violet is Sleep.
   Fonts: the system font, like the app (SF Pro on Apple devices), so nothing loads
   from a font service. */

:root {
  color-scheme: dark;

  /* Backgrounds */
  --abyss: #04060B;
  --deep: #0B101B;
  --raised: #0E1524;
  --card-border: #172036;
  --line: #1D2A40;
  --chip: #131B2C;

  /* Text */
  --mist: #EAF1FF;
  --body: #A5B1C8;
  --slate: #8D9AB3;
  --faint: #6F7C95;

  /* Focus (teal) */
  --lagoon: #34E3C4;
  --sky: #4FA6FF;
  --lagoon-ink: #03221C;

  /* Sleep (violet) */
  --dusk: #8B7BFF;
  --dusk-end: #B08CFF;
  --dusk-label: #A99DFF;
  --dusk-ink: #0A0820;

  --focus-gradient: linear-gradient(135deg, var(--lagoon), var(--sky));
  --sleep-gradient: linear-gradient(135deg, var(--dusk), var(--dusk-end));

  --radius: 22px;
  --max: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--abyss);
  color: var(--body);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--lagoon); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--mist); }

h1, h2, h3 { color: var(--mist); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.3rem, 7vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 4.5vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
strong { color: var(--mist); font-weight: 600; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; z-index: 10; background: var(--mist); color: var(--abyss); padding: 8px 12px; border-radius: 8px; }

/* Small spaced capitals, like the app's labels */
.caps {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--slate);
}
.caps.focus { color: var(--lagoon); }
.caps.sleep { color: var(--dusk-label); }

/* ---------- Nav ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 5;
  background: rgba(4, 6, 11, .82);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--card-border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--mist); text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.nav-links { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; font-size: 15px; }
.nav-links a { color: var(--slate); text-decoration: none; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--mist); }

/* ---------- Buttons and badge ---------- */
.appstore-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-radius: 14px;
  background: var(--mist); color: var(--abyss);
  font-weight: 600; font-size: 16px; text-decoration: none;
}
.appstore-badge svg { width: 22px; height: 22px; }
.appstore-badge.is-disabled { background: var(--chip); color: var(--mist); border: 1px solid var(--line); cursor: default; }
.appstore-badge .badge-small { display: block; font-size: 11px; font-weight: 500; color: var(--slate); letter-spacing: .02em; line-height: 1.2; }
.appstore-badge .badge-big { display: block; line-height: 1.25; }

.btn {
  display: inline-block; padding: 13px 22px; border-radius: 999px;
  font-weight: 600; font-size: 16px; text-decoration: none; text-align: center;
}
.btn-focus { background: var(--focus-gradient); color: var(--lagoon-ink); }
.btn-focus:hover { color: var(--lagoon-ink); filter: brightness(1.08); }
.btn-ghost { border: 1px solid var(--line); color: var(--mist); background: var(--chip); }
.btn-ghost:hover { border-color: var(--slate); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 64px 0 40px; text-align: center; overflow: hidden; }
.hero::before, .hero::after {
  content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%;
  filter: blur(90px); opacity: .28; z-index: -1; pointer-events: none;
}
.hero::before { background: var(--lagoon); left: 50%; top: -260px; transform: translateX(-95%); }
.hero::after { background: var(--dusk); left: 50%; top: -220px; transform: translateX(-5%); }
.hero-icon { width: 112px; height: 112px; border-radius: 25px; margin: 0 auto 24px; box-shadow: 0 18px 50px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.06); }
.hero h1 span { background: linear-gradient(100deg, var(--lagoon), var(--sky) 45%, var(--dusk) 70%, var(--dusk-end)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lede { font-size: clamp(1.05rem, 2.6vw, 1.25rem); max-width: 620px; margin: 0 auto 28px; color: var(--body); }
.hero-ctas { display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; }
.trust { margin-top: 22px; font-size: 14px; color: var(--slate); }
.trust span { white-space: nowrap; display: inline-block; }
.trust span + span::before { content: "·"; margin: 0 8px; color: var(--faint); }

/* ---------- Screenshots ---------- */
.shots { padding: 24px 0 56px; }
.shot-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 280px)); gap: 40px;
  justify-content: center; align-items: start;
}
.shot { margin: 0; text-align: center; }
.shot .frame {
  border-radius: 34px; padding: 8px; background: #11161f;
  border: 1px solid #222b3b;
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
}
.shot img { border-radius: 27px; width: 100%; aspect-ratio: 1320 / 2868; object-fit: cover; background: var(--deep); }
.shot.watch .frame { border-radius: 30%; padding: 10px; max-width: 200px; margin: 0 auto; }
.shot.watch img { border-radius: 24%; aspect-ratio: 416 / 496; }
.shot figcaption { margin-top: 12px; font-size: 14px; color: var(--slate); }
.shot-note { text-align: center; font-size: 13px; color: var(--faint); margin-top: 18px; }

/* ---------- Sections ---------- */
section { padding: 56px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.section-head p { color: var(--body); }

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.mode-card {
  position: relative; padding: 28px; border-radius: var(--radius);
  background: var(--deep); border: 1px solid var(--card-border); overflow: hidden;
}
.mode-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
}
.mode-card.focus::before { background: var(--focus-gradient); }
.mode-card.sleep::before { background: var(--sleep-gradient); }
.mode-card.sleep { background: linear-gradient(180deg, #120f2e 0%, var(--deep) 60%); border-color: #221d4a; }
.mode-card.focus { background: linear-gradient(180deg, #071c1d 0%, var(--deep) 60%); border-color: #12313a; }
.mode-card h3 { font-size: 1.5rem; margin-top: 8px; }
.mode-card ul { margin: 0; padding-left: 20px; }
.mode-card li { margin-bottom: 6px; }
.mode-card.focus li::marker { color: var(--lagoon); }
.mode-card.sleep li::marker { color: var(--dusk-label); }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature {
  padding: 24px; border-radius: var(--radius);
  background: var(--deep); border: 1px solid var(--card-border);
}
.feature p { margin: 0; font-size: 16px; }
.feature .icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--chip); border: 1px solid var(--line); margin-bottom: 14px; color: var(--lagoon);
}
.feature .icon.violet { color: var(--dusk-label); }
.feature .icon svg { width: 22px; height: 22px; }
.tag {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .06em;
  padding: 2px 8px; border-radius: 999px; vertical-align: middle; margin-left: 6px;
  color: var(--mist); background: linear-gradient(135deg, rgba(52,227,196,.18), rgba(139,123,255,.25));
  border: 1px solid #2a3552;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { font-size: 13px; padding: 4px 11px; border-radius: 999px; background: var(--chip); border: 1px solid var(--line); color: var(--mist); }

.private {
  border-radius: 28px; padding: 40px 28px; text-align: center;
  background: radial-gradient(120% 140% at 50% 0%, #0f1a2c 0%, var(--deep) 60%);
  border: 1px solid var(--card-border);
}
.private p { max-width: 620px; margin: 0 auto 1em; }

.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.plan { padding: 26px; border-radius: var(--radius); background: var(--deep); border: 1px solid var(--card-border); }
.plan.plus { border-color: #2a3552; background: linear-gradient(160deg, rgba(52,227,196,.07), rgba(139,123,255,.10) 60%, var(--deep)); }
.plan ul { margin: 0; padding-left: 20px; }
.plan li { margin-bottom: 6px; }

.closing { text-align: center; }

/* ---------- Text pages (privacy, support) ---------- */
.page-header { padding: 56px 0 24px; }
.page-header .container, .prose { max-width: 760px; }
.page-sub { font-size: 1.15rem; color: var(--body); }
.page-meta { font-size: 14px; color: var(--faint); }
.prose { margin: 0 auto; padding-bottom: 56px; }
.prose h2 { font-size: 1.4rem; margin-top: 2em; }
.prose h3 { margin-top: 1.6em; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.callout {
  padding: 20px 22px; border-radius: 18px; margin: 8px 0 24px;
  background: var(--deep); border: 1px solid var(--card-border); border-left: 3px solid var(--lagoon);
}
.callout.violet { border-left-color: var(--dusk); }
.callout p:last-child { margin-bottom: 0; }

.contact-form {
  padding: 26px; border-radius: var(--radius); margin: 8px 0 32px;
  background: var(--deep); border: 1px solid var(--card-border);
  scroll-margin-top: 80px;
}
.contact-form h2 { margin: 0 0 4px; font-size: 1.3rem; }
.contact-form > p { font-size: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 14px; font-weight: 600; color: var(--mist); margin-bottom: 6px; }
.field em { font-style: normal; font-weight: 400; color: var(--faint); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--mist);
  background: var(--chip); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 13px; outline: none;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--lagoon); box-shadow: 0 0 0 3px rgba(52,227,196,.18); }
.contact-form .btn { border: 0; cursor: pointer; font-family: inherit; }
.form-note { margin: 12px 0 0; font-size: 13px; color: var(--faint); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

details {
  border: 1px solid var(--card-border); background: var(--deep);
  border-radius: 16px; padding: 0 20px; margin-bottom: 12px;
}
details[open] { padding-bottom: 6px; }
summary {
  cursor: pointer; list-style: none; padding: 18px 28px 18px 0; position: relative;
  color: var(--mist); font-weight: 600;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  font-size: 22px; font-weight: 400; color: var(--slate);
}
details[open] summary::after { content: "−"; }
details p, details ol, details ul { font-size: 16px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--card-border); padding: 32px 0 40px; font-size: 14px; color: var(--faint); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; }
.footer-links a { color: var(--slate); text-decoration: none; }
.footer-links a:hover { color: var(--mist); }
.site-footer p { margin: 0; }

/* ---------- Phones ---------- */
@media (max-width: 860px) {
  .features { grid-template-columns: 1fr 1fr; }
  .shot-row {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 16px;
    padding: 0 20px 12px; margin: 0 -20px; scrollbar-width: none;
  }
  .shot-row::-webkit-scrollbar { display: none; }
  .shot { flex: 0 0 62%; max-width: 280px; scroll-snap-align: center; }
  .shot:first-child { margin-left: auto; }
  .shot:last-child { margin-right: auto; }
  .shot.watch { flex-basis: 48%; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav-links { gap: 16px; font-size: 14px; }
  .nav-links .hide-sm { display: none; }
  .hero { padding: 44px 0 28px; }
  .hero-icon { width: 92px; height: 92px; border-radius: 21px; }
  .modes, .features, .plans, .field-row { grid-template-columns: 1fr; }
  .contact-form { padding: 20px; }
  section { padding: 44px 0; }
  .mode-card, .feature, .plan { padding: 22px; }
  .private { padding: 32px 20px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
