/* ============================================================
   3Powers — base: reset, typography, layout primitives,
   buttons, header, footer, reveal motion.
   ============================================================ */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--surface-page);
  color: var(--text-primary);
  line-height: var(--leading-body);
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { color: var(--gold-bright); text-decoration: underline; }

h1, h2, h3 { font-family: var(--font-serif); font-weight: 700; color: var(--text-primary); }

code, kbd, samp { font-family: var(--font-mono); }

.container {
  width: 100%;
  max-width: var(--maxw-content);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.visually-hidden {  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- skip link ---- */
.skip-link {
  position: absolute;
  left: var(--space-5);
  top: -60px;
  z-index: 60;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: var(--text-small);
  padding: 10px 18px;
  border-radius: var(--radius-sharp);
  transition: top 0.15s ease;
}
.skip-link:focus { top: var(--space-3); color: var(--paper); text-decoration: none; }

/* ---- eyebrows / kickers ---- */
.kicker {
  font-family: var(--font-mono);
  font-size: var(--text-kicker);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-kicker);
  color: var(--gold);
  margin: 0 0 var(--space-5);
}

.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  font-size: var(--text-eyebrow);
  color: var(--gold);
  margin: 0 0 var(--space-6);
}

/* ---- the branch triad, as a 3px rule ---- */
.branch-strip { display: flex; height: 4px; }
.branch-strip span { flex: 1; }
.strip-gold { background: var(--gold); }
.strip-slate { background: var(--slate); }
.strip-oxblood { background: var(--oxblood); }

/* ---- sections ---- */
.section { padding: var(--space-26) 0; scroll-margin-top: 72px; }
.section-paper { background: var(--surface-card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-ink { background: var(--surface-ink); color: var(--text-on-ink); }
.section-ink h2, .section-ink h3 { color: var(--text-on-ink); }

.section-head { max-width: 720px; margin-bottom: var(--space-14); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-title {
  font-size: var(--text-section-title);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 var(--space-4);
}
.section-sub { margin: 0; color: var(--text-muted); font-size: var(--text-lead); line-height: var(--leading-lead); }
.section-ink .section-sub { color: var(--text-on-ink-muted); }

/* ---- buttons ---- */
.btn {
  display: inline-block;
  padding: 13px 28px;
  border: 0;
  border-radius: var(--radius-sharp);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--text-small);
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--ink-soft); color: var(--paper); box-shadow: 0 8px 20px rgba(33, 28, 22, 0.22); }
.btn-ghost { border: 1px solid var(--gold); color: var(--gold); background: transparent; }
.btn-ghost:hover { background: var(--gold); color: var(--paper); }
.btn-gold { background: var(--gold); color: var(--paper); }
.btn-gold:hover { background: var(--gold-bright); color: var(--paper); }
.btn-ghost-light { border: 1px solid rgba(252, 251, 248, 0.45); color: var(--paper); background: transparent; }
.btn-ghost-light:hover { border-color: var(--paper); color: var(--paper); }

.actions { display: flex; gap: var(--space-4); flex-wrap: wrap; align-items: center; }
.actions.center { justify-content: center; }

/* ---- install command, with a copy button ---- */
.cmd {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-default);
  background: var(--surface-card);
  font-family: var(--font-mono);
  overflow: hidden;
  max-width: 460px;
}
.cmd code {
  flex: 1;
  padding: 12px 16px;
  font-size: var(--text-small);
  color: var(--ink);
  white-space: nowrap;
  overflow-x: auto;
}
.cmd code b { color: var(--gold); font-weight: 500; user-select: none; margin-right: 8px; }
.cmd button {
  flex: none;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--paper-warm);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0 16px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.cmd button:hover { background: var(--ink); color: var(--paper); }
.cmd[data-copied="true"] button { background: var(--gold); color: var(--paper); }

.cmd-ink { background: rgba(0, 0, 0, 0.26); border-color: var(--code-border); }
.cmd-ink code { color: var(--code-text); }
.cmd-ink button { background: rgba(255, 255, 255, 0.05); border-left-color: var(--code-border); color: var(--text-on-ink-muted); }

/* ---- pullquote ---- */
.pullquote {
  max-width: 720px;
  margin: var(--space-14) auto 0;
  padding: var(--space-2) 0 var(--space-2) var(--space-8);
  border-left: 4px solid var(--gold-bright);
}
.pullquote p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-pullquote);
  line-height: var(--leading-lead);
  color: var(--text-secondary);
  margin: 0 0 var(--space-3);
}
.pullquote cite {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.section-ink .pullquote p { color: var(--text-on-ink); }
.section-ink .pullquote cite { color: var(--text-on-ink-muted); }

/* ---- source note: every specific number on this page is traceable ---- */
.provenance {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.provenance::before {
  content: "";
  width: 8px; height: 8px;
  background: var(--gold-bright);
  flex: none;
}
.section-ink .provenance { color: var(--text-on-ink-muted); }

/* ============ header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(252, 251, 248, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  height: var(--header-height);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--text-brand);
  letter-spacing: var(--tracking-tight);
  color: var(--ink);
}
.brand:hover { text-decoration: none; color: var(--ink); }
.brand img { width: 30px; height: 30px; display: block; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: var(--text-nav);
  letter-spacing: var(--tracking-nav);
  color: var(--text-muted);
}
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-cta {
  padding: 7px 16px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-pill);
  color: var(--ink) !important;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-cta:hover { background: var(--ink); color: var(--paper) !important; }

.progress-track { position: relative; height: 4px; background: var(--line); }
.progress-track .branch-strip {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform: scaleX(0);
}

/* ============ footer ============ */
.site-footer { background: var(--surface-card); border-top: 1px solid var(--line); color: var(--text-muted); }
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: var(--space-10);
  padding: var(--space-16) 0 var(--space-12);
}
.footer-brand { display: flex; align-items: center; gap: 9px; color: var(--ink); font-family: var(--font-serif); font-weight: 700; font-size: 1.05rem; }
.footer-brand img { width: 24px; height: 24px; }
.footer-about { margin: var(--space-4) 0 0; font-size: var(--text-small); color: var(--text-muted); max-width: 34ch; }
.footer-col h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: var(--tracking-kicker);
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 var(--space-5);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-col a { font-family: var(--font-mono); font-size: var(--text-footer); color: var(--text-muted); }
.footer-col a:hover { color: var(--ink); }
.footer-legal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  border-top: 1px solid var(--line);
  padding: var(--space-6) 0;
  font-family: var(--font-mono);
  font-size: var(--text-footer);
}

/* ============ motion ============ */
@media (prefers-reduced-motion: no-preference) {
  body[data-motion="on"] [data-reveal] {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
    transition-delay: var(--d, 0s);
  }
  body[data-motion="on"] [data-reveal].is-in { opacity: 1; transform: none; }
  body[data-motion="on"] .progress-track .branch-strip { transition: transform 0.08s linear; }
  body[data-motion="on"] .owl-anim { animation: owl-bob 4.2s ease-in-out infinite; transform-origin: 50% 85%; }
}

@keyframes owl-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  28% { transform: translateY(-3px) rotate(-3deg); }
  58% { transform: translateY(-1px) rotate(2.5deg); }
}

/* ============ responsive ============ */
@media (max-width: 960px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav-links { gap: 14px; }
  .nav-links li:not(:last-child) { display: none; }
  .section { padding: var(--space-16) 0; }
  .footer-inner { grid-template-columns: 1fr; gap: var(--space-8); }
}
