/* PracticeX marketing site — shared tokens + base
   Visual DNA: editorial, warm, calm. Not SaaS-blue.
   Anchored to the product UI: cream canvas, forest green ink, terracotta heat.
*/

:root {
  /* Canvas */
  --cream: #F4EFE6;         /* primary bg */
  --cream-2: #EEE7D9;       /* slightly warmer */
  --paper: #FBF7EF;         /* panels / cards */
  --ink: #1A2420;           /* body text */
  --ink-soft: #4A5550;
  --ink-mute: #8A8578;
  --rule: #D9CFBE;          /* hairlines */
  --rule-soft: #E4DBC9;

  /* Brand */
  --forest: #1F3A2E;        /* deep forest — primary */
  --forest-2: #2C4B3C;
  --forest-ink: #0F1F17;
  --terra: #C06B3E;         /* terracotta — heat/accent */
  --terra-soft: #D98A5D;
  --ochre: #C9A24A;         /* gold — pro / intelligence */
  --clay: #8A4A2A;
  --sage: #9FB39A;

  /* Semantic */
  --ok: #3E6B47;
  --warn: #B56B2A;
  --flag: #B1432A;

  /* Type */
  --serif: "Fraunces", "Source Serif 4", "Georgia", serif; /* display */
  --sans: "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Spacing */
  --gutter: clamp(20px, 4vw, 56px);
  --container: 1240px;
}

/* Fraunces is overused but we use it at a specific tight setting with
   optical-size tricks — it reads as a bespoke editorial serif here, not
   the default Medium-blog look. */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream);
  font-feature-settings: "ss01", "cv11";
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }

/* ---------- Type system ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}
.eyebrow .dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--terra);
  border-radius: 999px;
  margin-right: 8px;
  transform: translateY(-1px);
}

.display {
  font-family: var(--serif);
  font-weight: 420;
  font-style: normal;
  font-variation-settings: "opsz" 144, "SOFT" 20, "WONK" 0;
  letter-spacing: -0.022em;
  line-height: 0.98;
  color: var(--forest-ink);
  text-wrap: balance;
}
.display .italic { font-style: italic; font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1; color: var(--forest); }

h1.display { font-size: clamp(44px, 7vw, 92px); }
h2.display { font-size: clamp(32px, 4.2vw, 58px); font-weight: 440; letter-spacing: -0.02em; }
h3.display { font-size: clamp(22px, 2.2vw, 30px); font-weight: 460; letter-spacing: -0.015em; }

.lede {
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 58ch;
  text-wrap: pretty;
}

.kicker {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  text-transform: uppercase;
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: clamp(56px, 8vw, 120px) 0;
  position: relative;
}
.section.tight { padding: clamp(40px, 5vw, 64px) 0; }

.section-head {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 40px;
  align-items: start;
  margin-bottom: clamp(32px, 5vw, 64px);
}
.section-head .label { padding-top: 6px; }
@media (max-width: 720px) {
  .section-head { grid-template-columns: 1fr; gap: 12px; }
}

.rule { height: 1px; background: var(--rule); border: 0; }
.rule-soft { height: 1px; background: var(--rule-soft); border: 0; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--cream) 90%, transparent);
  backdrop-filter: saturate(130%) blur(10px);
  border-bottom: 1px solid var(--rule-soft);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--forest-ink);
}
.brand-mark {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  background: var(--forest);
  color: var(--cream);
  border-radius: 5px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 15px;
  font-style: italic;
  letter-spacing: -0.02em;
}
.brand-name {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 520;
  letter-spacing: -0.02em;
}
.brand-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding-left: 10px;
  margin-left: 6px;
  border-left: 1px solid var(--rule);
}
.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  opacity: 0.82;
  transition: opacity 0.15s;
}
.nav-links a:hover { opacity: 1; }
.nav-links a.active { opacity: 1; color: var(--forest); }
.nav-links a.btn-primary { color: var(--cream); opacity: 1; }
.nav-links a.btn-ghost { color: var(--ink); opacity: 1; }
@media (max-width: 820px) {
  .nav-links .hide-sm { display: none; }
  .brand-tag { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 6px;
  font: 500 14px/1 var(--sans);
  letter-spacing: 0.005em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.1s ease, background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--forest);
  color: var(--cream);
}
.btn-primary:hover { background: var(--forest-2); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}
.btn-ghost:hover { border-color: var(--ink); }
.btn-link {
  background: transparent;
  color: var(--forest);
  padding: 0;
  height: auto;
  border: 0;
  border-bottom: 1px solid var(--forest);
  border-radius: 0;
  padding-bottom: 2px;
}
.btn .arr { display: inline-block; transition: transform 0.2s; }
.btn:hover .arr { transform: translateX(2px); }

.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font: 500 11.5px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-soft);
}
.chip .dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--terra);
}
.chip-pilot .dot { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ok) 18%, transparent); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 3px color-mix(in oklab, var(--ok) 18%, transparent);} 50% { box-shadow: 0 0 0 6px color-mix(in oklab, var(--ok) 4%, transparent);} }

.tag {
  display: inline-block;
  font: 500 10.5px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding: 3px 6px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--paper);
}
.tag.pro { color: var(--clay); border-color: color-mix(in oklab, var(--clay) 30%, var(--rule)); background: color-mix(in oklab, var(--terra) 8%, var(--paper)); }

/* ---------- Cards / panels ---------- */
.panel {
  background: var(--paper);
  border: 1px solid var(--rule-soft);
  border-radius: 10px;
}
.panel-flat {
  background: var(--paper);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

/* ---------- Footer ---------- */
.footer {
  background: var(--forest-ink);
  color: color-mix(in oklab, var(--cream) 85%, transparent);
  padding: 64px 0 40px;
  margin-top: 80px;
}
.footer a { color: inherit; text-decoration: none; opacity: 0.75; }
.footer a:hover { opacity: 1; }
.footer h4 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: color-mix(in oklab, var(--cream) 60%, transparent);
  font-weight: 500;
  margin: 0 0 14px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid color-mix(in oklab, var(--cream) 15%, transparent);
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.footer-meta {
  display: flex;
  justify-content: space-between;
  padding-top: 28px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
}
@media (max-width: 820px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- Utility ---------- */
.stack { display: flex; flex-direction: column; }
.row { display: flex; }
.center { align-items: center; }
.between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.muted { color: var(--ink-mute); }
.ink-soft { color: var(--ink-soft); }
.hidden { display: none !important; }

/* subtle grain for warmth */
.grain::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: radial-gradient(circle at 1px 1px, rgba(0,0,0,0.04) 1px, transparent 0);
  background-size: 3px 3px;
}

/* Tweaks panel (inherits from host) */
.tweaks {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  background: var(--forest-ink);
  color: var(--cream);
  border-radius: 12px;
  padding: 14px 16px;
  display: none;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  font-size: 13px;
  min-width: 240px;
}
.tweaks.on { display: flex; }
.tweaks-title { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.6; }
.tweaks .row { gap: 6px; }
.tweak-btn {
  flex: 1;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid color-mix(in oklab, var(--cream) 18%, transparent);
  background: transparent;
  color: var(--cream);
  font: 500 12px/1 var(--sans);
  cursor: pointer;
  transition: background 0.15s;
}
.tweak-btn:hover { background: color-mix(in oklab, var(--cream) 8%, transparent); }
.tweak-btn.on { background: var(--terra); border-color: var(--terra); color: #fff; }
