/* ==========================================================================
   Atticus Fin — marketing site stylesheet
   Plain CSS, mobile-first. Breakpoints: 768px (tablet), 1024px (desktop).
   Light mode only — the marketing site never uses dark mode.
   ========================================================================== */

/* --- Tokens --------------------------------------------------------------- */
:root {
  /* palette */
  --bg-primary: #F4EFE6;     /* parchment */
  --bg-card: #EBE3D3;        /* bone */
  --bg-elevated: #FAF6EE;    /* cream */
  --text-primary: #2B2422;   /* ink sepia */
  --text-secondary: #6B5D52; /* walnut */
  --text-tertiary: #9A8A7A;  /* driftwood — decorative only; fails AA on parchment for body text */
  --accent-primary: #8B6F47; /* sepia */
  --accent-secondary: #B89968; /* tan */
  --olive: #6B7A4D;          /* income / positive */
  --terracotta: #A04A3C;     /* expense / negative */
  --amber: #C4843E;          /* warning */
  --border-subtle: #D9CFBE;  /* sand */
  --border-strong: #6B5D52;  /* walnut */

  /* type */
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* layout */
  --maxw: 1080px;
  --maxw-narrow: 680px;
  --radius: 12px;
  --radius-sm: 4px;
  --header-h: 56px;
}

/* --- Reset / base --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 8px); /* anchor targets clear the sticky header */
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 500; margin: 0; line-height: 1.15; }
p { margin: 0 0 1rem; }
a { color: var(--accent-primary); text-decoration: none; }
a:hover { color: var(--accent-secondary); }
/* Monetary / mono figures never break mid-value ($156 never wraps to "$15\n6"). */
.mono, .nowrap { font-family: var(--font-mono); white-space: nowrap; }
.nowrap { font-family: inherit; }

/* Keyboard focus ring (sepia, offset). :focus-visible so mouse clicks stay clean. */
a:focus-visible, button:focus-visible, .btn:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Layout helpers ------------------------------------------------------- */
section[id] { scroll-margin-top: calc(var(--header-h) + 16px); }
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  /* respect the notch in landscape on iPhones (viewport-fit=cover) */
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}
.narrow { max-width: var(--maxw-narrow); }
.section { padding: 64px 0; }
.section-pad-lg { padding: 64px 0; }
.center { text-align: center; }
.eyebrow {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 16px;
}

/* --- Buttons / links ------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;            /* iOS tap target */
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  padding: 11px 24px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent-primary); color: var(--bg-primary); }
.btn-primary:hover { background: var(--accent-secondary); color: var(--bg-primary); }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text-primary); }
.btn-outline:hover { background: var(--bg-card); color: var(--text-primary); }
.link-arrow { color: var(--accent-primary); font-weight: 500; }
.link-arrow:hover { text-decoration: underline; }
.text-link { color: var(--accent-primary); }
.text-link:hover { text-decoration: underline; }

/* --- Header --------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 239, 230, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border-subtle);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); }
.logo { font-family: var(--font-head); font-size: 18px; font-weight: 600; color: var(--text-primary); display: inline-flex; align-items: center; min-height: 44px; }
.logo:hover { color: var(--text-primary); }
.site-nav { display: flex; align-items: center; gap: 14px; }
.site-nav a { color: var(--text-secondary); font-size: 14px; display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
.site-nav a:hover { color: var(--text-primary); }
.site-nav a.btn-primary { color: var(--bg-primary); padding: 8px 16px; }

/* --- Hero ----------------------------------------------------------------- */
.hero { padding: 48px 0 64px; }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 32px; font-weight: 500; line-height: 1.12; margin: 0 0 20px; }
.hero .subhead { font-size: 18px; color: var(--text-secondary); line-height: 1.5; max-width: 480px; margin: 0 0 28px; }
.hero-cta-row { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.hero .secondary-link { font-size: 15px; color: var(--text-secondary); display: inline-flex; align-items: center; min-height: 44px; }
.hero .secondary-link:hover { color: var(--accent-primary); }
/* Animation is the product story — shown at every width, with breathing room. */
.hero-animation { margin-top: 8px; }

/* --- Problem -------------------------------------------------------------- */
.problem h2 { font-size: 28px; margin: 0 0 20px; }
.problem p { font-size: 17px; color: var(--text-primary); line-height: 1.5; }

/* --- Thesis cards --------------------------------------------------------- */
.thesis h2 { font-size: 28px; margin: 0 0 32px; }
.card-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 28px;
}
.card .num { font-family: var(--font-body); font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--accent-primary); margin: 0 0 12px; }
.card h3 { font-size: 22px; margin: 0 0 12px; }
.card p { font-size: 15px; color: var(--text-secondary); margin: 0; }

/* --- How it works --------------------------------------------------------- */
.how h2 { font-size: 28px; margin: 0 0 40px; }
.steps { display: grid; grid-template-columns: 1fr; gap: 36px; }
.step .step-num { font-family: var(--font-head); font-size: 56px; font-weight: 500; color: var(--accent-primary); line-height: 1; margin: 0 0 8px; }
.step h3 { font-size: 20px; margin: 0 0 10px; }
.step p { font-size: 14px; color: var(--text-secondary); line-height: 1.5; margin: 0; }

/* --- Trust ---------------------------------------------------------------- */
.trust { background: var(--bg-card); }
.trust .inner { max-width: 720px; margin: 0 auto; text-align: center; }
.trust img { height: 32px; margin: 0 auto 8px; }
.trust .caption { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-secondary); margin: 0 0 24px; }
.trust p { font-size: 15px; color: var(--text-primary); max-width: 600px; margin: 0 auto; }

/* --- Pricing teaser ------------------------------------------------------- */
.pricing-teaser { text-align: center; }
.pricing-teaser h2 { font-size: 26px; margin: 0 0 12px; }

/* --- Closing CTA ---------------------------------------------------------- */
.closing { text-align: center; padding: 80px 0; }
.closing h2 { font-size: 32px; margin: 0 0 28px; }
.closing .note { font-size: 14px; color: var(--text-secondary); margin: 16px 0 0; }

/* --- Footer --------------------------------------------------------------- */
.site-footer {
  background: var(--bg-card);
  color: var(--text-secondary);
  padding: 56px 0 calc(40px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-subtle);
}
.footer-cols { display: grid; grid-template-columns: 1fr; gap: 28px; }
.footer-col h4 { font-family: var(--font-body); font-size: 13px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-secondary); margin: 0 0 8px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 0; }
.footer-col a { color: var(--text-secondary); font-size: 15px; display: inline-flex; align-items: center; min-height: 40px; padding: 2px 0; }
.footer-col a:hover { color: var(--text-primary); }
.footer-bottom { text-align: center; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--border-subtle); font-size: 12px; color: var(--text-secondary); }

/* --- Generic page header (interior pages) --------------------------------- */
.page-head { padding: 56px 0 24px; text-align: center; }
.page-head h1 { font-size: 34px; margin: 0 0 16px; }
.page-head .subhead { font-size: 16px; color: var(--text-secondary); max-width: 520px; margin: 0 auto; }

/* --- Pricing page --------------------------------------------------------- */
.price-grid { display: grid; grid-template-columns: 1fr; gap: 24px; margin-top: 24px; }
.price-card { position: relative; background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; }
.price-card.featured { border: 2px solid var(--accent-primary); }
.badge { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--accent-primary); color: var(--bg-primary); font-size: 11px; font-weight: 600; letter-spacing: 0.5px; padding: 5px 12px; border-radius: var(--radius-sm); }
.price-card .price { font-family: var(--font-head); font-size: 44px; font-weight: 500; line-height: 1; }
.price-card .price-sub { color: var(--text-secondary); font-size: 14px; margin: 6px 0 16px; }
.price-card .desc { font-size: 14px; color: var(--text-primary); margin: 0 0 16px; line-height: 1.5; }
.price-card .best-for { font-size: 13px; color: var(--text-secondary); margin: 0 0 24px; }
.price-card .best-for strong { color: var(--text-primary); font-weight: 600; }
.price-card .btn { margin-top: auto; width: 100%; }

.compare-wrap { margin: 48px 0; }
table.compare { width: 100%; border-collapse: collapse; font-size: 14px; }
table.compare th, table.compare td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); }
table.compare thead th { font-family: var(--font-head); font-weight: 600; font-size: 16px; background: var(--bg-card); }
table.compare tbody th { font-weight: 500; color: var(--text-primary); }
table.compare td { color: var(--text-secondary); }
table.compare td.yes { color: var(--olive); font-family: var(--font-mono); }
table.compare tr:nth-child(even) td, table.compare tr:nth-child(even) th { background: rgba(235, 227, 211, 0.4); }

.faq { max-width: var(--maxw-narrow); margin: 0 auto; }
.faq h2 { font-size: 26px; margin: 0 0 28px; text-align: center; }
.faq-item { border-bottom: 1px solid var(--border-subtle); padding: 20px 0; }
.faq-item h3 { font-family: var(--font-body); font-size: 16px; font-weight: 600; margin: 0 0 8px; color: var(--text-primary); }
.faq-item p { font-size: 15px; color: var(--text-secondary); margin: 0; }

/* --- About ---------------------------------------------------------------- */
.about { max-width: var(--maxw-narrow); margin: 0 auto; }
.about .who { text-align: center; margin-bottom: 48px; }
.about .headshot { width: 200px; height: 200px; border-radius: 50%; border: 1px solid var(--border-subtle); margin: 0 auto 20px; object-fit: cover; }
.about .who h1 { font-size: 30px; margin: 0 0 4px; }
.about .who .role { color: var(--text-secondary); font-size: 16px; }
.about h2 { font-size: 24px; margin: 40px 0 16px; }
.about p { font-size: 17px; line-height: 1.6; color: var(--text-primary); }

/* --- Legal / doc pages ---------------------------------------------------- */
.doc { max-width: var(--maxw-narrow); margin: 0 auto; }
.doc h1 { font-size: 32px; margin: 0 0 8px; }
.doc .updated { color: var(--text-secondary); font-size: 13px; margin: 0 0 40px; }
.doc h2 { font-size: 20px; margin: 36px 0 12px; }
.doc h3 { font-family: var(--font-body); font-weight: 600; font-size: 16px; margin: 20px 0 8px; }
.doc p, .doc li { font-size: 16px; color: var(--text-primary); line-height: 1.55; }
.doc ul { padding-left: 20px; margin: 0 0 1rem; }
.doc li { margin-bottom: 8px; }
.doc .callout { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: 20px 24px; margin: 20px 0; }
.doc .callout p:last-child { margin-bottom: 0; }
.doc strong { font-weight: 600; }

/* --- Access form ---------------------------------------------------------- */
.form-wrap { max-width: 440px; margin: 0 auto; }
.access-form label { display: block; font-size: 14px; font-weight: 500; color: var(--text-primary); margin: 18px 0 6px; }
.access-form input, .access-form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;              /* >=16px so iOS Safari doesn't zoom on focus */
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
}
.access-form input:focus, .access-form textarea:focus { outline: none; border-color: var(--accent-primary); }
.access-form input:focus-visible, .access-form textarea:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 1px; }
.access-form textarea { resize: vertical; }
.access-form .btn { width: 100%; margin-top: 24px; }
.form-note { font-size: 13px; color: var(--text-secondary); margin-top: 20px; text-align: center; }
.form-success { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: 32px; text-align: center; color: var(--text-secondary); font-size: 16px; }

/* --- 404 ------------------------------------------------------------------ */
.notfound { text-align: center; padding: 96px 0; }
.notfound h1 { font-size: 32px; margin: 0 0 16px; }
.notfound p { color: var(--text-secondary); }

/* ==========================================================================
   SMS animation — fake iPhone frame + iMessage bubbles
   ========================================================================== */
.phone {
  width: 320px;
  max-width: 100%;
  margin: 0 auto;
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: 28px;
  box-shadow: 0 12px 40px rgba(43, 36, 34, 0.12);
  overflow: hidden;
}
.phone-header {
  text-align: center;
  padding: 12px 0 10px;
  border-bottom: 1px solid #E5E5EA;
}
.phone-header .name { color: #000; font-size: 13px; font-weight: 500; font-family: var(--font-body); }
.phone-header .service { color: #6E6E73; font-size: 11px; font-family: var(--font-body); }
.phone-body { padding: 12px; min-height: 380px; display: flex; flex-direction: column; gap: 2px; }

.msg-row { display: flex; flex-direction: column; margin-bottom: 6px; }
.msg-row.received { align-items: flex-start; }
.msg-row.sent { align-items: flex-end; }
.bubble {
  max-width: 78%;
  padding: 8px 13px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.received .bubble { background: #E5E5EA; color: #000; border-radius: 18px 18px 18px 4px; }
.sent .bubble { background: #0B93F6; color: #FFF; border-radius: 18px 18px 4px 18px; }
.timestamp { font-size: 10px; color: #6E6E73; padding-top: 4px; font-family: var(--font-body); }
.received .timestamp { padding-left: 4px; }
.sent .timestamp { padding-right: 4px; }

/* typing indicator */
.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: #8E8E93; opacity: 0.5; animation: typing-pulse 1.2s infinite ease-in-out; }
.sent .typing span { background: rgba(255,255,255,0.85); }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-pulse { 0%, 60%, 100% { opacity: 0.35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

.phone-body.fading { opacity: 0; transition: opacity 1s ease; }

/* On very narrow phones, let the frame use the full column width. */
@media (max-width: 359px) {
  .phone { width: 100%; }
}

/* ==========================================================================
   Responsive — tablet (768px) and desktop (1024px)
   ========================================================================== */
@media (min-width: 768px) {
  .hero h1 { font-size: 48px; }
  .problem h2, .thesis h2, .how h2 { font-size: 30px; }
  .pricing-teaser h2 { font-size: 28px; }
  .faq h2 { font-size: 28px; }
  .closing h2 { font-size: 36px; }
  .page-head h1 { font-size: 40px; }
  .doc h1 { font-size: 36px; }
  .about .headshot { width: 240px; height: 240px; }
  .about .who h1 { font-size: 32px; }
  .step .step-num { font-size: 64px; }
  .price-card .price { font-size: 48px; }
  /* roomier line-heights on larger screens */
  .problem p { line-height: 1.6; }
  .about p { line-height: 1.7; }
  .doc p, .doc li { line-height: 1.65; }
  body { line-height: 1.6; }
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .price-grid { grid-template-columns: repeat(3, 1fr); align-items: stretch; }
  .footer-cols { grid-template-columns: repeat(3, 1fr); }
  .section { padding: 80px 0; }
  .section-pad-lg { padding: 96px 0; }
  .closing { padding: 96px 0; }
}

@media (min-width: 1024px) {
  .hero { padding: 72px 0 88px; }
  .hero-grid { grid-template-columns: 1.1fr 0.9fr; gap: 56px; }
  .hero h1 { font-size: 56px; }
  .hero-animation { margin-top: 0; }
  .closing h2 { font-size: 40px; }
  .page-head h1 { font-size: 48px; }
}

/* --- Pricing comparison: stacked cards on mobile (no horizontal scroll) --- */
@media (max-width: 767px) {
  table.compare, table.compare tbody, table.compare tr, table.compare th, table.compare td { display: block; width: 100%; }
  table.compare thead { display: none; }
  table.compare tr {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    margin-bottom: 16px;
    padding: 6px 16px 10px;
  }
  table.compare tr:nth-child(even) td, table.compare tr:nth-child(even) th { background: transparent; }
  table.compare tbody th {
    font-family: var(--font-head);
    font-size: 17px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
  }
  table.compare td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 8px 0;
    border-bottom: none;
    color: var(--text-primary);
  }
  table.compare td::before {
    content: attr(data-label);
    color: var(--text-secondary);
    font-weight: 500;
  }
}

/* Reduced motion: the JS shows all messages at once; nothing extra needed here,
   but disable the typing-dot keyframe and transforms for safety. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .typing span { animation: none; }
  .phone-body.fading { transition: none; }
  .btn:active { transform: none; }
}
