/* Quark Soul — "Night Essay"
   Midnight ink, warm ember accent. Intimate, literary, single flowing column. */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500&family=Literata:ital,opsz,wght@0,16..30,400;0,16..30,500;1,16..30,400&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --ink: #12141f;
  --ink-alt: #191c29;
  --paper: #ede8dc;
  --paper-soft: #c9c3b2;
  --paper-faint: rgba(237, 232, 220, 0.55);
  --ember: #c67a4e;
  --ember-deep: #a8623b;
  --ember-soft: #dd9d72;
  --line: rgba(237, 232, 220, 0.14);
  --max: 760px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: 'Literata', serif;
  font-size: 19px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* faint star field */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(237,232,220,0.5) 50%, transparent 50%),
    radial-gradient(1px 1px at 70% 15%, rgba(237,232,220,0.35) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 85% 55%, rgba(237,232,220,0.4) 50%, transparent 50%),
    radial-gradient(1px 1px at 40% 70%, rgba(237,232,220,0.3) 50%, transparent 50%),
    radial-gradient(1px 1px at 55% 40%, rgba(237,232,220,0.25) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 10% 85%, rgba(237,232,220,0.35) 50%, transparent 50%),
    radial-gradient(1px 1px at 92% 80%, rgba(237,232,220,0.3) 50%, transparent 50%);
  background-size: 100% 100%;
}

h1, h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
  color: var(--paper);
}

a { color: var(--ember-soft); }
a:hover { color: var(--ember); }

.kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ember-soft);
  margin: 0 0 16px;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 28px; position: relative; z-index: 1; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 30px 28px; max-width: var(--max); margin: 0 auto; position: relative; z-index: 2;
}
.mark {
  font-family: 'IBM Plex Mono', monospace; font-weight: 600; font-size: 14px; letter-spacing: 0.03em;
  display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--paper);
}
.lang-switch {
  font-family: 'IBM Plex Mono', monospace; font-size: 13px; letter-spacing: 0.04em; text-decoration: none;
  color: var(--paper-soft); border: 1px solid var(--line); border-radius: 20px; padding: 9px 16px;
  display: inline-flex; align-items: center; min-height: 40px; touch-action: manipulation;
  transition: border-color .15s, color .15s;
}
.lang-switch:hover { border-color: var(--ember); color: var(--ember-soft); }

/* ---------- hero ---------- */
.hero { position: relative; padding: 50px 0 60px; }
.hero h1 { font-size: clamp(1.9rem, 4.6vw, 2.7rem); font-style: italic; }
.hero .lede { font-size: 19px; color: var(--paper-soft); margin: 26px 0 30px; font-family: 'Literata', serif; }

/* ---------- gap diagram ---------- */
.gap-art { position: relative; height: 130px; margin: 20px 0 10px; }
.gap-art svg { width: 100%; height: 100%; }
.gap-box { fill: var(--ink-alt); stroke: var(--paper-soft); stroke-width: 1.4; opacity: 0.9; }
.gap-box.accent { fill: var(--ember); stroke: var(--ember-deep); }
.gap-label { font-family: 'IBM Plex Mono', monospace; font-size: 12px; fill: var(--paper); }
.gap-label.on-accent { fill: var(--ink); font-weight: 600; }
.gap-q { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 26px; fill: var(--ember-soft); }
.gap-conn { stroke: var(--ember-soft); stroke-width: 1.6; stroke-dasharray: 3 5; }

@media (prefers-reduced-motion: no-preference) {
  .gap-box, .gap-conn, .gap-q { opacity: 0; animation: rise .6s ease-out forwards; transform-box: fill-box; transform-origin: center; }
  .gap-box { transform: translateY(8px); }
  .gap-box:nth-of-type(1) { animation-delay: .1s; }
  .gap-conn { animation-delay: .6s; }
  .gap-q { animation-delay: 1s; }
  .gap-box:nth-of-type(2) { animation-delay: .9s; }
  @keyframes rise { to { opacity: 1; transform: translateY(0); } }
}

/* ---------- CTA ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase;
  text-decoration: none; color: var(--ink); background: var(--ember); border: none; border-radius: 2px;
  padding: 15px 24px; cursor: pointer; transition: background .15s, transform .1s;
}
.btn:hover { background: var(--ember-soft); }
.btn:active { transform: translateY(1px); }
.btn-arrow { transition: transform .15s; }
.btn:hover .btn-arrow { transform: translateX(3px); }
.hero-note { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--paper-faint); margin-top: 14px; }

/* ---------- sections (flowing column, no rail — literary feel) ---------- */
.section { position: relative; padding: 48px 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: none; }
.section h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-style: italic; margin-bottom: 22px; }
.section .body p { margin: 0 0 18px; color: var(--paper-soft); }
.section .body p:first-of-type::first-letter {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3.4em;
  font-weight: 600;
  float: left;
  line-height: 0.8;
  margin: 0.06em 0.08em 0 0;
  color: var(--ember);
}
.section .body p:last-child { margin-bottom: 0; }

.pull {
  font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 26px; color: var(--ember-soft);
  border-left: 3px solid var(--ember); padding-left: 22px; margin: 30px 0; line-height: 1.35;
}

/* ---------- threads ---------- */
.threads { display: flex; flex-direction: column; margin-top: 6px; }
.thread { padding: 22px 0; border-top: 1px solid var(--line); }
.thread:first-child { border-top: none; padding-top: 4px; }
.thread-mark { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--ember-soft); display: block; margin-bottom: 8px; }
.thread h3 { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 21px; margin: 0 0 8px; color: var(--paper); }
.thread p { margin: 0; color: var(--paper-soft); }

/* ---------- FAQ ---------- */
.faq { display: flex; flex-direction: column; margin-top: 6px; }
.faq details { border-top: 1px solid var(--line); padding: 20px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; display: flex; align-items: baseline; justify-content: space-between; gap: 20px;
  font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 19px; color: var(--paper);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+'; font-family: 'IBM Plex Mono', monospace; font-size: 20px; color: var(--ember-soft);
  flex: 0 0 auto; transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .a { margin: 14px 0 0; color: var(--paper-soft); }

/* ---------- signup ---------- */
.signup { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.signup-field { flex: 1 1 220px; display: flex; flex-direction: column; gap: 6px; }
.signup-field label { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--paper-faint); }
.signup input[type="email"] {
  width: 100%; font-family: 'Literata', serif; font-size: 16px; padding: 13px 15px;
  border: 1.5px solid var(--paper-soft); border-radius: 2px; background: var(--ink-alt); color: var(--paper);
}
.signup input[type="email"]:focus { outline: 2px solid var(--ember); outline-offset: 1px; }
.signup .btn { flex: 0 0 auto; align-self: flex-end; }
.form-fine { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--paper-faint); margin-top: 12px; }

/* ---------- scroll reveal ---------- */
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease-out, transform .7s ease-out; }
  html.js .reveal.is-visible { opacity: 1; transform: translateY(0); }
}

/* ---------- cookie consent banner ---------- */
.cookie-banner {
  position: fixed; left: 20px; right: 20px; bottom: -260px; z-index: 50;
  max-width: 480px; margin: 0 auto;
  background: var(--ink-alt); color: var(--paper); border: 1px solid var(--ember-deep);
  border-radius: 4px; padding: 20px 22px; box-shadow: 0 16px 44px rgba(0,0,0,0.4);
  font-family: 'Literata', serif; font-size: 15px; line-height: 1.55; transition: bottom .4s ease-out;
}
.cookie-banner.is-visible { bottom: 20px; }
.cookie-banner p { margin: 0 0 14px; color: var(--paper-soft); }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-actions button {
  font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.03em; padding: 10px 18px;
  border-radius: 2px; cursor: pointer; min-height: 40px;
}
#cookie-accept { background: var(--ember); color: var(--ink); border: none; }
#cookie-accept:hover { background: var(--ember-soft); }
#cookie-decline { background: transparent; color: var(--paper); border: 1px solid var(--line); }
#cookie-decline:hover { border-color: var(--paper-soft); }
@media (max-width: 640px) { .cookie-banner { left: 12px; right: 12px; padding: 16px 18px; bottom: -300px; } .cookie-banner.is-visible { bottom: 12px; } }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); padding: 30px 0 44px; margin-top: 10px; }
.footer-row {
  display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--paper-faint);
}
.footer-row a { color: var(--paper-faint); }
.footer-row a:hover { color: var(--ember-soft); }
.legal-note { max-width: 60ch; font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--paper-faint); line-height: 1.6; margin-top: 16px; }

/* --- Legal page (privacy policy) --- */
.legal-page { min-height: 100vh; }
.legal-wrap { max-width: 720px; margin: 0 auto; padding: 48px 24px 80px; }
.legal-back { display: inline-block; margin-bottom: 32px; font-size: 14px; text-decoration: none; }
.legal-content h1 { font-size: clamp(28px, 4vw, 38px); line-height: 1.2; margin: 0 0 8px; }
.legal-content .legal-updated { color: var(--paper-soft); font-size: 14px; margin: 0 0 40px; }

/* ---------- focus-visible (a11y) ---------- */
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--ember); outline-offset: 2px; border-radius: 2px;
}
.legal-content h2 { font-size: 19px; margin: 36px 0 12px; }
.legal-content p { line-height: 1.65; margin: 0 0 14px; max-width: 68ch; }
.legal-content code { font-size: 0.9em; padding: 1px 5px; border-radius: 3px; background: rgba(128,128,128,0.15); }
