/* Plattar website - shared anatomy. Skin comes from the :root variables in site.css. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html.nav-locked { overflow: hidden; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 17px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, video, svg { max-width: 100%; display: block; }
[hidden] { display: none !important; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
::selection { background: rgba(var(--accent-rgb), .25); }

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text); }
.h1 { font-size: clamp(44px, 6.5vw, 84px); font-weight: 800; line-height: 1.04; letter-spacing: -0.03em; }
.h2 { font-size: clamp(32px, 4vw, 52px); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.h3 { font-size: clamp(20px, 2vw, 26px); font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
.lead { font-size: clamp(18px, 1.6vw, 20px); line-height: 1.55; color: var(--text-secondary); }
.body-sm { font-size: 15px; color: var(--text-secondary); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 20px;
}
.eyebrow::before { content: ''; width: 22px; height: 2px; border-radius: 2px; background: var(--accent); }

.container { max-width: 1200px; margin-inline: auto; padding-inline: clamp(20px, 4vw, 48px); }
.container-narrow { max-width: 760px; margin-inline: auto; padding-inline: clamp(20px, 4vw, 48px); }
.section { padding-block: clamp(80px, 12vh, 140px); }
.section-head { max-width: 680px; margin-bottom: clamp(40px, 6vh, 64px); }
.section-head .h2 { margin-bottom: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 28px; border-radius: var(--btn-radius, 999px);
  font-family: var(--font-body); font-size: 15px; font-weight: 600; line-height: 1; letter-spacing: .01em;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .25s cubic-bezier(.22,1,.36,1), box-shadow .25s, background .2s, border-color .2s, color .2s;
}
.btn-primary { background: var(--btn-bg, var(--accent)); color: var(--btn-fg, #fff); }
.btn-primary:hover { background: var(--btn-bg-hover, var(--accent-hover)); transform: translateY(-2px); box-shadow: 0 10px 30px -8px rgba(var(--accent-rgb), .5); }
.btn-primary:active { transform: translateY(0); box-shadow: 0 4px 12px -6px rgba(var(--accent-rgb), .5); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border-hover); }
.btn-secondary:hover { border-color: var(--text-tertiary); background: var(--surface-hover); transform: translateY(-2px); }
.btn-lg { padding: 18px 34px; font-size: 16px; }
.btn-sm { padding: 10px 18px; font-size: 14px; }

/* ---------- Cards ---------- */
.card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 28px;
  box-shadow: var(--shadow-soft);
  transition: transform .3s cubic-bezier(.22,1,.36,1), border-color .3s, box-shadow .3s;
}
a.card { display: block; }
.card:hover { transform: translateY(-4px); border-color: var(--border-hover); box-shadow: var(--shadow-lift); }
.card:focus-within { border-color: var(--accent); }
.card .h3 { margin-bottom: 10px; }
.card p { color: var(--text-secondary); font-size: 15.5px; }
.spotlight::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--accent-rgb), .10), transparent 65%);
  transition: opacity .4s;
}
.spotlight:hover::before { opacity: 1; }
.spotlight > * { position: relative; z-index: 1; }
.card-icon {
  width: 44px; height: 44px; border-radius: 12px; margin-bottom: 18px;
  display: grid; place-items: center;
  color: var(--accent); background: rgba(var(--accent-rgb), .1); border: 1px solid rgba(var(--accent-rgb), .18);
}
.card-icon svg { width: 20px; height: 20px; }

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px clamp(20px, 4vw, 48px);
  transition: background .3s, box-shadow .3s, padding .3s;
}
.nav.scrolled {
  padding-block: 12px;
  background: rgba(var(--nav-rgb, var(--bg-rgb)), .82);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border);
}
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  position: relative; color: var(--text-secondary); font-size: 14px; font-weight: 500;
  padding: 8px 12px; border-radius: 8px; transition: color .2s;
}
.nav-link:hover, .nav-link:focus-visible { color: var(--text); }
.nav-link[aria-current="page"] { color: var(--text); }
.nav-link[aria-current="page"]::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--accent);
}
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-burger { display: none; width: 44px; height: 44px; border-radius: 10px; place-items: center; color: var(--text); }
.nav-burger:hover { background: var(--surface-hover); }
.nav-overlay {
  position: fixed; inset: 0; z-index: 99; display: flex; flex-direction: column; justify-content: flex-start; gap: 2px;
  padding: 92px 24px 32px; overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--bg);
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.nav-overlay.open { opacity: 1; pointer-events: auto; }
.nav-overlay a {
  font-family: var(--font-display); font-size: clamp(24px, 6.4vw, 36px); font-weight: 700;
  padding: 10px 16px; border-radius: 12px; color: var(--text);
  transform: translateY(14px); opacity: 0; transition: transform .45s cubic-bezier(.22,1,.36,1), opacity .45s;
}
.nav-overlay.open a { transform: none; opacity: 1; }
.nav-overlay.open a:nth-child(2) { transition-delay: .04s; } .nav-overlay.open a:nth-child(3) { transition-delay: .08s; }
.nav-overlay.open a:nth-child(4) { transition-delay: .12s; } .nav-overlay.open a:nth-child(5) { transition-delay: .16s; }
.nav-overlay.open a:nth-child(6) { transition-delay: .2s; }  .nav-overlay.open a:nth-child(7) { transition-delay: .24s; }
.nav-overlay a:hover { color: var(--accent); }

/* ---------- Prose links ---------- */
.link {
  color: var(--accent); font-weight: 500;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size .3s;
}
.link:hover, .link:focus-visible { background-size: 100% 1.5px; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; font-size: 15px; }
.link-arrow svg { transition: transform .25s; }
.link-arrow:hover svg, .link-arrow:focus-visible svg { transform: translateX(4px); }

/* ---------- Tags ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); background: rgba(var(--accent-rgb), .09); border: 1px solid rgba(var(--accent-rgb), .22);
}

/* ---------- FAQ ---------- */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 16px; text-align: left;
  padding: 22px 4px; font-family: var(--font-body); font-size: 17px; font-weight: 600; color: var(--text);
  transition: color .2s;
}
.faq-q:hover, .faq-q:focus-visible { color: var(--accent); }
.faq-q .faq-x { flex: none; width: 22px; height: 22px; position: relative; color: var(--text-tertiary); transition: transform .3s; }
.faq-x::before, .faq-x::after { content: ''; position: absolute; inset: 50% auto auto 50%; width: 14px; height: 2px; background: currentColor; border-radius: 2px; transform: translate(-50%, -50%); }
.faq-x::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform .3s; }
.faq-item.open .faq-x::after { transform: translate(-50%, -50%) rotate(0deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .4s cubic-bezier(.22,1,.36,1); }
.faq-a p { padding: 0 4px 22px; color: var(--text-secondary); font-size: 15.5px; max-width: 640px; }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: inline-flex; align-items: center; gap: clamp(36px, 6vw, 80px); white-space: nowrap; padding-block: 8px; animation: marquee var(--marquee-speed, 32s) linear infinite; will-change: transform; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sticky CTA bar ---------- */
.sticky-cta {
  position: fixed; left: 50%; bottom: 18px; z-index: 90;
  display: flex; align-items: center; gap: 18px;
  padding: 10px 12px 10px 22px; border-radius: 999px;
  background: rgba(var(--ink-rgb, 17,17,20), .92); color: var(--on-ink, #fff);
  border: 1px solid rgba(255,255,255,.12);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 18px 44px -12px rgba(0,0,0,.4);
  transform: translate(-50%, 90px); opacity: 0; transition: transform .45s cubic-bezier(.22,1,.36,1), opacity .45s;
}
.sticky-cta.visible { transform: translate(-50%, 0); opacity: 1; }
.sticky-cta .sc-label { font-size: 14px; font-weight: 600; white-space: nowrap; }
.sticky-cta .sc-sub { font-size: 12px; opacity: .65; white-space: nowrap; }

/* ---------- Code blocks ---------- */
.codeblock {
  background: var(--code-bg, #0d1117); color: var(--code-fg, #e6edf3);
  border: 1px solid var(--code-border, rgba(255,255,255,.09));
  border-radius: 14px; overflow-x: auto;
  font-family: var(--font-mono, ui-monospace, "SF Mono", Menlo, monospace);
  font-size: 13.5px; line-height: 1.75;
}
.codeblock-bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--code-border, rgba(255,255,255,.09)); }
.codeblock-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.14); }
.codeblock-bar span { margin-left: 8px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.4); font-family: var(--font-body); }
.codeblock pre { padding: 18px 20px; white-space: pre; }
.codeblock .c-tag { color: #7ee787; } .codeblock .c-attr { color: #79c0ff; } .codeblock .c-str { color: #a5d6ff; } .codeblock .c-com { color: #8b949e; }
[data-type].typing::after { content: '▋'; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Stat ---------- */
.stat-num { font-family: var(--font-display); font-size: clamp(40px, 5vw, 64px); font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: var(--accent); }
.stat-label { margin-top: 10px; font-size: 14.5px; color: var(--text-secondary); max-width: 240px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: clamp(48px, 8vh, 80px) 0 100px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.footer h4 { font-family: var(--font-body); font-size: 12.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 16px; }
.footer ul { list-style: none; display: grid; gap: 10px; }
.footer ul a { font-size: 14.5px; color: var(--text-secondary); transition: color .2s; }
.footer ul a:hover, .footer ul a:focus-visible { color: var(--text); }
.footer-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 28px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-tertiary); }
.footer-fin { margin-top: 40px; text-align: center; font-size: 12.5px; color: var(--text-tertiary); }

.split-word { display: inline-block; }

/* ---------- Reveal pre-state safety ---------- */
html:not(.js) [data-reveal], html:not(.js) [data-reveal-group] > * { opacity: 1 !important; transform: none !important; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
  .marquee-track { animation: none; }
  .sticky-cta { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-burger { display: grid; }
  .nav-actions .btn-secondary { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .sticky-cta { left: 12px; right: 12px; transform: translateY(90px); width: auto; justify-content: space-between; }
  .sticky-cta.visible { transform: translateY(0); }
  .sticky-cta .sc-sub { display: none; }
}
