/* Callima website styles. Every page loads this one file.
   Colors, corner radii and side spacing live in :root below; change them
   there and every page follows. Sections are marked with ── headers. */

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

/* Same tokens as the app (lib/theme/app_colors.dart), drawn from the icon. */
:root {
  color-scheme: light;
  --moss:           #5F6C37;
  --moss-light:     #7A8749;
  --clay:           #9C561C;   /* actions + accent text, AA on cream */
  --clay-hover:     #874A17;
  --caramel:        #BC6C25;   /* icon orange, large/decorative only */
  --walnut:         #884E1C;
  --tan:            #DCA15D;
  --forest:         #273617;
  --amber:          #F6E6C0;   /* cream text on moss */
  --scaffold:       #F4ECD8;
  --surface:        #FAF4E3;
  --sheet:          #FEFADF;
  --input-fill:     #ECE1C9;
  --chip-bg:        #E3D6BB;
  --text-primary:   #2B1E10;
  --text-secondary: #6E5A42;
  --text-tertiary:  #97815F;
  --divider:        #E6D9BD;
  --error:          #A8322A;
  --radius-lg: 28px;
  --radius-md: 16px;
  --gutter: clamp(16px, 5vw, 72px);
}

html { scroll-behavior: smooth; }

/* Keep the sign-up card clear of the sticky nav when jumping to /#join. */
#join { scroll-margin-top: 88px; }

body {
  font-family: 'Nunito', system-ui, sans-serif;
  background: var(--scaffold);
  color: var(--text-primary);
  min-height: 100dvh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--caramel);
  outline-offset: 3px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── Nav ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  /* Same linen as the page. */
  background: var(--scaffold);
  padding: 0 var(--gutter);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.brand span {
  font-family: 'Alegreya', serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--moss);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.5vw, 28px);
  list-style: none;
}

.nav-right a {
  white-space: nowrap;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 150ms ease;
}

.nav-right a:hover { color: var(--clay); }
.nav-right a[aria-current="page"] { color: var(--clay); }

.nav-right a.nav-cta {
  background: var(--clay);
  color: var(--sheet);
  padding: 8px 16px;
  border-radius: 100px;
  transition: background 150ms ease;
}

.nav-right a.nav-cta:hover { background: var(--clay-hover); color: var(--sheet); }


/* ── Hero ── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding: clamp(20px, 4vw, 48px) var(--gutter) clamp(48px, 7vw, 88px);
  max-width: 1240px;
  margin: 0 auto;
}

/* Mirrors the app's Home hero card: moss gradient, cream type. */
.hero-card {
  background: linear-gradient(160deg, var(--moss) 0%, var(--moss-light) 100%);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 56px);
  color: var(--amber);
  box-shadow: 0 18px 40px -24px rgba(39, 54, 23, 0.55);
}

.hero-icon-mobile { display: none; }

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(246, 230, 192, 0.16);
  border: 1px solid rgba(246, 230, 192, 0.3);
  padding: 5px 12px;
  border-radius: 100px;
  margin-bottom: 18px;
}

.hero-title {
  font-family: 'Alegreya', serif;
  font-size: clamp(3.2rem, 7vw, 5.6rem);
  font-weight: 600;
  line-height: 1;
  margin-bottom: 10px;
}

.hero-tagline {
  font-family: 'Alegreya', serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  margin-bottom: 14px;
}

.hero-body {
  font-size: 1.05rem;
  max-width: 46ch;
  margin-bottom: 28px;
}

/* ── Beta sign-up card ── */
.signup {
  background: var(--sheet);
  color: var(--text-primary);
  border-radius: 20px;
  padding: clamp(20px, 3vw, 28px);
  max-width: 480px;
}

.signup h2 {
  font-family: 'Alegreya', serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--walnut);
  margin-bottom: 4px;
  line-height: 1.2;
}

.signup .lede {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

fieldset { border: none; margin-bottom: 16px; }

/* Platform picker: radio inputs styled as the app's sliding segmented toggle. */
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--chip-bg);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}

.segmented input { position: absolute; opacity: 0; pointer-events: none; }

.segmented label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 8px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.segmented svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }

.segmented input:checked + label {
  background: var(--sheet);
  color: var(--clay);
  box-shadow: 0 1px 3px rgba(43, 30, 16, 0.15);
}

.segmented input:focus-visible + label {
  outline: 3px solid var(--caramel);
  outline-offset: 1px;
}

.email-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.email-row input {
  flex: 1 1 200px;
  min-width: 0;
  font: inherit;
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--input-fill);
  border: 1.5px solid transparent;
  border-radius: 12px;
  padding: 12px 14px;
  transition: border-color 150ms ease;
}

/* "How did you hear about Callima?" — only on untagged visits. */
.heard-from { margin-bottom: 16px; }
.heard-from .optional { font-weight: 600; color: var(--text-tertiary); }
.heard-from select {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--input-fill);
  border: 1.5px solid transparent;
  border-radius: 12px;
  padding: 12px 14px;
}
.heard-from select:focus { outline: none; border-color: var(--clay); }

.email-row input::placeholder { color: var(--text-tertiary); }
.email-row input:focus { outline: none; border-color: var(--clay); }
.email-row input[aria-invalid="true"] { border-color: var(--error); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  background: var(--clay);
  color: var(--sheet);
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  cursor: pointer;
  text-decoration: none;
  transition: background 150ms ease, transform 150ms ease;
}

.btn:hover { background: var(--clay-hover); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.7; cursor: progress; }
.btn svg { width: 18px; height: 18px; fill: currentColor; }

.form-status {
  min-height: 1.4em;
  margin-top: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--error);
}

/* Newsletter disclosure: secondary text, not tertiary, so it stays legible. */
.fine-print {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-secondary);
  margin-top: 4px;
}

.fine-print a { color: var(--text-secondary); }

.opt-in {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-secondary);
  cursor: pointer;
}

.opt-in input {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--clay);
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Success state */
.signup-done { display: none; }
.signup-done:focus { outline: none; }
#join { scroll-margin-top: 84px; }
.signup.is-done .signup-form { display: none; }
.signup.is-done .signup-done { display: block; animation: rise 320ms ease-out; }

.signup-done .btn { width: 100%; padding: 14px 20px; margin: 6px 0 14px; }

.done-steps {
  list-style: none;
  counter-reset: step;
  margin-bottom: 14px;
}

.done-steps li {
  counter-increment: step;
  position: relative;
  padding-left: 30px;
  font-size: 0.93rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.done-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--chip-bg);
  color: var(--walnut);
  font-size: 0.75rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.link-button {
  background: none;
  border: none;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--clay);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 0;
}

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

/* ── Hero art: the App Store screenshots, one at a time ── */
.hero-art {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  min-width: 0;
}

.shots {
  --shot-w: clamp(240px, 25vw, 330px);
  position: relative;
  width: var(--shot-w);
  aspect-ratio: 1206 / 2622;
  border-radius: calc(var(--shot-w) * 0.075);
  overflow: hidden;
  background: var(--clay);
  box-shadow:
    0 30px 50px -28px rgba(136, 78, 28, 0.7),
    0 2px 0 rgba(43, 30, 16, 0.05);
  touch-action: pan-y;
  user-select: none;
}

/* data-pos is each slide's offset from the visible one. Neighbors wait
   just off either edge; the rest jump there without animating so a
   wrap-around never slides across the visible frame. */
.shot {
  position: absolute;
  inset: 0;
  transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.shot[data-pos="0"] { transform: none; }
.shot[data-pos="1"] { transform: translateX(100%); }
.shot[data-pos="-1"] { transform: translateX(-100%); }
.shot[data-pos="2"] { transform: translateX(100%); transition: none; visibility: hidden; }
.shot[data-pos="-2"] { transform: translateX(-100%); transition: none; visibility: hidden; }

.shots-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.shots-dot {
  width: 28px;
  height: 28px;
  border: 0;
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: 100px;
}

.shots-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 100px;
  background: var(--chip-bg);
  transition: width 300ms ease, background 300ms ease;
}

.shots-dot:hover::before { background: var(--tan); }
.shots-dot[aria-current="true"] { width: 40px; }
.shots-dot[aria-current="true"]::before { width: 24px; background: var(--clay); }

.shots-pause {
  width: 28px;
  height: 28px;
  margin-left: 6px;
  border: 1px solid var(--divider);
  border-radius: 100px;
  background: var(--surface);
  color: var(--walnut);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.shots-pause:hover { border-color: var(--tan); }
.shots-pause svg { width: 12px; height: 12px; }
.shots-pause .icon-play { display: none; }
.shots-pause[aria-pressed="true"] .icon-play { display: block; }
.shots-pause[aria-pressed="true"] .icon-pause { display: none; }

/* ── Features ── */
.features {
  padding: clamp(48px, 8vw, 96px) var(--gutter);
  max-width: 1240px;
  margin: 0 auto;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clay);
  margin-bottom: 10px;
}

.section-title {
  font-family: 'Alegreya', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: clamp(28px, 5vw, 48px);
  max-width: 20ch;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.feat {
  background: var(--surface);
  border-radius: 24px;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--divider);
}

.feat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}

.feat-icon svg { width: 22px; height: 22px; }

.feat:nth-child(1) .feat-icon { background: #E4E8D3; color: var(--moss); }
.feat:nth-child(2) .feat-icon { background: #F4E1C8; color: var(--clay); }
.feat:nth-child(3) .feat-icon { background: #DCE3D0; color: var(--forest); }
.feat:nth-child(4) .feat-icon { background: #F3E3C4; color: var(--walnut); }

.feat h3 {
  font-family: 'Alegreya', serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.25;
}

.feat p {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* ── Bottom CTA / contact ── */
.shelf-strip {
  background: var(--walnut);
  color: var(--sheet);
  padding: clamp(48px, 8vw, 80px) var(--gutter);
  text-align: center;
}

.shelf-strip h2 {
  font-family: 'Alegreya', serif;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 8px;
}

.shelf-strip p {
  font-size: 1.05rem;
  opacity: 0.9;
  margin: 0 auto 26px;
  max-width: 48ch;
}

.strip-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-cream {
  background: var(--sheet);
  color: var(--walnut);
}

.btn-cream:hover { background: var(--amber); }

.btn-ghost {
  background: rgba(254, 250, 223, 0.12);
  color: var(--sheet);
  border: 1px solid rgba(254, 250, 223, 0.35);
}

.btn-ghost:hover { background: rgba(254, 250, 223, 0.22); }

/* ── Footer ── */
footer {
  background: var(--sheet);
  border-top: 1px solid var(--divider);
  padding: 26px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

footer p { font-size: 0.85rem; color: var(--text-tertiary); }

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

footer a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
}

footer a:hover { color: var(--clay); }

footer .footer-credit {
  flex-basis: 100%;
  font-size: 0.78rem;
  line-height: 1.5;
}

footer .footer-credit a {
  font-size: inherit;
  font-weight: 600;
  color: var(--text-tertiary);
  text-decoration: underline;
}

/* ── Beta FAQ page ── */
.page-hero {
  background: linear-gradient(160deg, var(--moss) 0%, var(--moss-light) 100%);
  color: var(--amber);
  padding: clamp(48px, 9vw, 96px) var(--gutter);
  text-align: center;
}

.page-hero h1 {
  font-family: 'Alegreya', serif;
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 800;
  line-height: 1.08;
  margin-bottom: 14px;
}

.page-hero p {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  max-width: 52ch;
  margin: 0 auto 26px;
}

.faq-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 72px) var(--gutter);
}

.faq-section-title {
  font-family: 'Alegreya', serif;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--walnut);
  margin: 44px 0 16px;
}

.faq-section-title:first-child { margin-top: 0; }

.faq {
  margin-bottom: 8px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--divider);
  overflow: hidden;
}

.faq summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  font-family: 'Alegreya', serif;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
}

.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--clay); }

.faq-chevron {
  width: 18px;
  height: 18px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: transform 200ms ease;
}

.faq[open] { background: var(--sheet); }
.faq[open] .faq-chevron { transform: rotate(180deg); }

.faq-body { padding: 0 20px 18px; }

.faq-body p, .faq-body li {
  font-size: 1rem;
  color: var(--text-secondary);
}

.faq-body p + p { margin-top: 8px; }

.faq-body ul, .faq-body ol { padding-left: 22px; margin: 8px 0; }
.faq-body li { margin-bottom: 4px; }

.faq-body a, .prose a {
  color: var(--clay);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.faq-body strong { color: var(--text-primary); }

.feedback-card {
  margin-top: 48px;
  background: var(--walnut);
  color: var(--sheet);
  border-radius: 24px;
  padding: clamp(26px, 4vw, 40px);
  text-align: center;
}

.feedback-card h2 {
  font-family: 'Alegreya', serif;
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.feedback-card p { opacity: 0.9; margin-bottom: 22px; }

/* ── Privacy page ── */
.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(44px, 8vw, 88px) var(--gutter);
}

.prose h1 {
  font-family: 'Alegreya', serif;
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  color: var(--walnut);
  line-height: 1.1;
  margin-bottom: 6px;
}

.prose .updated {
  font-size: 0.9rem;
  color: var(--text-tertiary);
  margin-bottom: 40px;
}

.prose h2 {
  font-family: 'Alegreya', serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 36px 0 10px;
}

.prose p, .prose li {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.prose ul, .prose ol { padding-left: 22px; margin-bottom: 10px; }
.prose h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 22px 0 8px;
}
.prose .callout {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 16px;
  padding: 18px 20px;
  margin: 18px 0 8px;
}
.prose .callout p:last-child { margin-bottom: 0; }
.prose strong { color: var(--text-primary); }

/* ── Responsive ── */
@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .shots { --shot-w: min(64vw, 300px); }
  .hero-icon-mobile {
    display: block;
    width: 72px;
    height: 72px;
    border-radius: 16px;
    margin-bottom: 18px;
    box-shadow: 0 10px 20px -12px rgba(39, 54, 23, 0.8);
  }
  .features-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .nav-right .nav-hide-sm { display: none; }
  .eyebrow { font-size: 0.72rem; letter-spacing: 0.08em; }
  .hero { padding-top: 12px; }
  .hero-card { border-radius: 22px; }
  .email-row .btn { width: 100%; }
  footer { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 400px) {
  .nav-right .nav-hide-xs { display: none; }
  .brand span { font-size: 1.25rem; }
}

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