/* ============================================
   Marketing / Landing page
   Every rule is scoped under .landing. Propshaft's `stylesheet_link_tag :app`
   bundles every stylesheet in this directory into all pages, so this file is
   served app-wide — the .landing scope is what keeps it from affecting the
   authenticated app. The marketing layout also links it explicitly.
   ============================================ */

/* Display font (Bricolage Grotesque) is declared globally in fonts.css and
   exposed as var(--font-display) from 00-variables.css. */
.landing {
  --landing-shell: 1120px;
  --dusk-ink: #f8fafc;
  --dusk-ink-soft: rgba(248, 250, 252, 0.74);
  --day: #fbbf24;
  --night: #818cf8;
  position: relative;
}

.landing-body {
  overflow-x: hidden;
}

/* The landing owns its type. Only font/line properties here — margins and
   colour are left to the component classes so their per-element spacing and
   light-on-dusk colours aren't out-specified (01-reset already zeroes margins
   globally via `* { margin: 0 }`). */
.landing h1,
.landing h2,
.landing h3 {
  font-family: var(--font-display);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.landing-shell {
  width: 100%;
  max-width: var(--landing-shell);
  margin: 0 auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

/* ============================================
   Top bar (overlays the dark hero)
   ============================================ */
.landing-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

.landing-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: clamp(1rem, 2.5vw, 1.5rem);
}

.landing-wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-primary);
}

.landing-wordmark span {
  color: var(--color-text-secondary);
}

/* On the dark hero the wordmark and nav go light. */
.landing-topbar .landing-wordmark {
  color: #fff;
}
.landing-topbar .landing-wordmark span {
  color: #a5b4fc;
}

.landing-topbar-actions {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2.5vw, 1.5rem);
}

.landing-navlink {
  color: var(--dusk-ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  opacity: 0.85;
  transition: opacity var(--duration-base) ease;
}
@media (hover: hover) {
  .landing-navlink:hover {
    opacity: 1;
  }
}

/* ============================================
   Buttons (self-contained; not the app's .button)
   ============================================ */
.landing-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1.5px solid transparent;
  border-radius: var(--border-radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--duration-fast) ease, box-shadow var(--duration-base) ease,
              background var(--duration-base) ease, border-color var(--duration-base) ease;
  -webkit-tap-highlight-color: transparent;
}
.landing-btn-sm {
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
}
.landing-btn-lg {
  padding: 0.95rem 1.6rem;
  font-size: 1.05rem;
}
.landing-btn-icon {
  transition: transform var(--duration-base) ease;
}
@media (hover: hover) {
  .landing-btn:hover .landing-btn-icon {
    transform: translateX(3px);
  }
}

.landing-btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(37, 99, 235, 0.7);
}
@media (hover: hover) {
  .landing-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px -12px rgba(37, 99, 235, 0.8);
  }
}
.landing-btn-primary:active {
  transform: scale(0.98);
  transition-duration: var(--duration-press);
}

/* On the dark dusk bands (hero + top bar) a blue button blends into the indigo
   gradient — go solid white so the primary CTA pops. The final CTA sits on a
   light surface and keeps the blue gradient below. */
.landing-hero .landing-btn-primary,
.landing-topbar .landing-btn-primary {
  background: #fff;
  color: var(--color-primary-dark);
  box-shadow: 0 12px 28px -12px rgba(2, 6, 23, 0.7);
}
@media (hover: hover) {
  .landing-hero .landing-btn-primary:hover,
  .landing-topbar .landing-btn-primary:hover {
    background: #fff;
    box-shadow: 0 18px 34px -14px rgba(2, 6, 23, 0.8);
  }
}

.landing-btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--dusk-ink);
}
@media (hover: hover) {
  .landing-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.55);
  }
}

/* ============================================
   Hero
   ============================================ */
.landing-hero {
  position: relative;
  overflow: hidden;
  background: var(--hero-gradient);
  padding-top: clamp(7rem, 15vw, 9.5rem);
  padding-bottom: clamp(4.5rem, 10vw, 7rem);
}

/* Amber horizon glow, echoing the dashboard hero. */
.landing-hero-glow {
  position: absolute;
  inset: 0;
  background: var(--hero-horizon);
  pointer-events: none;
  animation: landingGlow 9s ease-in-out infinite;
}

@keyframes landingGlow {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

.landing-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 6vw, 4rem);
  align-items: center;
}

@media (min-width: 900px) {
  .landing-hero-inner {
    grid-template-columns: 1.08fr 0.92fr;
  }
}

.landing-eyebrow {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--day);
  margin-bottom: 1rem;
}

.landing-hero-title {
  color: #fff;
  font-weight: 800;
  font-size: clamp(2.5rem, 7vw, 4.25rem);
}

.landing-hero-sub {
  margin-top: 1.75rem;
  max-width: 34ch;
  color: var(--dusk-ink-soft);
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  line-height: 1.6;
}

.landing-cta-group {
  margin-top: 2.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.landing-hero-note {
  margin-top: 2rem;
  font-size: 0.85rem;
  color: rgba(248, 250, 252, 0.6);
}

/* Hero dial — the 50-hour goal, split day/night */
.landing-hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.landing-dial {
  --dial: clamp(210px, 42vw, 280px);
  position: relative;
  width: var(--dial);
  height: var(--dial);
  display: grid;
  place-items: center;
}

.landing-dial-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    var(--day) 0turn 0.80turn,
    var(--night) 0.80turn 1turn
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 20px), #000 calc(100% - 19px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 20px), #000 calc(100% - 19px));
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  transform: rotate(-0.5turn);
}

.landing-dial-center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.landing-dial-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 9vw, 4.5rem);
  line-height: 1;
  color: #fff;
  letter-spacing: -0.03em;
}

.landing-dial-label {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dusk-ink-soft);
}

.landing-dial-legend {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.landing-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--dusk-ink-soft);
}

.landing-dial-caption {
  margin-top: 0.85rem;
  font-size: 0.78rem;
  color: var(--dusk-ink-soft);
  opacity: 0.75;
  text-align: center;
}

.landing-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
}
.landing-dot-day { background: var(--day); }
.landing-dot-night { background: var(--night); }

/* ============================================
   Generic section rhythm
   ============================================ */
.landing-section {
  padding-block: clamp(3.5rem, 9vw, 6.5rem);
}

.landing-section-head {
  max-width: 44rem;
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
}

.landing-h2 {
  font-weight: 800;
  font-size: clamp(1.75rem, 4.2vw, 2.75rem);
}

.landing-section-sub {
  margin-top: 1rem;
  color: var(--color-text-secondary);
  font-size: 1.1rem;
  line-height: 1.6;
}

/* ============================================
   Features (cardless)
   ============================================ */
.landing-feature-grid {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 5vw, 3rem);
}

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

.landing-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 14px;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-md);
}
.landing-icon-dusk { background: linear-gradient(145deg, var(--day), var(--color-secondary) 40%, var(--night)); }
.landing-icon-blue { background: linear-gradient(145deg, var(--color-primary-light), var(--color-primary-dark)); }
.landing-icon-green { background: linear-gradient(145deg, #34d399, #059669); }

.landing-feature-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.landing-feature-text {
  color: var(--color-text-secondary);
  line-height: 1.65;
}

/* ============================================
   How it works
   ============================================ */
.landing-steps {
  background: var(--color-surface);
  border-block: 1px solid var(--color-border-light);
}

.landing-step-list {
  list-style: none;
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.25rem);
}

@media (min-width: 820px) {
  .landing-step-list {
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(2rem, 4vw, 3rem);
  }
}

.landing-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.landing-step-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--color-primary-dark);
  background: var(--color-info-soft);
  border: 1.5px solid var(--color-info-soft-strong);
}

.landing-step-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.landing-step-text {
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ============================================
   Night differentiator (dusk band)
   ============================================ */
.landing-night {
  background: var(--hero-gradient);
  position: relative;
  overflow: hidden;
}

.landing-night-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 6vw, 4rem);
  align-items: center;
}

@media (min-width: 900px) {
  .landing-night-inner {
    grid-template-columns: 1fr 0.85fr;
  }
}

.landing-eyebrow-light {
  color: var(--night);
}

.landing-h2-light {
  color: #fff;
  max-width: 20ch;
}

.landing-night-text {
  margin-top: 1.25rem;
  color: var(--dusk-ink-soft);
  font-size: 1.1rem;
  line-height: 1.65;
  max-width: 46ch;
}

.landing-check-list {
  list-style: none;
  margin-top: 1.75rem;
  display: grid;
  gap: 0.85rem;
}

.landing-check-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  color: var(--dusk-ink);
  font-weight: 500;
}
.landing-check-list li .icon {
  flex: none;
  margin-top: 0.15rem;
}

/* Day → night horizon illustration */
.landing-horizon {
  position: relative;
  height: clamp(170px, 32vw, 230px);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  background: linear-gradient(105deg, #f59e0b 0%, #b45309 20%, #4338ca 58%, #1c1b40 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 24px 48px -24px rgba(0, 0, 0, 0.7);
}
.landing-horizon::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 130%, rgba(251, 191, 36, 0.35) 0%, transparent 60%);
}
.landing-horizon-sun,
.landing-horizon-moon {
  position: absolute;
  top: clamp(1.25rem, 4vw, 2rem);
  display: inline-flex;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.35));
}
.landing-horizon-sun { left: clamp(1.5rem, 6vw, 2.75rem); }
.landing-horizon-moon { right: clamp(1.5rem, 6vw, 2.75rem); }
.landing-horizon-label {
  position: absolute;
  bottom: clamp(1rem, 3vw, 1.5rem);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
}
.landing-horizon-day { left: clamp(1.5rem, 6vw, 2.75rem); }
.landing-horizon-night { right: clamp(1.5rem, 6vw, 2.75rem); }

/* ============================================
   Final CTA
   ============================================ */
.landing-final {
  text-align: center;
  background: var(--color-background);
}

.landing-final-inner {
  max-width: 40rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.landing-final-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
}

.landing-final-sub {
  margin: 1.25rem 0 2.75rem;
  color: var(--color-text-secondary);
  font-size: 1.15rem;
}

/* ============================================
   Footer
   ============================================ */
.landing-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  padding-block: 2.5rem;
}

.landing-footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}

.landing-wordmark-sm {
  font-size: 1.2rem;
}

.landing-footer-links {
  display: flex;
  gap: 1.5rem;
}
.landing-footer-links a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
@media (hover: hover) {
  .landing-footer-links a:hover {
    color: var(--color-primary);
  }
}

.landing-footer-bottom {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border-light);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 1.5rem;
}

.landing-footer-tag,
.landing-footer-credit {
  color: var(--color-text-light);
  font-size: 0.85rem;
}

/* ============================================
   Motion
   ============================================ */

/* Hero entrance — staggered fade-up on load. Ends fully visible, so it is
   safe even where the animation never runs. */
@media (prefers-reduced-motion: no-preference) {
  .landing-hero-copy > *,
  .landing-hero-visual {
    animation: landingRise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .landing-eyebrow { animation-delay: 0.05s; }
  .landing-hero-title { animation-delay: 0.12s; }
  .landing-hero-sub { animation-delay: 0.2s; }
  .landing-cta-group { animation-delay: 0.28s; }
  .landing-hero-note { animation-delay: 0.36s; }
  .landing-hero-visual { animation-delay: 0.3s; }
}

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

/* Scroll reveal — progressive enhancement. Content is visible by default;
   only browsers that support scroll-driven animations hide-then-reveal it. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .landing-reveal {
      animation: landingRise linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 22%;
    }
  }
}
