:root {
  --bordeaux: #6b1f2a;
  --bordeaux-deep: #4a1520;
  --bordeaux-soft: #8a3a45;
  --vine: #2f5d3a;
  --vine-soft: #4a7a55;
  --oak: #b08d57;
  --oak-soft: #d4bc8a;
  --stone: #eef1ee;
  --mist: #d8e0da;
  --ink: #1c2420;
  --ink-muted: #5a6b62;
  --paper: #f7f8f5;
  --white: #ffffff;

  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, sans-serif;

  --space: clamp(1.25rem, 3vw, 2.5rem);
  --max: 72rem;
  --header-h: 4.25rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.skip-link {
  position: absolute;
  left: var(--space);
  top: -100px;
  z-index: 100;
  padding: 0.65rem 1rem;
  border-radius: 0.45rem;
  background: var(--bordeaux);
  color: var(--white);
  font-weight: 600;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0.75rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  color: var(--bordeaux);
  background: color-mix(in srgb, var(--bordeaux) 8%, transparent);
  padding: 0.15em 0.4em;
  border-radius: 0.3em;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Header */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header-h);
  padding: 0 var(--space);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), color 0.3s ease;
  color: rgba(255, 255, 255, 0.82);
}

.site-header .brand-mark {
  color: var(--white);
}

.site-header .nav a:hover {
  color: var(--white);
}

.site-header.is-scrolled {
  color: var(--ink-muted);
  border-bottom-color: color-mix(in srgb, var(--ink) 8%, transparent);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(14px);
}

.site-header.is-scrolled .brand-mark {
  color: var(--bordeaux);
}

.site-header.is-scrolled .nav a:hover {
  color: var(--bordeaux);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--bordeaux);
  transition: color 0.3s ease;
}

.brand-icon {
  width: 1.7rem;
  height: 1.7rem;
  color: var(--bordeaux);
}

.nav {
  display: none;
  gap: 1.6rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.nav a {
  transition: color 0.2s ease;
}

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

.header-cta {
  display: none;
}

@media (min-width: 840px) {
  .nav {
    display: flex;
  }

  .header-cta {
    display: inline-flex;
  }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 1.35rem;
  border-radius: 0.55rem;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-sm {
  min-height: 2.4rem;
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
}

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

.btn-primary:hover {
  background: var(--bordeaux-deep);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ink) 18%, transparent);
}

.btn-ghost:hover {
  border-color: var(--bordeaux);
  color: var(--bordeaux);
}

.section-contact .btn-ghost {
  color: var(--oak-soft);
  border-color: color-mix(in srgb, var(--oak-soft) 45%, transparent);
}

.section-contact .btn-ghost:hover {
  color: var(--white);
  border-color: var(--white);
}

/* Hero */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  overflow: hidden;
  color: var(--white);
}

.hero-visual {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 70% 15%, rgba(176, 141, 87, 0.28), transparent 55%),
    linear-gradient(160deg, #3a1018 0%, var(--bordeaux) 38%, #1f3a28 100%);
}

.hero-sky {
  position: absolute;
  inset: 0 0 42%;
  background:
    radial-gradient(ellipse 50% 40% at 20% 30%, rgba(255, 220, 170, 0.18), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 70%);
}

.hero-vines {
  position: absolute;
  inset: auto 0 0;
  height: 58%;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: clamp(0.5rem, 2vw, 1.5rem);
  padding: 0 4vw 0;
  mask-image: linear-gradient(180deg, transparent, #000 25%);
}

.hero-vines span {
  display: block;
  width: 100%;
  border-radius: 999px 999px 0 0;
  background:
    linear-gradient(180deg, rgba(74, 122, 85, 0.15), transparent 30%),
    repeating-linear-gradient(
      90deg,
      transparent 0 42%,
      rgba(47, 93, 58, 0.55) 42% 58%,
      transparent 58% 100%
    ),
    linear-gradient(180deg, var(--vine-soft), var(--vine) 55%, #1a3522);
  transform-origin: bottom center;
  animation: vine-rise 1.4s var(--ease) both;
}

.hero-vines span:nth-child(1) { height: 62%; animation-delay: 0.05s; }
.hero-vines span:nth-child(2) { height: 78%; animation-delay: 0.12s; }
.hero-vines span:nth-child(3) { height: 92%; animation-delay: 0.18s; }
.hero-vines span:nth-child(4) { height: 100%; animation-delay: 0.24s; }
.hero-vines span:nth-child(5) { height: 86%; animation-delay: 0.3s; }
.hero-vines span:nth-child(6) { height: 70%; animation-delay: 0.36s; }
.hero-vines span:nth-child(7) { height: 58%; animation-delay: 0.42s; }

@keyframes vine-rise {
  from {
    transform: scaleY(0.55);
    opacity: 0.4;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

.hero-haze {
  position: absolute;
  inset: auto 0 0;
  height: 38%;
  background: linear-gradient(180deg, transparent, rgba(26, 18, 20, 0.55) 45%, rgba(18, 12, 14, 0.72));
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(100% - 2 * var(--space), var(--max));
  margin: 0 auto;
  padding: calc(var(--header-h) + 1.5rem) 0 clamp(5rem, 14vh, 8rem);
}

.hero-brand {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7.2vw, 5.25rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.hero-title {
  margin: 0 0 0.9rem;
  max-width: 14ch;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3.8vw, 2.65rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--oak-soft);
}

.hero-lede {
  margin: 0 0 1.75rem;
  max-width: 36rem;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: rgba(255, 255, 255, 0.88);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero .btn-ghost {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.35);
}

.hero .btn-ghost:hover {
  border-color: var(--white);
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.hero .btn-primary {
  background: var(--oak);
  color: var(--bordeaux-deep);
}

.hero .btn-primary:hover {
  background: var(--oak-soft);
}

/* Sections */

.section {
  padding: clamp(4.5rem, 10vw, 7.5rem) 0;
}

.section-inner {
  width: min(100% - 2 * var(--space), var(--max));
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--vine);
}

.section-title {
  margin: 0 0 1rem;
  max-width: 16ch;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.4vw, 3.25rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--bordeaux-deep);
}

.section-lede {
  margin: 0 0 2.5rem;
  max-width: 40rem;
  color: var(--ink-muted);
  font-size: 1.08rem;
}

/* Chain */

.section-pitch {
  background:
    linear-gradient(180deg, var(--paper), var(--stone));
}

.chain {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1.5rem;
  counter-reset: none;
}

@media (min-width: 900px) {
  .chain {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.chain-step {
  display: grid;
  gap: 0.35rem;
  padding-top: 1rem;
  border-top: 2px solid color-mix(in srgb, var(--bordeaux) 55%, var(--mist));
}

.chain-index {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--oak);
}

.chain-step strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.chain-step span:last-child {
  color: var(--ink-muted);
  font-size: 0.95rem;
}

/* Modules — interaction containers, lightly bordered for scanability */

.section-modules {
  background: var(--white);
}

.module-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
}

@media (min-width: 720px) {
  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1040px) {
  .module-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.module {
  padding: 1.5rem 1.25rem 1.5rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
}

@media (min-width: 720px) {
  .module:nth-child(odd) {
    padding-right: 1.75rem;
    border-right: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  }

  .module:nth-child(even) {
    padding-left: 1.75rem;
  }
}

@media (min-width: 1040px) {
  .module {
    padding: 1.6rem 1.5rem 1.6rem 0;
    border-right: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  }

  .module:nth-child(3n) {
    border-right: none;
    padding-right: 0;
  }

  .module:nth-child(3n + 1) {
    padding-left: 0;
  }

  .module:nth-child(3n + 2),
  .module:nth-child(3n) {
    padding-left: 1.5rem;
  }
}

.module h3 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--bordeaux);
}

.module p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.98rem;
}

/* Traceability */

.section-trace {
  background:
    radial-gradient(ellipse 70% 50% at 85% 20%, rgba(176, 141, 87, 0.12), transparent 55%),
    linear-gradient(160deg, #1f2a24 0%, #152018 55%, #2a151a 100%);
  color: var(--mist);
}

.section-trace .eyebrow {
  color: var(--oak-soft);
}

.section-trace .section-title {
  color: var(--white);
  max-width: 14ch;
}

.section-trace .section-lede {
  color: color-mix(in srgb, var(--mist) 82%, transparent);
}

.trace-layout {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 920px) {
  .trace-layout {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 3.5rem;
  }
}

.trace-note {
  margin: -1rem 0 0;
  color: color-mix(in srgb, var(--mist) 70%, transparent);
  font-size: 0.95rem;
}

.trace-note code {
  color: var(--oak-soft);
  background: rgba(176, 141, 87, 0.15);
}

.trace-panel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.25rem;
  padding: 1.35rem 1.35rem 0.5rem;
  backdrop-filter: blur(8px);
}

.trace-lookup {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.trace-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--oak-soft);
}

.trace-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.04em;
}

.trace-chain {
  list-style: none;
  margin: 0;
  padding: 0;
}

.trace-chain li {
  display: grid;
  gap: 0.15rem;
  padding: 0.9rem 0 0.9rem 1.1rem;
  border-left: 2px solid rgba(176, 141, 87, 0.35);
  opacity: 0.45;
  transform: translateX(8px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease), border-color 0.45s ease;
}

.trace-chain li.is-active {
  opacity: 1;
  transform: translateX(0);
  border-left-color: var(--oak);
}

.trace-chain li span {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--oak-soft);
}

.trace-chain li strong {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--white);
}

/* Floor */

.section-floor {
  background: var(--stone);
}

.floor-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.75rem;
}

@media (min-width: 800px) {
  .floor-points {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 2.5rem;
  }
}

.floor-points li {
  display: grid;
  gap: 0.4rem;
  padding-left: 1.1rem;
  border-left: 3px solid var(--vine);
}

.floor-points strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--bordeaux-deep);
}

.floor-points span {
  color: var(--ink-muted);
}

/* Contact */

.section-contact {
  background:
    linear-gradient(145deg, var(--bordeaux-deep), var(--bordeaux) 55%, #2a3d30);
  color: var(--white);
}

.section-contact .eyebrow {
  color: var(--oak-soft);
}

.section-contact .section-title {
  color: var(--white);
  max-width: 18ch;
}

.section-contact .section-lede {
  color: rgba(255, 255, 255, 0.82);
}

.contact-panel {
  max-width: 40rem;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.section-contact .btn-primary {
  background: var(--oak);
  color: var(--bordeaux-deep);
}

.section-contact .btn-primary:hover {
  background: var(--oak-soft);
}

.contact-meta {
  margin: 0;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.62);
}

/* Footer */

.site-footer {
  background: #120e10;
  color: rgba(255, 255, 255, 0.55);
  padding: 1.5rem var(--space);
}

.footer-inner {
  width: min(100%, var(--max));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.9rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--white);
}

.footer-tag {
  color: var(--oak);
}

.footer-address {
  width: min(100%, var(--max));
  margin: 0.85rem auto 0;
  font-style: normal;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.42);
}

.footer-address a:hover {
  color: var(--oak-soft);
}

/* Reveal */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal,
  .hero-vines span,
  .trace-chain li {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
}
