@import "./chrome.css";

/* Align essay + deck chrome with the monochrome home page */

:root {
  --bg: #ffffff;
  --bg-card: #ffffff;
  --ink: #0a0a0a;
  --ink-muted: #737373;
  --rule: #e5e5e5;
  --accent: #171717;
  --accent-ink: #ffffff;
  --font: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --nav-h: 52px;
  --glass: #ffffff;
  --shadow-soft: none;
  --radius-pill: 0.375rem;
  --radius-card: 0.5rem;
  --header-h: 52px;
}

html.dark,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0a;
  --bg-card: #171717;
  --ink: #ffffff;
  --ink-muted: #a3a3a3;
  --rule: #262626;
  --accent: #e5e5e5;
  --accent-ink: #0a0a0a;
  --glass: #0a0a0a;
}

html, body {
  background: var(--bg) !important;
  color: var(--ink);
  font-family: var(--font);
}

/* Essay page: flat, wide, no postcard frame */
body:has(.post) .page {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 2.5rem 1.5rem 4rem !important;
}
@media (min-width: 640px) {
  body:has(.post) .page { padding-left: 2.5rem !important; padding-right: 2.5rem !important; }
}
@media (min-width: 1024px) {
  body:has(.post) .page { padding-left: 4rem !important; padding-right: 4rem !important; }
}
@media (min-width: 1280px) {
  body:has(.post) .page { padding-left: 5rem !important; padding-right: 5rem !important; }
}

.post {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.post::before { display: none !important; }

.post-meta {
  gap: 0.75rem;
  color: var(--ink-muted);
  font-size: 0.875rem;
  text-transform: none;
  letter-spacing: 0;
}
.post-meta span {
  border: none !important;
  background: none !important;
  padding: 0 !important;
}
.post-meta span + span::before {
  content: "·";
  margin-right: 0.75rem;
  color: var(--ink-muted);
}

.post h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  max-width: none !important;
  margin: 0.75rem 0 1rem;
}

.post-dek {
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--ink-muted);
  border: none !important;
  background: none !important;
  padding: 0 !important;
  margin: 0 0 2.5rem !important;
  max-width: 50rem;
}

.post h2 {
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 2.75rem;
}

.post p, .post li {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink);
}

.post-figure {
  margin: 2rem 0;
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--bg-card);
}
.post-figure img {
  display: block;
  width: 100%;
  height: auto;
}
.post-figure figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--ink-muted);
  border-top: 1px solid var(--rule);
}

.post-rule { display: none !important; }

.site-footer {
  border-top: 1px solid var(--rule);
  background: transparent !important;
  box-shadow: none !important;
  margin-top: 3rem;
  padding: 1.5rem !important;
}

/* Deck: keep slides, quiet the chrome */

body:has(.deck) {
  --stage: calc(100vw - 3rem);
}
.slide {
  border-radius: 0.75rem !important;
  border: 1px solid var(--rule) !important;
  box-shadow: none !important;
  background: var(--bg-card) !important;
}
.eyebrow {
  color: var(--ink-muted) !important;
  letter-spacing: 0.06em;
}


/* ========== Mobile ========== */








@media (max-width: 767px) {
  html, body {
    overflow-x: hidden !important;
  }

  /* Essay/deck: keep a single back affordance, hide duplicate Writing in menu chrome */
  body:has(.post) 

  /* Essay: comfortable reading column feel on phone, no fancy frame */
  body:has(.post) {
    --header-h: 52px;
  }
  body:has(.post) .page {
    padding: 1rem 1rem 3rem !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  .post h1 {
    font-size: 1.6rem !important;
    line-height: 1.2 !important;
    margin: 0.5rem 0 0.75rem !important;
  }
  .post-dek {
    font-size: 1rem !important;
    line-height: 1.45 !important;
    margin: 0 0 1.25rem !important;
    max-width: none !important;
  }
  .post h2 {
    font-size: 1.2rem !important;
    margin-top: 1.75rem !important;
  }
  .post p, .post li {
    font-size: 1rem !important;
    line-height: 1.65 !important;
  }
  .post-figure {
    margin: 1.25rem 0 !important;
    border-radius: 0.5rem;
  }
  .post-figure img {
    width: 100%;
    height: auto;
  }
  .post table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .post pre {
    max-width: 100%;
    overflow-x: auto;
  }
  .references {
    padding-left: 1.1rem;
    font-size: 0.9rem;
  }
  .site-footer {
    padding: 1rem !important;
    margin-top: 2rem;
  }

  /* ========== DECK: abandon slide-theater; become a scroll document ========== */
  html:has(.deck),
  body:has(.deck) {
    height: auto !important;
    min-height: 100% !important;
    overflow: visible !important;
    overflow-x: hidden !important;
  }

  body:has(.deck) {
    --header-h: 52px;
    --stage: 100% !important;
    --slide-pad: 1rem !important;
  }

  body:has(.deck) .deck {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0.75rem 0.75rem 5.5rem !important;
    gap: 0.85rem !important;
  }

  body:has(.deck) .slide {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 1rem !important;
    margin: 0 !important;
    border-radius: 0.65rem !important;
    box-shadow: none !important;
  }

  body:has(.deck) .slide.active {
    outline: 1px solid color-mix(in srgb, var(--ink) 18%, var(--rule));
  }

  body:has(.deck) .slide-head {
    align-items: flex-start !important;
    text-align: left !important;
  }

  body:has(.deck) .slide-head h1,
  body:has(.deck) .slide-head h2 {
    font-size: 1.25rem !important;
    line-height: 1.25 !important;
    max-width: none !important;
    text-align: left !important;
  }

  body:has(.deck) .slide-body {
    display: block !important;
    overflow: visible !important;
    justify-content: flex-start !important;
    padding-top: 0.5rem !important;
  }

  body:has(.deck) .slide-body > .split,
  body:has(.deck) .slide-body > .grid-2,
  body:has(.deck) .slide-body > .grid-3,
  body:has(.deck) .slide-body > .grid-4,
  body:has(.deck) .grid-2,
  body:has(.deck) .grid-3,
  body:has(.deck) .grid-4,
  body:has(.deck) .split,
  body:has(.deck) .stat-row,
  body:has(.deck) .toc,
  body:has(.deck) .flow,
  body:has(.deck) .flow-3,
  body:has(.deck) .chain,
  body:has(.deck) .shift-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0.55rem !important;
  }

  /* Bottom controls: compact pager for scroll mode */
  body:has(.deck) .controls {
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem calc(0.65rem + env(safe-area-inset-bottom, 0px)) !important;
    background: color-mix(in srgb, var(--bg) 94%, transparent) !important;
    border-top: 1px solid var(--rule);
    backdrop-filter: blur(10px);
  }

  body:has(.deck) .controls .hint {
    display: none !important;
  }

  body:has(.deck) .controls .nav-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }

  body:has(.deck) .controls .progress-pipe {
    flex: 1;
  }
}





