/* ==========================================================================
   Tempered Studio — THE stylesheet
   One shared design system for the homepage and every individual app page.
   Used by: index.html, apps/dandle.html, apps/today-hub.html,
            apps/app-template.html, and anything else you add to apps/.

   App pages override only three variables (--accent, --accent-deep,
   --accent-warm) in their own tiny inline <style> block. Everything else —
   type, spacing, nav, footer, buttons, every component below — comes
   from here, so no page ever has to reinvent its own chrome.
   ========================================================================== */

:root{
  --paper:        #f8f9fa;
  --surface:      #ffffff;
  --ink:          #201d1a;
  --ink-strong:   #15171a;   /* near-black, reserved for headings */
  --muted:        #686c72;
  --line:         #e2e4e7;
  --radius:       18px;
  --shadow:       0 1px 2px rgba(20,22,26,0.05), 0 10px 28px rgba(20,22,26,0.07);

  /* Studio default accent — the homepage and any app that doesn't
     override these three gets steel blue / rust. */
  --accent:       #3d4f63;
  --accent-deep:  #2f3e4e;
  --accent-warm:  #b5652c;

  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body:    'IBM Plex Sans', -apple-system, sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;

  --wrap: 1080px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ animation: none !important; transition: none !important; }
}

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

a{ color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.eyebrow{
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--accent-warm); font-weight: 500; margin: 0 0 20px;
}

/* ---------- Temper strip — a thin echo of the homepage's steel-tempering
   bar, run edge-to-edge at the very top of every APP page only (the
   homepage doesn't need it — it already has the full temper-bar treatment
   in its hero). This is the visual tie-back to the studio brand. ---------- */
.temper-strip{
  height: 4px; width: 100%;
  background: linear-gradient(90deg, #e9d38c 0%, #d1a24a 20%, #b5652c 40%, #7a4a4a 58%, #5c3f66 74%, #3d4f63 100%);
}

/* ---------- Studio wayfinding bar (app pages only, not the homepage) ---------- */
.studio-bar{ background: var(--surface); border-bottom: 1px solid var(--line); }
.studio-bar .wrap{
  display:flex; align-items:center; justify-content:space-between; height: 40px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
}
.studio-bar a{ color: var(--muted); transition: color .15s ease; }
.studio-bar a:hover{ color: var(--accent); }

/* ---------- Header / nav (identical on every page) ---------- */
header.site{
  padding: 26px 0;
  position: sticky;
  top: 0;
  background: rgba(248,249,250,0.9);
  backdrop-filter: blur(8px);
  z-index: 10;
  border-bottom: 1px solid transparent;
}
header.site.on-app{ padding: 20px 0; border-bottom: 1px solid var(--line); }
header.site .wrap{ display:flex; align-items:center; justify-content:space-between; gap: 20px; }
.brand{ font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; color: var(--ink-strong); }
.brand .dot{ color: var(--accent-warm); }
.nav-links{ display:flex; align-items:center; gap: 26px; }
.nav-links a{
  font-size: 12px; color: var(--muted); font-family: var(--font-mono); font-weight: 500;
  letter-spacing: 0.04em; border-bottom: 1px solid transparent; padding-bottom: 2px;
  transition: color .15s ease, border-color .15s ease;
}
.nav-links a:hover{ color: var(--accent); border-color: var(--accent); }
.nav-cta{
  font-family: var(--font-body); font-size: 13px; font-weight: 500; color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px;
  transition: border-color .15s ease, color .15s ease;
}
.nav-cta:hover{ border-color: var(--accent); color: var(--accent); }
@media (max-width: 640px){ .nav-links a:not(.nav-cta){ display:none; } }

/* ---------- Buttons (shared everywhere) ---------- */
.btn{
  display:inline-flex; align-items:center; gap: 8px; font-family: var(--font-body);
  font-size: 15px; font-weight: 600; border-radius: 999px; padding: 14px 28px;
  border: 1px solid transparent; cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn-primary{ background: var(--accent); color: #fff; }
.btn-primary:hover{ background: var(--accent-deep); }
.btn-ghost{ background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover{ border-color: var(--accent); color: var(--accent); }
.btn-note{ font-size: 0.9rem; color: var(--muted); }
.status-note{ font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.status-note::before{ content:"●"; color: var(--accent-warm); margin-right: 7px; font-size: 9px; vertical-align: 2px; }
.inline-link{ color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.inline-link:hover{ color: var(--accent-deep); }

/* ---------- Hero ---------- */
.hero{ padding: clamp(96px, 12vw, 144px) 0 clamp(64px, 8vw, 92px); }
.hero h1{
  font-family: var(--font-display); font-weight: 800; color: var(--ink-strong);
  font-size: clamp(2.6rem, 6.2vw, 4.6rem); letter-spacing: -0.03em; line-height: 1.03;
  margin: 18px 0 26px; max-width: 13ch;
}
.temper-bar{
  width: 100%; max-width: 400px; height: 8px; border-radius: 8px;
  background: linear-gradient(90deg, #e9d38c 0%, #d1a24a 20%, #b5652c 40%, #7a4a4a 58%, #5c3f66 74%, #3d4f63 100%);
}
.temper-caption{ font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); margin: 12px 0 0; }
.hero p.lede{ color: var(--muted); font-size: 18.5px; max-width: 50ch; margin: 28px 0 0; line-height: 1.7; }
.cta-row{ display:flex; flex-wrap: wrap; align-items:center; gap: 14px; margin-top: 34px; }

.hero-grid{ display:grid; grid-template-columns: 1.05fr .95fr; gap: clamp(40px, 6vw, 72px); align-items:center; }
@media (max-width: 900px){
  .hero-grid{ grid-template-columns: 1fr; gap: 48px; }
}

/* Centered variant — for simple single-purpose pages (coming soon, 404). */
.hero.center{ text-align: center; }
.hero.center .wrap{ max-width: 640px; }
.hero.center h1, .hero.center p.lede, .hero.center .temper-bar{ margin-left: auto; margin-right: auto; }
.hero.center .cta-row{ justify-content: center; }

/* ---------- Section rhythm (identical on every page) ---------- */
.section-block{ padding: clamp(80px, 9vw, 116px) 0; border-top: 1px solid var(--line); }
.section-block h2.big{
  font-family: var(--font-display); font-weight: 800; color: var(--ink-strong);
  font-size: clamp(28px, 3.8vw, 38px); letter-spacing: -0.02em; line-height: 1.15; max-width: 22ch; margin: 0 0 24px;
}
.section-block p{ max-width: 58ch; color: var(--ink); margin: 0 0 16px; font-size: 17px; }
.section-block p:last-of-type{ margin-bottom: 0; }
.section-block p.lede{ color: var(--muted); font-size: 1.05rem; max-width: 58ch; }

.principles{ display:flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.principles span{
  font-family: var(--font-mono); font-size: 12px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; background: var(--surface);
}

/* ---------- Catalog / work index (homepage) ---------- */
.index-head{
  display:flex; justify-content:space-between; font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 4px;
}
.row{
  display:flex; align-items:center; gap: 22px; padding: 26px 0;
  border-bottom: 1px solid var(--line); transition: padding-left .18s ease;
}
a.row:hover{ padding-left: 10px; }
a.row:hover .row-name{ color: var(--accent); }
.row-num{ font-family: var(--font-mono); font-size: 12px; color: var(--muted); width: 30px; flex-shrink: 0; }
.row-mark{ width: 9px; height: 9px; border-radius: 50%; background: var(--card-color, var(--accent)); flex-shrink: 0; }
.row-body{ flex: 1; min-width: 0; }
.row-name{ font-family: var(--font-display); font-weight: 800; color: var(--ink-strong); font-size: 22px; letter-spacing: -0.015em; transition: color .15s ease; }
.row-tag{ color: var(--muted); font-size: 14.5px; margin-top: 3px; }
.row-status{
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--accent-warm); flex-shrink: 0; white-space: nowrap;
}
.row-status.dim{ color: var(--muted); }
.row.disabled{ opacity: .55; }
.row.disabled .row-name{ color: var(--ink); }

/* ---------- Feature grid: card tile style ---------- */
.trio{ display:grid; grid-template-columns: repeat(3,1fr); gap: 22px; margin-top: 40px; }
@media (max-width: 800px){ .trio{ grid-template-columns: 1fr; } }
.tile{ background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 26px; }
.tile .tile-tag{ font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); display:block; margin-bottom: 10px; }
.tile h3{ font-family: var(--font-body); font-weight: 600; letter-spacing: 0; font-size: 19px; color: var(--ink-strong); margin: 0 0 8px; }
.tile p{ font-size: 14.5px; color: var(--muted); margin: 0; }

/* ---------- Feature grid: rule-bar style ---------- */
.cols{ display:grid; grid-template-columns: repeat(3,1fr); gap: clamp(24px, 4vw, 44px); margin-top: 44px; }
@media (max-width: 820px){ .cols{ grid-template-columns: 1fr; gap: 32px; } }
.col-rule{ width: 34px; height: 3px; border-radius: 2px; margin-bottom: 16px; background: var(--accent-warm); }
.col h3{ font-family: var(--font-body); font-weight: 600; letter-spacing: 0; font-size: 1.05rem; color: var(--ink-strong); margin: 0 0 8px; }
.col p{ color: var(--muted); font-size: 0.99rem; margin: 0; }

/* ---------- Stat blocks ---------- */
.stats{ display:grid; grid-template-columns: repeat(4,1fr); gap: 18px; margin-top: 44px; }
@media (max-width: 720px){ .stats{ grid-template-columns: repeat(2,1fr); } }
.stat{ background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 20px; text-align:center; }
.stat b{ display:block; font-family: var(--font-display); font-weight: 800; font-size: 2.1rem; line-height: 1; color: var(--ink-strong); margin-bottom: 7px; }
.stat span{ font-size: 0.87rem; color: var(--muted); }

/* ---------- Two-column split (copy + checklist / diagram) ---------- */
.split{ display:grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 68px); align-items:center; }
@media (max-width: 850px){ .split{ grid-template-columns: 1fr; gap: 36px; } }
.checks{ list-style:none; padding:0; margin: 26px 0 0; display:grid; gap: 13px; }
.checks li{ display:flex; gap: 11px; align-items:flex-start; color: var(--muted); font-size: 1rem; }
.checks svg{ width: 19px; height: 19px; flex-shrink: 0; margin-top: 3px; stroke: var(--accent); }

/* ---------- Generic node diagram ---------- */
.diagram{ background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px 28px; display:flex; align-items:center; justify-content:center; gap: 18px; }
.node{ font-family: var(--font-mono); font-size: 12px; text-align:center; padding: 14px 16px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); width: 120px; }
.diagram-line{ flex:1; max-width: 60px; border-top: 1.5px dashed var(--muted); position: relative; top: -14px; }
.diagram-caption{ text-align:center; font-size: 11.5px; color: var(--muted); margin-top: 14px; }

/* ---------- Preview card (a single "live idea" style demo) ---------- */
.card{ background: var(--surface); border-radius: 24px; padding: 28px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.card-top{ display:flex; align-items:center; gap: 11px; margin-bottom: 18px; }
.chip{ width: 38px; height: 38px; border-radius: 12px; display:grid; place-items:center; flex-shrink: 0; background: var(--accent); }
.chip svg{ width: 19px; height: 19px; stroke: #fff; }
.card-when{ font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.card-title{ font-family: var(--font-display); font-weight: 700; font-size: 1.55rem; line-height: 1.15; color: var(--ink-strong); margin: 0 0 12px; }
.card-how{ color: var(--muted); font-size: 1rem; margin: 0; }
.pills{ display:flex; flex-wrap:wrap; gap: 8px; margin-top: 20px; }
.pill{ font-size: 0.83rem; color: var(--muted); background: var(--paper); border-radius: 999px; padding: 6px 13px; }
.again{ margin-top: 22px; background: none; border: 0; color: var(--accent); font-family: var(--font-body); font-weight: 600; font-size: 0.96rem; cursor:pointer; padding: 8px 0; display:inline-flex; align-items:center; gap: 7px; }
.again:hover{ color: var(--accent-warm); }
.again svg{ width: 15px; height: 15px; transition: transform .35s ease; }
.again:hover svg{ transform: rotate(90deg); }
.fade{ animation: fade .34s ease; }
@keyframes fade{ from{ opacity:0; transform: translateY(6px); } to{ opacity:1; transform:none; } }

/* ---------- Home-screen preview frame (alternate hero visual) ---------- */
.phone-frame{ background: var(--surface); border-radius: 28px; box-shadow: var(--shadow); border: 1px solid var(--line); padding: 26px 24px 22px; max-width: 380px; margin: 0 auto; }

/* ---------- Screenshots — a real device-style frame for real screenshots ---------- */
.screenshot-frame{
  background: var(--surface); border: 1px solid var(--line); border-radius: 32px;
  padding: 10px; box-shadow: var(--shadow); max-width: 240px; margin: 0 auto;
}
.screenshot-frame img{ display:block; width: 100%; height: auto; border-radius: 24px; }
.screenshot-frame .placeholder{
  aspect-ratio: 9 / 19.5; background: var(--paper); border-radius: 24px;
  display:flex; align-items:center; justify-content:center; text-align:center;
  color: var(--muted); font-family: var(--font-mono); font-size: 12px; line-height: 1.5; padding: 20px;
}
.screens{ display:flex; gap: 24px; overflow-x: auto; padding: 4px 4px 12px; margin-top: 40px; scroll-snap-type: x mandatory; }
.screen{ flex: 0 0 220px; scroll-snap-align: start; margin: 0; }
.screen .screenshot-frame{ max-width: none; }
.screen figcaption{ font-family: var(--font-mono); font-size: 11px; color: var(--muted); text-align:center; margin-top: 12px; }

/* ---------- Pricing tiers ---------- */
.tiers{ display:grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 40px; max-width: 760px; }
@media (max-width: 720px){ .tiers{ grid-template-columns: 1fr; } }
.tier{ background: var(--surface); border-radius: 22px; padding: 28px; border: 1px solid var(--line); }
.tier.lead{ border: 2px solid var(--accent); }
.tier h3{ font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: -0.01em; color: var(--ink-strong); margin: 0; }
.tier .price{ font-family: var(--font-display); font-weight: 800; font-size: 2.2rem; color: var(--ink-strong); margin: 6px 0 4px; }
.tier ul{ list-style:none; padding:0; margin: 16px 0 0; display:grid; gap: 9px; font-size: 0.95rem; color: var(--muted); }
.tier li::before{ content:"·"; margin-right: 8px; color: var(--accent-warm); font-weight: 700; }

/* ---------- Swatch / theme picker row ---------- */
.palette-row{ display:flex; gap: 14px; flex-wrap: wrap; margin-top: 32px; }
.swatch{ background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; width: 118px; text-align:left; }
.swatch .chip{ width: 100%; height: 40px; border-radius: 8px; margin-bottom: 10px; background: none; }
.swatch .name{ font-size: 13px; font-weight: 600; color: var(--ink-strong); }
.swatch .kind{ font-family: var(--font-mono); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* ---------- Support / contact box (app pages) ---------- */
.support-box{ background: var(--surface); border-radius: 22px; padding: clamp(26px,4vw,38px); border: 1px solid var(--line); max-width: 640px; margin-top: 26px; }
.support-box p{ color: var(--muted); margin: 0 0 8px; }

/* ---------- Contact link (big email/mailto moment — homepage + app pages) ---------- */
.contact-link{
  display:inline-block; font-family: var(--font-display); font-weight: 800;
  font-size: clamp(24px, 4vw, 36px); color: var(--accent); border-bottom: 2px solid var(--accent-warm);
  padding-bottom: 4px; margin-top: 10px; transition: color .15s ease;
}
.contact-link:hover{ color: var(--accent-warm); }
.contact-link.small{ font-size: 1.35rem; }

/* ---------- Footer (identical on every page) ---------- */
footer.site{ padding: 40px 0 52px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
footer.site .wrap{ display:flex; flex-direction: column; gap: 18px; }
.footer-row{ display:flex; justify-content:space-between; align-items:center; flex-wrap: wrap; gap: 12px; }
.footer-links{ display:flex; gap: 20px; }
.footer-links a:hover{ color: var(--ink); }
.fine{ font-size: 0.83rem; max-width: 70ch; line-height: 1.6; color: var(--muted); }

/* ---------- Reveal-on-scroll ---------- */
.reveal{ opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in{ opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce){ .reveal{ opacity: 1; transform: none; } .row{ transition: none; } }

/* ---------- Small screens ---------- */
@media (max-width: 480px){
  .row{ flex-wrap: wrap; }
  .row-status{ order: 4; width: 100%; margin-left: 52px; margin-top: 2px; }
  .cta-row .btn{ flex: 1 1 auto; justify-content: center; }
}
