/* TamedTable homepage styles. Plain CSS, no build step.
   THEMING: every color is a CSS variable on :root (the "SaaSify Shade" palette).
   Change a value there to re-skin the page; dark zones use the --dark→--dark2 gradient. */

/* ---------- Palette (SaaSify Shade) ----------
   One locked palette. Light zones use linen/paper; dark zones (nav, hero, CTA)
   use the --dark → --dark2 gradient. Tweak these values to re-skin the page. */
:root {
  --ink:            #2A1E5C;   /* primary text / headings */
  --muted:          #6E6597;   /* secondary text on light */
  --accent:         #3D5AF1;   /* accent / primary action (blue) */
  --accent-soft:    #E6E9FE;   /* accent tint (highlights) */
  --silver:         #E4DDF4;   /* card borders on light */
  --line:           #EEE9F8;   /* hairline dividers on light */
  --linen:          #F4F1FB;   /* page ground (light zones) */
  --paper:          #FFFFFF;   /* cards / paper sections */
  --stage:          #ECE6F9;   /* illustration stage (distinct from sections) */
  --dark:           #4A2598;   /* dark-zone gradient start (indigo) */
  --dark2:          #9B2A78;   /* dark-zone gradient end (magenta) */
  --on-dark:        #F3F0FB;   /* text on dark */
  --on-dark-muted:  #CDC2EC;   /* muted text on dark */
  --dark-border:    #6A4FB0;   /* borders within dark zones */
  --btn-bg:         #3D5AF1;   /* primary button (light zones) */
  --btn-fg:         #FFFFFF;
  --dbtn-bg:        #3D5AF1;   /* primary button (dark zones) */
  --dbtn-fg:        #FFFFFF;

  --maxw: 1180px;
  --radius: 12px;
  --font-head: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--linen);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { font-family: var(--font-head); margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-size: 15px; font-weight: 600;
  padding: 11px 22px; border-radius: 8px;
  text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn .arrow { transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(3px); }
/* light-zone */
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn-primary:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--silver); }
.btn-outline:hover { border-color: var(--ink); transform: translateY(-1px); }
/* dark-zone */
.btn-dprimary { background: var(--dbtn-bg); color: var(--dbtn-fg); }
.btn-dprimary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-doutline { background: transparent; color: var(--on-dark); border-color: var(--dark-border); }
.btn-doutline:hover { border-color: var(--on-dark); transform: translateY(-1px); }

/* ---------- Brand lockup (inline, theme-aware) ---------- */
.brand { display: inline-flex; align-items: center; gap: 0.40em; text-decoration: none; font-size: 20px; }
.mark { height: 1.18em; width: auto; }
.wordmark { font-family: var(--font-head); font-weight: 500; font-variant-caps: small-caps; letter-spacing: 0.005em; }

/* ---------- Nav (dark zone) ---------- */
header.nav {
  position: relative;
  background: linear-gradient(120deg, var(--dark) 0%, var(--dark2) 100%);
  border-bottom: 1px solid var(--dark-border);
}
.nav-inner { display: flex; align-items: center; height: 66px; }
.nav .mark { color: var(--on-dark); }
.nav .wordmark { color: var(--on-dark); }
.nav-links { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.nav-links a.link { font-size: 15px; font-weight: 500; color: var(--on-dark-muted); text-decoration: none; transition: color .15s; }
.nav-links a.link:hover { color: var(--on-dark); }
.nav-toggle { display: none; }

/* ---------- Hero (dark zone) ---------- */
.hero { padding: 84px 0 76px; background: linear-gradient(120deg, var(--dark) 0%, var(--dark2) 100%); }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.hero h1 { font-size: 58px; font-weight: 600; line-height: 1.02; color: var(--on-dark); }
.hero .sub { font-size: 19px; color: var(--on-dark-muted); margin-top: 20px; max-width: 440px; }
.hero-cta { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }

/* Hero demo — before/after run, stand-in for the 60s screencast */
.demo {
  border: 1px solid var(--silver); border-radius: var(--radius);
  background: var(--paper); overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.55);
}
.demo-bar {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--stage);
}
.demo-dot { width: 11px; height: 11px; border-radius: 50%; }
.demo-cap { position: absolute; left: 0; right: 0; text-align: center; pointer-events: none; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.demo-body { padding: 20px; font-family: var(--font-mono); font-size: 13px; }
.demo-prompt { color: var(--ink); font-weight: 500; }
.demo-prompt .caret { color: var(--accent); }
table.demo-tbl { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 12.5px; }
table.demo-tbl th {
  text-align: left; font-weight: 500; color: var(--paper); background: var(--ink);
  padding: 8px 10px;
}
table.demo-tbl th:first-child { border-radius: 6px 0 0 0; }
table.demo-tbl th:last-child  { border-radius: 0 6px 0 0; }
table.demo-tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--ink); }
table.demo-tbl tr:nth-child(even) td { background: var(--stage); }
.cell-changed { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 5px; padding: 1px 6px; color: var(--ink); }
.demo-foot { padding: 12px 20px 18px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.demo-foot strong { color: var(--ink); font-weight: 600; }

/* Hero demo animation — the looping "60-second" run.
   One 9s timeline shared by every piece: the caret blinks, the prompt types in,
   then each row's messy "before" cross-fades to a clean, highlighted "after" with a
   little pop, holds, and resets. Rows stagger so the change cascades top-to-bottom. */
.demo-prompt .caret { animation: heroCaret 1s steps(1) infinite; }
.demo--anim .demo-typed { display: inline-block; animation: heroType 9s ease-out infinite; }
.demo--anim .swap { position: relative; display: inline-block; }
.demo--anim .swap .v-after { position: absolute; left: 0; top: 0; white-space: nowrap; }
.demo--anim .swap .v-before { animation: heroBefore 9s ease-in-out infinite; }
.demo--anim .swap .v-after  { animation: heroAfter 9s ease-in-out infinite; }
.demo--anim tr:nth-child(2) .swap .v-before,
.demo--anim tr:nth-child(2) .swap .v-after { animation-delay: .25s; }
.demo--anim tr:nth-child(3) .swap .v-before,
.demo--anim tr:nth-child(3) .swap .v-after { animation-delay: .5s; }

@keyframes heroCaret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes heroType {
  0%, 6%   { opacity: 0; transform: translateY(-2px); }
  16%, 96% { opacity: 1; transform: none; }
  100%     { opacity: 0; }
}
@keyframes heroBefore {
  0%, 42%  { opacity: 1; }
  50%, 94% { opacity: 0; }
  100%     { opacity: 1; }
}
@keyframes heroAfter {
  0%, 42%  { opacity: 0; transform: scale(.96); }
  50%      { opacity: 1; transform: scale(1.05); }
  56%, 94% { opacity: 1; transform: scale(1); }
  100%     { opacity: 0; transform: scale(.96); }
}

/* Respect reduced-motion: hold the clean, final state, no looping. */
@media (prefers-reduced-motion: reduce) {
  .demo-prompt .caret,
  .demo--anim .demo-typed,
  .demo--anim .swap .v-before,
  .demo--anim .swap .v-after { animation: none; }
  .demo--anim .swap .v-before { opacity: 0; }
  .demo--anim .swap .v-after  { opacity: 1; transform: none; }
}

/* ---------- Section scaffolding ---------- */
section { padding: 76px 0; }
.sec-paper { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.sec-head h2 { font-size: 36px; font-weight: 600; color: var(--ink); }
.sec-head p { color: var(--muted); margin-top: 14px; font-size: 17px; }

/* ---------- Value props ---------- */
.vp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.vp-card {
  border: 1px solid var(--silver); border-radius: var(--radius);
  background: var(--paper); padding: 26px 24px;
  display: flex; gap: 16px; align-items: flex-start;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.vp-card:hover { transform: translateY(-3px); box-shadow: 0 18px 36px -26px rgba(0,0,0,0.35); }
.vp-ic { flex-shrink: 0; width: 40px; height: 40px; }
.vp-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; color: var(--ink); }
.vp-card p { font-size: 14.5px; color: var(--muted); line-height: 1.55; }

/* ---------- How it works ---------- */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); position: relative; gap: 12px; }
.steps::before {
  content: ""; position: absolute; top: 23px; left: 10%; right: 10%;
  height: 2px; background: var(--silver); z-index: 0;
}
.step { text-align: center; position: relative; z-index: 1; padding: 0 6px; }
.step .num {
  width: 48px; height: 48px; margin: 0 auto 16px;
  border-radius: 50%; border: 2px solid var(--ink); background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 18px; font-weight: 600; color: var(--ink);
}
.step h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.step p { font-size: 13.5px; color: var(--muted); line-height: 1.5; }

/* ---------- Feature sections ---------- */
.feature { display: grid; grid-template-columns: 40fr 60fr; gap: 48px; align-items: center; }
.feature.flip .feat-text { order: 2; }
.feature.flip .feat-visual { order: 1; }
.feat-text h2 { font-size: 30px; font-weight: 600; margin: 8px 0 12px; color: var(--ink); }
.feat-text > p { color: var(--muted); font-size: 16px; margin-bottom: 22px; }
.feat-list { border-top: 1px solid var(--line); }
.feat-item {
  display: block; width: 100%; text-align: left; cursor: pointer;
  font-family: var(--font-body); background: transparent;
  border: 0; border-left: 2px solid transparent; border-bottom: 1px solid var(--line);
  padding: 13px 16px; transition: background .12s ease, border-color .12s ease;
}
.feat-item:hover { background: var(--stage); }
.feat-item.active { background: var(--accent-soft); border-left-color: var(--ink); }
.feat-item .fname { font-size: 15px; font-weight: 500; color: var(--ink); }
.feat-item.active .fname { font-weight: 600; }
.feat-item .fcmd { display: block; font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); margin-top: 3px; }

.feat-visual {
  border: 1px solid var(--silver); border-radius: var(--radius);
  background: var(--paper); overflow: hidden; display: flex; flex-direction: column;
}
.feat-stage {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 26px; min-height: 280px; background: var(--stage);
}
.feat-stage img { width: 100%; max-width: 380px; height: auto; }
.feat-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; border-top: 1px solid var(--line); background: var(--paper);
}
.feat-dots { display: flex; gap: 8px; }
.feat-dot {
  width: 10px; height: 10px; border-radius: 50%; cursor: pointer; padding: 0;
  background: transparent; border: 2px solid var(--silver); transition: background .12s, border-color .12s;
}
.feat-dot.active { background: var(--ink); border-color: var(--ink); }
.feat-demo {
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  background: var(--btn-bg); color: var(--btn-fg); text-decoration: none;
  padding: 7px 14px; border-radius: 7px; transition: filter .15s;
}
.feat-demo:hover { filter: brightness(1.12); }

/* Placeholder stage (features without an illustration yet) */
.feat-ph {
  flex: 1; min-height: 280px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; padding: 30px; text-align: center;
  background: var(--stage);
}
.feat-ph .ph-tag { font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }
.feat-ph .ph-snip {
  font-family: var(--font-mono); font-size: 14px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--silver); border-radius: 8px;
  padding: 12px 16px; box-shadow: 0 10px 24px -18px rgba(0,0,0,0.4);
}
.feat-ph .ph-snip b { color: var(--accent); font-weight: 500; }

/* ---------- CTA (dark zone) ---------- */
.cta { background: linear-gradient(120deg, var(--dark) 0%, var(--dark2) 100%); text-align: center; }
.cta h2 { font-size: 40px; font-weight: 600; color: var(--on-dark); }
.cta p { color: var(--on-dark-muted); font-size: 18px; margin-top: 14px; }
.cta-row { display: flex; gap: 14px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }

/* ---------- Footer (light zone) ---------- */
footer.foot { background: var(--paper); border-top: 1px solid var(--line); padding: 32px 0; }
.foot-inner { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.foot .mark { color: var(--ink); }
.foot .wordmark { color: var(--ink); }
.foot-links { display: flex; gap: 24px; margin-left: auto; }
.foot-links a { font-size: 14px; color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .wrap { padding: 0 20px; }
  .nav-toggle {
    display: flex; flex-direction: column; gap: 5px; margin-left: auto;
    background: transparent; border: 0; cursor: pointer; padding: 8px;
  }
  .nav-toggle span { width: 22px; height: 2px; background: var(--on-dark); border-radius: 2px; }
  .nav-links {
    position: absolute; top: 66px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0; margin: 0;
    background: var(--dark); border-bottom: 1px solid var(--dark-border);
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .nav-links.open { max-height: 320px; }
  .nav-links a.link { padding: 16px 20px; border-bottom: 1px solid var(--dark-border); }
  .nav-links .btn { margin: 14px 20px; justify-content: center; }

  .hero { padding: 56px 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero h1 { font-size: 40px; }
  .hero .sub { font-size: 17px; }

  section { padding: 52px 0; }
  .sec-head h2 { font-size: 28px; }
  .vp-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 0; }
  .steps::before { display: none; }
  .step { display: grid; grid-template-columns: 48px 1fr; column-gap: 14px; row-gap: 2px; text-align: left; padding: 16px 0; border-bottom: 1px solid var(--line); }
  .step .num { grid-row: 1 / 3; align-self: center; margin: 0; }
  .step h3 { grid-column: 2; align-self: end; margin-bottom: 0; }
  .step p { grid-column: 2; align-self: start; }

  .feature { grid-template-columns: 1fr; gap: 24px; }
  .feature.flip .feat-text { order: 1; }
  .feature.flip .feat-visual { order: 2; }
  .feat-text h2 { font-size: 24px; }
  .feat-stage, .feat-ph { min-height: 200px; }
  /* Compact one-line feature rows on mobile (matches the wireframe) */
  .feat-item { padding: 12px 14px; }
  .feat-item .fcmd { display: none; }

  .cta h2 { font-size: 30px; }
  .foot-links { margin-left: 0; width: 100%; }
}
