/* Earthshine landing page styles. Dark only. */

:root {
  --sky-1: #070B18;
  --sky-2: #121B3A;
  --sky-3: #1F2D5E;
  --base: #0a0e1a;
  --card: #10162a;
  --heading: #fff8e7;
  --text: #e8dcc8;
  --accent: #9b59b6;
  --border: rgba(255, 248, 231, 0.14);
  --max-width: 1080px;
  --gutter: 16px;
  --radius-lg: 20px;
  --radius-md: 12px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--base);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  overflow-x: hidden;
}

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

a {
  color: var(--heading);
}

h1, h2, h3 {
  color: var(--heading);
  line-height: 1.2;
  margin: 0 0 0.6em;
}

h1 {
  font-size: clamp(2rem, 5vw + 1rem, 3.2rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.5rem, 2.5vw + 1rem, 2.1rem);
}

h3 {
  font-size: 1.1rem;
  margin-bottom: 0.4em;
}

p {
  margin: 0 0 1em;
}

.Wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Skip link */
.SkipLink {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--heading);
  color: var(--base);
  padding: 0.75em 1em;
  z-index: 100;
  border-radius: 0 0 8px 0;
}

.SkipLink:focus {
  left: 0;
}

/* Focus visibility */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Header */
.SiteHeader {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10, 14, 26, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.HeaderInner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

.Brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  color: var(--heading);
  margin-right: auto;
}

.Brand img {
  border-radius: 8px;
}

.SiteNav {
  display: none;
}

.SiteNav a {
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
}

@media (min-width: 640px) {
  .SiteNav {
    display: block;
  }
}

.HeaderCta {
  font-size: 0.9rem;
  padding: 0.6em 1.1em;
}

/* Buttons */
.Btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.75em 1.4em;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid transparent;
  cursor: pointer;
}

.Btn-primary {
  background: #f0e6d3;
  color: #0a0e1a;
}

.Btn-primary:hover {
  background: #fff8e7;
}

.Btn-secondary {
  background: transparent;
  color: var(--heading);
  border-color: var(--border);
}

.Btn-secondary:hover {
  border-color: var(--heading);
}

.CtaRow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Hero */
.Hero {
  position: relative;
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 55%, var(--sky-3) 100%);
  padding: 3rem 0 3.5rem;
  overflow: hidden;
}

.Stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 20%, #fff8e7 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 80% 15%, #fff8e7 50%, transparent 51%),
    radial-gradient(1px 1px at 40% 10%, #e8dcc8 50%, transparent 51%),
    radial-gradient(1px 1px at 60% 30%, #e8dcc8 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 25% 45%, #fff8e7 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 40%, #e8dcc8 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 70% 5%, #fff8e7 50%, transparent 51%),
    radial-gradient(1px 1px at 15% 8%, #e8dcc8 50%, transparent 51%);
  opacity: 0.7;
}

@media (prefers-reduced-motion: no-preference) {
  .Stars {
    animation: Twinkle 6s ease-in-out infinite;
  }

  @keyframes Twinkle {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 0.9; }
  }
}

.HeroInner {
  position: relative;
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

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

.Subhead {
  font-size: 1.15rem;
  max-width: 42ch;
}

.Definition {
  max-width: 46ch;
  opacity: 0.9;
}

.HeroVisual {
  display: flex;
  justify-content: center;
  position: relative;
}

.HeroVisual::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 248, 231, 0.22), rgba(155, 89, 182, 0.12) 60%, transparent 72%);
  filter: blur(18px);
  z-index: 0;
}

.PhoneFrame {
  width: min(300px, 78vw);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
  padding: 8px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
  position: relative;
  z-index: 1;
}

.PhoneFrame img {
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius-lg) - 6px);
}

/* Sections */
.Section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--border);
}

.Section h2 {
  margin-bottom: 1.3rem;
}

/* How it works */
.StepGrid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
  counter-reset: step;
}

@media (min-width: 720px) {
  .StepGrid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.Step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  counter-increment: step;
}

.Step h3::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8em;
  height: 1.8em;
  border-radius: 50%;
  background: var(--accent);
  color: #fff8e7;
  font-size: 0.85rem;
  margin-right: 0.5em;
}

/* Features: alternating rows, screenshot beside text */
.FeatureRow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  margin-bottom: 3rem;
}

.FeatureRow:last-of-type {
  margin-bottom: 2.5rem;
}

@media (min-width: 720px) {
  .FeatureRow {
    flex-direction: row;
  }

  .FeatureRow-reverse {
    flex-direction: row-reverse;
  }
}

.FeatureRowText {
  flex: 1;
}

.FeatureRowText p:last-child {
  margin-bottom: 0;
}

.FeatureRowVisual {
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

/* Features: remaining text-only items, compact cards */
.FeatureMiniGrid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .FeatureMiniGrid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.FeatureMini {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
}

.FeatureMini p:last-child {
  margin-bottom: 0;
}

/* Glance */
.Glance dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem 1.2rem;
  margin: 0;
}

.Glance dt {
  color: var(--heading);
  font-weight: 600;
}

.Glance dd {
  margin: 0;
}

/* FAQ */
.FaqItem {
  border-bottom: 1px solid var(--border);
}

.FaqItem details {
  padding: 1rem 0;
}

.FaqItem summary {
  cursor: pointer;
  list-style: none;
}

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

.FaqItem summary h3 {
  display: inline;
  font-size: 1.05rem;
}

.FaqItem summary::after {
  content: '+';
  float: right;
  color: var(--accent);
  font-size: 1.3rem;
  line-height: 1;
}

.FaqItem details[open] summary::after {
  content: '\2212';
}

.FaqItem p {
  margin-top: 0.8rem;
  margin-bottom: 0;
}

/* Final CTA */
.FinalCta {
  text-align: center;
  background: var(--card);
}

.FinalCta .Btn {
  margin-top: 0.5rem;
}

/* Footer */
.SiteFooter {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
}

.FooterInner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
}

.FooterNav {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.FooterNav a {
  text-decoration: none;
  font-size: 0.9rem;
}

.FooterCopy {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.7;
}

/* 404 page */
.NotFound {
  min-height: 70vh;
  display: flex;
  align-items: center;
}

.NotFound .Wrap {
  text-align: center;
}


/* Motion */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  html.js .Reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  }

  html.js .Reveal.is-visible {
    opacity: 1;
    transform: none;
  }

  html.js .Reveal .Stagger > * {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  }

  html.js .Reveal.is-visible .Stagger > * {
    opacity: 1;
    transform: none;
  }

  html.js .Reveal.is-visible .Stagger > :nth-child(2) { transition-delay: 0.08s; }
  html.js .Reveal.is-visible .Stagger > :nth-child(3) { transition-delay: 0.16s; }
  html.js .Reveal.is-visible .Stagger > :nth-child(4) { transition-delay: 0.24s; }
  html.js .Reveal.is-visible .Stagger > :nth-child(5) { transition-delay: 0.32s; }
  html.js .Reveal.is-visible .Stagger > :nth-child(6) { transition-delay: 0.4s; }

  .HeroText > * {
    animation: RiseIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .HeroText > :nth-child(2) { animation-delay: 0.08s; }
  .HeroText > :nth-child(3) { animation-delay: 0.16s; }
  .HeroText > :nth-child(4) { animation-delay: 0.24s; }
  .HeroText > :nth-child(5) { animation-delay: 0.32s; }
  .HeroText > :nth-child(6) { animation-delay: 0.4s; }

  .HeroVisual {
    animation: RiseIn 1s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
  }

  .FaqItem[open] p {
    animation: FadeIn 0.35s ease both;
  }

  @keyframes RiseIn {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
  }

  @keyframes FadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
  }
}

.Btn {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s cubic-bezier(0.22, 1, 0.36, 1), background 0.25s ease, border-color 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}

.Btn:hover {
  transform: translateY(-2px);
}

.Btn-primary:hover {
  box-shadow: 0 10px 24px color-mix(in srgb, var(--heading) 35%, transparent);
}

.Btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.FaqItem summary::after {
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.FaqItem[open] summary::after,
.FaqItem details[open] summary::after {
  content: "+";
  transform: rotate(45deg);
}

.Step, .FeatureMini {
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s ease;
}

.Step:hover, .FeatureMini:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.1);
}

.PhoneFrame {
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.PhoneFrame:hover {
  transform: translateY(-6px);
}

/* App Store CTA */

.AppStoreBtn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 20px 8px 14px;
  background: #000;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  text-decoration: none;
  line-height: 1.05;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s cubic-bezier(0.22, 1, 0.36, 1), background 0.25s ease;
}

.AppStoreBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
  background: #111;
}

.AppStoreBtn:active {
  transform: translateY(0);
  box-shadow: none;
}

.AppStoreBtn-logo {
  flex-shrink: 0;
}

.AppStoreBtn-text {
  display: flex;
  flex-direction: column;
}

.AppStoreBtn-small {
  font-size: 0.7rem;
  letter-spacing: 0.01em;
  opacity: 0.9;
}

.AppStoreBtn-big {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.CtaNote {
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: color-mix(in srgb, var(--text) 72%, transparent);
}

.Section-finalCta .CtaNote,
.FinalCta .CtaNote {
  margin-top: 14px;
}

/* Developer credit */

.Footer-credit {
  margin: 0;
  font-size: 0.9rem;
}

.Footer-credit a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.Footer-credit a:hover {
  color: var(--heading);
}

.Btn-primary:hover {
  box-shadow: 0 0 0 4px rgba(255, 248, 231, 0.12), 0 12px 28px rgba(0, 0, 0, 0.45);
}

.AppStoreBtn {
  border-color: rgba(255, 248, 231, 0.32);
}

.Step:hover,
.FeatureMini:hover {
  border-color: rgba(255, 248, 231, 0.28);
}
