/* ============================================
   Tuiscint — Candlelit theme
   Tokens lifted directly from the app's theme.ts
   ============================================ */

:root {
  /* Light: Candlelit */
  --bg:       #f7f1e9;
  --bg-deep:  #f0e8e0;
  --surface:  #fdf9f4;
  --ink:      #221a16;
  --ink-soft: #48413c;
  --mute:     #76706c;
  --rule:     #ddd6cf;
  --chip:     #e8e0d8;
  --accent:   #c56a3e;

  /* Score-color gradient stops */
  --score-0:   #7b8891;
  --score-25:  #a5b1aa;
  --score-50:  #ddd7cd;
  --score-75:  #d6a273;
  --score-100: #d16022;

  /* Radii */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-pill: 999px;

  /* Type */
  --font-ui: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-journal: "Patrick Hand", "Open Sans", sans-serif;

  /* Layout */
  --maxw: 1080px;
  --maxw-narrow: 720px;
  --pad: 24px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #151a20;
    --bg-deep:  #0c1116;
    --surface:  #20262b;
    --ink:      #efeae4;
    --ink-soft: #bcb6af;
    --mute:     #7f878e;
    --rule:     #2d343a;
    --chip:     #2b3137;
    --accent:   #e28d4f;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease;
}
a:hover { border-bottom-color: var(--accent); }

a.brandmark { border-bottom: none; }
a.brandmark:hover { border-bottom: none; }

::selection { background: var(--accent); color: #fff; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 16px;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  border-bottom: none;
  transform: translateY(-200%);
  transition: transform 160ms ease;
  z-index: 100;
}
.skip-link:focus {
  transform: translateY(0);
  border-bottom: none;
}

/* ============================================
   Layout primitives
   ============================================ */

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.wrap-narrow {
  max-width: var(--maxw-narrow);
  margin: 0 auto;
  padding: 0 var(--pad);
}

section {
  padding: 96px 0;
  border-top: 1px solid var(--rule);
}

section:first-of-type { border-top: none; }

/* ============================================
   The master section pattern
   - .section-header at the top, left-aligned, max 720px
   - .section-body fills the wrap beneath, 64px below
   ============================================ */

.section-header {
  max-width: 720px;
  margin: 0 0 64px 0;
}

.section-header .kicker { margin: 0 0 14px 0; }

.section-header h2 { margin: 0; }

.section-header .lead {
  margin: 24px 0 0 0;
  max-width: 56ch;
}

.section-body { width: 100%; }

@media (max-width: 720px) {
  section { padding: 72px 0; }
  .section-header { margin-bottom: 48px; }
  .section-header h2 { font-size: clamp(26px, 7vw, 32px); }
}

.kicker {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--mute);
  margin: 0 0 16px 0;
}

h1, h2, h3, h4 {
  font-family: var(--font-ui);
  color: var(--ink);
  margin: 0;
  /*text-wrap: balance;*/
}

h1 {
  font-size: clamp(36px, 5vw, 58px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

h3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1em 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.6;
  text-wrap: pretty;
}

p.lead {
  font-size: 21px;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ============================================
   Header / nav
   ============================================ */

.site-header {
  padding: 28px 0 0 0;
  position: sticky;
  top: 0;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}

.brandmark {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brandmark .name {
  font-size: 18px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.005em;
}

.brandmark .pron {
  font-size: 14px;
  font-weight: 400;
  color: var(--mute);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  border-bottom: none;
}

.nav-links a:hover { color: var(--accent); }

.nav-links a.cta {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  padding: 8px 16px;
  border-radius: var(--r-pill);
  transition: background 160ms ease, color 160ms ease;
}

.nav-links a.cta:hover {
  background: var(--ink);
  color: var(--bg);
}

@media (max-width: 640px) {
  .nav-links { gap: 16px; }
  .nav-links a:not(.cta) { display: none; }
}

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

.hero { padding: 96px 0 64px 0; border-top: none; }

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

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
}

.hero h1 { margin-bottom: 24px; }

.hero .lead { max-width: 30ch; }

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;
  flex-wrap: wrap;
  align-items: center;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: var(--bg);
  padding: 14px 24px;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 600;
  border-bottom: none;
  transition: transform 160ms ease, background 160ms ease;
}
.btn-primary:hover {
  background: var(--accent);
  border-bottom: none;
}

.btn-ghost {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  border-bottom: none;
}
.btn-ghost:hover { color: var(--accent); }

/* Score arc — quiet, decorative */
.arc-mark {
  width: 100%;
  max-width: 280px;
  height: auto;
  display: block;
  margin: 0 0 40px 0;
}

/* Phone frame */
.phone-frame {
  position: relative;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 9 / 19.5;
  margin: 0 auto;
  border-radius: 42px;
  background: #1a1410;
  padding: 8px;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.08),
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 30px 60px -20px rgba(34, 26, 22, 0.25),
    0 12px 24px -8px rgba(34, 26, 22, 0.15);
}

.phone-frame .screen {
  position: absolute;
  inset: 8px;
  border-radius: 34px;
  overflow: hidden;
  background: var(--bg);
}

.phone-frame .screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.phone-frame::after {
  content: "";
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 88px;
  height: 24px;
  background: #0a0806;
  border-radius: var(--r-pill);
  z-index: 3;
}

/* Log section body */
.log-section {
  background:
    radial-gradient(ellipse 1200px 600px at 70% 40%, color-mix(in oklab, var(--score-75) 18%, transparent) 0%, transparent 70%),
    var(--bg);
}

.log-mock {
  max-width: 560px;
  margin: 0;
  /* The Log screen background wash in the app is a peach/cream tint */
  background: #fbeadb;
  border: 1px solid color-mix(in oklab, var(--score-75) 30%, var(--rule));
  border-radius: var(--r-lg);
  padding: 32px 36px 24px 36px;
  box-shadow:
    0 30px 60px -28px rgba(34, 26, 22, 0.18),
    0 8px 20px -10px rgba(34, 26, 22, 0.10);
}

@media (max-width: 640px) {
  .log-mock { padding: 24px 22px 20px 22px; }
}

.log-mock-inner { display: block; }

.log-mock-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
}

.log-back {
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
  border-bottom: none;
}

.log-brand { text-align: right; line-height: 1.2; }
.log-brand-name { color: var(--accent); font-size: 18px; font-weight: 500; }
.log-brand-pron { color: var(--mute); font-size: 13px; }

.log-meta {
  color: var(--mute);
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 18px;
}

.log-score {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 32px;
}

.log-score-num {
  font-size: 72px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.02em;
}

.log-score-word {
  font-size: 22px;
  font-weight: 400;
  color: var(--ink-soft);
}

.log-slider { padding: 8px 0; margin-bottom: 36px; }

.log-slider-track {
  position: relative;
  height: 6px;
  border-radius: var(--r-pill);
  background: linear-gradient(
    to right,
    var(--score-0) 0%,
    var(--score-25) 25%,
    var(--score-50) 50%,
    var(--score-75) 75%,
    var(--score-100) 100%
  );
}

.log-slider-thumb {
  position: absolute;
  top: 50%;
  left: 80%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--score-100);
  border: 3px solid #fbeadb;
  box-shadow: 0 2px 5px rgba(34, 26, 22, 0.22);
  transform: translate(-50%, -50%);
}

.log-entry {
  font-family: var(--font-journal);
  font-size: 22px;
  line-height: 1.45;
  color: var(--ink);
  margin: 0 0 36px 0;
  font-weight: 400;
}

.log-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid color-mix(in oklab, var(--score-75) 28%, transparent);
  gap: 16px;
}

.log-tagchip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--mute);
  font-size: 13px;
}

.log-tag-glyph {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--rule);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-weight: 500;
}

.log-tag-text { font-size: 13px; color: var(--ink-soft); }

.log-actions { display: flex; align-items: center; gap: 20px; }

.log-cancel { color: var(--ink-soft); font-size: 15px; font-weight: 400; }

.log-save {
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--r-pill);
}

/* ============================================
   How it works — three steps
   ============================================ */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  align-items: stretch;
}

@media (max-width: 880px) {
  .steps { grid-template-columns: 1fr; gap: 56px; }
}

.step {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
}

.step-text {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.step-num {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

.step h3 { margin-bottom: 12px; }

.step p { font-size: 16px; margin-bottom: 0; }

.step .phone-frame {
  margin-top: 56px;
  margin-left: auto;
  margin-right: auto;
  max-width: 240px;
  flex: 0 0 auto;
}

/* ============================================
   Privacy — its own section, quiet and direct
   ============================================ */

.privacy {
  background: var(--bg-deep);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.privacy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

@media (max-width: 880px) {
  .privacy-grid { grid-template-columns: 1fr; gap: 32px; }
}

.privacy ul {
  list-style: none;
  padding: 0;
  margin: 24px 0 0 0;
}

.privacy li {
  padding: 16px 0;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: baseline;
}

.privacy li:last-child { border-bottom: 1px solid var(--rule); }

.privacy li .label {
  font-size: 13px;
  font-weight: 500;
  color: var(--mute);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.privacy li .val {
  font-size: 16px;
  color: var(--ink);
  font-weight: 500;
}

/* ============================================
   What it finds — sample insight + tags
   ============================================ */

.insight-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 32px 36px;
  border: 1px solid var(--rule);
  max-width: 640px;
  margin: 0;
}

.insight-card .header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--mute);
  letter-spacing: 0.02em;
}

.insight-card .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.insight-card .body {
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink);
  margin: 0;
  font-weight: 400;
}

.insight-card .body em {
  font-style: normal;
  background: linear-gradient(to bottom, transparent 65%, color-mix(in oklab, var(--accent) 22%, transparent) 65%);
  padding: 0 2px;
}

.tag-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-top: 64px;
}

.tag-grid h3 { margin-bottom: 8px; }

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

.tag-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}

.tag-row .score-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg);
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.score-badge--high { background: var(--score-100); }
.score-badge--warm { background: var(--score-75); }
.score-badge--cool { background: var(--score-25); }
.score-badge--low  { background: var(--score-0); }

.tag-row .chip {
  background: var(--chip);
  color: var(--ink);
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
}

.tag-row .chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ============================================
   Who it's for
   ============================================ */

.audience-list {
  margin: 0;
  max-width: 760px;
  display: flex;
  flex-direction: column;
}

.audience-list .row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 48px;
  padding: 28px 0;
  border-top: 1px solid var(--rule);
  align-items: baseline;
}

.audience-list .row:last-child { border-bottom: 1px solid var(--rule); }

.audience-list .row .who {
  font-size: 14px;
  font-weight: 500;
  color: var(--mute);
  letter-spacing: 0.02em;
}

.audience-list .row .desc {
  font-size: 19px;
  color: var(--ink);
  line-height: 1.45;
  margin: 0;
  font-weight: 400;
  letter-spacing: -0.005em;
  text-wrap: pretty;
}

@media (max-width: 640px) {
  .audience-list .row { grid-template-columns: 1fr; gap: 8px; padding: 24px 0; }
  .audience-list .row .desc { font-size: 17px; }
}

/* ============================================
   Download / CTA
   ============================================ */

.download {
  background: var(--bg-deep);
}

.download .badges {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0;
}

.app-badge {
  display: inline-block;
  padding: 11px;
  border-bottom: none;
  transition: transform 160ms ease;
}
.app-badge:hover {
  transform: translateY(-2px);
  border-bottom: none;
}
.app-badge img { display: block; }

.download .req {
  font-size: 13px;
  color: var(--mute);
  margin: 32px 0 0 0;
  max-width: 80ch;
}

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

footer {
  padding: 48px 0 64px 0;
  border-top: 1px solid var(--rule);
}

footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 32px;
}

footer .brandmark .name { font-size: 16px; }
footer .brandmark .pron { font-size: 13px; }

footer .meta {
  font-size: 13px;
  color: var(--mute);
  margin-top: 12px;
  max-width: 36ch;
  line-height: 1.5;
}

footer .links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

footer .links a {
  color: var(--ink-soft);
  border-bottom: none;
}
footer .links a:hover { color: var(--accent); }

footer .copy {
  font-size: 12px;
  color: var(--mute);
  margin-top: 32px;
  width: 100%;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

/* ============================================
   Reading pages (privacy, support, terms)
   ============================================ */

.reading {
  padding: 64px 0 96px 0;
}

.reading .crumb {
  font-size: 13px;
  color: var(--mute);
  margin-bottom: 24px;
}

.reading .crumb a { color: var(--mute); border-bottom: none; }
.reading .crumb a:hover { color: var(--accent); }

.reading h1 {
  font-size: clamp(32px, 4.5vw, 48px);
  line-height: 1.1;
  margin-bottom: 8px;
}

.reading .updated {
  font-size: 13px;
  color: var(--mute);
  margin-bottom: 48px;
}

.reading article h2 {
  font-size: 22px;
  margin: 48px 0 16px 0;
  letter-spacing: -0.005em;
}

.reading article h3 {
  font-size: 17px;
  margin: 28px 0 10px 0;
  color: var(--ink);
}

.reading article p,
.reading article li {
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.reading article ul {
  padding-left: 22px;
  margin: 0 0 16px 0;
}

.reading article li { margin-bottom: 6px; }

.reading article strong { color: var(--ink); font-weight: 600; }

.callout {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 24px 28px;
  margin: 32px 0;
}

.callout p:last-child { margin-bottom: 0; }

/* Support page specific */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 32px 0 48px 0;
}

@media (max-width: 640px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 24px;
}

.contact-card .label {
  font-size: 12px;
  font-weight: 500;
  color: var(--mute);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.contact-card .val {
  font-size: 18px;
  color: var(--ink);
  font-weight: 500;
}

.contact-card .val a {
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
}
.contact-card .val a:hover { border-bottom-color: var(--accent); color: var(--accent); }

.contact-card .note {
  font-size: 13px;
  color: var(--mute);
  margin-top: 8px;
}

details.faq {
  border-top: 1px solid var(--rule);
  padding: 20px 0;
}

details.faq:last-of-type {
  border-bottom: 1px solid var(--rule);
}

details.faq summary {
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

details.faq summary::-webkit-details-marker { display: none; }

details.faq summary::after {
  content: "+";
  color: var(--mute);
  font-size: 22px;
  font-weight: 300;
  transition: transform 200ms ease;
}

details.faq[open] summary::after {
  content: "−";
}

details.faq[open] summary { color: var(--accent); }

details.faq .answer {
  margin-top: 12px;
  font-size: 16px;
  color: var(--ink-soft);
  line-height: 1.6;
}

details.faq .answer p:last-child { margin-bottom: 0; }
