/* ==========================================================================
   crotzer.co — Minimal Edition (single source of truth)
   Layout/restraint inspired by sheeks.co: generous whitespace, spacing as
   structure, understated nav, rows instead of cards. Palette stays gray/orange
   throughout; gradients are the one deliberate flourish.
   ========================================================================== */

:root {
  --paper: #fffdfb;
  --paper-alt: #f7f5f3;
  --paper-card: #ffffff;
  --ink: #171514;
  --ink-soft: #5e5e5e;
  --ink-faint: #9a9691;
  --line: rgba(43, 41, 38, 0.1);
  --orange: #ec5c35;
  --orange-light: #ef7543;
  --orange-deep: #c24c2b;
  --orange-soft: rgba(236, 92, 53, 0.1);
  --gradient-brand: linear-gradient(135deg, var(--orange) 0%, var(--orange-light) 100%);
  --gradient-mesh:
    radial-gradient(circle at 12% 8%, rgba(236, 92, 53, 0.14) 0%, transparent 42%),
    radial-gradient(circle at 88% 0%, rgba(94, 94, 94, 0.1) 0%, transparent 38%),
    radial-gradient(circle at 50% 100%, rgba(239, 117, 67, 0.08) 0%, transparent 45%);
  --font-display: 'Inter', 'Segoe UI', Arial, sans-serif;
  --font-body: 'Inter', 'Segoe UI', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;
  --max-width: 700px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --shadow-soft: 0 10px 30px rgba(23, 21, 20, 0.05);
  --shadow-strong: 0 20px 48px rgba(23, 21, 20, 0.09);
}

html.dark-mode {
  --paper: #141414;
  --paper-alt: #1b1b1b;
  --paper-card: #1e1e1e;
  --ink: #f1efec;
  --ink-soft: #b4b4b4;
  --ink-faint: #767676;
  --line: rgba(241, 239, 236, 0.1);
  --orange: #ef7543;
  --orange-light: #f79367;
  --orange-deep: #ec5c35;
  --orange-soft: rgba(239, 117, 67, 0.16);
  --gradient-brand: linear-gradient(135deg, var(--orange) 0%, var(--orange-light) 100%);
  --gradient-mesh:
    radial-gradient(circle at 12% 8%, rgba(239, 117, 67, 0.16) 0%, transparent 42%),
    radial-gradient(circle at 88% 0%, rgba(180, 180, 180, 0.08) 0%, transparent 38%),
    radial-gradient(circle at 50% 100%, rgba(236, 92, 53, 0.12) 0%, transparent 45%);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.3);
  --shadow-strong: 0 20px 48px rgba(0, 0, 0, 0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; background: var(--paper); }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.wrap { width: 90%; max-width: var(--max-width); margin: 0 auto; }
::selection { background: var(--orange-soft); color: var(--orange-deep); }

/* Motion + reveal */
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

.eyebrow { display: block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--orange); margin-bottom: 0.6rem; }

/* ==========================================================================
   Announcement banner + nav
   ========================================================================== */
.m-banner {
  display: block;
  background: var(--paper-alt);
  border-bottom: 1px solid var(--line);
  padding: 0.6rem 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}
.m-banner:hover { color: var(--orange); }
.m-banner-inner { display: inline-flex; align-items: center; gap: 0.4rem; }
.m-banner .arrow { color: var(--orange); display: inline-block; }

#top { position: relative; z-index: 20; }
.m-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.m-nav.is-scrolled { border-bottom-color: var(--line); }
.m-nav-inner, .header-inner { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 0; gap: 1rem; }

.brand { display: flex; align-items: center; gap: 0.65rem; cursor: pointer; }
.m-logo-mark {
  display: inline-block;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background-color: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  background-image: url('assets/logo.png');
  /* Crops the "C" mark out of the full logo file (icon sits above the
     wordmark text in the source image) — no separate cropped asset needed. */
  background-size: 99px 66px;
  background-position: -27px -4px;
  background-repeat: no-repeat;
}
.m-wordmark { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; color: var(--ink); }
.m-wordmark span { background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-text { display: none; }
@media (min-width: 900px) { .brand-text { display: block; } }
.tagline { font-size: 0.78rem; color: var(--ink-faint); }

.nav-links, .m-nav-links { display: flex; align-items: center; gap: 1.5rem; list-style: none; }
.nav-links a {
  position: relative;
  display: inline-block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -0.4rem;
  height: 2px;
  background: var(--gradient-brand);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
}
.nav-links a:hover::after, .nav-links li.active a::after { transform: scaleX(1); }
.nav-links li.active a, .nav-links a:hover { color: var(--ink); }

.m-theme-toggle, .theme-toggle-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.m-theme-toggle:hover, .theme-toggle-btn:hover { border-color: var(--orange); transform: rotate(12deg); }
html.dark-mode .m-icon-dark, html.dark-mode .theme-icon.dark-icon { display: none; }
html.light-mode .m-icon-light, html.light-mode .theme-icon.light-icon { display: none; }

/* Mobile nav toggle — hidden on desktop, hamburger-to-X on small screens */
.m-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}
.m-nav-toggle:hover { border-color: var(--orange); transform: rotate(8deg); }
.m-nav.is-open .m-nav-toggle { border-color: var(--orange); background: var(--orange-soft); transform: rotate(0deg); }
.m-nav-toggle-bar {
  display: block;
  width: 15px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease, background 0.3s ease;
}
.m-nav.is-open .m-nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); background: var(--orange); }
.m-nav.is-open .m-nav-toggle-bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.m-nav.is-open .m-nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); background: var(--orange); }

@media (max-width: 760px) {
  .m-nav-toggle { display: inline-flex; }
  .nav-links.m-nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-strong);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease, border-color 0.3s ease;
  }
  .m-nav.is-open .nav-links.m-nav-links { max-height: 26rem; opacity: 1; }
  .nav-links.m-nav-links li { width: 100%; border-top: 1px solid var(--line); }
  .nav-links.m-nav-links li:first-child { border-top: none; }
  .nav-links.m-nav-links li:last-child { display: flex; justify-content: center; padding: 1rem 0; }
  .nav-links.m-nav-links a { display: block; padding: 1rem 1.4rem; font-size: 1rem; }
  .nav-links.m-nav-links a::after { display: none; }
  .nav-links.m-nav-links a:hover, .nav-links.m-nav-links li.active a { background: var(--paper-alt); color: var(--orange); }
  .m-nav.is-open .nav-links.m-nav-links li {
    opacity: 0;
    transform: translateY(-6px);
    animation: mNavItemIn 0.4s ease forwards;
  }
  .m-nav.is-open .nav-links.m-nav-links li:nth-child(1) { animation-delay: 0.04s; }
  .m-nav.is-open .nav-links.m-nav-links li:nth-child(2) { animation-delay: 0.09s; }
  .m-nav.is-open .nav-links.m-nav-links li:nth-child(3) { animation-delay: 0.14s; }
  .m-nav.is-open .nav-links.m-nav-links li:nth-child(4) { animation-delay: 0.19s; }
  .m-nav.is-open .nav-links.m-nav-links li:nth-child(5) { animation-delay: 0.24s; }
  .m-nav.is-open .nav-links.m-nav-links li:nth-child(6) { animation-delay: 0.29s; }
}
@keyframes mNavItemIn { to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   Hero
   ========================================================================== */
.m-hero { position: relative; padding: 6rem 0 5rem; overflow: hidden; }
.m-hero::before { content: ''; position: absolute; inset: 0; background-image: var(--gradient-mesh); pointer-events: none; }
.m-hero-inner { position: relative; z-index: 1; }
.m-eyebrow {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-soft);
  background: var(--paper-alt); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.35rem 0.8rem; margin-bottom: 1.6rem;
}
.m-eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gradient-brand); animation: mDotPulse 2.4s ease-in-out infinite; }
@keyframes mDotPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.m-hero h1 {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(2.2rem, 5.2vw, 3.4rem);
  line-height: 1.08; letter-spacing: -0.02em; max-width: 16ch; margin-bottom: 1.4rem;
}
.m-hero h1 em, .m-contact h2 em {
  font-style: normal; background: var(--gradient-brand);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.m-hero p { color: var(--ink-soft); font-size: 1.06rem; max-width: 46ch; margin-bottom: 2.1rem; }
.m-hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.m-btn, .btn-primary, .btn-sm, .btn-outline {
  font: inherit; cursor: pointer; font-weight: 600; border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.m-btn { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.92rem; padding: 0.75rem 1.3rem; }
.m-btn-primary, .btn-primary {
  background: var(--gradient-brand); color: #fff; border: 1px solid transparent;
  padding: 0.7rem 1.3rem; box-shadow: var(--shadow-soft);
}
.m-btn-primary:hover, .btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-strong); }
.btn-primary:active { transform: translateY(0) scale(0.97); }
.m-btn-ghost, .btn-outline {
  background: transparent; border: 1px solid var(--line); color: var(--ink); padding: 0.5rem 1rem; font-size: 0.88rem;
}
.m-btn-ghost:hover, .btn-outline:hover { border-color: var(--orange); color: var(--orange); }
.btn-sm { background: transparent; color: var(--ink); border: 1px solid var(--line); padding: 0.4rem 0.85rem; font-size: 0.84rem; }
.btn-sm:hover { border-color: var(--orange); color: var(--orange); }
.btn-danger { color: #c0392b !important; border-color: rgba(192, 57, 43, 0.35) !important; }
.btn-danger:hover { background: rgba(192, 57, 43, 0.08) !important; }

/* ==========================================================================
   Sections — spacing as structure, no boxed panels
   ========================================================================== */
.m-section { padding: 4.5rem 0; border-top: 1px solid var(--line); }
.m-section:first-of-type { border-top: none; }
.m-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 2.4rem; flex-wrap: wrap; }
.m-section-label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--orange); }
.m-section-head h2 { font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 1.9rem); font-weight: 700; letter-spacing: -0.01em; margin-top: 0.4rem; }
.m-section-link, .view-all-link { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); transition: color 0.2s ease; white-space: nowrap; }
.m-section-link:hover, .view-all-link:hover { color: var(--orange); }

/* ==========================================================================
   Articles — full list, detail reader
   ========================================================================== */
.main-content { flex: 1; padding-bottom: 4rem; }
.article-stream { list-style: none; padding: 1rem 0 0; }
.section-label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--orange); margin: 2.4rem 0 0.5rem; }
.section-label:first-child { margin-top: 0; }
.article-item { padding: 1.15rem 0; border-top: 1px solid var(--line); transition: padding-left 0.25s ease; }
.article-item:first-of-type { border-top: none; }
.article-item:hover { padding-left: 0.5rem; }
.article-link { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.article-title-text { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--ink); transition: color 0.2s ease; }
.article-item:hover .article-title-text { color: var(--orange); }
.tooltip-sub { display: block; font-size: 0.9rem; color: var(--ink-soft); margin-top: 0.3rem; }
.tag-badge { font-size: 0.72rem; font-weight: 600; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.03em; margin-right: 0.4rem; display: inline-block; }

.article-container { padding: 3rem 0 4rem; }
.back-link {
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 0.85rem; font-weight: 600; color: var(--ink-soft);
  margin-bottom: 1.6rem; transition: color 0.2s ease;
}
.back-link:hover { color: var(--orange); }
.article-title-meta { display: flex; align-items: center; gap: 0.7rem; font-size: 0.82rem; color: var(--ink-faint); margin-bottom: 0.8rem; flex-wrap: wrap; }
.cat-badge {
  background: var(--orange-soft); color: var(--orange); font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; padding: 0.2rem 0.55rem; border-radius: 999px;
}
.article-main-title {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(1.9rem, 4vw, 2.6rem);
  letter-spacing: -0.02em; line-height: 1.12; color: var(--ink); margin-bottom: 0.6rem;
}
.article-subtitle-tooltip {
  font-size: 1.05rem; color: var(--ink-soft); font-style: italic;
  padding-bottom: 1.4rem; border-bottom: 1px solid var(--line); margin-bottom: 0.5rem;
}
.markdown-body { font-size: 1.02rem; line-height: 1.8; color: var(--ink); }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; margin: 2rem 0 0.8rem; }
.markdown-body p { margin-bottom: 1.1rem; }
.markdown-body ul { margin: 0 0 1.1rem 1.2rem; }
.markdown-body li { margin-bottom: 0.4rem; }
.markdown-body blockquote { border-left: 3px solid var(--orange); padding-left: 1.1rem; margin: 1.5rem 0; color: var(--ink-soft); font-style: italic; }
.markdown-body pre { background: var(--paper-alt); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem; overflow-x: auto; font-family: var(--font-mono); font-size: 0.88rem; margin: 1.5rem 0; }
.markdown-body code { font-family: var(--font-mono); background: var(--orange-soft); color: var(--orange-deep); padding: 0.15rem 0.35rem; border-radius: 4px; font-size: 0.88em; }
.markdown-body pre code { background: none; color: var(--ink); padding: 0; }
.markdown-body hr { border: none; border-top: 1px solid var(--line); margin: 2rem 0; }
.article-footer { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.share-box { font-size: 0.88rem; color: var(--ink-soft); display: flex; align-items: center; gap: 0.6rem; }

/* ==========================================================================
   Search + tag chips
   ========================================================================== */
.search-section { padding: 1.6rem 0 0; }
.search-bar {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--paper-alt); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.7rem 1rem; transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.search-bar:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
.search-icon { font-size: 0.9rem; opacity: 0.6; }
.search-bar input { border: none; background: transparent; width: 100%; font: inherit; color: var(--ink); outline: none; }
.clear-btn { background: transparent; border: none; color: var(--ink-faint); font-size: 1.1rem; cursor: pointer; }
.tag-chips, .status-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.chip {
  background: transparent; border: 1px solid var(--line); color: var(--ink-soft);
  font-size: 0.78rem; font-weight: 600; padding: 0.35rem 0.8rem; border-radius: 999px; cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.chip:hover { border-color: var(--orange); color: var(--orange); }
.chip.active { background: var(--gradient-brand); color: #fff; border-color: transparent; }

/* ==========================================================================
   Projects — row list (shared by full Projects view + Home's featured list)
   ========================================================================== */
.projects-header { padding: 3rem 0 1rem; }
.projects-header h2 { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.7rem, 3.5vw, 2.2rem); letter-spacing: -0.02em; margin-bottom: 0.5rem; }
.section-desc { color: var(--ink-soft); font-size: 0.98rem; max-width: 56ch; margin-bottom: 0.5rem; }

.projects-grid { display: flex; flex-direction: column; padding-bottom: 2rem; }
.project-card { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.4rem 0; border-top: 1px solid var(--line); transition: padding-left 0.25s ease; }
.projects-grid .project-card:first-child { border-top: none; }
.project-card:hover { padding-left: 0.5rem; }
.project-card-top { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; flex: 1; }
.project-title-row { display: flex; align-items: center; gap: 0.6rem; }
.project-title-row h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; letter-spacing: -0.01em; color: var(--ink); }
.project-title-row::after {
  content: '\2192'; opacity: 0; transform: translateX(-4px); color: var(--orange); font-weight: 700;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.project-card:hover .project-title-row::after { opacity: 1; transform: translateX(0); }
.badge-status { font-size: 0.7rem; font-weight: 700; padding: 0.16rem 0.5rem; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-status.active { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.badge-status.shipped { background: rgba(94, 94, 94, 0.12); color: var(--ink-soft); }
.badge-status.experiment { background: var(--orange-soft); color: var(--orange); }
.badge-status.archived { background: rgba(94, 94, 94, 0.08); color: var(--ink-faint); }
.project-desc { color: var(--ink-soft); font-size: 0.92rem; max-width: 58ch; }
.project-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.3rem; }
.project-tags .tag-badge { background: var(--paper-alt); border: 1px solid var(--line); color: var(--ink-faint); padding: 0.15rem 0.5rem; border-radius: 999px; text-transform: none; letter-spacing: 0; margin-right: 0; }
.project-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.project-link {
  font-size: 0.82rem; font-weight: 600; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.32rem 0.7rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.project-link:hover { border-color: var(--orange); color: var(--orange); }
.project-link.secondary { color: var(--ink-faint); }

/* Home's featured writing preview (recent 3 posts) */
.home-articles-list { list-style: none; }
.home-article-row { display: block; padding: 1.2rem 0; border-top: 1px solid var(--line); transition: padding-left 0.25s ease; }
.home-article-row:first-child { border-top: none; }
.home-article-row:hover { padding-left: 0.5rem; }
.home-article-link { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.home-article-title { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; color: var(--ink); transition: color 0.2s ease; }
.home-article-link:hover .home-article-title { color: var(--orange); }
.home-article-date { font-size: 0.8rem; color: var(--ink-faint); white-space: nowrap; }
.home-article-excerpt { color: var(--ink-soft); font-size: 0.9rem; margin-top: 0.35rem; }

/* ==========================================================================
   Approach / contact (Home page + About page)
   ========================================================================== */
.m-approach-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 3rem; }
.m-approach-copy p { color: var(--ink-soft); margin-bottom: 1.1rem; font-size: 1rem; }
.m-approach-copy p:last-child { margin-bottom: 0; }
.m-approach-copy strong { color: var(--ink); font-weight: 700; }
.m-stack { display: flex; flex-wrap: wrap; gap: 0.5rem; align-content: flex-start; }
.m-stack span {
  font-size: 0.82rem; font-weight: 600; color: var(--ink-soft);
  background: var(--paper-alt); border: 1px solid var(--line); padding: 0.4rem 0.75rem; border-radius: 999px;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.m-stack span:hover { border-color: var(--orange); color: var(--orange); transform: translateY(-2px); }

.m-contact h2 { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -0.02em; max-width: 16ch; margin-bottom: 1rem; }
.m-contact p { color: var(--ink-soft); max-width: 48ch; margin-bottom: 2rem; }

/* ==========================================================================
   About page
   ========================================================================== */
.about-container { padding: 3rem 0 4rem; display: flex; flex-direction: column; gap: 3rem; }
.about-bio h2 { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.7rem, 3.5vw, 2.3rem); letter-spacing: -0.02em; margin-bottom: 0.8rem; }
.about-bio p.lead { font-size: 1.06rem; color: var(--ink); margin-bottom: 0.9rem; }
.about-bio p { color: var(--ink-soft); margin-bottom: 0.9rem; }

.generator-box, .contact-section { border-top: 1px solid var(--line); padding-top: 2.4rem; }
.generator-header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.6rem; }
.generator-header h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.gen-tag { font-size: 0.72rem; font-weight: 700; color: var(--orange); background: var(--orange-soft); padding: 0.22rem 0.5rem; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; }
.gen-intro { font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 1rem; }
.generator-card { background: var(--paper-alt); border: 1px dashed var(--line); border-radius: var(--radius-md); padding: 1.2rem; margin-bottom: 1rem; }
.generator-card.pop { animation: mGenPop 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes mGenPop { 0% { transform: scale(0.97); border-color: var(--orange); } 60% { transform: scale(1.015); } 100% { transform: scale(1); } }
.gen-text { font-size: 1.05rem; font-style: italic; color: var(--ink); line-height: 1.5; }

.contact-section h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; margin-bottom: 0.5rem; }
.contact-section > p { color: var(--ink-soft); margin-bottom: 1.2rem; }
.contact-form, .form-group { display: flex; flex-direction: column; gap: 0.7rem; }
.form-group label { font-size: 0.84rem; font-weight: 600; color: var(--ink); }
.form-group input, .form-group textarea, .form-group select {
  background: var(--paper-alt); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem; font: inherit; color: var(--ink); outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
.alert-success { background: rgba(34, 197, 94, 0.1); color: #16a34a; border: 1px solid rgba(34, 197, 94, 0.25); }
.alert-error { background: rgba(192, 57, 43, 0.1); color: #c0392b; border: 1px solid rgba(192, 57, 43, 0.25); }
.alert-success, .alert-error { border-radius: var(--radius-sm); padding: 0.7rem 0.9rem; font-size: 0.88rem; }

/* ==========================================================================
   Admin / Noggin CMS
   ========================================================================== */
.auth-card { max-width: 420px; margin: 3rem auto; }
.auth-header { text-align: center; margin-bottom: 1.4rem; }
.auth-header h2 { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; margin-bottom: 0.4rem; }
.auth-header p { font-size: 0.86rem; color: var(--ink-soft); }

.admin-dashboard { padding: 3rem 0 4rem; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-bottom: 1.2rem; margin-bottom: 1.4rem; border-bottom: 1px solid var(--line); }
.admin-title { display: flex; align-items: center; gap: 0.7rem; }
.admin-title h2 { font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; }
.cms-badge { font-size: 0.72rem; font-weight: 700; color: var(--orange); background: var(--orange-soft); padding: 0.2rem 0.5rem; border-radius: 999px; }
.admin-top-actions { display: flex; gap: 0.5rem; }

.cms-tabs { display: flex; gap: 1.4rem; border-bottom: 1px solid var(--line); margin-bottom: 1.6rem; flex-wrap: wrap; }
.cms-tab { background: none; border: none; border-bottom: 2px solid transparent; color: var(--ink-soft); padding: 0.6rem 0; cursor: pointer; font-weight: 600; font-size: 0.9rem; transition: color 0.2s ease, border-color 0.2s ease; }
.cms-tab:hover { color: var(--ink); }
.cms-tab.active { color: var(--orange); border-bottom-color: var(--orange); }
.cms-content-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.cms-content-header h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }

.cms-table-wrapper { border: 1px solid var(--line); border-radius: var(--radius-md); overflow-x: auto; }
.cms-table { width: 100%; border-collapse: collapse; }
.cms-table th, .cms-table td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); font-size: 0.86rem; text-align: left; }
.cms-table tr:last-child td { border-bottom: none; }
.cms-table th { background: var(--paper-alt); color: var(--ink-soft); font-weight: 700; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.03em; }
.table-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.project-form-box { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 1.3rem; }
.project-form-box h4 { font-family: var(--font-display); font-weight: 700; margin-bottom: 1rem; }
.editor-toolbar-container { margin-bottom: 1rem; }
.editor-label { display: block; font-size: 0.84rem; font-weight: 600; color: var(--ink); margin-bottom: 0.5rem; }

.wrap-class-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; }
.wrap-class-label { font-size: 0.78rem; color: var(--ink-faint); margin-right: 0.2rem; }
.tb-btn { background: var(--paper); border: 1px solid var(--line); color: var(--ink); font-size: 0.8rem; border-radius: 4px; padding: 0.3rem 0.55rem; cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease; }
.tb-btn:hover { border-color: var(--orange); color: var(--orange); }

/* Toast UI Editor — the library ships its own light/default and dark themes
   (both loaded in <head>; app.js picks one at construction time and rebuilds
   the instance on theme toggle), so color is left to Toast UI itself here.
   previewStyle is 'tab' (see app.js), so Toast UI's own preview pane and its
   Write/Preview toggle are never used — the site drives a fully separate
   preview panel below instead, so the two never share scroll behavior. */
.toast-editor-mount { border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 1.4rem; }
.toastui-editor-defaultUI {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-sm) !important;
  font-family: var(--font-body) !important;
}
.toastui-editor-defaultUI-toolbar {
  border-bottom: 1px solid var(--line) !important;
}
.toastui-editor-mode-switch .tab-item.active {
  color: var(--orange) !important;
}
.toastui-editor-md-tab-container { display: none; }

.editor-preview-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.editor-preview-header {
  padding: 0.6rem 0.9rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  background: var(--paper-alt);
  border-bottom: 1px solid var(--line);
}
.editor-preview-body {
  padding: 1rem 1.1rem;
  max-height: 320px;
  overflow-y: auto;
  background: var(--paper);
}
.form-actions { display: flex; gap: 0.6rem; margin-top: 1.3rem; }

.highlight { background: #fef08a; color: #854d0e; padding: 0.08rem 0.35rem; border-radius: 4px; }
html.dark-mode .highlight { background: #7a5a12; color: #fef3c7; }
.callout-box { background: var(--paper-alt); border-left: 4px solid var(--orange); border-radius: var(--radius-sm); padding: 1rem 1.25rem; margin: 1.2rem 0; }
.badge-pill { background: var(--orange-soft); color: var(--orange); font-weight: 700; font-size: 0.8rem; padding: 0.15rem 0.6rem; border-radius: 20px; display: inline-block; }
.text-accent { color: var(--orange); font-weight: 700; }
.font-serif-italic { font-style: italic; }

/* ==========================================================================
   Project detail pages
   ========================================================================== */
.pd-shell { max-width: 760px; padding-bottom: 3rem; }
.pd-breadcrumb {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.82rem; font-weight: 600; color: var(--ink-soft);
  margin: 2.2rem 0 1.5rem; transition: color 0.2s ease, transform 0.2s ease;
}
.pd-breadcrumb:hover { color: var(--orange); transform: translateX(-2px); }

.pd-hero { padding: 0.5rem 0 2.2rem; }
.pd-hero-eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--orange); margin-bottom: 0.8rem; }
.pd-hero h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 4.4vw, 2.8rem); letter-spacing: -0.02em; line-height: 1.08; margin-bottom: 0.9rem; }
.pd-hero h1 em { font-style: normal; background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pd-hero-tagline { color: var(--ink-soft); font-size: 1.05rem; max-width: 58ch; margin-bottom: 1.4rem; }
.pd-hero-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.6rem; }
.pd-hero-meta span { font-size: 0.76rem; font-weight: 600; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 999px; padding: 0.28rem 0.7rem; }
.pd-hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }

/* Dynamic project pages (#project/{id}) render a single markdown body here,
   rather than the fixed two-card pd-grid layout — same border/spacing rhythm
   as the sections around it, and reuses .markdown-body typography so a
   project page reads exactly like an article. */
.pd-body { padding: 2.4rem 0; border-top: 1px solid var(--line); }

.pd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; padding: 2.4rem 0; border-top: 1px solid var(--line); }
.pd-card h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; margin-bottom: 0.8rem; }
.pd-card p { color: var(--ink-soft); margin-bottom: 0.9rem; }
.pd-card p:last-child { margin-bottom: 0; }
.pd-quote { border-left: 3px solid var(--orange); padding-left: 1rem; margin: 1rem 0; font-style: italic; color: var(--ink-soft); }
.pd-checklist { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.pd-checklist li { position: relative; padding-left: 1.3rem; color: var(--ink-soft); font-size: 0.95rem; }
.pd-checklist li::before { content: '\2192'; position: absolute; left: 0; color: var(--orange); font-weight: 700; }
.pd-card code, .pd-checklist code { font-family: var(--font-mono); font-size: 0.85em; background: var(--orange-soft); color: var(--orange-deep); padding: 0.1rem 0.35rem; border-radius: 4px; }

.pd-related { padding: 2.4rem 0; border-top: 1px solid var(--line); }
.pd-related h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; margin-bottom: 1rem; }
.pd-related-grid { display: flex; flex-direction: column; }
.pd-related-card { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; border-top: 1px solid var(--line); transition: padding-left 0.25s ease; }
.pd-related-grid .pd-related-card:first-child { border-top: none; }
.pd-related-card:hover { padding-left: 0.5rem; text-decoration: none; }
.pd-related-card:hover strong { color: var(--orange); }
.pd-related-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); }
.pd-related-card strong { font-family: var(--font-display); font-weight: 700; color: var(--ink); transition: color 0.2s ease; }

.pd-cta { padding: 2.4rem 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.pd-cta p { color: var(--ink-soft); font-size: 0.95rem; }

/* ==========================================================================
   Footer
   ========================================================================== */
.m-footer, .site-footer { border-top: 1px solid var(--line); padding: 2.2rem 0; margin-top: auto; }
.m-footer-inner, .footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; font-size: 0.85rem; color: var(--ink-faint); }
.m-footer-links, .footer-links { display: flex; flex-wrap: wrap; gap: 1.1rem; align-items: center; }
.m-footer-links a, .footer-links a { color: var(--ink-faint); transition: color 0.2s ease; }
.m-footer-links a:hover, .footer-links a:hover { color: var(--orange); }
.footer-links .sep { display: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .brand-text { display: none; }
}
@media (max-width: 720px) {
  .m-nav-links, .nav-links { gap: 1rem; }
  .m-approach-grid { grid-template-columns: 1fr; gap: 2rem; }
  .m-section { padding: 3rem 0; }
  .m-hero { padding: 4.5rem 0 3.5rem; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .project-card, .article-link, .home-article-link { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .admin-topbar { flex-direction: column; align-items: flex-start; }
  .pd-grid { grid-template-columns: 1fr; }
  .pd-related-card { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
}
