/* ------------------------------------------------------------------ *
 * Fig tools — marketing site
 * Palette + type inherited from the existing nxpert.io landing page
 * (denver/index.html + fig.html):
 *   bg      #fefcf8   ink     #333
 *   teal    #1f4a52 / #2a5f68 / #336b74 / #143b42   (primary)
 *   fig     #46224f / #8e4585 / #bf6aa8 / #e6accf   (purple, decorative)
 *   body    Inter    ·    headlines: Georgia italic, teal
 * ------------------------------------------------------------------ */

:root {
  --bg:        #fefcf8;
  --ink:       #333333;
  --ink-soft:  #55534f;
  --teal:      #1f4a52;
  --teal-2:    #2a5f68;
  --teal-3:    #336b74;
  --teal-4:    #143b42;
  --fig-skin:  #46224f;
  --fig-mid:   #8e4585;
  --fig-light: #bf6aa8;
  --fig-pale:  #e6accf;
  --card:      #ffffff;
  --sand:      #f6f1e8;   /* a touch warmer than bg, for banded sections */
  --muted:     #8a857c;
  --line:      #e9e1d3;
  --good:      #2f7d4f;
  --warn:      #b7791f;
  --grad:      linear-gradient(135deg, #1f4a52 0%, #336b74 100%);
  --grad-fig:  linear-gradient(135deg, #46224f 0%, #8e4585 60%, #bf6aa8 100%);
  --shadow:    0 12px 40px -14px rgba(31, 74, 82, 0.28);
  --shadow-sm: 0 5px 18px -10px rgba(31, 74, 82, 0.35);
  --radius:    16px;
  --maxw:      1120px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Headlines echo the nxpert h1: italic serif, teal */
h1, h2, h3 { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--teal); line-height: 1.18; }
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); margin: 0 0 .3em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin: 0 0 .4em; }
h3 { font-size: 1.18rem; margin: 0 0 .4em; }
h4 { font-family: var(--sans); font-style: normal; }
p  { margin: 0 0 1em; }
a  { color: var(--teal-2); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { font-weight: 600; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.eyebrow {
  font-family: var(--sans); font-style: normal;
  text-transform: uppercase; letter-spacing: .16em; font-size: .74rem;
  font-weight: 600; color: var(--fig-mid); margin: 0 0 .9em;
}
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 62ch; }
.muted { color: var(--muted); }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--sans); font-weight: 600; font-size: 1rem; padding: .78em 1.5em;
  border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--teal); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { color: #fff; background: var(--teal-2); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn-lg { font-size: 1.06rem; padding: .92em 1.75em; }

/* ---- nav ---- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(254, 252, 248, .84);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 28px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.3rem; color: var(--teal); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 32px; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--ink-soft); font-weight: 500; font-size: .96rem; }
.nav-links a:hover { color: var(--teal); text-decoration: none; }
.nav-links a.active { color: var(--teal); font-weight: 600; }
.nav-cta { padding: .55em 1.1em; font-size: .9rem; }

/* ---- sections ---- */
section { padding: 84px 0; }
.section-sand { background: var(--sand); }
.section-ink  { background: var(--teal-4); color: #f3efe6; }
.section-ink h2, .section-ink h3 { color: #fff; }
.section-ink .lead, .section-ink p { color: rgba(243,239,230,.82); }
.section-ink .eyebrow { color: var(--fig-pale); }

/* ---- hero ---- */
.hero { padding: 64px 0 56px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
.hero-stats { display: flex; gap: 32px; margin-top: 34px; flex-wrap: wrap; }
.hero-stats .n { font-family: var(--serif); font-style: italic; font-size: 1.5rem; color: var(--teal); }
.hero-stats .l { font-size: .84rem; color: var(--muted); }

/* ---- centered hero (landing first frame) ---- */
.hero-center { min-height: calc(100vh - 66px); display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 32px 0; }
.hero-center h1 { max-width: 20ch; margin: 0 0 4px; }
.hero-center .fig-stage { margin: 6px auto 20px; }
.tell-line { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.tell-line .cmd { margin: 0; }   /* beat .cmd's default margin-top so the box sits centred with the text */
.tell { font-family: var(--sans); font-size: 1rem; color: var(--ink-soft); margin: 0; white-space: nowrap; }
.cmd-hero { display: inline-flex; }
.section-ink .tell { color: rgba(243,239,230,.85); }
.section-ink .tell-line .cmd { border: 1px solid rgba(255,255,255,.2); }
.scroll-cue { margin-top: 34px; font-size: .8rem; color: var(--muted); letter-spacing: .08em;
  text-transform: uppercase; display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.scroll-cue span { font-size: 1.1rem; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(5px);} }
@media (prefers-reduced-motion: reduce) { .scroll-cue span { animation: none; } }

/* ---- full-screen comparison panel ---- *
 * The panel fills the viewport. When the user reaches it, scroll is locked and
 * the right column's flip-down "binder calendar" (5 placeholder frames, the last
 * stays as the final slide) plays once; then scroll is released (see main.js).
 * The left column is static. */
.loop-panel { min-height: 100vh; display: flex; align-items: center; padding: 48px 0; }
.loop-inner { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.loop-inner .wrap { margin-bottom: 2px; }

.imgcols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; width: min(940px, 92vw); }
.imgcol-block { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.col-title { font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--teal); text-align: center; }
.imgcol { position: relative; overflow: hidden; border-radius: 14px; border: 1px solid var(--line);
  background: var(--sand); height: min(52vh, 470px); box-shadow: var(--shadow-sm); }
.ph-label { position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--serif); font-style: italic; font-size: 2.2rem; color: rgba(31,74,82,.28); }

/* left: single static placeholder (no movement) */
.imgcol-single { background: repeating-linear-gradient(180deg, #fff 0 46px, #efe6d6 46px 48px); }

/* right: flip-down calendar leaves; transform is set by scroll (main.js) */
.flipcal { perspective: 1500px; }
.flipcal .leaf { position: absolute; inset: 0; transform-origin: 50% 0; backface-visibility: hidden;
  background: repeating-linear-gradient(180deg, #fff 0 46px, #efe6d6 46px 48px); will-change: transform; }
.flipcal .leaf:nth-child(1) { z-index: 5; }
.flipcal .leaf:nth-child(2) { z-index: 4; }
.flipcal .leaf:nth-child(3) { z-index: 3; }
.flipcal .leaf:nth-child(4) { z-index: 2; }
.flipcal .leaf:nth-child(5) { z-index: 1; }

@media (max-width: 640px) {
  .imgcols { grid-template-columns: 1fr; }
  .imgcol { height: 42vh; }
}

/* ---- agent command block ---- */
.cmd { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 26px;
  background: var(--teal-4); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow-sm); }
.cmd-label { font-family: var(--sans); font-size: .68rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .12em; color: var(--fig-pale); }
.cmd code { background: none; color: #eef3f1; font-size: .92rem; padding: 0; }
.cmd code b { color: #7fd0c4; font-weight: 600; }
.cmd-copy { margin-left: auto; font-family: var(--sans); font-size: .74rem; font-weight: 600;
  padding: .35em .8em; border-radius: 8px; cursor: pointer; color: #eef3f1;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); }
.cmd-copy:hover { background: rgba(255,255,255,.2); }
.cmd-sm { margin-top: 16px; padding: 9px 12px; }
.cmd-sm code { font-size: .86rem; color: #eef3f1; }

/* ---- message cards (landing value props) ---- */
.msg { padding: 30px; }
.msg-ic { font-size: 1.8rem; margin-bottom: 10px; }
.msg h3 { font-size: 1.32rem; }
.msg p { font-size: 1rem; }

/* ---- fig animation stage (from the existing fig.html) ---- *
 * The fig now fills the stage; aspect-ratio matches GRID + explode padding
 * (29:34), and it's sized ~2× the previous on-screen fig. */
.fig-stage { width: min(520px, 84vw); margin: 0 auto; aspect-ratio: 29 / 34; }
.fig-stage canvas { display: block; width: 100%; height: 100%; }

/* ---- cards / grids ---- */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm);
}
.card h3 { display: flex; align-items: center; gap: 10px; margin-bottom: .5em; }
.card .ic { font-size: 1.3rem; }
.card p { margin-bottom: 0; color: var(--ink-soft); font-size: .97rem; }
/* card-accent / card-fig kept as hooks; no decorative top border */

.principle { counter-increment: p; position: relative; padding-left: 56px; }
.principle::before {
  content: counter(p); position: absolute; left: 0; top: 4px;
  width: 38px; height: 38px; border-radius: 10px; background: var(--grad);
  color: #fff; font-family: var(--serif); font-style: italic; font-size: 1.1rem;
  display: grid; place-items: center;
}
.principles { counter-reset: p; }

/* ---- pill / badge ---- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600;
  padding: .3em .8em; border-radius: 999px; background: var(--sand); color: var(--ink-soft); }
.pill-good { background: #e3f0e7; color: var(--good); }
.pill-warn { background: #f6ecd7; color: var(--warn); }
.pill-fig  { background: #f3e2ee; color: var(--fig-skin); }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--sand); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
tr:last-child td { border-bottom: none; }
td.num { font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }
.arm { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-komai  { background: #8a857c; }
.dot-figma  { background: #8e4585; }
.dot-builder{ background: #336b74; }
.dot-claude { background: #1f4a52; }

.bar { position: relative; height: 8px; border-radius: 999px; background: var(--line); margin-top: 5px; overflow: hidden; }
.bar > span { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--grad); }

/* ---- note ---- */
.note { border-left: 3px solid var(--fig-mid); background: var(--sand); padding: 14px 18px;
  border-radius: 0 10px 10px 0; font-size: .9rem; color: var(--ink-soft); }

/* ---- code ---- */
code { font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: .88em;
  background: var(--sand); padding: .12em .4em; border-radius: 6px; color: var(--fig-skin); }
pre { background: var(--teal-4); color: #eef3f1; padding: 20px 22px; border-radius: 14px;
  overflow-x: auto; font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: .86rem;
  line-height: 1.65; box-shadow: var(--shadow-sm); position: relative; }
pre code { background: none; color: inherit; padding: 0; }
pre .c { color: #8fb0ac; }          /* comment */
pre .k { color: #7fd0c4; }          /* keyword/command */
pre .s { color: #e6accf; }          /* string */
.copy-btn { position: absolute; top: 10px; right: 10px; font-family: var(--sans); font-size: .72rem; padding: .3em .7em;
  background: rgba(255,255,255,.1); color: #eef3f1; border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px; cursor: pointer; }
.copy-btn:hover { background: rgba(255,255,255,.2); }

/* ---- docs layout ---- */
.docs { display: grid; grid-template-columns: 220px 1fr; gap: 48px; align-items: start; }
.docs-toc { position: sticky; top: 90px; font-size: .92rem; }
.docs-toc a { display: block; padding: 5px 0; color: var(--ink-soft); }
.docs-toc a:hover { color: var(--teal); text-decoration: none; }
.docs-toc .t { font-family: var(--sans); font-weight: 700; text-transform: uppercase; font-size: .72rem; letter-spacing: .1em; color: var(--muted); margin: 18px 0 6px; }
.docs-body h2 { scroll-margin-top: 90px; padding-top: 8px; }
.docs-body h3 { scroll-margin-top: 90px; margin-top: 32px; }
.docs-body table { margin: 16px 0; }
.docs-body p, .docs-body li { color: var(--ink-soft); }

/* ---- footer ---- */
.footer { background: var(--teal-4); color: rgba(243,239,230,.72); padding: 48px 0 40px; }
.footer-grid { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer a { color: rgba(243,239,230,.72); }
.footer a:hover { color: #fff; }
.footer .brand { color: #fff; margin-bottom: 12px; }
.footer h4 { color: #fff; font-family: var(--sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 12px; }
.footer-col a { display: block; padding: 4px 0; font-size: .92rem; }
.footer-bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12);
  font-size: .84rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---- CTA band ---- */
.cta-band { background: var(--grad); color: #fff; border-radius: 24px; padding: 54px 44px; text-align: center; box-shadow: var(--shadow); }
.cta-band h2 { color: #fff; }
.cta-band .lead { color: rgba(255,255,255,.9); margin: 0 auto 24px; }
.cta-band .btn-primary { background: #fff; color: var(--teal); }
.cta-band .btn-primary:hover { background: #fff; color: var(--teal-2); }

@media (prefers-reduced-motion: reduce) { .btn:hover { transform: none; } }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .fig-stage { grid-row: 1; max-width: 320px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .docs { grid-template-columns: 1fr; }
  .docs-toc { position: static; }
  .nav-links { gap: 16px; }
  .nav-links a:not(.nav-cta) { display: none; }
  section { padding: 60px 0; }
}
@media (max-width: 620px) { .cta-band { padding: 40px 24px; } }
