/* ============================================================
   KeemAI — personal brand site
   Dark editorial-tech aesthetic. Serif display (Fraunces),
   sans body (Sora), mono annotations (IBM Plex Mono).
   ============================================================ */

:root {
  --bg: #0a0d12;
  --bg-2: #0d1219;
  --surface: #10161f;
  --surface-2: #131a25;
  --border: #1d2734;
  --border-strong: #2a3646;
  --text: #e9edf2;
  --muted: #8b98a7;
  --faint: #5b6875;
  --accent: #4fd1c5;
  --accent-strong: #2bb3a8;
  --accent-dim: rgba(79, 209, 197, 0.14);
  --amber: #f0b95c;
  --radius: 14px;
  --maxw: 1160px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Sora", -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
.mono { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.03em; }

/* ---- background atmosphere ------------------------------- */
.hero-grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 70% 0%, rgba(79, 209, 197, 0.10), transparent 60%),
    radial-gradient(50% 40% at 10% 100%, rgba(79, 209, 197, 0.05), transparent 60%);
}
.hero-grid-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(120,140,160,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120,140,160,0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(80% 70% at 50% 0%, #000 30%, transparent 90%);
  -webkit-mask-image: radial-gradient(80% 70% at 50% 0%, #000 30%, transparent 90%);
}

/* ---- nav -------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(10, 13, 18, 0.72);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  height: 64px; display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: baseline; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; }
.brand-mark { color: var(--text); }
.brand-dot { color: var(--accent); }
.nav nav { display: flex; gap: 22px; margin-left: auto; }
.nav nav a { font-size: 0.88rem; color: var(--muted); transition: color 0.15s; }
.nav nav a:hover { color: var(--text); }
.btn-nav { margin-left: 6px; }

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  width: 40px; height: 40px; flex-direction: column; gap: 5px;
  align-items: center; justify-content: center; margin-left: auto;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); }

/* ---- buttons --------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-size: 0.88rem; font-weight: 500;
  padding: 10px 20px; border-radius: 9px; cursor: pointer;
  border: 1px solid transparent; transition: transform 0.12s, background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary { background: var(--accent); color: #06231f; }
.btn-primary:hover { background: #63e0d6; transform: translateY(-1px); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-nav { padding: 8px 16px; font-size: 0.82rem; }
.link-btn {
  background: none; border: 0; color: var(--accent); cursor: pointer;
  font-family: var(--mono); font-size: 0.78rem; padding: 0; text-decoration: underline;
}

/* ---- hero ------------------------------------------------ */
.hero {
  position: relative; overflow: hidden;
  max-width: var(--maxw); margin: 0 auto;
  padding: 120px 24px 96px;
}
.eyebrow { color: var(--accent); margin-bottom: 22px; }
.hero-title {
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  font-weight: 600; letter-spacing: -0.02em;
}
.hero-title em { font-style: italic; color: var(--accent); }
.hero-sub { max-width: 560px; margin-top: 26px; font-size: 1.08rem; color: var(--muted); }
.hero-cta { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }
.hero-status {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 44px;
  color: var(--muted); background: var(--surface); border: 1px solid var(--border);
  padding: 9px 14px; border-radius: 999px;
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: 0 0 auto;
  box-shadow: 0 0 0 0 rgba(79, 209, 197, 0.6);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(79,209,197,0.55); }
  70% { box-shadow: 0 0 0 9px rgba(79,209,197,0); }
  100% { box-shadow: 0 0 0 0 rgba(79,209,197,0); }
}

/* ---- sections ------------------------------------------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: 72px 24px; }
.section-head { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; align-items: baseline; margin-bottom: 34px; }
.section-head .num { color: var(--accent); }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.section-head p { grid-column: 1 / -1; color: var(--muted); font-size: 0.98rem; }

/* ---- grids & cards -------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; gap: 14px;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: 0 18px 40px -22px rgba(0,0,0,0.7); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card .kind, .card .date, .card .readtime { color: var(--faint); }
.card h3 { font-size: 1.28rem; }
.card p { color: var(--muted); font-size: 0.92rem; }
.card-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.card-link { color: var(--accent); font-size: 0.85rem; font-weight: 500; }
.card-link:hover { text-decoration: underline; }
.card-link.muted { color: var(--faint); }

.tags, .chips { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.03em;
  color: var(--muted); background: var(--bg-2); border: 1px solid var(--border);
  padding: 3px 8px; border-radius: 6px;
}
.badge {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.03em;
  color: var(--amber); background: rgba(240,185,92,0.10); border: 1px solid rgba(240,185,92,0.25);
  padding: 3px 9px; border-radius: 999px;
}
.chip {
  font-size: 0.82rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 13px;
}
.chip-dim { color: var(--muted); background: var(--bg-2); }

.product-price { font-family: var(--mono); font-size: 1.5rem; color: var(--accent); }
.product .btn { width: 100%; }

.empty { color: var(--faint); font-family: var(--mono); font-size: 0.85rem; padding: 20px 0; }

/* ---- collaborate ---------------------------------------- */
.collab { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: start; }
.collab-info .lead { font-size: 1.12rem; color: var(--text); margin-bottom: 18px; }
.collab-info .lead strong { font-weight: 600; }
.status-line { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); margin-bottom: 26px; }
.collab-info h4, .about h4 { font-size: 1.05rem; margin: 0 0 12px; }
.help-list { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 9px; }
.help-list li { position: relative; padding-left: 22px; color: var(--muted); font-size: 0.95rem; }
.help-list li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }
.contact-line { color: var(--muted); }
.contact-line a { color: var(--accent); }

.collab-form {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; display: flex; flex-direction: column; gap: 8px;
}
.collab-form label { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--muted); margin-top: 10px; }
.collab-form label span { color: var(--accent); }
.collab-form input, .collab-form select, .collab-form textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-family: var(--sans); font-size: 0.92rem; padding: 11px 13px;
  transition: border-color 0.15s;
}
.collab-form textarea { resize: vertical; min-height: 96px; }
.collab-form input:focus, .collab-form select:focus, .collab-form textarea:focus {
  outline: none; border-color: var(--accent);
}
.collab-form .btn { margin-top: 18px; }
.form-status { font-size: 0.85rem; color: var(--muted); margin-top: 8px; min-height: 1.2em; }
.form-status.error { color: #f07a7a; }
.form-note { color: var(--faint); margin-top: 6px; }

/* ---- about ---------------------------------------------- */
.about { max-width: 780px; }
.about-bio { font-size: 1.18rem; color: var(--text); line-height: 1.7; }
.about-bio strong { font-weight: 600; }
.about-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 34px; }

/* ---- footer -------------------------------------------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-2); margin-top: 40px; }
.footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 44px 24px;
  display: grid; grid-template-columns: 1fr auto; gap: 22px; align-items: start;
}
.footer-tag { color: var(--faint); margin-top: 8px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.footer-links a { font-size: 0.85rem; color: var(--muted); }
.footer-links a:hover { color: var(--text); }
.footer-copy { grid-column: 1 / -1; color: var(--faint); border-top: 1px solid var(--border); padding-top: 18px; }

/* ---- toast --------------------------------------------- */
#toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  background: var(--surface-2); border: 1px solid var(--accent); color: var(--text);
  padding: 11px 18px; border-radius: 9px; font-size: 0.88rem; opacity: 0;
  pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 100;
  max-width: min(90vw, 480px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- reveal -------------------------------------------- */
/* content is visible by default; only hidden when JS is active and the
   reveal observer hasn't fired yet — no-JS visitors see everything */
html.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
html.js .reveal.in { opacity: 1; transform: none; }

/* ---- focus --------------------------------------------- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}

/* ---- responsive ---------------------------------------- */
@media (max-width: 900px) {
  .grid, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .collab { grid-template-columns: 1fr; }
  .nav nav {
    position: fixed; top: 64px; left: 0; right: 0; margin: 0;
    background: rgba(10,13,18,0.98); border-bottom: 1px solid var(--border);
    flex-direction: column; gap: 0; padding: 8px 24px 20px;
    display: none;
  }
  .nav nav.open { display: flex; }
  .nav nav a { padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 1rem; }
  .nav nav a:last-child { border-bottom: 0; }
  .nav-toggle { display: flex; }
  .btn-nav { display: none; }
}
@media (max-width: 560px) {
  .grid, .grid-3 { grid-template-columns: 1fr; }
  .hero { padding: 80px 20px 72px; }
  .section { padding: 56px 20px; }
  .about-cols { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
}

/* ---- blog post page ---- */
.nav .post-back { margin-left: auto; color: var(--muted); font-size: 0.82rem; }
.nav .post-back:hover { color: var(--accent); }
.post { max-width: 720px; margin: 0 auto; padding: 72px 24px 96px; }
.post-header { margin-bottom: 36px; }
.post-header h1 { font-size: clamp(2rem, 5.5vw, 3rem); font-weight: 600; margin-top: 20px; letter-spacing: -0.02em; }
.post-meta { display: flex; gap: 12px; align-items: center; margin-top: 16px; color: var(--faint); }
.post-body { font-size: 1.05rem; }
.post-body p { color: #c7d0da; line-height: 1.85; margin: 0 0 1.4em; }
.post-body h2 { font-size: 1.5rem; margin: 2.1em 0 0.65em; }
.post-body strong { color: var(--text); font-weight: 600; }
.post-body em { color: var(--text); }
.post-body ul, .post-body ol { color: #c7d0da; margin: 0 0 1.5em; padding-left: 24px; line-height: 1.8; }
.post-body li { margin-bottom: 0.45em; }
.post-body code { font-family: var(--mono); font-size: 0.82em; color: var(--accent); background: var(--bg-2); border: 1px solid var(--border); padding: 2px 6px; border-radius: 5px; }
.post-body pre { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 18px; overflow-x: auto; margin: 0 0 1.7em; }
.post-body pre code { background: none; border: 0; padding: 0; color: #c7d0da; font-size: 0.85rem; line-height: 1.7; }
.post-body blockquote { border-left: 2px solid var(--accent); margin: 0 0 1.6em; padding: 2px 0 2px 20px; color: var(--muted); font-style: italic; }

/* ============================================================
   KeemAI — principles, membership ladder, newsletter
   ============================================================ */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.form-status.ok { color: var(--accent); }

/* ---- principles ------------------------------------------- */
.principles-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-top: 34px;
}
.principle {
  position: relative; padding: 26px 24px 22px;
  border-top: 2px solid var(--accent-dim);
  transition: border-color 0.2s, transform 0.2s;
}
.principle:hover { border-top-color: var(--accent); transform: translateY(-2px); }
.principle-n {
  display: block; color: var(--accent); font-size: 0.75rem;
  letter-spacing: 0.12em; margin-bottom: 14px;
}
.principle h3 { font-size: 1.15rem; margin-bottom: 8px; }
.principle p { color: var(--muted); font-size: 0.9rem; }

/* ---- membership ladder ------------------------------------ */
.ladder { display: flex; flex-direction: column; gap: 14px; margin-top: 34px; }
.tier {
  display: grid; grid-template-columns: 1fr auto; gap: 18px 28px;
  align-items: center; padding: 22px 26px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius); transition: border-color 0.2s, transform 0.2s;
}
.tier:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.tier[data-status="coming"] { border-left-color: var(--amber); }
.tier[data-status="waitlist"] { border-left-color: var(--accent-strong); }
.tier-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.tier-lvl { color: var(--accent); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; }
.tier-main h3 { font-size: 1.3rem; margin-bottom: 6px; }
.tier-main p { color: var(--muted); font-size: 0.92rem; max-width: 640px; }
.tier-side { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.tier-price { font-size: 1.25rem; color: var(--text); }
.tier-cta { min-width: 168px; border-color: var(--border-strong); color: var(--text); background: transparent; }
.tier-cta:hover { border-color: var(--accent); color: var(--accent); }
.tier-cta[data-status="email"] {
  background: var(--accent); color: #06231f; border-color: transparent;
}
.tier-cta[data-status="email"]:hover { background: #63e0d6; color: #06231f; }
.tier-cta[data-status="live"] {
  background: var(--accent); color: #06231f; border-color: transparent;
}
.tier-cta[data-status="live"]:hover { background: #63e0d6; color: #06231f; }
.tier-cta[data-status="coming"] {
  color: var(--faint); border-style: dashed; cursor: default; opacity: 0.85;
}
.tier-cta[data-status="coming"]:hover { border-color: var(--border-strong); color: var(--faint); }
.tier-cta[data-status="waitlist"] { border-color: var(--accent); color: var(--accent); }

/* ---- newsletter ------------------------------------------- */
.newsletter {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 26px; align-items: center;
  margin-top: 34px; padding: 30px 32px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.newsletter-info h3 { font-size: 1.3rem; margin-bottom: 6px; }
.newsletter-info p { color: var(--muted); }
.newsletter-form { display: flex; gap: 10px; flex-wrap: wrap; }
.newsletter-form input[type="email"] {
  flex: 1 1 220px; min-width: 0;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px;
  color: var(--text); padding: 10px 14px; font-family: var(--sans); font-size: 0.9rem;
}
.newsletter-form input[type="email"]:focus { outline: none; border-color: var(--accent); }
.newsletter-form .form-status { flex-basis: 100%; }
.footer-form { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; max-width: 420px; }
.footer-form-label { display: block; flex-basis: 100%; color: var(--faint); margin-bottom: 2px; }
.footer-form input[type="email"] {
  flex: 1 1 160px; min-width: 0;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px;
  color: var(--text); padding: 8px 12px; font-family: var(--sans); font-size: 0.86rem;
}
.footer-form input[type="email"]:focus { outline: none; border-color: var(--accent); }

/* ---- responsive ------------------------------------------- */
@media (max-width: 900px) {
  .principles-grid { grid-template-columns: repeat(2, 1fr); }
  .tier { grid-template-columns: 1fr; }
  .tier-side { flex-direction: row; align-items: center; justify-content: space-between; }
  .newsletter { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .principles-grid { grid-template-columns: 1fr; }
  .newsletter { padding: 24px 20px; }
  .tier { padding: 18px 18px; }
  .tier-side { flex-direction: column; align-items: stretch; text-align: center; }
  .tier-cta { min-width: 0; width: 100%; }
}

/* ---- archon spotlight ------------------------------------- */
.spotlight {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 34px; align-items: center;
  margin-top: 34px;
}
.spotlight-shot img {
  width: 100%; display: block; border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(79, 209, 197, 0.06);
}
.shot-caption { color: var(--faint); margin-top: 10px; }
.spotlight-info h3 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); margin-bottom: 14px; }
.spotlight-info > p { color: var(--muted); margin-bottom: 16px; }
.spotlight-list { margin-bottom: 22px; }
.spotlight-cta { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .spotlight { grid-template-columns: 1fr; }
}


/* ---- self-hosted fonts (no third-party requests) ------- */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('assets/fonts/Fraunces-400_700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/IBMPlexMono-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/IBMPlexMono-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('assets/fonts/Sora-300_700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* ---- consent checkbox ------------------------------------- */
.consent-line {
  display: flex; align-items: flex-start; gap: 8px; flex-basis: 100%;
  font-size: 0.8rem; color: var(--muted); cursor: pointer; margin-top: 4px;
}
.consent-line input[type="checkbox"] {
  accent-color: var(--accent); margin-top: 3px; cursor: pointer; flex: none;
}
.consent-line a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.consent-line a:hover { color: var(--text); }
.consent-compact { font-size: 0.74rem; }
