/* tizanae.com — shared design system.
   One file. Every page links to it. Adding an article never touches design. */

:root {
  color-scheme: light dark;
  --bg: #FFFFFF;
  --bg-alt: #F5F5F7;
  --border: #D2D2D7;
  --text-primary: #1D1D1F;
  --text-secondary: #424245;
  --text-muted: #86868B;
  --accent: #0071E3;
  --accent-hover: #0077ED;
  --font-serif: "Libre Caslon Text", Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-alt: #1C1C1E;
    --border: #38383A;
    --text-primary: #F5F5F7;
    --text-secondary: #C7C7CC;
    --text-muted: #8E8E93;
    --accent: #0A84FF;
    --accent-hover: #2A95FF;
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 19px;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

@media (min-width: 768px) {
  body { font-size: 20px; line-height: 1.62; }
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 768px) {
  .container { padding: 0 40px; }
}

/* ---------- Header / Nav ---------- */

.header { padding: 24px 0; }

@media (min-width: 768px) {
  .header { padding: 32px 0; }
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nav .brand {
  color: var(--text-primary);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav a:not(.brand) {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 200ms ease;
}

.nav a:hover { opacity: 0.7; }

/* ---------- Sections ---------- */

section { padding: 72px 0; }

@media (min-width: 768px) {
  section { padding: 112px 0; }
}

.section-alt { background: var(--bg-alt); }

.section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

/* ---------- The mark ---------- */
/* "Outcome ≠ Explanation" — the doorway line's spine, rendered once
   as a motto on the homepage and repeated small in every footer. */

.mark {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(20px, 2.6vw, 26px);
  letter-spacing: -0.005em;
  color: var(--text-secondary);
}

.mark .op {
  font-style: normal;
  color: var(--accent);
  padding: 0 4px;
}

.mark--footer {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.mark--footer .op { padding: 0 3px; }

.section-heading {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(34px, 5.6vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.024em;
  color: var(--text-primary);
  margin-bottom: 48px;
}

/* ---------- Hero ---------- */

.hero {
  padding-top: 56px;
  padding-bottom: 80px;
}

@media (min-width: 768px) {
  .hero {
    padding-top: 96px;
    padding-bottom: 112px;
  }
}

.hero h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(40px, 9vw, 68px);
  line-height: 1.06;
  letter-spacing: -0.026em;
  color: var(--text-primary);
  margin-bottom: 28px;
}

.hero .lede {
  font-size: clamp(20px, 3vw, 24px);
  line-height: 1.45;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.014em;
  max-width: 620px;
}

.hero .lede + .lede { margin-top: 20px; }

/* ---------- The Question Shelf ---------- */

.shelf { list-style: none; }

.shelf li {
  border-top: 1px solid var(--border);
}

.shelf li:last-child {
  border-bottom: 1px solid var(--border);
}

.shelf a {
  display: block;
  padding: 28px 0;
  text-decoration: none;
  transition: opacity 200ms ease;
}

.shelf a:hover { opacity: 0.72; }

.shelf .q {
  display: block;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(21px, 3.2vw, 27px);
  line-height: 1.25;
  letter-spacing: -0.018em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.shelf .t {
  display: block;
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-muted);
}

.shelf a .q::after {
  content: " →";
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Article ---------- */

.article { padding-top: 40px; }

@media (min-width: 768px) {
  .article { padding-top: 64px; }
}

.article-meta {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.article h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(34px, 6.4vw, 54px);
  line-height: 1.1;
  letter-spacing: -0.024em;
  margin-bottom: 40px;
}

.article p {
  margin-bottom: 26px;
  color: var(--text-primary);
}

.article em { color: var(--text-secondary); }

.article h2 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(24px, 3.6vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 64px 0 24px;
}

.article .kicker {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(21px, 3vw, 26px);
  line-height: 1.42;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: -0.005em;
  margin-bottom: 48px;
}

/* ---------- The operation rail ---------- */
/* Question → Observation → Contradiction → Generator, made visible.
   On wide screens each beat gets a small-caps label in the margin.
   Below the rail breakpoint, the same label sits inline above its
   beat instead — same information, no rail required. */

.beat { position: relative; }

.beat + .beat { margin-top: 8px; }

.beat-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.beat-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

@media (min-width: 1180px) {
  .beat-label {
    position: absolute;
    left: -170px;
    top: 5px;
    width: 130px;
    justify-content: flex-end;
    margin-bottom: 0;
  }

  .beat-label::before { order: 2; }
}

/* Closing ritual: Model before / Model after */
.carry {
  margin: 64px 0 0;
  padding: 28px;
  background: var(--bg-alt);
  border-radius: 18px;
}

.carry .shift {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

@media (min-width: 560px) {
  .carry .shift { flex-direction: row; gap: 28px; }
  .carry .shift > div { flex: 1; }
}

.carry .label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.carry .label--before { color: var(--text-muted); }
.carry .label--after { color: var(--accent); }

.carry p {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(18px, 2.4vw, 21px);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.005em;
}

.carry .forward {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-family: inherit;
  font-style: normal;
  font-size: 15px;
  color: var(--text-muted);
}

/* Related links under an article */
.related {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.related .label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.related a {
  display: block;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 10px;
}

.related a:hover { opacity: 0.7; }

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #FFFFFF;
  padding: 16px 32px;
  text-decoration: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  border-radius: 980px;
  transition: background 220ms ease, transform 120ms ease;
  border: none;
  cursor: pointer;
  min-height: 52px;
  white-space: nowrap;
}

.button:hover { background: var(--accent-hover); }
.button:active { transform: scale(0.97); }

@media (max-width: 480px) {
  .button { width: 100%; justify-content: center; }
}

/* ---------- About photo ---------- */

.about-photo {
  width: 100%;
  border-radius: 18px;
  display: block;
  margin: 8px 0 44px;
}

.about-photo-cap {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: -32px;
  margin-bottom: 44px;
}

/* ---------- Books ---------- */

.books-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

@media (min-width: 640px) {
  .books-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

.book-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.book-cover {
  width: 100%;
  aspect-ratio: 5 / 8;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 20px 40px -20px rgba(0,0,0,0.35);
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.book-cover.coming-soon {
  background: #0A0A0C;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.book-cover.coming-soon::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0) 40%);
}

.book-cover.coming-soon .cs-label {
  color: rgba(255,255,255,0.9);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 8px 18px;
  border-radius: 980px;
  z-index: 1;
}

.book-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.book-meta {
  font-size: 15px;
  color: var(--text-muted);
}

/* ---------- Newsletter (inline, quiet — never sticky) ---------- */

.newsletter {
  padding: 40px 32px;
  background: var(--bg-alt);
  border-radius: 18px;
  margin-top: 64px;
}

.newsletter h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
}

.newsletter p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 480px) {
  .newsletter-form { flex-direction: row; }
}

.newsletter-form input[type="email"] {
  flex: 1;
  padding: 14px 18px;
  border-radius: 980px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px;
  min-height: 48px;
}

.newsletter-form input[type="email"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.newsletter-form button {
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #FFFFFF;
  background: var(--accent);
  border: none;
  border-radius: 980px;
  padding: 14px 26px;
  cursor: pointer;
  min-height: 48px;
  white-space: nowrap;
  transition: background 200ms ease;
}

.newsletter-form button:hover { background: var(--accent-hover); }

.newsletter-power {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
}

.newsletter-power a { color: var(--text-muted); }

/* ---------- Provenance ---------- */
/* The signature element. Every artifact opens with where it came from. */

.provenance {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 17px;
  color: var(--text-muted);
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.provenance a {
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}

.provenance a:hover { color: var(--accent); }

/* ---------- The Ledger (100 Conversations) ---------- */

.ledger { list-style: none; }

.ledger li {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.ledger li:last-child { border-bottom: 1px solid var(--border); }

.ledger .num {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.ledger .who {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.ledger .sentence {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 19px;
  line-height: 1.45;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.ledger .model {
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-primary);
}

.ledger .model strong {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}

.ledger .q {
  font-size: 16px;
  color: var(--text-muted);
  margin-top: 10px;
}

.ledger .reserved {
  color: var(--text-muted);
  font-style: italic;
  font-size: 17px;
}

.ledger-count {
  font-family: var(--font-serif);
  font-size: clamp(20px, 2.6vw, 24px);
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.ledger-count .n { color: var(--accent); font-weight: 700; }

/* ---------- Prose pages (about, contact) ---------- */

.prose p { margin-bottom: 26px; color: var(--text-primary); }
.prose a { color: var(--accent); text-decoration: none; font-weight: 500; }
.prose a:hover { opacity: 0.7; }

/* ---------- Footer ---------- */

footer {
  padding: 48px 0 64px;
  border-top: 1px solid var(--border);
  margin-top: 72px;
}

footer p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

footer a { color: var(--text-secondary); text-decoration: none; }
footer a:hover { color: var(--accent); }

@media (min-width: 768px) {
  footer { padding: 56px 0 80px; }
}

/* ---------- Misc ---------- */

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

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