@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@700&display=swap');

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

:root {
  --c-ink: #1A1A1A;
  --c-cream: #F5F0E8;
  --c-red: #FF3B00;
  --c-ink-80: rgba(26,26,26,0.8);
  --c-red-dim: rgba(255,59,0,0.12);
  --nav-w: 220px;
  --font-main: 'Space Grotesk', 'Arial Black', Arial, sans-serif;
  --radius-card: 10px;
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  line-height: 1.6;
  background: var(--c-ink);
  color: var(--c-cream);
}

body.body-root {
  font-family: var(--font-main);
  background: var(--c-ink);
  color: var(--c-cream);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== Layout Shell ===== */
.site-shell {
  display: flex;
  min-height: 100vh;
}

/* ===== Sidenav ===== */
.sidenav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-w);
  height: 100vh;
  background: var(--c-cream);
  color: var(--c-ink);
  z-index: 100;
  display: flex;
  flex-direction: column;
  border-right: 3px solid var(--c-ink);
  overflow-y: auto;
}

.sidenav summary {
  display: none;
  list-style: none;
  cursor: pointer;
  padding: 16px 20px;
  align-items: center;
  gap: 6px;
  flex-direction: column;
  width: 48px;
}

.sidenav summary::-webkit-details-marker { display: none; }

.toggle-bar {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--c-ink);
  border-radius: 2px;
}

.sidenav-menu {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

.brand-item {
  padding: 24px 20px 20px;
  border-bottom: 3px solid var(--c-ink);
}

.brand-logo {
  text-decoration: none;
  display: block;
}

.brand-text {
  font-family: var(--font-main);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.logo-img {
  max-width: 140px;
  height: auto;
  display: block;
}

.sidenav-menu li {
  border-bottom: 1.5px solid rgba(26,26,26,0.15);
}

.nav-link {
  display: block;
  padding: 14px 20px;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--c-ink);
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background var(--transition), color var(--transition), padding-left var(--transition);
  min-height: 48px;
  display: flex;
  align-items: center;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: var(--c-ink);
  color: var(--c-cream);
  padding-left: 28px;
  outline: none;
}

/* ===== Page Main ===== */
.page-main {
  margin-left: var(--nav-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ===== Main & Wrap ===== */
main {
  flex: 1;
}

.wrap {
  width: 100%;
}

/* ===== Hero Section ===== */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  padding: 0;
  background: var(--c-ink);
  position: relative;
  overflow: hidden;
  scroll-margin-top: 0;
}

.hero-article {
  padding: 10vh 6vw 8vh;
  max-width: 900px;
  position: relative;
  z-index: 1;
}

.hero-h1 {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: clamp(3rem, 10vw, 8rem);
  line-height: 1.0;
  letter-spacing: -0.04em;
  color: var(--c-cream);
  margin-bottom: 2rem;
  will-change: opacity, transform;
}

/* Kinetic typing animation */
@keyframes kinetic-in {
  0% { opacity: 0; transform: translateY(40px) skewY(2deg); }
  60% { opacity: 1; transform: translateY(-4px) skewY(-0.5deg); }
  100% { opacity: 1; transform: translateY(0) skewY(0); }
}

@keyframes typing-cursor {
  0%, 100% { border-right-color: var(--c-red); }
  50% { border-right-color: transparent; }
}

@keyframes text-flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.85; }
  94% { opacity: 1; }
  97% { opacity: 1; }
  98% { opacity: 0.9; }
}

.kinetic-title {
  animation: kinetic-in 0.9s cubic-bezier(0.16,1,0.3,1) both;
}

.hero-h1 .accent {
  color: var(--c-red);
  display: inline-block;
  animation: text-flicker 6s infinite 2s;
}

.hero-sub {
  font-family: var(--font-main);
  font-size: clamp(1rem, 2.2vw, 1.4rem);
  font-weight: 700;
  color: var(--c-cream);
  opacity: 0.65;
  letter-spacing: 0.02em;
  max-width: 560px;
  animation: kinetic-in 0.9s cubic-bezier(0.16,1,0.3,1) 0.2s both;
}

/* Red accent line on hero */
.hero-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--c-red);
}

/* ===== Content Section ===== */
.content-section {
  background: var(--c-cream);
  color: var(--c-ink);
  scroll-margin-top: 0;
}

.content-article {
  display: flex;
  gap: 0;
  align-items: flex-start;
  min-height: 60vh;
}

/* ===== Aside (left) ===== */
.content-aside {
  width: 200px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  min-height: 100%;
  border-right: 3px solid var(--c-ink);
  background: var(--c-ink);
  color: var(--c-cream);
  align-self: stretch;
}

.aside-inner {
  padding: 32px 16px 32px;
  position: sticky;
  top: 0;
}

.aside-eyebrow {
  display: block;
  font-family: var(--font-main);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-red);
  margin-bottom: 16px;
}

.aside-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.aside-link {
  display: block;
  font-family: var(--font-main);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--c-cream);
  text-decoration: none;
  padding: 8px 10px;
  border-left: 2px solid transparent;
  letter-spacing: 0.02em;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: border-color var(--transition), color var(--transition);
}

.aside-link:hover,
.aside-link:focus-visible {
  border-left-color: var(--c-red);
  color: var(--c-red);
  outline: none;
}

/* ===== Content Body ===== */
.content-body {
  flex: 1;
  min-width: 0;
  padding: 56px 6vw 80px;
}

/* Content section styling from page.content */
.content-body section {
  scroll-margin-top: 80px;
  margin-bottom: 80px;
  padding-bottom: 60px;
  border-bottom: 3px solid var(--c-ink);
}

.content-body section:last-child {
  border-bottom: none;
}

.content-body h2 {
  font-family: var(--font-main);
  font-size: clamp(1.6rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--c-ink);
  margin-bottom: 1.2rem;
  margin-top: 2rem;
}

.content-body h3 {
  font-family: var(--font-main);
  font-size: clamp(1.1rem, 2.5vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--c-ink);
  margin-bottom: 1rem;
  margin-top: 2rem;
}

.content-body p {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--c-ink);
  margin-bottom: 1.2rem;
  max-width: 72ch;
}

.content-body ul,
.content-body ol {
  padding-left: 1.4em;
  margin-bottom: 1.2rem;
}

.content-body li {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--c-ink);
  margin-bottom: 0.4rem;
}

.content-body a {
  color: var(--c-red);
  font-weight: 700;
  text-underline-offset: 3px;
}

.content-body a:hover {
  opacity: 0.75;
}

.content-body strong {
  font-weight: 700;
  color: var(--c-ink);
}

.content-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.content-body th,
.content-body td {
  border: 2px solid var(--c-ink);
  padding: 10px 14px;
  text-align: left;
}

.content-body th {
  background: var(--c-ink);
  color: var(--c-cream);
  font-weight: 700;
}

/* ===== Scroll Reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1), transform 0.6s cubic-bezier(0.16,1,0.3,1);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.16,1,0.3,1), transform 0.5s cubic-bezier(0.16,1,0.3,1);
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0s; opacity: 1; transform: none; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.08s; opacity: 1; transform: none; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.16s; opacity: 1; transform: none; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.24s; opacity: 1; transform: none; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.32s; opacity: 1; transform: none; }
.reveal-stagger.visible > *:nth-child(n+6) { transition-delay: 0.4s; opacity: 1; transform: none; }

/* ===== Footer ===== */
.site-footer {
  background: var(--c-ink);
  color: var(--c-cream);
  border-top: 4px solid var(--c-red);
}

.footer-cta {
  background: var(--c-red);
  color: var(--c-cream);
  padding: 72px 8vw 64px;
  text-align: left;
}

.footer-eyebrow {
  display: block;
  font-family: var(--font-main);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-cream);
  opacity: 0.75;
  margin-bottom: 16px;
}

.footer-cta-title {
  font-family: var(--font-main);
  font-size: clamp(2rem, 6vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.0;
  color: var(--c-cream);
  margin-bottom: 1rem;
}

.footer-cta-desc {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--c-cream);
  opacity: 0.85;
  max-width: 500px;
  margin-bottom: 2rem;
}

.cta-btn {
  display: inline-block;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-red);
  background: var(--c-cream);
  padding: 14px 36px;
  text-decoration: none;
  border: 3px solid var(--c-cream);
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  transition: background var(--transition), color var(--transition);
}

.cta-btn:hover,
.cta-btn:focus-visible {
  background: var(--c-ink);
  color: var(--c-cream);
  border-color: var(--c-ink);
  outline: none;
}

.footer-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-bottom: 2px solid rgba(245,240,232,0.12);
}

.footer-col {
  padding: 48px 40px 48px;
  border-right: 2px solid rgba(245,240,232,0.12);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col:last-child {
  border-right: none;
}

.footer-col-title {
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-red);
  display: block;
  margin-bottom: 8px;
}

.footer-col-desc {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--c-cream);
  opacity: 0.65;
}

.footer-link {
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--c-cream);
  text-decoration: none;
  opacity: 0.65;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: opacity var(--transition), color var(--transition);
}

.footer-link:hover,
.footer-link:focus-visible {
  opacity: 1;
  color: var(--c-red);
  outline: none;
}

.footer-bottom {
  padding: 28px 8vw;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--c-cream);
  opacity: 0.5;
  font-weight: 700;
}

.footer-note {
  font-size: 0.78rem;
  color: var(--c-cream);
  opacity: 0.35;
}

/* ===== Small eyebrow adjacent to h2/h3 in content ===== */
.content-body small {
  display: block;
  font-family: var(--font-main);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-red);
  margin-bottom: 8px;
}

/* ===== Kinetic subtitle glitch-scan decoration ===== */
@keyframes scanline {
  0% { background-position: 0 0; }
  100% { background-position: 0 100vh; }
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(245,240,232,0.015) 3px,
    rgba(245,240,232,0.015) 4px
  );
  pointer-events: none;
  z-index: 0;
  animation: scanline 12s linear infinite;
}

/* ===== Focus visible global ===== */
:focus-visible {
  outline: 2px solid var(--c-red);
  outline-offset: 2px;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  :root {
    --nav-w: 0px;
  }

  .sidenav {
    width: 100%;
    height: auto;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    border-right: none;
    border-bottom: 3px solid var(--c-ink);
    z-index: 200;
    background: var(--c-cream);
    flex-direction: column;
  }

  .sidenav summary {
    display: flex;
    width: 100%;
    flex-direction: row;
    justify-content: flex-end;
    padding: 14px 20px;
    gap: 5px;
    align-items: center;
    min-height: 52px;
    border-bottom: 2px solid rgba(26,26,26,0.12);
  }

  .sidenav summary .toggle-bar {
    width: 22px;
  }

  .sidenav-menu {
    display: none;
  }

  .sidenav[open] .sidenav-menu {
    display: flex;
    flex-direction: column;
    max-height: 70vh;
    overflow-y: auto;
  }

  .page-main {
    margin-left: 0;
    margin-top: 52px;
  }

  .hero-section {
    min-height: 100svh;
    min-height: 100vh;
  }

  .hero-article {
    padding: 8vh 24px 6vh;
  }

  .content-article {
    flex-direction: column;
  }

  .content-aside {
    width: 100%;
    position: relative;
    border-right: none;
    border-bottom: 3px solid var(--c-ink);
    align-self: auto;
  }

  .aside-inner {
    padding: 20px 20px;
    position: static;
  }

  .aside-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }

  .aside-link {
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 6px 10px;
    min-height: 40px;
    font-size: 0.72rem;
  }

  .aside-link:hover {
    border-bottom-color: var(--c-red);
    border-left-color: transparent;
  }

  .content-body {
    padding: 36px 24px 60px;
  }

  .footer-info {
    grid-template-columns: 1fr;
  }

  .footer-col {
    border-right: none;
    border-bottom: 2px solid rgba(245,240,232,0.12);
    padding: 32px 24px;
  }

  .footer-col:last-child {
    border-bottom: none;
  }

  .footer-cta {
    padding: 48px 24px 40px;
  }
}

@media (max-width: 480px) {
  .hero-h1 {
    font-size: clamp(2.4rem, 13vw, 3.5rem);
  }

  .content-body h2 {
    font-size: clamp(1.4rem, 7vw, 2rem);
  }

  .footer-cta-title {
    font-size: clamp(1.8rem, 10vw, 3rem);
  }
}

/* ===== Scroll margin for sections ===== */
section[id] {
  scroll-margin-top: 56px;
}

@media (min-width: 901px) {
  section[id] {
    scroll-margin-top: 24px;
  }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
  .reveal, .reveal-stagger > * {
    opacity: 1 !important;
    transform: none !important;
  }
}
