/* Big Feelings Design System — strictly derived from design/tokens.json & design/DESIGN.md */

:root {
  color-scheme: light dark;

  /* App surface */
  --app-bg: #F6F5F3;
  --app-card: #FFFFFF;
  --app-ink: #1C1A18;
  --app-ink2: #6F6A65;
  --app-ink3: #736D67;
  --app-line: rgba(28, 26, 24, 0.08);
  --app-chip: #EFEDEA;
  --app-selected-ink: #FFFFFF;
  --app-accent: #E2602F;
  --app-tint: #5B4A8C;
  --app-tint-soft: rgba(91, 74, 140, 0.10);
  --app-accent-text: #C4491D;
  --app-accent-ink: #FFFFFF;
  --app-accent-fill: #C4491D;
  --app-accent-soft: rgba(226, 96, 47, 0.12);

  /* Moments */
  --moment-bright: #E9A93A;
  --moment-bright-soft: rgba(233, 169, 58, 0.14);
  --moment-tough: #E3837A;
  --moment-tough-soft: rgba(227, 131, 122, 0.15);

  /* Night surface */
  --night-bg: linear-gradient(180deg, #F6EEE7 0%, #F2E5DC 55%, #EFDCD1 100%);
  --night-bg-solid: #F2E5DC;
  --night-ink: #2B2433;
  --night-ink2: rgba(43, 36, 51, 0.68);
  --night-ink3: rgba(43, 36, 51, 0.66);
  --night-card: rgba(255, 255, 255, 0.62);
  --night-line: rgba(43, 36, 51, 0.10);
  --night-selected: #2B2433;
  --night-selected-ink: #F6EFE8;
  --night-moon: #E2894A;

  /* Paper surface */
  --paper-bg: #F8F3EA;
  --paper-bg2: #EFE7D9;
  --paper-ink: #2A241D;
  --paper-ink2: #6B6154;
  --paper-line: rgba(42, 36, 29, 0.10);

  /* Brand & child palette */
  --brand-night: #2B2433;
  --brand-cream: #FBF6EE;
  --brand-orange: #E2602F;
  --child-orange: #E2602F;
  --child-plum: #7A5C8E;

  /* Typography */
  --font-display: "New York", ui-serif, "Iowan Old Style", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;

  /* Radii & spacing */
  --radius-card: 22px;
  --radius-chip: 999px;
  --radius-button: 26px;
  --radius-tile: 14px;
  --gutter: 18px;
  --stack: 14px;
  --card-pad: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --app-bg: #0C0B0B;
    --app-card: #1C1B1A;
    --app-ink: #F4F1ED;
    --app-ink2: #A7A19A;
    --app-ink3: #9A948E;
    --app-line: rgba(255, 255, 255, 0.08);
    --app-chip: #2E2B28;
    --app-selected-ink: #0C0B0B;
    --app-accent: #FF8A5C;
    --app-tint: #B7A6EA;
    --app-tint-soft: rgba(183, 166, 234, 0.14);
    --app-accent-text: #FF8A5C;
    --app-accent-ink: #1A0F0A;
    --app-accent-fill: #FF8A5C;
    --app-accent-soft: rgba(255, 138, 92, 0.16);

    --night-bg: linear-gradient(180deg, #1B1A2B 0%, #2A2230 55%, #33262C 100%);
    --night-bg-solid: #2A2230;
    --night-ink: #F6EFE8;
    --night-ink2: rgba(246, 239, 232, 0.70);
    --night-ink3: rgba(246, 239, 232, 0.68);
    --night-card: rgba(255, 255, 255, 0.07);
    --night-line: rgba(255, 255, 255, 0.10);
    --night-selected: #F6EFE8;
    --night-selected-ink: #1B1A2B;
    --night-moon: #FFD9A8;

    --paper-bg: #14120F;
    --paper-bg2: #201C17;
    --paper-ink: #ECE3D3;
    --paper-ink2: #968B7C;
    --paper-line: rgba(236, 227, 211, 0.10);
  }
}

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

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

body {
  margin: 0;
  background-color: var(--app-bg);
  color: var(--app-ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--app-tint);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover {
  opacity: 0.85;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--app-tint);
  outline-offset: 3px;
}

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

.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.container-narrow {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--app-line);
  background-color: var(--app-bg);
}

.site-header-night {
  background: transparent;
  border-bottom: 1px solid var(--night-line);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding-block: 14px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 22%;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(27, 26, 43, 0.14);
}

.brand-wordmark {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.brand-wordmark em {
  font-style: italic;
  color: var(--app-accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a {
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--app-ink2);
  padding: 6px 12px;
  border-radius: var(--radius-chip);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.site-header-night .site-nav a {
  color: var(--night-ink2);
}

.site-nav a:hover {
  color: var(--app-ink);
  background-color: var(--app-chip);
  opacity: 1;
}

.site-header-night .site-nav a:hover {
  color: var(--night-ink);
  background-color: var(--night-card);
}

.site-nav a[aria-current="page"] {
  color: var(--app-tint);
  background-color: var(--app-tint-soft);
}

/* Night Hero */
.night-surface {
  background: var(--night-bg);
  color: var(--night-ink);
}

.hero {
  padding-block: 42px 58px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  align-items: center;
}

@media (min-width: 820px) {
  .hero {
    padding-block: 56px 76px;
  }

  .hero-grid {
    grid-template-columns: 1.12fr 0.88fr;
    gap: 44px;
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: var(--radius-chip);
  background-color: var(--night-card);
  border: 1px solid var(--night-line);
  color: var(--night-ink2);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 18px;
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--night-moon);
  flex-shrink: 0;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(34px, 5vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

.hero-title em {
  font-style: italic;
  color: var(--app-accent);
}

.hero-subtitle {
  font-size: 18px;
  line-height: 1.55;
  color: var(--night-ink2);
  margin: 0 0 26px;
  max-width: 50ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-button);
  background-color: var(--app-accent-fill);
  color: var(--app-accent-ink);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  opacity: 0.92;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: var(--radius-button);
  background-color: var(--night-card);
  border: 1px solid var(--night-line);
  color: var(--night-ink);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}

.hero-footnote {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--night-ink3);
}

/* Preview card in hero */
.preview-card {
  background-color: var(--app-card);
  color: var(--app-ink);
  border-radius: 28px;
  padding: 20px;
  border: 1px solid var(--app-line);
  box-shadow: 0 18px 44px rgba(27, 26, 43, 0.14);
}

.preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.child-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 5px;
  border-radius: var(--radius-chip);
  background-color: var(--app-chip);
  font-size: 14px;
  font-weight: 600;
}

.child-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--child-orange);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.preview-date {
  font-size: 13px;
  font-weight: 500;
  color: var(--app-accent-text);
}

.moment-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.moment-tile {
  border-radius: 18px;
  padding: 14px;
  border: 1.5px solid transparent;
}

.moment-tile--bright {
  background-color: var(--moment-bright-soft);
  border-color: var(--moment-bright);
}

.moment-tile--tough {
  background-color: var(--moment-tough-soft);
  border-color: var(--moment-tough);
}

.moment-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
}

.moment-tile--bright .moment-badge {
  background-color: var(--moment-bright);
  color: #FFFFFF;
}

.moment-tile--tough .moment-badge {
  background-color: var(--moment-tough);
  color: #FFFFFF;
}

.moment-label {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.moment-hint {
  font-size: 12px;
  color: var(--app-ink2);
  margin: 2px 0 0;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background-color: var(--app-bg);
  margin-bottom: 12px;
}

.icon-tile {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-tile);
  background-color: var(--app-tint-soft);
  color: var(--app-tint);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.action-row-title {
  font-size: 15px;
  font-weight: 500;
  margin: 0;
}

.action-row-sub {
  font-size: 13px;
  color: var(--app-ink2);
  margin: 1px 0 0;
}

.pattern-snippet {
  border-top: 1px solid var(--app-line);
  padding-top: 12px;
}

.pattern-kicker {
  font-size: 12px;
  font-weight: 600;
  color: var(--app-tint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 4px;
}

.pattern-line {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.35;
  margin: 0 0 8px;
}

.tally-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--app-ink2);
}

.tally-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tally-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--app-accent);
}

/* App Sections */
.section {
  padding-block: 56px;
}

.section-tight {
  padding-block: 40px;
}

.section + .section {
  border-top: 1px solid var(--app-line);
}

.section-header {
  max-width: 60ch;
  margin-bottom: 28px;
}

.section-kicker {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  color: var(--app-accent-text);
  margin: 0 0 6px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(26px, 3.6vw, 34px);
  line-height: 1.18;
  letter-spacing: -0.015em;
  margin: 0 0 10px;
}

.section-lead {
  color: var(--app-ink2);
  margin: 0;
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--stack);
}

@media (min-width: 680px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

.card {
  background-color: var(--app-card);
  border: 1px solid var(--app-line);
  border-radius: var(--radius-card);
  padding: 22px;
}

.card-night {
  background: var(--night-bg);
  color: var(--night-ink);
  border-color: var(--night-line);
}

.card-night .card-body {
  color: var(--night-ink2);
}

.card-paper {
  background-color: var(--paper-bg);
  color: var(--paper-ink);
  border-color: var(--paper-line);
}

.card-paper .card-title,
.card-paper .journal-sample {
  font-family: var(--font-display);
}

.card-paper .card-body {
  color: var(--paper-ink2);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.card-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 21px;
  line-height: 1.25;
  margin: 0;
}

.card-body {
  font-size: 15px;
  line-height: 1.55;
  color: var(--app-ink2);
  margin: 0;
}

.journal-sample {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--paper-line);
  font-size: 16px;
  line-height: 1.6;
  color: var(--paper-ink);
  font-style: italic;
}

/* Summaries list */
.summary-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.summary-chip {
  font-size: 13px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: var(--radius-chip);
  background-color: var(--app-chip);
  color: var(--app-ink);
}

.card-wide {
  grid-column: 1 / -1;
}

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 720px) {
  .pricing-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.plan-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.plan-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-chip);
  background-color: var(--app-tint-soft);
  color: var(--app-tint);
  margin-bottom: 10px;
}

.card-night .plan-label {
  background-color: var(--night-card);
  color: var(--night-ink);
}

.plan-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin: 8px 0 10px;
}

.plan-price {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.1;
}

.plan-price-sub {
  font-size: 14px;
  color: var(--app-ink2);
}

.card-night .plan-price-sub {
  color: var(--night-ink2);
}

.check-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
  font-size: 15px;
}

.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.check-mark {
  color: var(--app-tint);
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1.45;
}

.card-night .check-mark {
  color: var(--night-moon);
}

.plan-note {
  font-size: 13px;
  color: var(--app-ink2);
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--app-line);
}

.card-night .plan-note {
  color: var(--night-ink2);
  border-top-color: var(--night-line);
}

/* Subpages (Privacy, Support, 404) */
.page-hero {
  padding-block: 34px 36px;
  border-bottom: 1px solid var(--night-line);
}

.page-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(30px, 4.2vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
}

.page-meta {
  font-size: 14px;
  color: var(--night-ink2);
  margin: 0;
}

.prose {
  padding-block: 36px 56px;
}

.prose h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 23px;
  line-height: 1.25;
  margin: 34px 0 10px;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.65;
}

.prose ul {
  margin: 0 0 16px;
  padding-left: 22px;
  font-size: 16px;
  line-height: 1.65;
}

.prose li + li {
  margin-top: 6px;
}

.highlight-card {
  background-color: var(--app-card);
  border: 1px solid var(--app-line);
  border-radius: var(--radius-card);
  padding: 20px 22px;
  margin: 22px 0 28px;
}

.highlight-card h2 {
  margin-top: 0;
}

.highlight-card ul:last-child,
.highlight-card p:last-child {
  margin-bottom: 0;
}

/* Responsive storage table */
.table-wrap {
  margin: 16px 0 20px;
  background-color: var(--app-card);
  border: 1px solid var(--app-line);
  border-radius: var(--radius-card);
  overflow-x: auto;
}

.storage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  text-align: left;
}

.storage-table th,
.storage-table td {
  padding: 13px 16px;
  vertical-align: top;
  border-bottom: 1px solid var(--app-line);
}

.storage-table tr:last-child td {
  border-bottom: none;
}

.storage-table th {
  font-size: 13px;
  font-weight: 600;
  color: var(--app-ink2);
  background-color: var(--app-bg);
}

.storage-table td:first-child {
  font-weight: 500;
  width: 42%;
}

@media (max-width: 560px) {
  .storage-table thead {
    display: none;
  }

  .storage-table,
  .storage-table tbody,
  .storage-table tr,
  .storage-table td {
    display: block;
    width: 100%;
  }

  .storage-table tr {
    padding: 12px 16px;
    border-bottom: 1px solid var(--app-line);
  }

  .storage-table tr:last-child {
    border-bottom: none;
  }

  .storage-table td {
    padding: 2px 0;
    border-bottom: none;
  }

  .storage-table td:first-child {
    width: 100%;
    margin-bottom: 4px;
  }

  .storage-table td:last-child {
    color: var(--app-ink2);
  }
}

/* Support FAQ */
.faq-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.faq-item {
  background-color: var(--app-card);
  border: 1px solid var(--app-line);
  border-radius: var(--radius-card);
  padding: 18px 20px;
}

.faq-item h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 19px;
  line-height: 1.3;
  margin: 0 0 8px;
}

.faq-item p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--app-ink2);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--app-line);
  background-color: var(--app-bg);
  padding-block: 32px 42px;
  font-size: 14px;
  color: var(--app-ink2);
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin-bottom: 16px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--app-ink);
  text-decoration: none;
}

.footer-brand .brand-icon {
  width: 24px;
  height: 24px;
}

.footer-brand .brand-wordmark {
  font-size: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.footer-disclaimer {
  margin: 0;
  font-size: 13px;
  color: var(--app-ink3);
  max-width: 68ch;
}
