/* ============================================
   NOERONG — Big Ideas. Vivid Thinking.
   Dark editorial design system
   ============================================ */

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

/* Design tokens */
:root {
  --bg: #0d0d12;
  --bg-elevated: #13131c;
  --bg-hover: #18182280;
  --text: #ede8db;
  --text-muted: #8b8679;
  --text-dim: #56524a;
  --accent: #c9a84c;
  --accent-soft: #7a6428;
  --accent-glow: rgba(201, 168, 76, 0.08);
  --rule: #1f1f2c;
  --max-width: 720px;
  --max-width-wide: 1100px;
  --serif: 'Cormorant Garamond', 'EB Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

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

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
a:hover { color: var(--accent); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

img { max-width: 100%; height: auto; display: block; }

/* ============================================
   READING PROGRESS BAR
   ============================================ */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  width: 0%;
  z-index: 200;
  transition: width 0.08s linear;
  transform-origin: left;
}

/* ============================================
   NAV
   ============================================ */
.nav {
  border-bottom: 1px solid var(--rule);
  background: rgba(13, 13, 18, 0.88);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.nav-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}
.logo {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text);
  flex-shrink: 0;
}
.logo:hover { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 40px;
  list-style: none;
}
.nav-links a {
  font-size: 11px;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  position: relative;
  padding-bottom: 2px;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a.active { color: var(--accent); }
.nav-links a.active::after { transform: scaleX(1); }

/* Mobile hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text-muted);
  transition: color 0.2s var(--ease);
  line-height: 1;
  font-size: 20px;
}
.nav-toggle:hover { color: var(--accent); }

/* ============================================
   SCROLL TO TOP
   ============================================ */
.scroll-top {
  position: fixed;
  bottom: 36px;
  right: 36px;
  width: 40px;
  height: 40px;
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
  z-index: 50;
  border-radius: 2px;
}
.scroll-top.visible {
  opacity: 1;
  visibility: visible;
}
.scroll-top:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ============================================
   HERO (Home)
   ============================================ */
.hero {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 130px 40px 110px;
  text-align: center;
  border-bottom: 1px solid var(--rule);
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(68px, 11vw, 110px);
  font-weight: 600;
  letter-spacing: -3px;
  line-height: 0.95;
  color: var(--text);
  margin-bottom: 32px;
}
.hero .tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(20px, 2.5vw, 27px);
  color: var(--accent);
  letter-spacing: 0.2px;
  font-weight: 400;
  margin-bottom: 24px;
}
.hero .hero-desc {
  font-size: 14px;
  color: var(--text-dim);
  letter-spacing: 0.3px;
  max-width: 380px;
  margin: 0 auto;
  line-height: 1.7;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-label {
  max-width: var(--max-width);
  margin: 80px auto 0;
  padding: 0 40px 18px;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--rule);
  font-weight: 600;
}

/* ============================================
   ESSAY LIST (Home + Essays page)
   ============================================ */
.essays {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
}
.essay-card {
  padding: 52px 0;
  border-bottom: 1px solid var(--rule);
  display: block;
  color: inherit;
  transition: background 0.2s var(--ease);
}
.essay-card:last-child { border-bottom: none; }
.essay-card:hover .essay-title { color: var(--accent); }
.essay-card:hover .essay-read-more { color: var(--accent); }
.essay-card:hover .essay-read-more::after { transform: translateX(5px); }

.essay-meta {
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  font-weight: 600;
}
.essay-category { color: var(--accent); }
.essay-dot { color: var(--text-dim); }

.essay-title {
  font-family: var(--serif);
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
  color: var(--text);
  transition: color 0.2s var(--ease);
}
.essay-excerpt {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 580px;
  margin-bottom: 20px;
}
.essay-read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  transition: color 0.2s var(--ease);
}
.essay-read-more::after {
  content: '→';
  display: inline-block;
  transition: transform 0.2s var(--ease);
}

/* Filter bar */
.filters {
  max-width: var(--max-width);
  margin: 64px auto 0;
  padding: 0 40px 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid var(--rule);
}
.filter-btn {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--text-muted);
  padding: 7px 16px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 1.2px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  border-radius: 2px;
  text-transform: uppercase;
  font-weight: 600;
}
.filter-btn:hover {
  color: var(--text);
  border-color: var(--text-dim);
}
.filter-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* No results state */
.no-results {
  padding: 80px 40px;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  letter-spacing: 0.5px;
  display: none;
}
.no-results.visible { display: block; }

/* ============================================
   ARTICLE PAGE
   ============================================ */
.article {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 80px 40px 140px;
}
.article-header {
  margin-bottom: 72px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--rule);
}
.article-meta {
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 28px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-weight: 600;
  align-items: center;
}
.article-meta .article-category { color: var(--accent); }
.article h1 {
  font-family: var(--serif);
  font-size: clamp(36px, 5.5vw, 54px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -1px;
  margin-bottom: 28px;
  color: var(--text);
}
.article-subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 2.5vw, 22px);
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.45;
}

.article-body {
  font-size: 19px;
  line-height: 1.84;
  color: var(--text);
}
.article-body p { margin-bottom: 30px; }

/* Drop cap */
.article-body p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 72px;
  font-weight: 600;
  float: left;
  line-height: 0.82;
  margin: 8px 14px 0 0;
  color: var(--accent);
}

.article-body h2 {
  font-family: var(--serif);
  font-size: 29px;
  font-weight: 600;
  line-height: 1.2;
  margin: 72px 0 24px;
  color: var(--text);
  letter-spacing: -0.3px;
}
.article-body h3 {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 52px 0 20px;
  font-weight: 700;
}

.article-body blockquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 25px;
  line-height: 1.45;
  color: var(--accent);
  border-left: 2px solid var(--accent);
  padding: 8px 0 8px 36px;
  margin: 56px 0;
  font-weight: 400;
}

.article-body strong { color: var(--text); font-weight: 600; }
.article-body em { font-style: italic; }
.article-body a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-soft);
  transition: border-color 0.2s var(--ease);
}
.article-body a:hover { border-bottom-color: var(--accent); }

.article-body hr {
  border: none;
  text-align: center;
  margin: 64px 0;
}
.article-body hr::after {
  content: "✦  ✦  ✦";
  letter-spacing: 14px;
  color: var(--text-dim);
  font-size: 12px;
}

.article-body ul, .article-body ol {
  margin: 0 0 30px 8px;
  padding-left: 24px;
}
.article-body li {
  margin-bottom: 12px;
  padding-left: 6px;
  color: var(--text-muted);
}
.article-body li strong { color: var(--text); }
.article-body ul li::marker { color: var(--accent); }
.article-body ol li::marker { color: var(--accent); font-weight: 600; }

/* Tables */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 44px 0;
  font-size: 15px;
}
.article-body th {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  font-weight: 700;
}
.article-body td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
  color: var(--text-muted);
  vertical-align: top;
}
.article-body tr:hover td { color: var(--text); }

/* Closing line */
.article-closing {
  margin-top: 88px;
  padding-top: 44px;
  border-top: 1px solid var(--rule);
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--accent);
  text-align: center;
  line-height: 1.55;
}

/* Article footer */
.article-footer {
  margin-top: 80px;
  padding-top: 44px;
  border-top: 1px solid var(--rule);
  text-align: center;
}
.article-footer .author-line {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}
.article-footer .author-line a { color: var(--accent); }
.back-link {
  display: inline-block;
  margin-top: 20px;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  transition: color 0.2s var(--ease);
}
.back-link:hover { color: var(--accent); }

/* ============================================
   ABOUT PAGE
   ============================================ */
.about {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 110px 40px 140px;
}
.about h1 {
  font-family: var(--serif);
  font-size: clamp(52px, 8vw, 78px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -2px;
  margin-bottom: 56px;
  color: var(--text);
}
.about-body {
  font-size: 19px;
  line-height: 1.84;
  color: var(--text);
}
.about-body p { margin-bottom: 30px; }
.about-body p:first-of-type {
  font-family: var(--serif);
  font-style: italic;
  font-size: 24px;
  color: var(--accent);
  line-height: 1.5;
  margin-bottom: 44px;
}
.about-divider {
  width: 48px;
  height: 1px;
  background: var(--accent);
  margin: 52px 0;
}
.about-contact {
  margin-top: 72px;
  padding-top: 44px;
  border-top: 1px solid var(--rule);
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
}
.about-contact a { color: var(--accent); }

/* ============================================
   CONTACT PAGE
   ============================================ */
.contact {
  max-width: 520px;
  margin: 0 auto;
  padding: 130px 40px 140px;
  text-align: center;
}
.contact h1 {
  font-family: var(--serif);
  font-size: clamp(52px, 8vw, 78px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -2px;
  margin-bottom: 24px;
  color: var(--text);
}
.contact-intro {
  font-family: var(--serif);
  font-style: italic;
  font-size: 21px;
  color: var(--text-muted);
  margin-bottom: 56px;
  line-height: 1.5;
}
.contact-email {
  font-family: var(--serif);
  font-size: 28px;
  color: var(--accent);
  display: inline-block;
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 6px;
  margin-bottom: 48px;
  transition: border-color 0.2s var(--ease);
}
.contact-email:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.contact-divider {
  width: 32px;
  height: 1px;
  background: var(--rule);
  margin: 0 auto 36px;
}
.contact-note {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 44px;
  line-height: 1.7;
  letter-spacing: 0.2px;
}
.contact-social {
  display: flex;
  justify-content: center;
  gap: 32px;
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  font-weight: 600;
}
.contact-social a {
  color: var(--text-muted);
  transition: color 0.2s var(--ease);
}
.contact-social a:hover { color: var(--accent); }

/* ============================================
   FOOTER
   ============================================ */
.footer {
  max-width: var(--max-width-wide);
  margin: 100px auto 0;
  padding: 40px 40px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}
.footer-name {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--text-muted);
  font-weight: 600;
}
.footer-links { display: flex; align-items: center; }
.footer-links a {
  color: var(--text-dim);
  margin-left: 28px;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
  transition: color 0.2s var(--ease);
}
.footer-links a:hover { color: var(--accent); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .nav-inner { padding: 16px 24px; }
  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--rule);
    flex-direction: column;
    padding: 28px 24px;
    gap: 22px;
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: 12px; letter-spacing: 1px; }
  .nav-toggle { display: flex; align-items: center; }

  .hero { padding: 80px 24px 72px; }
  .hero h1 { letter-spacing: -1px; }

  .section-label,
  .essays,
  .article,
  .about,
  .filters,
  .contact { padding-left: 24px; padding-right: 24px; }

  .essay-card { padding: 40px 0; }
  .article { padding-top: 56px; padding-bottom: 80px; }
  .about { padding-top: 80px; padding-bottom: 80px; }
  .contact { padding-top: 80px; padding-bottom: 80px; }

  .article-body { font-size: 17px; line-height: 1.78; }
  .article-body blockquote { font-size: 20px; padding-left: 22px; }
  .article-body p:first-of-type::first-letter { font-size: 54px; }
  .article-body h2 { font-size: 26px; margin-top: 56px; }

  .footer {
    flex-direction: column;
    text-align: center;
    padding: 36px 24px;
    gap: 20px;
    margin-top: 60px;
  }
  .footer-links { flex-wrap: wrap; justify-content: center; }
  .footer-links a { margin: 0 14px; }

  .scroll-top { bottom: 20px; right: 20px; width: 36px; height: 36px; }
}

@media (max-width: 480px) {
  .article-body table { font-size: 13px; }
  .article-body th, .article-body td { padding: 10px 12px; }
  .contact-email { font-size: 22px; }
  .filters { margin-top: 40px; }
}
