/* ============================================================
   Hero Habits — Shared Stylesheet
   Design tokens extracted from the app's theme system
   ============================================================ */

/* --- CSS Custom Properties (Light mode default) --- */
:root {
  /* Backgrounds */
  --bg-primary:    #FAF8F5;
  --bg-secondary:  #F3F0EB;
  --bg-card:       #FFFFFF;

  /* Text */
  --text-primary:   #1A1A1A;
  --text-secondary: #6B6B6B;
  --text-on-accent: #FFFFFF;

  /* Border */
  --border-subtle: #E8E4DE;

  /* Accent */
  --accent-coral:   #E8725C;
  --accent-fire:    #FF6B35;
  --accent-primary: #007AFF;
  --accent-success: #34C759;
  --accent-warning: #FF9500;
  --accent-error:   #FF3B30;

  /* Badge backgrounds */
  --badge-primary-bg: rgba(0, 122, 255, 0.1);
  --badge-warning-bg: rgba(255, 149, 0, 0.15);
  --badge-success-bg: rgba(52, 199, 89, 0.12);

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  /* Typography */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", ui-monospace, monospace;

  /* Transitions */
  --transition: 0.2s ease;

  /* Layout */
  --max-width: 1080px;
  --nav-height: 64px;
}

/* --- Dark mode overrides --- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary:    #1C1A17;
    --bg-secondary:  #252320;
    --bg-card:       #2A2825;

    --text-primary:   #F5F3F0;
    --text-secondary: #A8A5A0;
    --text-on-accent: #FFFFFF;

    --border-subtle: #3A3735;

    --accent-primary: #0A84FF;

    --badge-primary-bg: rgba(10, 132, 255, 0.2);
    --badge-warning-bg: rgba(255, 149, 0, 0.2);
    --badge-success-bg: rgba(52, 199, 89, 0.2);
  }
}

/* ============================================================
   Reset & Base
   ============================================================ */

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

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

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color var(--transition), color var(--transition);
}

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

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: opacity var(--transition);
}

a:hover {
  opacity: 0.75;
}

/* ============================================================
   Layout Utilities
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

/* ============================================================
   Navigation
   ============================================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  transition: background-color var(--transition), border-color var(--transition);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--text-primary);
}

.nav__logo-hex {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.nav__logo-text {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  list-style: none;
}

.nav__links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.nav__links a:hover,
.nav__links a.nav__link--active {
  color: var(--text-primary);
  opacity: 1;
}

.nav__links a.nav__link--active {
  font-weight: 600;
}

.nav__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background-color: var(--accent-coral);
  color: var(--text-on-accent) !important;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: opacity var(--transition), transform var(--transition);
}

.nav__cta:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Mobile nav: hide links, show only logo + cta */
@media (max-width: 600px) {
  .nav__links {
    display: none;
  }
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding-block: var(--space-12) var(--space-8);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  text-align: center;
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--text-primary);
}

.footer__logo-hex {
  width: 28px;
  height: 28px;
}

.footer__logo-text {
  font-size: 16px;
  font-weight: 700;
}

.footer__tagline {
  font-size: 14px;
  color: var(--text-secondary);
}

.footer__links {
  display: flex;
  gap: var(--space-6);
  list-style: none;
}

.footer__links a {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.footer__links a:hover {
  color: var(--text-primary);
  opacity: 1;
}

.footer__copy {
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}

/* ============================================================
   Hexagon SVG helper (reusable inline)
   ============================================================ */

.hex-icon {
  display: inline-block;
  flex-shrink: 0;
}

/* ============================================================
   Hero Section
   ============================================================ */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--space-20) var(--space-16);
}

/* large decorative hexagon in the background */
.hero__bg-hex {
  position: absolute;
  top: -120px;
  right: -180px;
  width: 600px;
  height: 600px;
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}

@media (prefers-color-scheme: dark) {
  .hero__bg-hex {
    opacity: 0.06;
  }
}

.hero__layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--space-16);
}

@media (max-width: 768px) {
  .hero__layout {
    grid-template-columns: 1fr;
    gap: var(--space-12);
  }

  .hero {
    padding-block: var(--space-12) var(--space-12);
    text-align: center;
  }
}

/* --- Left: copy --- */
.hero__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  align-self: flex-start;
  padding: 5px var(--space-3);
  background-color: var(--badge-primary-bg);
  color: var(--accent-primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
}

@media (max-width: 768px) {
  .hero__eyebrow {
    align-self: center;
  }
}

.hero__headline {
  font-size: clamp(36px, 6vw, 60px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  color: var(--text-primary);
}

.hero__headline em {
  font-style: normal;
  color: var(--accent-coral);
}

.hero__sub {
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 440px;
}

@media (max-width: 768px) {
  .hero__sub {
    max-width: 100%;
  }
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .hero__actions {
    justify-content: center;
  }
}

/* App Store button */
.btn-store {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  background-color: var(--text-primary);
  color: var(--bg-primary) !important;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity var(--transition), transform var(--transition);
  line-height: 1;
}

.btn-store:hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

.btn-store__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: currentColor;
}

.btn-store__label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.btn-store__sub {
  font-size: 10px;
  font-weight: 400;
  opacity: 0.75;
  letter-spacing: 0.3px;
}

.btn-store__main {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

/* --- Right: visual mockup --- */
.hero__visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 320px;
}

/* stacked card depth effect */
.streak-card-stack {
  position: relative;
  width: 100%;
  max-width: 360px;
}

/* back card */
.streak-card-stack__back {
  position: absolute;
  top: -14px;
  left: 14px;
  right: -14px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  height: 170px;
  opacity: 0.6;
}

/* front card */
.streak-card {
  position: relative;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
}

@media (prefers-color-scheme: dark) {
  .streak-card {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  }
}

.streak-card__body {
  padding: var(--space-4);
  padding-bottom: 0;
}

/* header row */
.streak-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.streak-card__header-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
}

.streak-card__icon {
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
}

.streak-card__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.streak-card__badges {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.streak-card__badge {
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
}

.streak-card__badge--do {
  background-color: var(--badge-primary-bg);
  color: var(--accent-primary);
}

/* content row: ring + dots */
.streak-card__content {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

/* progress ring */
.streak-ring {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.streak-ring svg {
  transform: rotate(-90deg);
}

.streak-ring__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.streak-ring__number {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
}

.streak-ring__label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* week dots */
.streak-week {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.streak-week__label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.streak-week__dots {
  display: flex;
  gap: 4px;
}

.streak-dot {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1.5px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 500;
  color: var(--text-secondary);
  background-color: transparent;
}

.streak-dot--done {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

.streak-dot--today {
  background-color: var(--bg-secondary);
  border-color: var(--border-subtle);
}

/* stats bar */
.streak-card__stats {
  display: flex;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-secondary);
}

.streak-stat {
  flex: 1;
  padding: 10px var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.streak-stat + .streak-stat {
  border-left: 1px solid var(--border-subtle);
}

.streak-stat__value {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent-primary);
  line-height: 1;
}

.streak-stat__label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ============================================================
   Shared section header
   ============================================================ */

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.section-sub {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 480px;
  margin-inline: auto;
  line-height: 1.6;
}

/* ============================================================
   Features Section
   ============================================================ */

.features {
  padding-block: var(--space-20);
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-16);
}

@media (max-width: 768px) {
  .features__grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .features__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.feature-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
}

@media (prefers-color-scheme: dark) {
  .feature-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

.feature-card__icon {
  font-size: 28px;
  line-height: 1;
}

.feature-card__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.feature-card__desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* --- Categories --- */

.categories {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.categories__label {
  font-size: 15px;
  color: var(--text-secondary);
}

.categories__pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
}

.category-pill {
  padding: 6px 14px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}

/* ============================================================
   CTA Banner
   ============================================================ */

.cta-banner {
  padding-block: var(--space-20);
}

.cta-banner__inner {
  position: relative;
  overflow: hidden;
  background-color: var(--accent-coral);
  border-radius: var(--radius-lg);
  padding: var(--space-16) var(--space-6);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.cta-banner__hex {
  position: absolute;
  width: 420px;
  height: 420px;
  right: -100px;
  bottom: -120px;
  opacity: 0.12;
  pointer-events: none;
}

.cta-banner__title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -1px;
  color: #fff;
  position: relative;
}

.cta-banner__sub {
  font-size: 17px;
  color: rgba(255, 255, 255, 0.8);
  position: relative;
}

.cta-banner__actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  justify-content: center;
  margin-top: var(--space-2);
  position: relative;
}

/* Light variant of store button (for use on coral background) */
.btn-store--light {
  background-color: #fff;
  color: #1A1A1A !important;
}
