/* ==========================================================================
   Nightfall Echo — Theme CSS
   Inspired by Spectral (HTML5 UP) visual DNA
   Dark theme, uppercase headings, wide letter-spacing, ghost buttons,
   alternating colored sections with progressive darkening
   ========================================================================== */

/* --- CSS Variables --- */
:root {
  --color-bg: #2a3240;
  --color-bg-alt: #232b36;
  --color-bg-deep: #1b2028;
  --color-teal: #1fa89c;
  --color-teal-light: #b8e4e0;
  --color-teal-muted: #8ed4cd;
  --color-indigo: #4c4f8a;
  --color-indigo-light: #cfcfe2;
  --color-red: #e0432e;
  --color-white: #ffffff;
  --color-text: #c5cdd8;
  --color-text-muted: rgba(255,255,255,0.5);
  --font-body: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --letter-wide: 0.2em;
  --letter-body: 0.06em;
  --max-inner: 58em;
  --transition-fast: 0.2s ease;
  --transition-med: 0.4s ease;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: var(--letter-body);
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; border-bottom: 1px dotted rgba(255,255,255,0.4); transition: color var(--transition-fast), border-color var(--transition-fast); }
a:hover { border-bottom-color: transparent; color: var(--color-white); }
ul, ol { list-style: none; }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-white);
  font-weight: 700;
  letter-spacing: var(--letter-wide);
  line-height: 1.2;
  text-transform: uppercase;
  margin: 0 0 0.8em 0;
}
h1 { font-size: 2em; }
h2 { font-size: 1.4em; line-height: 1.5; }
h3 { font-size: 1.15em; line-height: 1.5; }
h4 { font-size: 1em; }
p { margin: 0 0 1.6em 0; }
strong, b { color: var(--color-teal-light); font-weight: 600; }
em, i { font-style: italic; }
hr {
  border: 0;
  border-bottom: 2px solid rgba(255,255,255,0.15);
  margin: 2.5em 0;
}
blockquote {
  border-left: 4px solid rgba(255,255,255,0.2);
  padding: 0.5em 0 0.5em 1.8em;
  font-style: italic;
  margin: 0 0 1.6em 0;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  background: transparent;
  border: none;
  box-shadow: inset 0 0 0 2px var(--color-white);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  padding: 0.9em 2.6em;
  border-radius: 3px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  border-bottom: none;
  white-space: nowrap;
  text-align: center;
}
.btn:hover {
  background: rgba(255,255,255,0.12);
  border-bottom: none;
}
.btn:active { background: rgba(255,255,255,0.22); }
.btn--primary {
  background: var(--color-red);
  box-shadow: none;
  color: #fff;
}
.btn--primary:hover { background: #e5574a; }
.btn--primary:active { background: #cc3a26; }
.btn--ghost-dark {
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.15);
  color: var(--color-white);
}

/* --- Inner Container --- */
.inner {
  max-width: var(--max-inner);
  margin: 0 auto;
  padding-left: 2em;
  padding-right: 2em;
}

/* --- Skip Nav --- */
.skip-nav {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 99999;
  border-bottom: none;
}
.skip-nav:focus {
  position: fixed;
  left: 1em;
  top: 1em;
  width: auto;
  height: auto;
  background: var(--color-red);
  color: #fff;
  padding: 0.8em 1.5em;
  font-size: 0.85em;
  z-index: 99999;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3.4em;
  line-height: 3.4em;
  z-index: 9000;
  background: var(--color-bg);
  transition: background var(--transition-fast);
}
.site-header.is-transparent {
  background: transparent;
}
.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: none;
}
.site-header__brand {
  font-size: 0.85em;
  font-weight: 700;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: var(--color-white);
  border-bottom: none;
  transition: opacity var(--transition-fast);
  white-space: nowrap;
}
.site-header.is-transparent .site-header__brand {
  opacity: 0;
  pointer-events: none;
}

/* Desktop nav */
.site-nav__list {
  display: flex;
  gap: 0.2em;
}
.site-nav__list a {
  display: block;
  padding: 0 1.2em;
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: var(--color-white);
  border-bottom: none;
  transition: background var(--transition-fast);
}
.site-nav__list a:hover {
  background: rgba(255,255,255,0.08);
}

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 2.8em;
  height: 2.8em;
  position: relative;
  z-index: 9100;
}
.hamburger span,
.hamburger span::before,
.hamburger span::after {
  display: block;
  width: 1.4em;
  height: 2px;
  background: var(--color-white);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  transition: all 0.3s ease;
}
.hamburger span { top: 50%; transform: translate(-50%, -50%); }
.hamburger span::before { content: ''; top: -7px; left: 0; width: 100%; }
.hamburger span::after { content: ''; top: 7px; left: 0; width: 100%; }
.hamburger.is-active span { background: transparent; }
.hamburger.is-active span::before { top: 0; transform: rotate(45deg); }
.hamburger.is-active span::after { top: 0; transform: rotate(-45deg); }

/* Mobile nav overlay */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: var(--color-bg-deep);
  z-index: 9050;
  padding: 5em 2em 2em;
  transition: right 0.35s ease;
  overflow-y: auto;
}
.mobile-nav.is-open { right: 0; }
.mobile-nav a {
  display: block;
  padding: 0.8em 0;
  font-size: 0.85em;
  font-weight: 600;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: var(--color-white);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.mobile-nav a:hover { color: var(--color-teal); }
.mobile-nav__overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9040;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.mobile-nav__overlay.is-visible { opacity: 1; }

@media screen and (max-width: 860px) {
  .site-nav__list { display: none; }
  .hamburger { display: block; }
  .mobile-nav { display: block; }
}

/* ==========================================================================
   HERO / BANNER
   ========================================================================== */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  text-align: center;
  position: relative;
  padding: 4em 2em;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(31,168,156,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(76,79,138,0.1) 0%, transparent 50%);
  pointer-events: none;
}
.hero__title {
  font-size: 2em;
  position: relative;
  display: inline-block;
  padding: 0.3em 0.8em;
  z-index: 1;
}
.hero__title::before,
.hero__title::after {
  content: '';
  display: block;
  position: absolute;
  height: 2px;
  background: var(--color-white);
  width: 100%;
  left: 0;
  transition: width 0.8s ease;
}
.hero__title::before { top: 0; }
.hero__title::after { bottom: 0; }
.hero__subtitle {
  max-width: 36em;
  margin: 1.2em auto 2em;
  font-size: 0.95em;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: var(--color-text);
  z-index: 1;
  position: relative;
}
.hero__cta { z-index: 1; position: relative; }
.hero__scroll {
  position: absolute;
  bottom: 2em;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75em;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: var(--color-text-muted);
  border-bottom: none;
  z-index: 1;
  text-align: center;
}
.hero__scroll::after {
  content: '';
  display: block;
  width: 1px;
  height: 2.5em;
  background: rgba(255,255,255,0.3);
  margin: 0.8em auto 0;
}
@media screen and (max-width: 736px) {
  .hero__title { font-size: 1.35em; padding: 0.2em 0.5em; }
  .hero__subtitle { font-size: 0.8em; }
}

/* ==========================================================================
   SECTION WRAPPERS
   ========================================================================== */
.section { padding: 5em 0 4em; }

.section--teal {
  background: var(--color-teal);
  color: var(--color-teal-light);
}
.section--teal h2, .section--teal h3, .section--teal h4,
.section--teal strong { color: var(--color-white); }
.section--teal .section__lead { color: var(--color-teal-muted); }

.section--indigo {
  background: var(--color-indigo);
  color: var(--color-indigo-light);
}
.section--indigo h2, .section--indigo h3, .section--indigo h4,
.section--indigo strong { color: var(--color-white); }
.section--indigo .section__lead { color: #b9bad4; }

.section--dark { background: var(--color-bg-alt); }
.section--deep { background: var(--color-bg-deep); }

.section__header {
  text-align: center;
  max-width: 42em;
  margin: 0 auto 3em;
}
.section__header h2 {
  position: relative;
  display: inline-block;
  padding-bottom: 0.6em;
  margin-bottom: 0.8em;
}
.section__header h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 3em;
  height: 2px;
  background: rgba(255,255,255,0.25);
}
.section--teal .section__header h2::after { background: rgba(0,0,0,0.15); }
.section--indigo .section__header h2::after { background: rgba(0,0,0,0.15); }

.section__lead {
  color: var(--color-text);
  font-size: 0.95em;
  letter-spacing: 0.04em;
}

/* ==========================================================================
   TOPICS — Spotlight-style alternating image/text rows
   ========================================================================== */
.topics-section { padding: 0; }
.topic-row {
  display: flex;
  align-items: center;
}
.topic-row:nth-child(odd) { flex-direction: row; }
.topic-row:nth-child(even) { flex-direction: row-reverse; }

/* Progressive darkening like Spectral's spotlight */
.topic-row:nth-child(1) { background: rgba(0,0,0,0.06); }
.topic-row:nth-child(2) { background: rgba(0,0,0,0.12); }
.topic-row:nth-child(3) { background: rgba(0,0,0,0.18); }
.topic-row:nth-child(4) { background: rgba(0,0,0,0.24); }
.topic-row:nth-child(5) { background: rgba(0,0,0,0.30); }
.topic-row:nth-child(6) { background: rgba(0,0,0,0.36); }

.topic-row__visual {
  width: 38%;
  min-height: 16em;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.topic-row__icon {
  width: 4em;
  height: 4em;
  border: 2px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3em;
  color: var(--color-white);
}
.topic-row__content {
  width: 62%;
  padding: 3em 4em;
}
.topic-row__content h3 { margin-bottom: 0.5em; }
.topic-row__content p:last-child { margin-bottom: 0; }

@media screen and (max-width: 860px) {
  .topic-row,
  .topic-row:nth-child(odd),
  .topic-row:nth-child(even) {
    flex-direction: column;
  }
  .topic-row__visual {
    width: 100%;
    min-height: 8em;
  }
  .topic-row__content {
    width: 100%;
    padding: 2.5em 2em;
    text-align: center;
  }
}

/* ==========================================================================
   LATEST POSTS
   ========================================================================== */
.posts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.post-card {
  padding: 3em 3em 2em;
  position: relative;
  transition: background var(--transition-fast);
}
/* Progressive darkening on cards like Spectral features */
.post-card:nth-child(1) { background: rgba(0,0,0,0.03); }
.post-card:nth-child(2) { background: rgba(0,0,0,0.06); }
.post-card:nth-child(3) { background: rgba(0,0,0,0.09); }
.post-card:nth-child(4) { background: rgba(0,0,0,0.12); }
.post-card:nth-child(5) { background: rgba(0,0,0,0.15); }
.post-card:nth-child(6) { background: rgba(0,0,0,0.18); }
.post-card:hover { background: rgba(255,255,255,0.03); }

.post-card__cover {
  width: 100%;
  height: 12em;
  object-fit: cover;
  margin-bottom: 1.5em;
}
.post-card__date {
  display: block;
  font-size: 0.72em;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.8em;
}
.post-card__title {
  font-size: 1.05em;
  margin-bottom: 0.6em;
}
.post-card__title a {
  border-bottom: none;
  color: var(--color-white);
}
.post-card__title a:hover { color: var(--color-teal); }
.post-card__excerpt {
  font-size: 0.9em;
  color: var(--color-text);
  line-height: 1.65;
}
.post-card__excerpt p:last-child { margin-bottom: 0; }
.post-card__link {
  display: inline-block;
  margin-top: 1em;
  font-size: 0.75em;
  font-weight: 600;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  border-bottom: 1px dotted rgba(255,255,255,0.3);
}

@media screen and (max-width: 736px) {
  .posts-grid { grid-template-columns: 1fr; }
  .post-card { padding: 2em 1.8em 1.5em; }
}

/* ==========================================================================
   FAQ
   ========================================================================== */
.faq-list {
  max-width: 44em;
  margin: 0 auto;
}
.faq-item {
  border-bottom: 1px solid rgba(0,0,0,0.12);
}
.faq-item:last-child { border-bottom: none; }
.faq-item__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 1.5em 0;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.95em;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-white);
  line-height: 1.4;
}
.faq-item__question:focus { outline: 2px solid rgba(255,255,255,0.3); outline-offset: 2px; }
.faq-item__icon {
  flex-shrink: 0;
  margin-left: 1.5em;
  width: 1.2em;
  height: 1.2em;
  position: relative;
}
.faq-item__icon::before,
.faq-item__icon::after {
  content: '';
  position: absolute;
  background: var(--color-white);
  transition: transform 0.3s ease;
}
.faq-item__icon::before {
  width: 100%;
  height: 2px;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}
.faq-item__icon::after {
  width: 2px;
  height: 100%;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}
.faq-item.is-open .faq-item__icon::after {
  transform: translateX(-50%) rotate(90deg);
  opacity: 0;
}
.faq-item__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
  padding: 0 0 0 0;
}
.faq-item.is-open .faq-item__answer {
  max-height: 30em;
  padding-bottom: 1.5em;
}
.faq-item__answer p:last-child { margin-bottom: 0; }

/* ==========================================================================
   CTA BAND (editorial, not sales)
   ========================================================================== */
.cta-band {
  padding: 4em 0;
}
.cta-band .inner {
  display: flex;
  align-items: center;
  gap: 3em;
}
.cta-band__text {
  flex: 1;
}
.cta-band__text h2 { margin-bottom: 0.4em; }
.cta-band__text p { color: var(--color-text); margin: 0; }
.cta-band__actions {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8em;
}
@media screen and (max-width: 860px) {
  .cta-band .inner { flex-direction: column; text-align: center; }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: var(--color-bg-deep);
  padding: 5em 0 3em;
  text-align: center;
}
.site-footer__nav {
  display: flex;
  justify-content: center;
  gap: 0.4em;
  flex-wrap: wrap;
  margin-bottom: 2em;
}
.site-footer__nav a {
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 0.4em 1em;
  border-bottom: none;
  transition: color var(--transition-fast);
}
.site-footer__nav a:hover { color: var(--color-white); }
.site-footer__contact {
  margin-bottom: 2em;
}
.site-footer__contact a {
  color: var(--color-text-muted);
  font-size: 0.85em;
  letter-spacing: 0.08em;
}
.site-footer__contact a:hover { color: var(--color-white); }
.site-footer__copy {
  font-size: 0.75em;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.site-footer__brand {
  font-weight: 700;
  color: var(--color-white);
  display: block;
  font-size: 0.85em;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  margin-bottom: 1.5em;
}

/* ==========================================================================
   PAGE / ARTICLE CONTENT
   ========================================================================== */
.page-header {
  padding: 10em 0 6em;
  text-align: center;
  position: relative;
  background:
    linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0.45)),
    linear-gradient(135deg, var(--color-bg-alt), var(--color-bg-deep));
  background-size: cover;
  background-position: center;
}
.page-header h1 {
  font-size: 1.75em;
  margin-bottom: 0.3em;
}
.page-header p {
  color: var(--color-text);
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  font-size: 0.85em;
}
.page-content {
  background: var(--color-white);
  color: #4a4650;
  padding: 4em 0;
}
.page-content .inner { max-width: 42em; }
.page-content h2, .page-content h3, .page-content h4 { color: var(--color-bg); }
.page-content strong, .page-content b { color: var(--color-bg-deep); }
.page-content h2 { font-size: 1.3em; margin-top: 2em; }
.page-content h3 { font-size: 1.1em; margin-top: 1.8em; }
.page-content a { color: var(--color-teal); border-bottom-color: var(--color-teal); }
.page-content a:hover { color: var(--color-bg); }
.page-content hr { border-bottom-color: #ddd; }
.page-content blockquote { border-left-color: var(--color-teal); color: #666; }
.page-content img { border-radius: 2px; margin: 1.5em 0; }
.page-content ul, .page-content ol { margin: 0 0 1.6em 1.5em; }
.page-content ul { list-style: disc; }
.page-content ol { list-style: decimal; }
.page-content li { margin-bottom: 0.4em; }

/* --- Post single --- */
.post-single__cover {
  width: 100%;
  max-height: 28em;
  object-fit: cover;
  margin-bottom: 2em;
}
.post-single__meta {
  font-size: 0.75em;
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  color: #999;
  margin-bottom: 2em;
}
.post-single__excerpt {
  font-size: 1.05em;
  color: #666;
  border-left: 3px solid var(--color-teal);
  padding-left: 1.2em;
  margin-bottom: 2em;
  font-style: italic;
}

/* ==========================================================================
   BLOG INDEX
   ========================================================================== */
.blog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.blog-grid .post-card { padding: 2.5em; }
@media screen and (max-width: 600px) {
  .blog-grid { grid-template-columns: 1fr; }
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3em;
  padding: 3em 0;
}
.pagination a, .pagination span {
  display: inline-block;
  min-width: 2.8em;
  height: 2.8em;
  line-height: 2.8em;
  text-align: center;
  font-size: 0.8em;
  font-weight: 600;
  letter-spacing: 0.1em;
  border-bottom: none;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
}
.pagination a:hover { color: var(--color-white); background: rgba(255,255,255,0.08); }
.pagination a.active,
.pagination .active {
  background: var(--color-white);
  color: var(--color-bg);
  border-radius: 2px;
}

/* ==========================================================================
   UTILITY / FOCUS
   ========================================================================== */
:focus-visible {
  outline: 2px solid rgba(255,255,255,0.5);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media screen and (max-width: 480px) {
  .section { padding: 3em 0 2.5em; }
  .section__header { margin-bottom: 2em; }
  h2 { font-size: 1.15em; }
}
