/* Hibou Carmin — Unique Editorial Stylesheet
   Strict technological / expert-publishing aesthetic
   Dark premium palette + carmine accents
   Fully custom, zero frameworks */

:root {
  --bg-deep: #0c0c0e;
  --bg-panel: #141418;
  --bg-elevated: #1c1c22;
  --bg-hover: #25252d;
  --text-primary: #f0f0f2;
  --text-secondary: #a0a0ab;
  --text-muted: #6b6b76;
  --accent: #c41e3a;
  --accent-soft: #e8455f;
  --accent-dim: #8a1528;
  --border: #2a2a32;
  --border-light: #3a3a44;
  --success: #2dd4a8;
  --warning: #f5a623;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-sans: "Avenir Next", "Segoe UI", "Helvetica Neue", Helvetica, system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Segoe UI Mono", Menlo, Consolas, monospace;
  --radius: 6px;
  --radius-lg: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.45);
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-soft); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }
ul, ol { list-style: none; }

/* ========== TYPOGRAPHY ========== */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); margin-bottom: 1.2rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }
.lead { font-size: 1.15rem; color: var(--text-secondary); max-width: 52ch; }

/* ========== LAYOUT ========== */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.section {
  padding: 4.5rem 0;
}
.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

/* ========== HEADER ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 12, 14, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.15rem;
}
.logo svg {
  width: 36px;
  height: 36px;
}
.logo:hover { color: var(--text-primary); }

.nav-main {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}
.nav-main a {
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
  position: relative;
}
.nav-main a:hover,
.nav-main a.active {
  color: var(--text-primary);
}
.nav-main a.active::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: var(--transition);
}

/* ========== HERO (full-bleed) ========== */
.hero {
  position: relative;
  min-height: min(88vh, 720px);
  display: flex;
  align-items: flex-end;
  padding: 5.5rem 0 4.5rem;
  overflow: hidden;
  isolation: isolate;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(105deg, rgba(12, 12, 14, 0.94) 0%, rgba(12, 12, 14, 0.78) 42%, rgba(12, 12, 14, 0.45) 100%),
    linear-gradient(to top, rgba(12, 12, 14, 0.88) 0%, transparent 45%);
  pointer-events: none;
}
.hero-content {
  position: relative;
  max-width: 38rem;
}
.hero-brand {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
  letter-spacing: -0.02em;
}
.hero-brand span {
  color: var(--accent-soft);
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-soft);
  background: rgba(196, 30, 58, 0.12);
  border: 1px solid rgba(196, 30, 58, 0.3);
  padding: 0.35rem 0.85rem;
  border-radius: 4px;
  margin-bottom: 1.2rem;
}
.hero h1 {
  margin-bottom: 1.1rem;
  font-size: clamp(1.75rem, 3.8vw, 2.55rem);
}
.hero h1 span {
  color: var(--accent-soft);
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 550;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-soft);
  color: #fff;
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}
.btn-ghost:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

/* ========== LATEST ANALYSES ========== */
.analyses-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}
.analysis-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.analysis-card:hover {
  border-color: var(--border-light);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.card-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-elevated);
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}
.analysis-card:hover .card-media img {
  transform: scale(1.04);
}
.card-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(196, 30, 58, 0.1);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.8rem;
}
.card-body {
  padding: 1.4rem 1.5rem 1.6rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-body h3 {
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
}
.card-body h3 a {
  color: var(--text-primary);
}
.card-body h3 a:hover {
  color: var(--accent-soft);
}
.card-excerpt {
  color: var(--text-secondary);
  font-size: 0.92rem;
  flex: 1;
  margin-bottom: 1.1rem;
}
.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 0.9rem;
}
.difficulty {
  display: flex;
  gap: 3px;
}
.difficulty span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-light);
}
.difficulty span.filled {
  background: var(--accent);
}

/* ========== COMPARISON TOOL ========== */
.tool-section {
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.tool-intro {
  max-width: 48ch;
  margin-bottom: 2.2rem;
}
.comparison-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-deep);
}
table.comparison {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.comparison th,
table.comparison td {
  padding: 0.95rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table.comparison th {
  background: var(--bg-elevated);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}
table.comparison tr:last-child td {
  border-bottom: none;
}
table.comparison td:first-child {
  font-weight: 550;
  color: var(--text-primary);
}
table.comparison .score {
  font-family: var(--font-mono);
  color: var(--accent-soft);
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.filter-tag {
  font-size: 0.8rem;
  padding: 0.4rem 0.9rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.filter-tag:hover,
.filter-tag.active {
  border-color: var(--accent);
  color: var(--accent-soft);
  background: rgba(196, 30, 58, 0.1);
}

/* ========== INTERACTIVE CALCULATOR ========== */
.calc-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  margin-top: 2rem;
}
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}
.calc-field label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}
.calc-field input,
.calc-field select {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font-sans);
}
.calc-field input:focus,
.calc-field select:focus {
  outline: none;
  border-color: var(--accent);
}
.calc-result {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
}
.calc-result .metric {
  text-align: center;
}
.calc-result .metric .num {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--accent-soft);
}
.calc-result .metric .lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ========== GLOSSARY TEASER ========== */
.glossary-preview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.term-item {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  cursor: pointer;
  transition: border-color var(--transition);
}
.term-item:hover {
  border-color: var(--accent-dim);
}
.term-item strong {
  color: var(--accent-soft);
  font-weight: 550;
}
.term-item p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}

/* ========== ACCORDION ========== */
.accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.acc-item {
  border-bottom: 1px solid var(--border);
}
.acc-item:last-child {
  border-bottom: none;
}
.acc-trigger {
  width: 100%;
  text-align: left;
  background: var(--bg-panel);
  border: none;
  color: var(--text-primary);
  padding: 1.15rem 1.4rem;
  font-size: 1rem;
  font-weight: 550;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition);
}
.acc-trigger:hover {
  background: var(--bg-elevated);
}
.acc-trigger::after {
  content: "+";
  font-size: 1.3rem;
  color: var(--accent);
  font-weight: 300;
}
.acc-item.open .acc-trigger::after {
  content: "−";
}
.acc-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  background: var(--bg-deep);
}
.acc-item.open .acc-panel {
  max-height: 400px;
}
.acc-content {
  padding: 0 1.4rem 1.3rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ========== FOOTER ========== */
.site-footer {
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  padding: 3.5rem 0 2rem;
  margin-top: 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.9rem;
  max-width: 32ch;
}
.footer-col h4 {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-weight: 550;
}
.footer-col ul li {
  margin-bottom: 0.5rem;
}
.footer-col a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.footer-col a:hover {
  color: var(--accent-soft);
}
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.contact-item strong {
  color: var(--text-primary);
  font-weight: 500;
}
.disclaimer {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 90ch;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ========== POPUP / TOOLTIP ========== */
.term-popup {
  position: fixed;
  z-index: 200;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  max-width: 320px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all 0.2s ease;
  pointer-events: none;
}
.term-popup.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.term-popup h4 {
  font-size: 0.95rem;
  color: var(--accent-soft);
  margin-bottom: 0.4rem;
}
.term-popup p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ========== LEGAL / INNER PAGES ========== */
.page-hero {
  padding: 3.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
}
.page-content {
  max-width: 72ch;
  padding: 3rem 0 5rem;
}
.article-figure {
  margin: 0 0 1.4rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}
.article-figure img {
  width: 100%;
  height: auto;
  display: block;
}
.article-figure figcaption {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 0.65rem 0.9rem;
  border-top: 1px solid var(--border);
}
.page-content h2 {
  margin-top: 2.2rem;
  margin-bottom: 0.9rem;
}
.page-content p,
.page-content li {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}
.page-content ul {
  padding-left: 1.3rem;
  list-style: disc;
}
.page-content a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 980px) {
  .hero {
    min-height: min(78vh, 640px);
  }
  .analyses-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .glossary-preview {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .nav-main {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1.2rem 1.5rem 1.5rem;
    gap: 0.8rem;
  }
  .nav-main.open {
    display: flex;
  }
  .nav-toggle {
    display: flex;
  }
  .analyses-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }
  .hero {
    min-height: auto;
    padding: 3.5rem 0 3rem;
  }
  .hero::after {
    background:
      linear-gradient(to top, rgba(12, 12, 14, 0.95) 0%, rgba(12, 12, 14, 0.72) 55%, rgba(12, 12, 14, 0.55) 100%);
  }
  .section {
    padding: 3.2rem 0;
  }
  .calc-result {
    gap: 1.2rem;
  }
}

/* Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
