/* Hallmark · route: custom (tuned) · macrostructure: Narrative Workflow · theme: Astral ritual
 * paper: oklch(12% 0.014 52) · accent: oklch(69% 0.088 76) · display: Playfair Display · body: Inter
 * axes: dark literary / roman editorial serif / antique gold · gates: all-pass
 */

html { background: var(--ap-ink); }

body {
  background: var(--ap-ink);
  color: var(--ap-paper);
  font-family: var(--ap-font-sans);
}

body::selection {
  background: var(--ap-gold);
  color: var(--ap-ink);
}

#starfield {
  opacity: 0.1;
}

.orb { display: none; }

:focus-visible {
  outline: 2px solid var(--ap-gold-bright);
  outline-offset: 4px;
}

body > nav {
  position: fixed;
  inset: var(--ap-space-md) auto auto 50%;
  z-index: 30;
  width: var(--ap-page);
  min-height: 60px;
  display: grid;
  grid-template-columns: minmax(164px, 1fr) auto minmax(164px, 1fr);
  gap: var(--ap-space-md);
  padding: 0 var(--ap-space-md);
  border: 1px solid var(--ap-line);
  border-radius: var(--ap-radius);
  background: color-mix(in oklch, var(--ap-ink) 92%, transparent);
  box-shadow: 0 18px 42px var(--ap-shadow);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.nav-logo {
  gap: var(--ap-space-xs);
  color: var(--ap-paper);
  font-family: var(--ap-font-display);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 0;
}

.nav-logo svg { width: 24px; height: 24px; color: var(--ap-gold); }
.nav-logo svg path[stroke] { stroke: var(--ap-paper); }
.nav-logo svg circle { fill: var(--ap-paper); }

.nav-links {
  gap: clamp(var(--ap-space-sm), 2vw, var(--ap-space-lg));
}

.nav-links a,
.footer-links a {
  color: var(--ap-paper-muted);
  font-family: var(--ap-font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.nav-links a:hover,
.footer-links a:hover { color: var(--ap-gold-bright); }

.lang-trigger {
  min-height: 40px;
  gap: var(--ap-space-xs);
  padding: 0 var(--ap-space-xs);
  border-color: var(--ap-line-strong);
  border-radius: 6px;
  background: var(--ap-ink-raised);
  color: var(--ap-paper);
  font-family: var(--ap-font-sans);
  font-size: 12px;
}

.lang-trigger:hover,
.lang-picker.open .lang-trigger {
  border-color: var(--ap-gold);
  background: var(--ap-ink-soft);
}

.lang-dropdown {
  border-color: var(--ap-line-strong);
  border-radius: var(--ap-radius);
  background: var(--ap-ink-raised);
  box-shadow: 0 20px 48px var(--ap-shadow);
}

.lang-item {
  border-radius: 5px;
  color: var(--ap-paper-muted);
  font-family: var(--ap-font-sans);
}

.lang-item:hover,
.lang-item.active { background: var(--ap-ink-soft); color: var(--ap-paper); }

#hero {
  min-height: 100svh;
  display: block;
  /* Keep the fixed navigation clear; retain 20% of the previous 230px gap. */
  padding: calc(60px + var(--ap-space-md) + 46px) 0 var(--ap-space-xl);
  border-bottom: 1px solid var(--ap-line);
}

.hero-inner {
  width: var(--ap-page);
  min-height: min(760px, calc(100svh - 150px));
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(360px, 1.18fr);
  grid-template-rows: 1fr auto;
  gap: var(--ap-space-xl);
  align-items: stretch;
  margin: 0 auto;
  padding-top: 0;
}

.hero-copy {
  max-width: 520px;
  align-self: start;
  padding: 0 0 var(--ap-space-xl);
}

.hero-kicker,
.section-label {
  margin: 0 0 var(--ap-space-md);
  color: var(--ap-gold);
  font-family: var(--ap-font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.4;
  text-transform: uppercase;
}

.hero-headline {
  max-width: 8ch;
  color: var(--ap-paper);
  font-family: var(--ap-font-display);
  font-size: clamp(58px, 6.6vw, 108px);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 0.94;
}

.hero-rule {
  width: min(100%, 460px);
  height: 28px;
  display: flex;
  align-items: center;
  margin: var(--ap-space-md) 0;
}

.hero-rule::before,
.hero-rule::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--ap-line-strong);
}

.hero-rule-star {
  width: 28px;
  height: 28px;
  display: block;
  flex: 0 0 28px;
  padding: var(--ap-space-2xs);
  color: var(--ap-gold);
}

.hero-rule-star svg { width: 100%; height: 100%; }
.hero-rule-star svg path[stroke] { stroke: var(--ap-paper); }

.hero-sub {
  max-width: 47ch;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--ap-paper-muted);
  font-size: 17px;
  line-height: 1.75;
}

.cta-group {
  gap: var(--ap-space-xs);
  margin-top: var(--ap-space-lg);
}

.btn-store,
.badge-btn {
  min-height: 54px;
  gap: var(--ap-space-xs);
  padding: var(--ap-space-xs) var(--ap-space-sm);
  border-color: var(--ap-line-strong);
  border-radius: var(--ap-radius);
  background: var(--ap-ink-raised);
  color: var(--ap-paper);
  box-shadow: none;
}

.btn-store:hover,
.badge-btn:hover {
  border-color: var(--ap-gold-bright);
  background: var(--ap-oxblood-deep);
  color: var(--ap-paper);
  transform: translateY(-2px);
}

.btn-store-ios,
.badge-btn-primary { border-color: var(--ap-line-strong); }
.btn-store-primary { border-color: var(--ap-gold); }
.btn-store-secondary,
.badge-btn-secondary { border-color: var(--ap-paper-muted); }
.btn-store-label small,
.badge-label small { color: var(--ap-paper-muted); }
.btn-store-label strong,
.badge-label strong { color: var(--ap-paper); }

.hero-visual {
  min-height: 560px;
  align-self: stretch;
  overflow: hidden;
  border: 1px solid var(--ap-line);
  border-radius: 0;
  box-shadow: none;
}

.hero-art {
  width: 100%;
  height: 100%;
  object-position: 58% center;
}

.scroll-hint {
  grid-column: 1 / -1;
  height: var(--ap-space-xl);
  align-items: end;
}

.scroll-line { height: var(--ap-space-lg); background: var(--ap-gold); }

.container { width: var(--ap-page); }

.section-pad,
#journal { padding: var(--ap-space-3xl) 0; }

.section-title {
  max-width: 11ch;
  color: var(--ap-paper);
  font-family: var(--ap-font-display);
  font-size: clamp(42px, 5vw, 76px);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.02;
}

.section-subtitle {
  max-width: 60ch;
  margin-top: var(--ap-space-md);
  color: var(--ap-paper-muted);
  font-size: 17px;
  line-height: 1.75;
}

#features {
  border-bottom: 1px solid var(--ap-line);
  background: var(--ap-ink-raised);
}

.features-layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0 var(--ap-space-md);
}

.features-layout .features-header {
  grid-column: 1 / span 8;
  max-width: 760px;
  margin: 0 0 var(--ap-space-xl);
  padding: 0 0 var(--ap-space-lg);
  border-bottom: 1px solid var(--ap-line-strong);
}

.features-layout .features-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  counter-reset: feature;
  border-top: 1px solid var(--ap-line);
}

.feature-card {
  min-height: 174px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  column-gap: var(--ap-space-md);
  padding: var(--ap-space-lg) var(--ap-space-lg) var(--ap-space-lg) 0;
  border-top: 0;
  border-right: 1px solid var(--ap-line);
  border-bottom: 1px solid var(--ap-line);
  counter-increment: feature;
  opacity: 1;
  transform: none;
  transition: background-color var(--ap-duration) var(--ap-ease), color var(--ap-duration) var(--ap-ease);
}

.feature-card:nth-child(even) {
  padding-right: 0;
  padding-left: var(--ap-space-lg);
  border-right: 0;
}

.feature-card::before {
  position: static;
  content: "0" counter(feature);
  color: var(--ap-gold);
  font-family: var(--ap-font-display);
  font-size: 31px;
  line-height: 1;
}

.feature-card:hover { background: var(--ap-ink-soft); }
.feature-icon { display: none; }

.feature-card h3 {
  margin: 0;
  color: var(--ap-paper);
  font-family: var(--ap-font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.18;
}

.feature-card p {
  grid-column: 2;
  max-width: 41ch;
  margin: var(--ap-space-xs) 0 0;
  color: var(--ap-paper-muted);
  font-size: 14px;
  line-height: 1.7;
}

.features-visual {
  grid-column: 1 / -1;
  grid-row: auto;
  min-height: 0;
  aspect-ratio: 19 / 7;
  margin-top: var(--ap-space-xl);
  overflow: hidden;
  border: 1px solid var(--ap-line);
  background: var(--ap-ink);
  box-shadow: none;
}

.features-visual img { object-position: 50% 43%; }

#how-it-works {
  border-bottom: 1px solid var(--ap-line);
  background: var(--ap-ink);
}

.how-layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--ap-space-xl) var(--ap-space-md);
}

.how-layout > div:first-child {
  grid-column: 1 / span 7;
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--ap-space-md);
  margin-top: var(--ap-space-xl);
  border-top: 2px solid var(--ap-gold);
}

.how-step {
  min-height: 214px;
  display: block;
  padding: var(--ap-space-md) 0 0;
  border: 0;
  border-right: 1px solid var(--ap-line);
  opacity: 1;
  transform: none;
}

.how-step:not(:first-child) { padding-left: var(--ap-space-md); }
.how-step:last-child { border-bottom: 0; border-right: 0; }
.step-dot { display: none; }

.step-num {
  color: var(--ap-gold);
  font-family: var(--ap-font-display);
  font-size: 35px;
  font-weight: 600;
  line-height: 1;
}

.step-content h3 {
  margin: var(--ap-space-md) 0 0;
  color: var(--ap-paper);
  font-family: var(--ap-font-display);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.16;
}

.step-content p {
  margin-top: var(--ap-space-xs);
  color: var(--ap-paper-muted);
  font-size: 14px;
  line-height: 1.7;
}

.ritual-visual {
  grid-column: 1 / -1;
  min-height: 440px;
  margin-top: var(--ap-space-sm);
  border: 1px solid var(--ap-line);
  background-color: var(--ap-ink-raised);
  background-image: url("/assets/astralpost-ritual-journal.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow: none;
  opacity: 1;
  transform: none;
}

.ritual-visual .phone-scene { display: none; }

#journal {
  border-bottom: 1px solid var(--ap-line);
  background: var(--ap-ink-raised);
}

.journal-header {
  max-width: 680px;
  margin-bottom: var(--ap-space-xl);
}

.journal-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--ap-line-strong);
  border-bottom: 1px solid var(--ap-line);
}

.journal-preview-card,
.journal-preview-card--glossary {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: var(--ap-space-lg);
  border: 0;
  border-right: 1px solid var(--ap-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-decoration: none;
  transition: background-color var(--ap-duration) var(--ap-ease);
}

.journal-preview-card:last-child { border-right: 0; }
.journal-preview-card::before,
.journal-preview-card::after { content: none; }
.journal-preview-card:hover { background: var(--ap-oxblood-deep); transform: none; }

.journal-card-label {
  color: var(--ap-gold);
  font-family: var(--ap-font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.journal-preview-card h3 {
  margin: var(--ap-space-md) 0 0;
  color: var(--ap-paper);
  font-family: var(--ap-font-display);
  font-size: clamp(25px, 2.3vw, 34px);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.13;
}

.journal-preview-card p {
  margin: var(--ap-space-sm) 0 0;
  color: var(--ap-paper-muted);
  font-size: 14px;
  line-height: 1.7;
}

.journal-card-link {
  margin-top: auto;
  padding-top: var(--ap-space-lg);
  color: var(--ap-gold-bright);
  font-size: 13px;
  font-weight: 600;
}

#quote {
  padding: var(--ap-space-3xl) max(var(--ap-space-md), calc((100% - 940px) / 2));
  border-bottom: 1px solid var(--ap-line);
  background: var(--ap-oxblood-deep);
}

.quote-text {
  max-width: 16ch;
  margin: 0;
  color: var(--ap-paper);
  font-family: var(--ap-font-display);
  font-size: clamp(41px, 5.5vw, 82px);
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.04;
  opacity: 1;
  transform: none;
}

.quote-source {
  margin: var(--ap-space-lg) 0 0;
  color: var(--ap-gold-bright);
  font-family: var(--ap-font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  opacity: 1;
  transform: none;
}

#download {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid var(--ap-line);
  background: var(--ap-ink);
}

#download::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background-image: url("/assets/astralpost-download-ritual.png");
  background-position: right center;
  background-repeat: no-repeat;
  background-size: auto 100%;
  opacity: 0.24;
}

.download-wrap {
  max-width: 680px;
  margin: 0;
  padding: var(--ap-space-xl) 0;
  border-top: 1px solid var(--ap-line-strong);
  border-bottom: 1px solid var(--ap-line);
}

.download-wrap .section-title { max-width: 9ch; }
.download-badges { gap: var(--ap-space-xs); margin-top: var(--ap-space-lg); }

body > footer {
  padding: var(--ap-space-xl) 0 var(--ap-space-lg);
  border: 0;
  background: var(--ap-ink-raised);
}

.footer-inner {
  width: var(--ap-page);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ap-space-lg);
  margin: 0 auto;
  padding: var(--ap-space-md) 0;
  border-top: 1px solid var(--ap-line);
}

.footer-inner:first-child { align-items: flex-start; }

.footer-logo {
  color: var(--ap-paper);
  font-family: var(--ap-font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0;
}

.footer-links {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--ap-space-xs) var(--ap-space-md);
}

.footer-copy,
.footer-owner {
  color: var(--ap-muted);
  font-size: 12px;
  letter-spacing: 0;
}

.footer-owner { color: var(--ap-gold); }

.reveal,
.feature-card,
.how-step,
.ritual-visual { opacity: 1; transform: none; }

@media (max-width: 920px) {
  body > nav {
    grid-template-columns: minmax(140px, 1fr) auto;
  }

  .nav-links { display: none; }
  .hero-inner { grid-template-columns: minmax(0, 0.9fr) minmax(300px, 1.1fr); gap: var(--ap-space-lg); }
  .hero-headline { font-size: clamp(54px, 7vw, 82px); }
  .features-layout .features-header { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  body > nav {
    inset: var(--ap-space-xs) auto auto 50%;
    min-height: 56px;
    padding: 0 var(--ap-space-sm);
  }

  .nav-logo { font-size: 22px; }
  .nav-logo svg { width: 22px; height: 22px; }
  .lang-globe,
  .lang-flag { display: none; }
  .lang-name { display: inline; }
  .lang-trigger { min-width: 44px; justify-content: center; padding: 0 var(--ap-space-xs); }

  #hero { min-height: 0; padding: calc(56px + var(--ap-space-xs) + 29px) 0 var(--ap-space-2xl); }
  .hero-inner { min-height: 0; display: flex; flex-direction: column; gap: var(--ap-space-lg); }
  .hero-copy { max-width: none; padding: 0; }
  .hero-headline { max-width: 9ch; font-size: clamp(52px, 15vw, 74px); }
  .hero-sub { font-size: 16px; }
  .cta-group { display: grid; grid-template-columns: 1fr; }
  .store-wrap,
  .btn-store { width: 100%; }
  .hero-visual { width: 100%; min-height: 0; aspect-ratio: 4 / 3; }
  .scroll-hint { display: none; }

  .section-title { max-width: 10ch; font-size: clamp(39px, 12.5vw, 58px); }
  .section-subtitle { font-size: 16px; }
  .features-layout .features-grid { grid-template-columns: 1fr; }
  .feature-card,
  .feature-card:nth-child(even) { min-height: 0; padding: var(--ap-space-md) 0; border-right: 0; }
  .feature-card::before { font-size: 27px; }
  .feature-card h3 { font-size: 24px; }
  .features-visual { aspect-ratio: 4 / 3; margin-top: var(--ap-space-lg); }

  .how-layout > div:first-child { grid-column: 1 / -1; }
  .how-steps { grid-template-columns: 1fr; gap: 0; }
  .how-step,
  .how-step:not(:first-child) { min-height: 0; display: grid; grid-template-columns: 52px minmax(0, 1fr); column-gap: var(--ap-space-sm); padding: var(--ap-space-md) 0; border-bottom: 1px solid var(--ap-line); border-right: 0; }
  .step-content h3 { margin: 0; font-size: 25px; }
  .step-content p { margin-top: var(--ap-space-xs); }
  .ritual-visual { min-height: 280px; margin-top: 0; background-position: 62% center; }

  .journal-preview-grid { grid-template-columns: 1fr; }
  .journal-preview-card,
  .journal-preview-card--glossary { min-height: 230px; padding: var(--ap-space-lg) 0; border-right: 0; border-bottom: 1px solid var(--ap-line); }
  .journal-preview-card:last-child { border-bottom: 0; }
  .journal-preview-card h3 { font-size: 30px; }

  #quote { padding: var(--ap-space-2xl) var(--ap-space-md); }
  .quote-text { font-size: clamp(38px, 12vw, 56px); }

  #download::after { background-size: auto 56%; background-position: right bottom; opacity: 0.18; }
  .download-wrap { padding: var(--ap-space-lg) 0; }
  .download-wrap .section-title { max-width: 10ch; }
  .download-badges { display: grid; grid-template-columns: 1fr; }
  .download-badges .store-wrap,
  .download-badges .badge-btn { width: 100%; }

  .footer-inner,
  .footer-inner:first-child { align-items: flex-start; flex-direction: column; }
  .footer-links { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
