/* =========================================================
   FLOKUS — flokus.org
   1. Tokens          6. Hero
   2. Base            7. Systems
   3. Utilities       8. Approach
   4. Layout          9. Operations
   5. Header / nav   10. About / Notify / Footer
   ========================================================= */

/* ---------- 1. TOKENS ---------- */
:root {
  --bg:            #17140F;
  --surface:       #221D17;
  --border:        #3A322A;
  --text-heading:  #F5F2EE;
  --text-body:     #B8B0A8;
  --text-muted:    #8A8178;
  --accent:        #C2410C;
  --accent-hover:  #D4551A;
  --accent-text:   #E2703A;
  --on-accent:     #17140F;
  --ok:            #6B9E6E;
  --warn:          #C9A227;
  --terminal:      #0D0B08;
  --header-bg:     rgba(23, 20, 15, 0.92);

  --font-ui:   'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --section-y: 56px;
  --header-h:  61px;
  --radius:    4px;
  --ease:      150ms ease;

  color-scheme: dark;
}

/* ---------- 2. BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-ui);
  color: var(--text-heading);
  margin: 0;
  font-weight: 500;
}

h1 {
  font-size: clamp(2.125rem, 6.2vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
  font-weight: 500;
  margin-bottom: 24px;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.375rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

h3 { font-size: 1.1875rem; letter-spacing: -0.01em; line-height: 1.3; }

p { margin: 0 0 18px; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent-text); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--text-heading); }

ul { list-style: none; margin: 0; padding: 0; }

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
  border-radius: 2px;
}

::selection { background: var(--accent); color: var(--on-accent); }

/* ---------- 3. UTILITIES ---------- */
.measure { max-width: 68ch; }

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

.honeypot { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.1875rem;
  border-radius: var(--radius);
  transition: top var(--ease);
}
.skip-link:focus { top: 12px; color: var(--on-accent); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--accent-text);
  margin: 0 0 18px;
}

/* ---------- 4. LAYOUT ---------- */
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.section { padding: var(--section-y) 0; scroll-margin-top: calc(var(--header-h) + 8px); }
.section + .section { border-top: 1px solid var(--border); }
.section__intro { margin-top: 16px; }
.section h2 + .section__intro { margin-top: 14px; }

/* ---------- 5. HEADER / NAV ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header { background: var(--bg); }
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
}

.wordmark {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: 0.02em;
  color: var(--text-heading);
}
.wordmark:hover { color: var(--accent-text); }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-heading);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color var(--ease), color var(--ease);
}
.nav-toggle:hover { border-color: var(--accent); }

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 16px;
  height: 1px;
  background: var(--text-heading);
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -5px; }
.nav-toggle__bars::after { top: 5px; }

.site-nav { display: none; }
.site-nav.is-open {
  display: block;
  position: absolute;
  left: 0; right: 0;
  top: 100%;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 8px 20px 20px;
}
.site-nav a {
  display: block;
  padding: 10px 0;
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  color: var(--text-body);
}
.site-nav a:hover { color: var(--text-heading); }
.site-nav__code { color: var(--accent-text); }

/* ---------- 6. HERO ---------- */
.hero { padding: calc(var(--section-y) + 16px) 0 var(--section-y); scroll-margin-top: var(--header-h); }

.lead { font-size: 1.0625rem; color: var(--text-body); }

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 40px; }

.btn {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.005em;
  padding: 13px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--ease), border-color var(--ease), color var(--ease);
}
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn--primary:disabled { background: var(--border); color: var(--text-body); cursor: default; }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--text-heading); }
.btn--ghost:hover { border-color: var(--accent); color: var(--text-heading); }

.meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}
.meta-strip li + li { border-left: 1px solid var(--border); padding-left: 14px; }

/* ---------- 7. SYSTEMS ---------- */
.systems { display: grid; gap: 16px; margin-top: 40px; }

.system {
  display: grid;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: border-color var(--ease);
}
.system:hover { border-color: var(--accent); }

.system__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  color: var(--text-body);
  white-space: nowrap;
}
.dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.dot--ok { background: var(--ok); }
.dot--warn { background: var(--warn); }

.shot { margin: 36px 0 0; }
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.shot figcaption {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  line-height: 1.6;
  color: var(--text-muted);
}

.stack {
  margin: 16px 0 0;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  color: var(--text-body);
}

.system__action { margin: 0; }
.arrow-link {
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
}
.arrow-link:hover { color: var(--text-heading); }

.system__note {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  color: var(--text-body);
}

/* ---------- 8. APPROACH ---------- */
.rules { display: grid; gap: 16px; margin-top: 40px; }

.rule {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: border-color var(--ease);
}
.rule:hover { border-color: var(--accent); }
.rule__num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--accent-text);
  margin: 0 0 14px;
}
.rule h3 { margin-bottom: 12px; }
.rule p { font-size: 0.9375rem; margin: 0; }

/* ---------- 9. OPERATIONS ---------- */
.ops { display: grid; gap: 16px; margin-top: 40px; align-items: start; }

.term {
  background: var(--terminal);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.term__bar {
  display: flex;
  gap: 7px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.term__bar span { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }

.term__body {
  margin: 0;
  padding: 18px 14px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1.9;
  color: var(--text-body);
  tab-size: 4;
}
.term__prompt { color: var(--text-muted); }
.t-ok { color: var(--ok); }
.t-warn { color: var(--warn); }

.practices {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.practice { padding: 18px 22px; }
.practice + .practice { border-top: 1px solid var(--border); }
.practice dt {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  color: var(--accent-text);
  margin-bottom: 7px;
}
.practice dd { margin: 0; font-size: 0.9375rem; }

/* ---------- 10a. ABOUT ---------- */
.prose { margin-top: 26px; }
.prose p { font-size: 1.0625rem; }

/* ---------- 10b. NOTIFY ---------- */
.notify {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: calc(var(--section-y) / 2) 0;
}
.notify__inner { display: grid; gap: 28px; align-items: start; }
.notify__title { font-size: 1.375rem; letter-spacing: -0.015em; margin-bottom: 14px; }
.notify p { font-size: 0.9375rem; }

.notify__form { display: grid; gap: 12px; }

.notify__form input[type="email"],
.notify__form select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text-heading);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  transition: border-color var(--ease);
}
.notify__form input[type="email"]::placeholder { color: var(--text-muted); }
.notify__form input[type="email"]:hover,
.notify__form select:hover { border-color: var(--accent); }
.notify__form select { font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.04em; }

.notify__status { font-size: 0.875rem; margin-top: 14px; }
.notify__status:empty { margin-top: 0; }
.notify__status.is-ok { color: var(--ok); }
.notify__status.is-error { color: var(--accent-text); }

.notify__fine { margin-top: 14px; font-size: 0.8125rem; color: var(--text-body); }

/* ---------- 10c. FOOTER ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 44px 0 28px; }
.footer__cols { display: grid; gap: 32px; }
.footer__label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin: 0 0 14px;
}
.footer__col li { margin-bottom: 9px; }
.footer__col a { font-size: 0.9375rem; color: var(--text-body); }
.footer__col a:hover { color: var(--accent-text); }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.footer__bottom p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ---------- 10d. PRODUCT PAGES (academy / financials) ---------- */
.page-hero { padding: 34px 0 var(--section-y); }
.page-hero + .section { border-top: 1px solid var(--border); }
.page-hero h1 { font-size: clamp(1.875rem, 5.2vw, 3rem); }

.back-link { margin: 0 0 28px; }
.back-link a {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}
.back-link a:hover { color: var(--accent-text); }

.page-hero__id { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 20px; }
.page-hero__id .eyebrow { margin: 0; }

/* version blocks — one per release, stacked in sequence (academy) */
.version__id { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 20px; }
.version__id .eyebrow { margin: 0; }

.practices--wide { margin-top: 36px; }
.practices--wide .practice { padding: 20px 24px; }
.practices--wide dd { max-width: 68ch; }

/* ---------- 11. RESPONSIVE ---------- */
@media (min-width: 560px) {
  .notify__form { grid-template-columns: minmax(0, 1fr) auto; }
  .notify__form input[type="email"] { grid-column: 1 / -1; }
}

@media (min-width: 768px) {
  :root { --section-y: 96px; }
  .wrap { padding: 0 32px; }
  .term__body { font-size: 0.75rem; padding: 20px 22px 24px; }

  .nav-toggle { display: none; }
  .site-nav { display: block; }
  .site-nav ul { display: flex; align-items: center; gap: 30px; }
  .site-nav a { padding: 0; font-size: 0.875rem; }

  .footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 32px; }
}

@media (min-width: 900px) {
  .system { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 36px; padding: 30px 30px; }
  .rules { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ops { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
  .notify__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; }
  .footer__cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- 12. MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
