/* ============================================================
   HONOR FORWARD — style.css
   Global styles for honorforward.org
   ============================================================ */

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

:root {
  --ink:          #1a1208;
  --paper:        #f5f0e8;
  --warm-white:   #faf7f2;
  --ember:        #c94f1a;
  --ember-light:  #e8703a;
  --gold:         #c8a84b;
  --mid:          #7a6e60;
  --rule:         #d4c9b5;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Source Serif 4', Georgia, serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── NOISE TEXTURE OVERLAY ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

p {
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--ember);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--ink);
}

blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.3rem;
  border-left: 4px solid var(--ember);
  padding-left: 1.5rem;
  margin: 2rem 0;
  color: var(--ink);
}

blockquote cite {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-style: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
  margin-top: 0.75rem;
}

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

/* ── UTILITY CLASSES ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ember);
  display: inline-block;
  margin-bottom: 0.5rem;
}

.mono {
  font-family: var(--font-mono);
}

.text-mid {
  color: var(--mid);
}

.text-ember {
  color: var(--ember);
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.25s, transform 0.2s, color 0.2s;
}

.btn-primary {
  background: var(--ember);
  color: white;
}

.btn-primary:hover {
  background: var(--ember-light);
  color: white;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
}

.btn-outline:hover {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--ember);
  padding-left: 0;
  padding-right: 0;
}

.btn-ghost:hover {
  color: var(--ink);
  transform: translateX(4px);
}

/* ── MASTHEAD / NAVIGATION ── */
.masthead {
  border-bottom: 3px double var(--ink);
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--warm-white);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow 0.3s;
}

.masthead.scrolled {
  box-shadow: 0 2px 20px rgba(26, 18, 8, 0.1);
}

.masthead-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--mid);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-width: 200px;
}

.masthead-logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
}

.masthead-logo span {
  color: var(--ember);
}

.masthead-logo:hover {
  color: var(--ink);
}

.masthead-nav {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  align-items: center;
  min-width: 200px;
  justify-content: flex-end;
}

.masthead-nav a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
  padding-bottom: 2px;
}

.masthead-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--ember);
  transition: width 0.2s;
}

.masthead-nav a:hover {
  color: var(--ember);
}

.masthead-nav a:hover::after {
  width: 100%;
}

/* Mobile hamburger */
.masthead-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.masthead-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s, opacity 0.3s;
}

.masthead-toggle.open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.masthead-toggle.open span:nth-child(2) {
  opacity: 0;
}

.masthead-toggle.open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile nav drawer */
.mobile-nav {
  display: none;
  position: fixed;
  top: 53px;
  left: 0;
  right: 0;
  background: var(--warm-white);
  border-bottom: 2px solid var(--ink);
  z-index: 99;
  padding: 1.5rem 2rem;
  transform: translateY(-10px);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  pointer-events: none;
}

.mobile-nav.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

.mobile-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mobile-nav a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s;
}

.mobile-nav a:hover {
  color: var(--ember);
}

/* ── HERO ── */
.hero {
  min-height: 92vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  overflow: hidden;
}

.hero-left {
  background: var(--ink);
  padding: 5rem 4rem 4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.hero-left::after {
  content: '';
  position: absolute;
  bottom: -80px;
  right: -80px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--ember) 0%, transparent 70%);
  opacity: 0.15;
  pointer-events: none;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2rem;
  animation: fadeUp 0.8s ease both;
}

.hero-headline {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3rem, 5vw, 5.5rem);
  line-height: 1.0;
  color: var(--warm-white);
  animation: fadeUp 0.9s 0.1s ease both;
}

.hero-headline em {
  color: var(--ember-light);
  font-style: italic;
}

.hero-subtext {
  font-size: 1.05rem;
  font-weight: 300;
  color: #a89e90;
  line-height: 1.75;
  max-width: 400px;
  margin-top: 2rem;
  animation: fadeUp 1s 0.2s ease both;
}

.hero-cta-wrap {
  animation: fadeUp 1.1s 0.3s ease both;
}

.hero-footer-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #4a4035;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 4rem;
}

.hero-right {
  background: var(--warm-white);
  padding: 5rem 4rem 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid var(--rule);
  position: relative;
}

.hero-pull-quote {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  font-style: italic;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
  border-left: 4px solid var(--ember);
  padding-left: 2rem;
  margin-bottom: 3rem;
  animation: fadeUp 1s 0.4s ease both;
}

.hero-manifesto {
  font-size: 0.95rem;
  color: var(--mid);
  line-height: 1.85;
  animation: fadeUp 1.1s 0.5s ease both;
}

/* ── SECTION RULE ── */
.section-rule {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 2rem;
  margin: 3rem 0 0;
}

.section-rule::before,
.section-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ink);
}

.section-rule span {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--ink);
  white-space: nowrap;
}

/* ── LATEST ARTICLES SECTION ── */
.latest {
  padding: 4rem 2rem 6rem;
  max-width: 1200px;
  margin: 0 auto;
}

.latest-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 3rem;
  border-bottom: 3px double var(--ink);
  padding-bottom: 1rem;
}

.latest-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
}

.latest-view-all {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ember);
}

.latest-view-all:hover {
  color: var(--ink);
}

.articles-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0;
}

/* Featured article */
.article-featured {
  border-right: 1px solid var(--rule);
  padding-right: 2.5rem;
}

.article-featured .article-title {
  font-size: 1.9rem;
  margin-bottom: 1rem;
}

.article-featured .article-excerpt {
  display: block;
}

/* Side articles */
.articles-side {
  display: flex;
  flex-direction: column;
}

.article-small {
  padding: 0 1.5rem 2rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2rem;
}

.article-small:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.articles-side + .articles-side {
  border-left: 1px solid var(--rule);
}

/* Article shared */
.article-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ember);
  display: block;
  margin-bottom: 0.6rem;
}

.article-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.3;
  color: var(--ink);
  text-decoration: none;
  display: block;
  margin-bottom: 0.75rem;
  transition: color 0.2s;
}

.article-title:hover {
  color: var(--ember);
}

.article-excerpt {
  font-size: 0.92rem;
  color: var(--mid);
  line-height: 1.75;
  margin-bottom: 1rem;
  display: none;
}

.article-meta {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b0a595;
}

/* ── TOAST NOTIFICATION ── */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--ink);
  color: var(--warm-white);
  padding: 1rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s;
  max-width: 320px;
  border-left: 3px solid var(--ember);
}

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

/* ── READ PROGRESS BAR ── */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--ember);
  width: 0%;
  z-index: 200;
  transition: width 0.1s linear;
}

/* ── FOOTER ── */
.footer {
  background: var(--ink);
  color: var(--mid);
  padding: 3rem 2rem;
  text-align: center;
  border-top: 4px solid var(--ember);
  margin-top: auto;
}

.footer-logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2rem;
  color: var(--warm-white);
  margin-bottom: 0.5rem;
}

.footer-logo span {
  color: var(--ember);
}

.footer-tagline {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  color: var(--gold);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  list-style: none;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--ember);
}

.footer-copy {
  font-size: 0.8rem;
  color: #4a4035;
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Scroll-triggered fade-in for article cards */
.fade-in-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-right {
    display: none;
  }

  .hero-left {
    min-height: 80vh;
    padding: 4rem 2rem;
  }

  .articles-grid {
    grid-template-columns: 1fr;
  }

  .article-featured {
    border-right: none;
    padding-right: 0;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 2rem;
    margin-bottom: 2rem;
  }

  .article-featured .article-excerpt {
    display: block;
  }

  .articles-side {
    padding-left: 0;
  }

  .articles-side + .articles-side {
    border-left: none;
    border-top: 1px solid var(--rule);
    padding-top: 2rem;
  }

  .article-small {
    padding-left: 0;
  }

  .masthead-nav {
    display: none;
  }

  .masthead-toggle {
    display: flex;
  }

  .mobile-nav {
    display: block;
  }

  .masthead-date {
    display: none;
  }
}

@media (min-width: 901px) {
  .article-featured .article-excerpt {
    display: block;
  }
}
