/* ========================================
   VIABRASIL — Stylesheet Principal
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Source+Serif+4:opsz,wght@8..60,300;8..60,400;8..60,500;8..60,600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---- Tokens ---- */
:root {
  --ink:       #1a1610;
  --ink-soft:  #3d3628;
  --sand:      #f5f0e8;
  --sand-dark: #ede7d9;
  --amber:     #c97b2e;
  --amber-deep:#a05e18;
  --road:      #2c3e50;
  --road-mid:  #3d5166;
  --line:      rgba(26,22,16,.12);
  --line-soft: rgba(26,22,16,.06);
  --white:     #ffffff;
  --radius:    4px;
  --max:       1200px;
  --col:       680px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: 'Source Serif 4', Georgia, serif;
  background: var(--sand);
  color: var(--ink);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a  { color: inherit; text-decoration: none; }

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  line-height: 1.2;
  letter-spacing: -.01em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 600; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.7rem); font-weight: 600; }
h4 { font-size: 1.15rem; font-weight: 600; }

p { max-width: 72ch; margin-bottom: 1.25rem; }
p:last-child { margin-bottom: 0; }

.lead {
  font-size: 1.2rem;
  font-weight: 300;
  line-height: 1.65;
  color: var(--ink-soft);
}

.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: .85em;
  letter-spacing: .03em;
}

/* ---- Layout ---- */
.container   { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.col-narrow  { max-width: var(--col); margin: 0 auto; }
.grid-2      { display: grid; grid-template-columns: repeat(2,1fr); gap: 40px; }
.grid-3      { display: grid; grid-template-columns: repeat(3,1fr); gap: 32px; }
.grid-4      { display: grid; grid-template-columns: repeat(4,1fr); gap: 24px; }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---- Header ---- */
#site-header {
  background: var(--road);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid var(--amber);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.logo-mark {
  font-family: 'Playfair Display', serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -.02em;
}

.logo-mark span {
  color: var(--amber);
}

.logo-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: .65rem;
  color: rgba(255,255,255,.45);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-left: 2px;
  align-self: flex-end;
  margin-bottom: 3px;
}

/* ---- Nav ---- */
.main-nav { display: flex; align-items: center; gap: 4px; }

.main-nav a {
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255,255,255,.72);
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: color .2s, background .2s;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--white);
  background: rgba(255,255,255,.08);
}

.nav-cta {
  background: var(--amber) !important;
  color: var(--white) !important;
  margin-left: 8px;
}
.nav-cta:hover { background: var(--amber-deep) !important; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: .3s;
}

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .main-nav {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--road);
    flex-direction: column;
    padding: 16px 24px 24px;
    gap: 2px;
    border-bottom: 3px solid var(--amber);
  }
  .main-nav.open { display: flex; }
  .main-nav a { width: 100%; padding: 10px 14px; }
}

/* ---- Hero ---- */
.hero {
  background: var(--road);
  position: relative;
  overflow: hidden;
  padding: 80px 0 72px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 120px,
      rgba(255,255,255,.015) 120px,
      rgba(255,255,255,.015) 121px
    ),
    radial-gradient(ellipse 80% 60% at 70% 50%, rgba(201,123,46,.18) 0%, transparent 70%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-eyebrow::before {
  content: '';
  display: block;
  width: 28px; height: 2px;
  background: var(--amber);
}

.hero h1 { color: var(--white); margin-bottom: 24px; }
.hero h1 em { font-style: italic; color: var(--amber); }
.hero .lead { color: rgba(255,255,255,.7); margin-bottom: 36px; max-width: 54ch; }

.hero-meta {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.hero-stat strong {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--amber);
  line-height: 1;
  margin-bottom: 4px;
}
.hero-stat span {
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
}

.hero-image-wrap {
  position: relative;
}
.hero-image-wrap img {
  border-radius: 8px;
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  box-shadow: 0 24px 64px rgba(0,0,0,.4);
}
.hero-caption {
  position: absolute;
  bottom: -14px; right: -14px;
  background: var(--amber);
  color: var(--white);
  font-family: 'JetBrains Mono', monospace;
  font-size: .65rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: var(--radius);
}

@media (max-width: 768px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-image-wrap { display: none; }
}

/* ---- Breadcrumb / Section ---- */
.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---- Cards ---- */
.card {
  background: var(--white);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  transition: transform .25s, box-shadow .25s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(26,22,16,.1);
}
.card-img {
  aspect-ratio: 16/9;
  object-fit: cover;
  width: 100%;
}
.card-body { padding: 24px; }
.card-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: .65rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 10px;
}
.card-body h3 { font-size: 1.15rem; margin-bottom: 10px; }
.card-body p { font-size: .92rem; color: var(--ink-soft); margin-bottom: 16px; max-width: 100%; }
.card-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--amber);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap .2s;
}
.card-link:hover { gap: 10px; }

/* ---- Feature Strip ---- */
.feature-strip {
  background: var(--road);
  padding: 56px 0;
}

.feature-item {
  text-align: center;
  padding: 24px 16px;
}
.feature-icon {
  width: 52px; height: 52px;
  background: rgba(201,123,46,.15);
  border: 1px solid rgba(201,123,46,.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.4rem;
}
.feature-item h4 {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 8px;
}
.feature-item p {
  font-size: .85rem;
  color: rgba(255,255,255,.55);
  max-width: 22ch;
  margin: 0 auto;
}

/* ---- Big Article / Editorial ---- */
.editorial-section { padding: 80px 0; }
.editorial-section + .editorial-section { border-top: 1px solid var(--line-soft); }

.editorial-header {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.article-content h2 { margin: 2.4rem 0 1rem; }
.article-content h3 { margin: 2rem 0 .8rem; color: var(--road); }
.article-content p  { margin-bottom: 1.3rem; }
.article-content strong { color: var(--ink); }

.callout {
  background: var(--sand-dark);
  border-left: 4px solid var(--amber);
  padding: 20px 24px;
  border-radius: 0 6px 6px 0;
  margin: 2rem 0;
}
.callout p { margin: 0; }

.fact-box {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 2px;
  background: var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin: 2.5rem 0;
}
.fact-box-item {
  background: var(--white);
  padding: 24px;
  text-align: center;
}
.fact-box-item strong {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--amber);
  margin-bottom: 6px;
}
.fact-box-item span {
  font-size: .82rem;
  color: var(--ink-soft);
}

@media (max-width: 600px) {
  .fact-box { grid-template-columns: 1fr; }
}

/* ---- Sidebar Layout ---- */
.with-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 60px;
  align-items: start;
}
@media (max-width: 900px) {
  .with-sidebar { grid-template-columns: 1fr; }
}

.sidebar-widget {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 24px;
  margin-bottom: 24px;
}
.sidebar-widget h4 {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 16px;
  font-size: 1rem;
}
.sidebar-list { list-style: none; }
.sidebar-list li {
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: .88rem;
}
.sidebar-list li:last-child { border-bottom: none; }
.sidebar-list a { color: var(--road); transition: color .2s; }
.sidebar-list a:hover { color: var(--amber); }

/* ---- Divider ---- */
.divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 60px 0;
}

/* ---- Section spacings ---- */
.pt-80 { padding-top: 80px; }
.pb-80 { padding-bottom: 80px; }
.py-80 { padding: 80px 0; }
.pt-48 { padding-top: 48px; }
.pb-48 { padding-bottom: 48px; }
.py-48 { padding: 48px 0; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-48 { margin-bottom: 48px; }
.mb-64 { margin-bottom: 64px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }

/* ---- Page Hero (inner pages) ---- */
.page-hero {
  background: var(--road);
  padding: 60px 0 52px;
  border-bottom: 3px solid var(--amber);
}
.page-hero .hero-eyebrow { margin-bottom: 14px; }
.page-hero h1 { color: var(--white); font-size: clamp(1.8rem,4vw,2.8rem); }
.page-hero .lead { color: rgba(255,255,255,.65); max-width: 60ch; margin-top: 16px; margin-bottom: 0; }

/* ---- Breadcrumb ---- */
.breadcrumb {
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  letter-spacing: .08em;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  margin-bottom: 20px;
}
.breadcrumb a { color: rgba(255,255,255,.4); transition: color .2s; }
.breadcrumb a:hover { color: var(--amber); }
.breadcrumb span { color: rgba(255,255,255,.25); margin: 0 8px; }

/* ---- Table of Contents ---- */
.toc {
  background: var(--sand-dark);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 24px 28px;
  margin: 2rem 0 2.5rem;
}
.toc-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 14px;
}
.toc ol { padding-left: 1.4rem; }
.toc li { margin: 6px 0; font-size: .9rem; }
.toc a { color: var(--road); text-decoration: underline; text-decoration-color: transparent; transition: .2s; }
.toc a:hover { color: var(--amber); text-decoration-color: var(--amber); }

/* ---- Tag ---- */
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: .65rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--sand-dark);
  color: var(--ink-soft);
  padding: 4px 10px;
  border-radius: 30px;
  border: 1px solid var(--line);
}

/* ---- Contact ---- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
@media (max-width: 700px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-item {
  display: flex;
  gap: 18px;
  margin-bottom: 28px;
}
.contact-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  width: 44px; height: 44px;
  background: var(--sand-dark);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.contact-item h4 { font-size: .9rem; margin-bottom: 4px; }
.contact-item p, .contact-item a { font-size: .9rem; color: var(--ink-soft); max-width: 100%; margin: 0; }

/* ---- Footer ---- */
#site-footer {
  background: var(--ink);
  color: rgba(255,255,255,.65);
  padding: 64px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand .logo-mark { color: var(--white); font-size: 1.4rem; }
.footer-brand p {
  font-size: .85rem;
  line-height: 1.6;
  margin-top: 14px;
  max-width: 34ch;
  color: rgba(255,255,255,.45);
}

.footer-col h5 {
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a {
  font-size: .85rem;
  color: rgba(255,255,255,.55);
  transition: color .2s;
}
.footer-col a:hover { color: var(--amber); }

.footer-bottom {
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom p, .footer-bottom small {
  font-size: .75rem;
  color: rgba(255,255,255,.3);
  max-width: 100%;
  margin: 0;
}

.disclaimer-bar {
  background: rgba(255,255,255,.04);
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 16px 0;
  margin-top: 20px;
}
.disclaimer-bar p {
  font-size: .72rem;
  color: rgba(255,255,255,.28);
  line-height: 1.6;
  max-width: 100%;
  margin: 0;
  text-align: center;
}

/* ---- Legal pages ---- */
.legal-content h2 { font-size: 1.5rem; margin: 2.5rem 0 1rem; color: var(--road); }
.legal-content h3 { font-size: 1.2rem; margin: 1.8rem 0 .7rem; }
.legal-content p  { margin-bottom: 1.2rem; font-size: .95rem; }
.legal-content ul, .legal-content ol {
  padding-left: 1.6rem;
  margin-bottom: 1.2rem;
}
.legal-content li { margin-bottom: .5rem; font-size: .95rem; }

/* ---- Utility ---- */
.text-center { text-align: center; }
.text-amber  { color: var(--amber); }
.text-muted  { color: var(--ink-soft); }
.bg-sand     { background: var(--sand-dark); }
.bg-white    { background: var(--white); }
.rounded     { border-radius: 6px; }

/* ---- Inline highlight ---- */
mark {
  background: rgba(201,123,46,.15);
  color: inherit;
  padding: 1px 4px;
  border-radius: 2px;
}

/* ---- Scroll reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ---- Ad placeholder ---- */
.ad-slot {
  background: var(--sand-dark);
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 20px;
  text-align: center;
  margin: 32px 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-slot small {
  font-family: 'JetBrains Mono', monospace;
  font-size: .6rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(26,22,16,.25);
}
