/* Self-contained styles for the server-rendered /writing section.
   Matches the lucashubert.me brand: high-contrast black & white, sharp corners,
   system sans, uppercase tracking for labels. Light mode. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: #000;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

.container, .nav-inner, .footer-inner, .more-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 640px) { .nav-inner, .footer-inner, .more-inner { padding-left: 1.5rem; padding-right: 1.5rem; } }
@media (min-width: 1024px) { .nav-inner, .footer-inner, .more-inner { padding-left: 2rem; padding-right: 2rem; } }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid #000;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-logo { font-weight: 700; text-transform: uppercase; letter-spacing: -0.02em; font-size: 1.125rem; text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.18em; text-decoration: none; opacity: 0.85; }
.nav-links a:hover { opacity: 0.5; }
.nav-links a.is-active { opacity: 1; text-decoration: underline; text-underline-offset: 6px; }
.nav-cta { border: 1px solid #000; padding: 0.6rem 1.25rem; opacity: 1 !important; }
.nav-cta:hover { background: #000; color: #fff; }
.nav-toggle { display: none; background: none; border: 0; color: #000; cursor: pointer; font-size: 1.5rem; line-height: 1; padding: 0.25rem 0.4rem; }
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid #000;
    padding: 0.5rem 1rem 1.25rem; box-shadow: 0 10px 24px rgba(0,0,0,0.08); z-index: 60;
  }
  .nav.open .nav-links { display: flex; }
  .nav-links a { font-size: 0.95rem; padding: 0.9rem 0; border-top: 1px solid rgba(0,0,0,0.1); opacity: 1; }
  .nav-links a:first-child { border-top: 0; }
  .nav-links a.is-active { text-decoration: none; }
  .nav-cta { margin-top: 0.75rem; padding: 0.9rem 1rem; text-align: center; border: 1px solid #000; }
}

/* Shared label / buttons */
.eyebrow { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.2em; opacity: 0.5; margin: 0 0 1rem; }
.btn, .btn-outline {
  display: inline-block; text-decoration: none; font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.16em; padding: 0.95rem 1.6rem; line-height: 1;
  border: 1px solid #000; transition: background .15s, color .15s;
}
.btn { background: #000; color: #fff; }
.btn:hover { background: #262626; }
.btn-outline { background: transparent; color: #000; }
.btn-outline:hover { background: #000; color: #fff; }

/* Article */
.article { border-top: 1px solid #000; }
.article-wrap { max-width: 720px; margin: 0 auto; padding: 3.5rem 1.25rem 4rem; }
.back-link { display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.18em; text-decoration: none; opacity: 0.5; margin-bottom: 2.5rem; }
.back-link:hover { opacity: 1; }
.article-title { font-size: clamp(2.2rem, 6vw, 3.5rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.02; margin: 0 0 2rem; }
.article-hero { margin: 0 0 2.5rem; }
.article-hero img { width: 100%; border: 1px solid #000; }

/* Prose typography */
.prose { font-size: 1.16rem; line-height: 1.75; }
.prose p { margin: 0 0 1.5rem; }
.prose h2 { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin: 3rem 0 1.1rem; }
.prose h3 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em; margin: 2.25rem 0 0.9rem; }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { opacity: 0.6; }
.prose strong { font-weight: 700; }
.prose em { font-style: italic; }
.prose ul, .prose ol { margin: 0 0 1.5rem; padding-left: 1.4rem; }
.prose li { margin: 0 0 0.6rem; }
.prose blockquote { margin: 2rem 0; padding-left: 1.5rem; border-left: 3px solid #000; font-size: 1.3rem; font-style: italic; line-height: 1.5; }
.prose img { margin: 2rem 0; border: 1px solid #000; }
.prose hr { border: 0; border-top: 1px solid #000; margin: 3rem 0; }
.signature { margin: 2.5rem 0 0; font-weight: 700; opacity: 0.6; }
.orig-note { margin: 0.75rem 0 0; font-size: 0.85rem; opacity: 0.55; }
.orig-note a { text-decoration: underline; text-underline-offset: 2px; }

/* CTA */
.cta { border: 1px solid #000; padding: 2.5rem; margin: 3.5rem 0 0; }
.cta h2 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 0.75rem; line-height: 1.1; }
.cta-sub { opacity: 0.65; margin: 0 0 1.75rem; line-height: 1.6; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Writing index */
.writing-index { border-top: 1px solid #000; }
.index-head { max-width: 1280px; margin: 0 auto; padding: 4rem 1rem 2.5rem; }
@media (min-width: 1024px) { .index-head { padding-left: 2rem; padding-right: 2rem; } }
.index-head h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.0; margin: 0 0 1.25rem; max-width: 16ch; }
.index-head .lede { font-size: 1.15rem; line-height: 1.6; opacity: 0.6; max-width: 60ch; margin: 0 0 2rem; font-weight: 300; }

/* Cards */
.card-grid {
  max-width: 1280px; margin: 0 auto; padding: 0 1rem 4rem;
  display: grid; grid-template-columns: 1fr; gap: 0;
  border-top: 1px solid #000;
}
@media (min-width: 1024px) { .card-grid { padding-left: 2rem; padding-right: 2rem; } }
.card {
  display: flex; gap: 1.5rem; text-decoration: none; color: inherit;
  padding: 2rem 0; border-bottom: 1px solid #000; align-items: flex-start;
}
.card:hover .card-title { text-decoration: underline; text-underline-offset: 4px; }
.card-media { flex: 0 0 200px; }
.card-media img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border: 1px solid #000; }
.card-body { flex: 1 1 auto; }
.card-meta { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; opacity: 0.4; margin: 0 0 0.6rem; }
.card-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 0.6rem; }
.card-excerpt { opacity: 0.6; line-height: 1.6; margin: 0 0 0.9rem; max-width: 62ch; }
.card-more { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; }
@media (max-width: 640px) { .card { flex-direction: column; gap: 1rem; } .card-media { flex-basis: auto; width: 100%; } }

/* More reading */
.more-reading { background: #fafafa; border-top: 1px solid #000; }
.more-inner { padding: 3rem 1rem; }
.more-reading .eyebrow { margin-bottom: 1.5rem; }
.more-reading .card-grid { border-top: 0; padding: 0; }

/* Pagination */
.pagination { max-width: 1280px; margin: 0 auto; padding: 0 1rem 5rem; display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; }
@media (min-width: 1024px) { .pagination { padding-left: 2rem; padding-right: 2rem; } }
.page-nums { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.page-num, .page-step { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; text-decoration: none; padding: 0.6rem 0.9rem; border: 1px solid #000; color: #000; line-height: 1; }
.page-num:hover, .page-step:hover { background: #000; color: #fff; }
.page-num.is-current { background: #000; color: #fff; }
.page-step.is-disabled { opacity: 0.3; pointer-events: none; }
.page-ellipsis { padding: 0.6rem 0.3rem; font-weight: 700; opacity: 0.4; align-self: center; }

/* Footer */
.footer { border-top: 1px solid #000; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; padding-top: 2.5rem; padding-bottom: 2.5rem; }
.footer-name { font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.footer-links a { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; text-decoration: none; opacity: 0.85; }
.footer-links a:hover { opacity: 0.4; }
.footer-copy { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.16em; opacity: 0.5; }
