/* -------------------------------------------------------------
   ROUTEZERO EDITORIAL ESSAY SYSTEM
   Pure, High-Craft Literary Reading Experience
   ------------------------------------------------------------- */
:root {
  /* Surface & Background */
  --c-bg: #FAFAF9;
  --c-card-bg: #FFFFFF;
  --c-surface-subtle: #F4F4F5;
  
  /* Text Colors */
  --c-text-title: #18181B;
  --c-text-body: #27272A;
  --c-text-secondary: #52525B;
  --c-text-muted: #71717A;
  --c-text-light: #A1A1AA;
  
  /* Brand Accent: Emerald Green */
  --c-accent: #059669;
  --c-accent-light: #10B981;
  --c-accent-subtle: #ECFDF5;
  --c-accent-glow: rgba(16, 185, 129, 0.12);
  
  /* Dividers & Borders */
  --c-border: rgba(0, 0, 0, 0.08);
  --c-border-subtle: rgba(0, 0, 0, 0.04);
  
  /* Typography */
  --ff-heading: 'Outfit', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ff-body: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --ff-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* Layout Widths */
  --header-max-width: 980px;
  --reading-max-width: 680px;
}

/* -------------------------------------------------------------
   RESET & BASE STYLES
   ------------------------------------------------------------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--c-bg);
  color: var(--c-text-body);
  font-family: var(--ff-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  width: 100%;
  background-color: var(--c-bg);
  color: var(--c-text-body);
  line-height: 1.95;
  overflow-x: hidden;
  position: relative;
}

::selection {
  background-color: var(--c-accent);
  color: #FFFFFF;
}

/* Reading Progress Bar */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #10B981 0%, #059669 100%);
  z-index: 1000;
  transition: width 0.1s linear;
}

/* -------------------------------------------------------------
   EDITORIAL HEADER (STICKY & RESPONSIVE)
   ------------------------------------------------------------- */
.editorial-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: rgba(250, 250, 249, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--c-border);
}

.header-inner {
  max-width: var(--header-max-width);
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo {
  height: 26px;
  width: auto;
  display: block;
}

.essay-nav-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.essay-nav-links::-webkit-scrollbar {
  display: none;
}

.essay-nav-item {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  font-family: var(--ff-heading);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-text-muted);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.essay-nav-item:hover {
  color: var(--c-text-title);
  background: var(--c-surface-subtle);
}

.essay-nav-item.active {
  color: var(--c-accent);
  background: var(--c-accent-subtle);
  border-color: rgba(16, 185, 129, 0.3);
}

/* -------------------------------------------------------------
   MAIN ESSAY CONTAINER
   ------------------------------------------------------------- */
.article-wrapper {
  position: relative;
  z-index: 5;
  max-width: var(--reading-max-width);
  margin: 0 auto;
  padding: 4.5rem 1.5rem 6.5rem;
}

.essay-article {
  display: flex;
  flex-direction: column;
}

/* Title & Metadata Header */
.essay-title-group {
  margin-bottom: 3.5rem;
  border-bottom: 1px solid var(--c-border);
  padding-bottom: 2.25rem;
}

.essay-meta-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 0.82rem;
}

.essay-number {
  color: var(--c-accent);
  font-family: var(--ff-mono);
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--c-accent-subtle);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

.essay-meta-details {
  color: var(--c-text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.main-title {
  font-family: var(--ff-heading);
  font-size: clamp(2.15rem, 5.5vw, 3rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--c-text-title);
  letter-spacing: -0.035em;
  margin-bottom: 0.85rem;
  word-break: keep-all;
}

.sub-title {
  font-family: var(--ff-heading);
  font-size: clamp(1.15rem, 2.8vw, 1.35rem);
  font-weight: 500;
  line-height: 1.5;
  color: var(--c-text-secondary);
  letter-spacing: -0.015em;
  word-break: keep-all;
}

/* -------------------------------------------------------------
   ESSAY BODY TYPOGRAPHY
   ------------------------------------------------------------- */
.essay-body {
  display: flex;
  flex-direction: column;
  gap: 1.65rem;
  font-size: clamp(1.05rem, 1.8vw, 1.125rem);
  color: var(--c-text-body);
  letter-spacing: -0.012em;
}

.essay-body p {
  word-break: keep-all;
  overflow-wrap: break-word;
  line-height: 1.95;
}

.essay-body strong {
  font-weight: 700;
  color: var(--c-text-title);
}

/* Lead, Emphasis & Callouts */
.highlight-lead {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--c-text-title) !important;
  line-height: 1.75 !important;
  margin: 0.5rem 0;
}

.emphasis-paragraph {
  color: var(--c-text-title) !important;
  font-weight: 500;
}

.final-quote {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--c-text-title) !important;
  line-height: 1.75 !important;
  margin-top: 1.5rem;
  padding: 1.35rem 1.65rem;
  background: var(--c-accent-subtle);
  border-left: 3.5px solid var(--c-accent);
  border-radius: 0 10px 10px 0;
  border-top: 1px solid rgba(16, 185, 129, 0.15);
  border-right: 1px solid rgba(16, 185, 129, 0.15);
  border-bottom: 1px solid rgba(16, 185, 129, 0.15);
}

/* Section Headings & Dividers */
.section-heading {
  font-family: var(--ff-heading);
  font-size: clamp(1.35rem, 3.2vw, 1.65rem);
  font-weight: 700;
  color: var(--c-text-title);
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin-top: 2.25rem;
  margin-bottom: 0.25rem;
  word-break: keep-all;
}

.section-divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, var(--c-border) 0%, rgba(0, 0, 0, 0.02) 100%);
  margin: 2.5rem 0 1.5rem;
}

/* Editorial Blockquote */
.editorial-quote {
  margin: 1.5rem 0;
  padding: 1.35rem 1.65rem;
  background: var(--c-card-bg);
  border: 1px solid var(--c-border);
  border-left: 3.5px solid var(--c-accent);
  border-radius: 8px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--c-text-title);
  line-height: 1.65;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

/* -------------------------------------------------------------
   NEXT / PREVIOUS ESSAY NAVIGATION CARD
   ------------------------------------------------------------- */
.next-essay-card {
  margin-top: 4.5rem;
  padding: 1.75rem 2rem;
  background: var(--c-card-bg);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.next-essay-card:hover {
  border-color: rgba(16, 185, 129, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--c-accent-glow);
}

.next-essay-meta {
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--c-accent);
  margin-bottom: 0.5rem;
}

.next-essay-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.next-essay-title {
  font-family: var(--ff-heading);
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--c-text-title);
  margin-bottom: 0.35rem;
  transition: color 0.2s ease;
}

.next-essay-card:hover .next-essay-title {
  color: var(--c-accent);
}

.next-essay-subtitle {
  font-size: 0.92rem;
  color: var(--c-text-secondary);
  line-height: 1.5;
}

/* -------------------------------------------------------------
   NEWSLETTER SUBSCRIPTION BOX
   ------------------------------------------------------------- */
.newsletter-box {
  margin-top: 3.5rem;
  padding: 2.25rem 2.5rem;
  background: var(--c-card-bg);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  position: relative;
  overflow: hidden;
}

.newsletter-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #10B981 0%, #059669 100%);
}

.newsletter-badge {
  display: inline-block;
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--c-accent);
  background: var(--c-accent-subtle);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  margin-bottom: 0.85rem;
}

.newsletter-title {
  font-family: var(--ff-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--c-text-title);
  margin-bottom: 0.5rem;
  letter-spacing: -0.015em;
}

.newsletter-desc {
  font-size: 0.95rem;
  color: var(--c-text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  word-break: keep-all;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.input-group {
  display: flex;
  gap: 0.65rem;
}

.newsletter-input {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-family: var(--ff-body);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  background: var(--c-bg);
  color: var(--c-text-title);
  outline: none;
  transition: all 0.2s ease;
}

.newsletter-input:focus {
  background: #FFFFFF;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-glow);
}

.newsletter-btn {
  padding: 0.75rem 1.4rem;
  font-family: var(--ff-heading);
  font-size: 0.92rem;
  font-weight: 600;
  color: #FFFFFF;
  background: var(--c-accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.newsletter-btn:hover {
  background: var(--c-accent-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--c-accent-glow);
}

.form-feedback {
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 0.25rem;
  display: none;
}

.form-feedback.success {
  display: block;
  color: var(--c-accent);
}

.form-feedback.error {
  display: block;
  color: #DC2626;
}

/* -------------------------------------------------------------
   ESSAY FOOTER & CONTACT
   ------------------------------------------------------------- */
.essay-footer {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-contact {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.contact-label {
  font-family: var(--ff-mono);
  font-size: 0.8rem;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.contact-email {
  font-family: var(--ff-mono);
  font-size: 0.95rem;
  color: var(--c-accent);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dashed rgba(16, 185, 129, 0.4);
  padding-bottom: 1px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.contact-email:hover {
  border-bottom-style: solid;
  color: var(--c-accent-light);
}

.footer-social-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem 1.15rem;
}

.social-link-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--c-text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-link-item:hover {
  color: var(--c-accent);
  transform: translateY(-1px);
}

.social-link-item svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.social-link-item:hover svg {
  transform: scale(1.1);
}

.footer-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--c-text-muted);
}

.copyright {
  font-family: var(--ff-mono);
  font-size: 0.8rem;
}

.back-to-top {
  background: none;
  border: none;
  color: var(--c-text-muted);
  font-family: var(--ff-heading);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease;
}

.back-to-top:hover {
  color: var(--c-accent);
}

/* Feedback Toast */
.copy-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  padding: 0.75rem 1.35rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1000;
  pointer-events: none;
}

.copy-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* -------------------------------------------------------------
   RESPONSIVE & MOBILE BREAKPOINTS
   ------------------------------------------------------------- */
@media (max-width: 768px) {
  .header-inner {
    padding: 0.85rem 1.15rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .brand-link {
    align-self: flex-start;
  }

  .essay-nav-links {
    width: 100%;
    display: flex;
    gap: 0.4rem;
  }

  .essay-nav-item {
    flex: 1;
    justify-content: center;
    text-align: center;
    padding: 0.4rem 0.65rem;
    font-size: 0.78rem;
  }

  .article-wrapper {
    padding: 2.5rem 1.15rem 4.5rem;
  }

  .essay-title-group {
    margin-bottom: 2.25rem;
    padding-bottom: 1.5rem;
  }

  .main-title {
    font-size: 1.95rem;
  }

  .sub-title {
    font-size: 1.1rem;
  }

  .essay-body {
    font-size: 1.02rem;
    gap: 1.4rem;
  }

  .section-heading {
    font-size: 1.35rem;
    margin-top: 1.75rem;
  }

  .next-essay-card {
    padding: 1.35rem 1.25rem;
    margin-top: 3rem;
  }

  .newsletter-box {
    padding: 1.65rem 1.25rem;
    margin-top: 2.5rem;
  }

  .input-group {
    flex-direction: column;
  }

  .newsletter-btn {
    width: 100%;
    padding: 0.85rem;
  }

  .copy-toast {
    bottom: 1.25rem;
    right: 1.25rem;
    left: 1.25rem;
    text-align: center;
  }
}
