/* Sunbrief website. The Ember look from the app: always dark, warm light behind, solid cards. */

:root {
  color-scheme: dark;

  /* Colours, taken from the app's Theme.swift */
  --paper: #0b0f1e;
  --card: #151b2e;
  --raised: #1e2540;
  --border: #262e4a;
  --ink: #f4efe9;
  --muted: #b4b2bd;
  --on-cream: #0b0f1e;
  --urgent: #ff8a4c;
  --important: #ffd166;
  --fyi: #8e9bc2;
  --coral: #ff8a4c;
  --rose: #e0457b;
  --violet: #7b5cff;

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: clamp(2.6rem, 1.4rem + 4.6vw, 5.25rem);
  --h2: clamp(2rem, 1.2rem + 3vw, 3.5rem);
  --h3: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  --body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --small: 0.9375rem;

  /* Space */
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2rem);
  --max: 1200px;
  --section: clamp(6rem, 4rem + 8vw, 11rem);
  --radius: 24px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

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

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

body {
  margin: 0;
  min-height: 100svh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection {
  background: var(--rose);
  color: var(--ink);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--on-cream);
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 1rem;
}

/* ---------- The ember glow: two soft lights drifting slowly behind everything ---------- */

.glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.glow::before,
.glow::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  will-change: transform;
}

/* Warm coral and rose, up left */
.glow::before {
  width: 95vmax;
  height: 95vmax;
  left: -40vmax;
  top: -38vmax;
  background: radial-gradient(closest-side, rgb(255 138 76 / 0.42), rgb(224 69 123 / 0.24) 55%, transparent); /* taste-skill-ignore: brand glow */
  animation: drift-a 18s ease-in-out infinite alternate;
}

/* Violet, on the right */
.glow::after {
  width: 75vmax;
  height: 75vmax;
  right: -36vmax;
  top: 22vh;
  background: radial-gradient(closest-side, rgb(123 92 255 / 0.3), transparent); /* taste-skill-ignore: brand glow */
  animation: drift-b 18s ease-in-out infinite alternate;
}

@keyframes drift-a {
  to { transform: translate3d(5vmax, 4vmax, 0); }
}

@keyframes drift-b {
  to { transform: translate3d(-5vmax, -3vmax, 0); }
}

/* ---------- Layout ---------- */

.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section) 0;
}

/* ---------- Header ---------- */

.site-header {
  padding-block: 1.25rem;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 800;
  font-size: 1.1875rem;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.wordmark img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  font-size: var(--small);
  font-weight: 600;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  padding-block: 0.5rem;
  transition: color 0.15s;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
}

.nav a {
  white-space: nowrap;
}

@media (max-width: 480px) {
  .nav .nav-how { display: none; }
}

/* ---------- Buttons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 1.5rem;
  border-radius: 999px;
  border: 0;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.97);
}

/* The main button: cream, the brightest thing on screen */
.btn-cream {
  background: var(--ink);
  color: var(--on-cream);
}

@media (hover: hover) and (pointer: fine) {
  .btn-cream:hover { background: #fffaf4; }
  .btn-solid:hover { background: var(--raised); }
}

.btn-solid {
  background: var(--card);
  color: var(--ink);
}

.soon {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 1.25rem;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(3rem, 2rem + 6vw, 7rem) 0;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 4vw, 3.5rem) clamp(3rem, 6vw, 5rem);
  align-items: start;
}

.hero h1 {
  grid-column: 1 / -1;
  font-size: var(--display);
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.hero .lede {
  margin-top: 0;
  max-width: 34ch;
  font-size: clamp(1.1875rem, 1rem + 0.6vw, 1.4375rem);
  line-height: 1.45;
}

.hero .actions {
  margin-top: 2.25rem;
}

.hero .tagline {
  margin-top: 2.5rem;
  color: var(--muted);
  font-size: var(--body);
}

@media (min-width: 960px) {
  .hero .wrap {
    grid-template-columns: 1fr 440px;
  }
}

/* ---------- The example brief (the one card with the ember edge) ---------- */

.demo {
  position: relative;
  width: 100%;
  max-width: 440px;
  justify-self: center;
}

.demo-count {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.875rem;
  font-size: var(--small);
  color: var(--muted);
}

.deck {
  position: relative;
  display: grid;
}

/* All cards share one grid cell so they stack */
.card {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--card);
  transform-origin: 50% 100%;
  /* The card moving up the stack is on-screen movement: ease-in-out */
  transition: transform 300ms var(--ease-in-out), opacity 300ms ease;
}

.card > * {
  transition: opacity 200ms ease 100ms;
}

.card[hidden],
.all-clear[hidden] {
  display: none;
}

/* Waiting cards show only their edge; their words fade in when they reach the top */
.card.is-next > *,
.card.is-after > * {
  opacity: 0;
  transition-delay: 0ms;
}

/* Cards waiting behind the top one peek out below it */
.card.is-next {
  transform: translateY(14px) scale(0.95);
  opacity: 0.6;
}

.card.is-after {
  transform: translateY(26px) scale(0.9);
  opacity: 0.25;
}

/* The card that matters most right now: solid, with the ember gradient edge */
.card.is-top {
  z-index: 2;
  border: 1.5px solid transparent;
  background:
    linear-gradient(var(--card), var(--card)) padding-box, /* taste-skill-ignore: the app's ember edge, used once */
    linear-gradient(135deg, var(--coral), var(--rose), var(--violet)) border-box; /* taste-skill-ignore */
  box-shadow: 0 10px 44px rgb(224 69 123 / 0.28); /* taste-skill-ignore: the app's warm shadow under the card that matters */
}

/* A leaving card stays above the one moving up behind it */
.card.is-leaving,
.card.is-later {
  z-index: 3;
}

/* Exits are quicker than entrances: the system is responding, not the user deciding */
.card.is-leaving {
  transform: translateX(110%) rotate(6deg);
  opacity: 0;
  transition: transform 220ms var(--ease-out), opacity 220ms ease;
}

.card.is-later {
  transform: translateY(40px) scale(0.9);
  opacity: 0;
  transition: transform 220ms var(--ease-out), opacity 220ms ease;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: var(--small);
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: var(--small);
  font-weight: 700;
  color: #1e1424;
}

.badge-urgent { background: var(--urgent); }
.badge-important { background: var(--important); }
.badge-fyi { background: var(--fyi); }

.card h3 {
  font-size: var(--h3);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.draft {
  padding: 1rem;
  border-radius: 16px;
  background: var(--raised);
  font-size: 1rem;
  line-height: 1.5;
}

.draft-label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: var(--small);
  font-weight: 600;
  color: var(--muted);
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 0.625rem;
}

.card-actions .btn {
  min-height: 48px;
}

.card-actions .btn-solid {
  background: var(--raised);
}

@media (hover: hover) and (pointer: fine) {
  .card-actions .btn-solid:hover { background: #283152; }
}

.all-clear {
  grid-area: 1 / 1;
  position: relative;
  min-height: 380px;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1.5rem;
  background: var(--card) url("img/sunrise.jpg") center 45% / cover no-repeat;
  transition: opacity 300ms ease, transform 300ms var(--ease-out);
}

@starting-style {
  .all-clear {
    opacity: 0;
    transform: scale(0.96);
  }
}

/* A neutral scrim so the words stay readable on the photo */
.all-clear::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgb(11 15 30 / 0.85), rgb(11 15 30 / 0) 65%); /* taste-skill-ignore: scrim over photo */
}

.all-clear > * {
  position: relative;
}

.all-clear h3 {
  font-size: var(--h3);
}

.all-clear .btn {
  margin-top: 0.75rem;
  align-self: flex-start;
}

.demo-status {
  min-height: 1.5em;
  margin-top: 1rem;
  font-size: var(--small);
  color: var(--muted);
  text-align: center;
}

/* ---------- Section headings ---------- */

.section h2 {
  font-size: var(--h2);
  max-width: 16ch;
}

.section .intro {
  margin-top: 1.25rem;
  max-width: 40ch;
  color: var(--muted);
}

/* ---------- Benefits ---------- */

.benefits .wrap {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: center;
}

.benefits figure {
  margin: 0;
}

.benefits figure img {
  width: 100%;
  max-width: 420px;
  margin-inline: auto;
}

.benefit-list {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 2rem;
}

.benefit-list h3 {
  font-size: var(--h3);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.benefit-list p {
  margin-top: 0.5rem;
  max-width: 42ch;
}

@media (min-width: 860px) {
  .benefits .wrap {
    grid-template-columns: 0.9fr 1.1fr;
  }
}

/* ---------- How it works: two lanes, Sunbrief and you ---------- */

.lanes-head {
  display: none;
}

.steps {
  list-style: none;
  margin: 3rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.step {
  padding: 1.375rem 1.5rem;
  border-radius: 20px;
  background: var(--card);
}

.step[data-lane="you"] {
  background: var(--raised);
}

.step-who {
  display: block;
  font-size: var(--small);
  font-weight: 600;
  color: var(--muted);
}

.step h3 {
  margin-top: 0.25rem;
  font-size: var(--h3);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.step p {
  margin-top: 0.375rem;
}

@media (min-width: 860px) {
  .lanes-head {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 3.5rem;
    font-size: var(--h3);
    font-weight: 800;
    letter-spacing: -0.02em;
  }

  .steps {
    margin-top: 1.25rem;
    grid-template-columns: 1fr 1fr;
    column-gap: 1.5rem;
    row-gap: 0.75rem;
  }

  .step[data-lane="you"] { grid-column: 1; }
  .step[data-lane="sunbrief"] { grid-column: 2; }

  /* One row per step, so the hand-off zig-zags between you and Sunbrief */
  .step:nth-child(1) { grid-row: 1; }
  .step:nth-child(2) { grid-row: 2; }
  .step:nth-child(3) { grid-row: 3; }
  .step:nth-child(4) { grid-row: 4; }
  .step:nth-child(5) { grid-row: 5; }

  .step-who {
    position: absolute;
    width: 1px; /* taste-skill-ignore: visually hidden text for screen readers */
    height: 1px; /* taste-skill-ignore */
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* ---------- Privacy promise ---------- */

.promise-panel {
  margin-top: 3rem;
  padding: clamp(1.75rem, 4vw, 3.5rem);
  border-radius: 32px;
  background: var(--card);
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
}

.promise-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2rem;
}

.promise-list h3 {
  font-size: var(--h3);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.promise-list p {
  margin-top: 0.5rem;
  max-width: 38ch;
}

.promise-link {
  font-weight: 700;
}

@media (min-width: 760px) {
  .promise-list {
    grid-template-columns: 1fr 1fr;
    column-gap: 3rem;
    row-gap: 2.5rem;
  }
}

/* ---------- Closing ---------- */

.closing .wrap {
  display: grid;
  gap: 2.5rem;
  align-items: end;
}

.closing h2 {
  font-size: var(--display);
  line-height: 0.95;
  letter-spacing: -0.045em;
  max-width: 13ch;
}

.closing .actions {
  margin-top: 2rem;
}

.closing .tagline {
  margin-top: 1.5rem;
  max-width: 34ch;
  font-size: clamp(1.1875rem, 1rem + 0.6vw, 1.4375rem);
  line-height: 1.45;
}

.closing figure {
  margin: 0;
  border-radius: 32px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.closing figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 48%;
}

@media (min-width: 860px) {
  .closing .wrap {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: var(--section);
  padding-block: 3rem 2.5rem;
  background: rgb(6 9 19 / 0.7);
}

.site-footer .wrap {
  display: grid;
  gap: 1.75rem;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  font-weight: 600;
}

.footer-links a {
  text-decoration: none;
  padding-block: 0.375rem;
}

.footer-links a:hover {
  text-decoration: underline;
}

.fineprint {
  font-size: var(--small);
  color: var(--muted);
}

/* ---------- Text pages: Privacy, Terms, Support ---------- */

.doc {
  padding-block: clamp(2.5rem, 2rem + 4vw, 5rem) 0;
}

.doc .wrap {
  max-width: calc(720px + var(--gutter) * 2);
}

.doc h1 {
  font-size: var(--h2);
  letter-spacing: -0.04em;
}

.doc .updated {
  margin-top: 1rem;
  color: var(--muted);
  font-size: var(--small);
}

.doc .summary {
  margin-top: 2rem;
  font-size: clamp(1.1875rem, 1rem + 0.6vw, 1.375rem);
  line-height: 1.45;
}

.doc h2 {
  margin-top: 3rem;
  font-size: var(--h3);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.doc h2 + p,
.doc p + p {
  margin-top: 0.75rem;
}

.doc ul {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.625rem;
}

.doc li::marker {
  color: var(--muted);
}

.doc .callout {
  margin-top: 3rem;
  padding: 1.5rem;
  border-radius: 20px;
  background: var(--card);
}

.doc .callout h2 {
  margin-top: 0;
}

.contact-card {
  margin-top: 2.5rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: 28px;
  background: var(--card);
}

.contact-card p {
  color: var(--muted);
}

.contact-card .email {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: clamp(1.375rem, 1.1rem + 1.2vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  word-break: break-word;
}

.contact-card .btn {
  margin-top: 1.5rem;
}

.faq {
  margin-top: 1rem;
}

.faq details {
  margin-top: 0.75rem;
  border-radius: 20px;
  background: var(--card);
}

.faq summary {
  position: relative;
  padding: 1.25rem 3.5rem 1.25rem 1.5rem;
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
  border-radius: 20px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--muted);
  transition: transform 0.2s var(--ease-out);
}

.faq details[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

.faq details p {
  padding: 0 1.5rem 1.375rem;
  max-width: 60ch;
}

.faq details[open] p {
  animation: answer-in 200ms var(--ease-out);
}

@keyframes answer-in {
  from { opacity: 0; transform: translateY(-4px); }
}

.not-found {
  min-height: 60vh;
  display: flex;
  align-items: center;
}

.not-found h1 {
  font-size: var(--display);
  letter-spacing: -0.045em;
}

.not-found p {
  margin-top: 1.25rem;
  color: var(--muted);
}

.not-found .btn {
  margin-top: 2rem;
}

/* ---------- Gentle entrance as sections scroll in (only when scripts run) ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 60ms);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- Less motion for people who ask for it ---------- */

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

  .glow::before,
  .glow::after {
    animation: none;
  }

  /* Reduced motion keeps gentle fades and drops movement */
  .js .reveal {
    transform: none;
    transition: opacity 300ms ease;
  }

  .card,
  .card.is-leaving,
  .card.is-later {
    transition: opacity 200ms ease;
  }

  .all-clear {
    transition: opacity 200ms ease;
  }

  .btn:active {
    transform: none;
  }

  .faq summary::after {
    transition: none;
  }

  .faq details[open] p {
    animation: answer-fade 200ms ease;
  }

  @keyframes answer-fade {
    from { opacity: 0; }
  }
}

@media (prefers-reduced-motion: reduce) {
  @starting-style {
    .all-clear { transform: none; }
  }
}

/* Stagger steps for the entrance */
[data-d="1"] { --i: 1; }
[data-d="2"] { --i: 2; }
[data-d="3"] { --i: 3; }
[data-d="4"] { --i: 4; }
