/* ──────────────────────────────────────────────────────────────────────────
   Practice Room — site-wide stylesheet
   Used by: homepage, blog index, blog posts, about/contact/privacy pages.
   Tool pages use their own scoped styles but share this chrome.
   ────────────────────────────────────────────────────────────────────────── */

/* ── RESET ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: #f4f2ed;
  color: #1a1918;
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background .2s, color .2s;
}

/* ── SITE CHROME (metronome palette) ──────────────────────────────────── */
.site-banner {
  width: 100%;
  border-bottom: 1px solid rgba(0,0,0,0.10);
  background: #f4f2ed;
  display: flex;
  justify-content: center;
  transition: background .2s, border-color .2s;
}
.site-banner a { display: block; width: 100%; text-align: center; }
.site-banner img { width: 100%; max-width: 900px; height: auto; display: block; margin: 0 auto; }

.site-nav {
  background: #e8e4db;
  border-bottom: 1px solid rgba(0,0,0,0.10);
  display: flex;
  align-items: center;
  transition: background .2s, border-color .2s;
  position: relative;
}
/* Fade hint on the right edge to signal horizontal scroll on mobile */
.site-nav::after {
  content: '';
  position: absolute;
  right: 80px; /* clear of both the hand + theme toggles */
  top: 0; bottom: 0;
  width: 32px;
  pointer-events: none;
  background: linear-gradient(to right, transparent, #e8e4db);
  transition: background .2s;
}
.nav-links {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  padding: 0 0 0 1.5rem;
  scrollbar-width: none;
  /* Prevent any wrapping — single scrollable row */
  flex-wrap: nowrap;
}
.nav-links::-webkit-scrollbar { display: none; }
.site-nav a {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #6a6660;
  text-decoration: none;
  padding: 13px 14px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.site-nav a:hover { color: #1a1814; }
.site-nav a.active { color: #8b6914; border-bottom-color: #8b6914; }
.site-nav .nav-home {
  font-weight: 700;
  color: #8b6914;
  border-right: 1px solid rgba(0,0,0,0.10);
  margin-right: 6px;
}

/* ── HAND + THEME TOGGLE BUTTONS ──────────────────────────────────────── */
.pr-hand-toggle,
.pr-theme-toggle {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: #6a6660;
  line-height: 1;
  transition: color .15s;
}
.pr-hand-toggle  { font-family: 'Space Mono', monospace; font-size: 12px; font-weight: 700; letter-spacing: .05em; padding: 8px 10px; }
.pr-theme-toggle { font-size: 16px; padding: 8px 1.5rem 8px 10px; }
.pr-hand-toggle:hover,
.pr-theme-toggle:hover { color: #1a1814; }

.site-footer {
  margin-top: auto;
  background: #e8e4db;
  border-top: 1px solid rgba(0,0,0,0.10);
  padding: 1.5rem 2rem;
  text-align: center;
  font-family: 'Space Mono', monospace;
  font-size: .75rem;
  letter-spacing: .06em;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  transition: background .2s, border-color .2s, color .2s;
  color: #9a9690;
}
.site-footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}
.site-footer a { color: #8b6914; text-decoration: none; }
.site-footer a:hover { opacity: .7; }
.site-footer .footer-meta { color: #9a9690; }

/* ── PAGE WRAPPER ─────────────────────────────────────────────────────── */
.page-main {
  flex: 1;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}
.page-main.wide { max-width: 1100px; }

/* ── HEADINGS & PROSE ─────────────────────────────────────────────────── */
.page-main h1 { font-size: 28px; font-weight: 500; letter-spacing: -0.01em; margin: 0 0 0.5rem; }
.page-main h2 { font-size: 20px; font-weight: 500; margin: 2rem 0 0.75rem; }
.page-main h3 { font-size: 16px; font-weight: 600; margin: 1.5rem 0 0.5rem; }
.page-main p  { margin: 0 0 1rem; }
.page-main a  { color: #8b6914; text-decoration: underline; text-underline-offset: 2px; }
.page-main a:hover { opacity: .75; }
.page-main ul, .page-main ol { margin: 0 0 1rem 1.25rem; }
.page-main li { margin: 0.25rem 0; }
.page-main blockquote {
  border-left: 3px solid #8b6914;
  padding: 0.25rem 0 0.25rem 1rem;
  margin: 1rem 0;
  color: #6a6660;
  font-style: italic;
}
.page-main code {
  background: #e0dcd4;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-family: 'Space Mono', monospace;
  font-size: 0.9em;
}
.page-main pre {
  background: #1a1a1f;
  color: #e8e6df;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1rem 0;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  line-height: 1.5;
}
.page-main pre code { background: transparent; padding: 0; color: inherit; }
.page-main img { max-width: 100%; height: auto; border-radius: 6px; margin: 1rem 0; }
.page-main hr { border: 0; border-top: 1px solid rgba(0,0,0,0.08); margin: 2rem 0; }

/* ── BLOG POST META ───────────────────────────────────────────────────── */
.post-meta {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #9a9690;
  text-transform: uppercase;
  margin-bottom: 2rem;
}
.post-meta time { color: #6a6660; }

/* ── BLOG INDEX & HOMEPAGE LATEST POSTS ───────────────────────────────── */
.post-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.5rem; }
.post-list-item { border-bottom: 1px solid rgba(0,0,0,0.08); padding-bottom: 1.5rem; }
.post-list-item:last-child { border-bottom: none; }
.post-list-item h2 { margin: 0 0 0.25rem; font-size: 18px; font-weight: 500; }
.post-list-item h2 a { color: #1a1918; text-decoration: none; }
.post-list-item h2 a:hover { color: #8b6914; }
.post-list-item .post-date {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #9a9690;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.post-list-item .post-excerpt { color: #6a6660; font-size: 13px; }

/* ── HOMEPAGE TOOL GRID ───────────────────────────────────────────────── */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.8rem;
  margin: 1rem 0 2.5rem;
}
.tool-card {
  display: block;
  background: #f0ece4;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  text-decoration: none !important;
  color: inherit;
  transition: border-color .15s, transform .15s;
}
.tool-card:hover { border-color: #8b6914; transform: translateY(-1px); }
.tool-card .tool-name { font-weight: 600; font-size: 14px; color: #1a1918; margin-bottom: 0.2rem; }
.tool-card .tool-desc { font-size: 12px; color: #6a6660; line-height: 1.45; }

/* ── SECTION HEADERS ON HOMEPAGE ──────────────────────────────────────── */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 2rem 0 0.75rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  padding-bottom: 0.4rem;
}
.section-head h2 {
  margin: 0;
  font-size: 14px;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6a6660;
}
.section-head a {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8b6914;
  text-decoration: none;
}
.section-head a:hover { opacity: .7; }

/* ── RESPONSIVE ───────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .page-main { padding: 1.25rem 1rem 2rem; }
  .page-main h1 { font-size: 24px; }
  .nav-links { padding-left: 0.75rem; }
  .site-nav a { padding: 12px 10px; font-size: 9px; }
  .pr-hand-toggle  { padding: 8px 6px; }
  .pr-theme-toggle { padding: 8px 10px 8px 6px; }
}

/* ════════════════════════════════════════════════════════════════════════
   DARK MODE  —  html[data-theme="dark"]
   ════════════════════════════════════════════════════════════════════════ */

html[data-theme=dark] body { background: #1a1a1f; color: #e8e6df; }

/* Chrome */
html[data-theme=dark] .site-banner { background: #22222a; border-bottom-color: rgba(255,255,255,.07); }
html[data-theme=dark] .site-nav    { background: #22222a; border-bottom-color: rgba(255,255,255,.07); }
html[data-theme=dark] .site-nav::after { background: linear-gradient(to right, transparent, #22222a); }
html[data-theme=dark] .site-nav a  { color: #6a6660; }
html[data-theme=dark] .site-nav a:hover { color: #e8e6df; }
html[data-theme=dark] .site-nav a.active,
html[data-theme=dark] .site-nav .nav-home { color: #c9a84c; }
html[data-theme=dark] .site-nav a.active { border-bottom-color: #c9a84c; }
html[data-theme=dark] .site-nav .nav-home { border-right-color: rgba(255,255,255,.07); }
html[data-theme=dark] .pr-hand-toggle,
html[data-theme=dark] .pr-theme-toggle        { color: #6a6660; }
html[data-theme=dark] .pr-hand-toggle:hover,
html[data-theme=dark] .pr-theme-toggle:hover  { color: #e8e6df; }
html[data-theme=dark] .site-footer { background: #22222a; border-top-color: rgba(255,255,255,.07); color: #4a4a56; }
html[data-theme=dark] .site-footer a { color: #c9a84c; }
html[data-theme=dark] .site-footer .footer-meta { color: #4a4a56; }

/* Content */
html[data-theme=dark] .page-main a { color: #c9a84c; }
html[data-theme=dark] .page-main blockquote { border-left-color: #c9a84c; color: #9a9690; }
html[data-theme=dark] .page-main code { background: #22222a; color: #e8e6df; }
html[data-theme=dark] .page-main hr { border-top-color: rgba(255,255,255,.07); }

/* Blog lists */
html[data-theme=dark] .post-list-item { border-bottom-color: rgba(255,255,255,.07); }
html[data-theme=dark] .post-list-item h2 a { color: #e8e6df; }
html[data-theme=dark] .post-list-item h2 a:hover { color: #c9a84c; }
html[data-theme=dark] .post-list-item .post-excerpt { color: #6a6660; }
html[data-theme=dark] .post-meta time { color: #6a6660; }

/* Tool grid */
html[data-theme=dark] .tool-card { background: #22222a; border-color: rgba(255,255,255,.07); }
html[data-theme=dark] .tool-card:hover { border-color: #c9a84c; }
html[data-theme=dark] .tool-card .tool-name { color: #e8e6df; }
html[data-theme=dark] .tool-card .tool-desc { color: #6a6660; }

/* Section heads */
html[data-theme=dark] .section-head { border-bottom-color: rgba(255,255,255,.07); }
html[data-theme=dark] .section-head h2 { color: #6a6660; }
html[data-theme=dark] .section-head a { color: #c9a84c; }
