/* ==========================================================================
   MITO GREEN — Design System
   Biomass · Biochar · Carbon Solutions
   --------------------------------------------------------------------------
   Built on the official brand identity:
     Serif  — Playfair Display   (display / editorial headlines)
     Sans   — Be Vietnam Pro     (body / UI)
     Mono   — IBM Plex Mono      (eyebrows / technical labels)
   ========================================================================== */

/* ----- Tokens ------------------------------------------------------------ */
:root {
  /* Brand greens */
  --forest: #1a3828;
  --canopy: #2e6b44;
  --leaf: #4c9962;
  --sprout: #6dd67a;

  /* Neutrals */
  --carbon: #111b16;
  --slate: #334d3e;
  --mist: #a8c4b0;
  --fog: #d4e6da;
  --parchment: #f2f7f4;
  --chalk: #f5f0e8;
  --white: #ffffff;

  /* Accents */
  --gold: #c8891a;
  --amber: #e8a020;

  /* Semantic */
  --bg: var(--white);
  --bg-alt: var(--parchment);
  --ink: var(--carbon);
  --ink-soft: rgba(17, 27, 22, 0.62);
  --ink-faint: rgba(17, 27, 22, 0.42);
  --line: rgba(17, 27, 22, 0.1);
  --line-strong: rgba(17, 27, 22, 0.16);

  /* Fonts */
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Be Vietnam Pro", "Inter", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

  /* Fluid type scale */
  --fs-display: clamp(3.1rem, 8.5vw, 7.5rem);
  --fs-h1: clamp(2.5rem, 5.6vw, 4.75rem);
  --fs-h2: clamp(2rem, 4.2vw, 3.4rem);
  --fs-h3: clamp(1.45rem, 2.6vw, 2.05rem);
  --fs-h4: clamp(1.18rem, 1.7vw, 1.4rem);
  --fs-lead: clamp(1.12rem, 1.55vw, 1.4rem);
  --fs-body: clamp(1rem, 1.05vw, 1.08rem);
  --fs-sm: 0.875rem;
  --fs-eyebrow: 0.7rem;

  /* Spacing / layout */
  --container: 1280px;
  --container-wide: 1480px;
  --container-narrow: 880px;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --section-y: clamp(5rem, 11vw, 9.5rem);
  --radius: 4px;
  --radius-lg: 10px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 0.6s;

  /* Elevation */
  --shadow-sm: 0 2px 10px rgba(17, 27, 22, 0.06);
  --shadow-md: 0 14px 40px -12px rgba(17, 27, 22, 0.18);
  --shadow-lg: 0 40px 80px -24px rgba(17, 27, 22, 0.32);

  --header-h: 78px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--canopy);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--sprout);
  color: var(--carbon);
}

/* ----- Typography -------------------------------------------------------- */
h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.display {
  font-family: var(--serif);
  font-weight: 700;
  font-size: var(--fs-display);
  line-height: 0.96;
  letter-spacing: -0.025em;
}

h1,
.h1 {
  font-size: var(--fs-h1);
}
h2,
.h2 {
  font-size: var(--fs-h2);
}
h3,
.h3 {
  font-size: var(--fs-h3);
  line-height: 1.12;
}
h4,
.h4 {
  font-size: var(--fs-h4);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

em,
.italic {
  font-style: italic;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--ink-soft);
  font-weight: 300;
}

p {
  max-width: 68ch;
}

strong {
  font-weight: 600;
}

/* Eyebrow / mono label */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  font-family: var(--mono);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--canopy);
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}
.eyebrow.is-centered {
  justify-content: center;
}

.mono {
  font-family: var(--mono);
  letter-spacing: 0.04em;
}

/* ----- Layout primitives ------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide {
  max-width: var(--container-wide);
}
.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  padding-block: var(--section-y);
}
.section--tight {
  padding-block: clamp(3.5rem, 7vw, 6rem);
}
.section--flush-top {
  padding-top: 0;
}

.bg-alt {
  background: var(--bg-alt);
}
.bg-chalk {
  background: var(--chalk);
}

/* Dark sections */
.section--dark,
.bg-dark {
  background: var(--carbon);
  color: rgba(255, 255, 255, 0.86);
}
.section--forest {
  background: var(--forest);
  color: rgba(255, 255, 255, 0.86);
}
.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--forest h1,
.section--forest h2,
.section--forest h3,
.section--forest h4 {
  color: var(--white);
}
.section--dark .eyebrow,
.section--forest .eyebrow {
  color: var(--sprout);
}
.section--dark .lead,
.section--forest .lead {
  color: rgba(255, 255, 255, 0.66);
}

/* Section header block */
.section-head {
  max-width: 760px;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.section-head .eyebrow {
  margin-bottom: 1.4rem;
}
.section-head p {
  margin-top: 1.5rem;
}
.section-head.is-centered {
  margin-inline: auto;
  text-align: center;
}

/* Grid helpers */
.grid {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}
.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}
.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.flow > * + * {
  margin-top: 1.15em;
}

/* ----- Buttons ----------------------------------------------------------- */
.btn {
  --btn-bg: var(--forest);
  --btn-fg: var(--white);
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  padding: 1.05em 1.8em;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-radius: 100px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease), color var(--dur) var(--ease);
  will-change: transform;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--canopy);
  transform: translateY(101%);
  transition: transform var(--dur) var(--ease);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn:hover::after {
  transform: translateY(0);
}
.btn .btn-arrow {
  transition: transform 0.45s var(--ease);
}
.btn:hover .btn-arrow {
  transform: translateX(4px);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn--ghost::after {
  background: var(--forest);
}
.btn--ghost:hover {
  color: var(--white);
  border-color: var(--forest);
}

.btn--light {
  --btn-bg: var(--white);
  --btn-fg: var(--forest);
}
.btn--light::after {
  background: var(--sprout);
}
.btn--light:hover {
  color: var(--forest);
}

.btn--on-dark.btn--ghost {
  --btn-fg: var(--white);
  border-color: rgba(255, 255, 255, 0.3);
}
.btn--on-dark.btn--ghost::after {
  background: var(--white);
}
.btn--on-dark.btn--ghost:hover {
  color: var(--forest);
  border-color: var(--white);
}

/* Inline arrow link */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--canopy);
  padding-bottom: 3px;
  position: relative;
}
.link-arrow::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
}
.link-arrow:hover::after {
  transform: scaleX(1);
}
.link-arrow svg {
  transition: transform 0.45s var(--ease);
}
.link-arrow:hover svg {
  transform: translateX(4px);
}
.section--dark .link-arrow,
.section--forest .link-arrow {
  color: var(--sprout);
}

/* ----- Header / Nav ------------------------------------------------------ */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease), height var(--dur) var(--ease);
}
.site-header__inner {
  width: 100%;
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  z-index: 2;
}
.brand__mark {
  width: 30px;
  height: 38px;
  object-fit: contain;
  transition: filter var(--dur) var(--ease);
}
.brand__type {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.brand__name {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  transition: color var(--dur) var(--ease);
}
.brand__tag {
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 3px;
  transition: color var(--dur) var(--ease);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1.2rem, 2vw, 2.2rem);
}
.nav__link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  padding-block: 0.4rem;
  transition: color 0.35s var(--ease);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1.5px;
  background: var(--canopy);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}
.nav__link:hover,
.nav__link[aria-current="page"] {
  color: var(--ink);
}
.nav__link:hover::after,
.nav__link[aria-current="page"]::after {
  transform: scaleX(1);
}
.nav__cta {
  margin-left: 0.6rem;
  padding: 0.7em 1.3em;
  font-size: 0.85rem;
}

/* Transparent over-hero state */
.site-header.is-transparent {
  background: transparent;
}
.site-header.is-transparent .brand__name {
  color: var(--white);
}
.site-header.is-transparent .brand__tag {
  color: rgba(255, 255, 255, 0.55);
}
.site-header.is-transparent .brand__mark {
  filter: brightness(1.35) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4))
    drop-shadow(0 0 6px rgba(109, 214, 122, 0.25));
}
.site-header.is-transparent .nav__link {
  color: rgba(255, 255, 255, 0.78);
}
.site-header.is-transparent .nav__link:hover,
.site-header.is-transparent .nav__link[aria-current="page"] {
  color: var(--white);
}
.site-header.is-transparent .nav__link::after {
  background: var(--sprout);
}
.site-header.is-transparent .nav__cta {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(6px);
}
.site-header.is-transparent .nav__cta::after {
  background: var(--white);
}
.site-header.is-transparent .nav__cta:hover {
  color: var(--forest);
}
.site-header.is-transparent .nav__toggle span {
  background: var(--white);
}

/* Scrolled state */
.site-header.is-scrolled {
  height: 66px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 1px 0 var(--line), 0 8px 30px -18px rgba(17, 27, 22, 0.25);
}

/* Mobile toggle */
.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 30px;
  height: 30px;
  z-index: 2;
}
.nav__toggle span {
  display: block;
  height: 1.5px;
  width: 24px;
  background: var(--ink);
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
}

/* ----- Footer ------------------------------------------------------------ */
.site-footer {
  background: var(--carbon);
  color: rgba(255, 255, 255, 0.6);
  padding-top: clamp(4rem, 8vw, 7rem);
  position: relative;
  overflow: hidden;
}
.site-footer__glow {
  position: absolute;
  width: 700px;
  height: 700px;
  top: -350px;
  right: -150px;
  background: radial-gradient(
    circle,
    rgba(46, 107, 68, 0.28) 0%,
    transparent 65%
  );
  pointer-events: none;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
  position: relative;
}
.footer-brand .brand__name {
  color: var(--white);
}
.footer-brand .brand__tag {
  color: rgba(255, 255, 255, 0.4);
}
.footer-brand .brand__mark {
  filter: brightness(1.3) drop-shadow(0 0 8px rgba(109, 214, 122, 0.3));
}
.footer-brand p {
  margin-top: 1.4rem;
  max-width: 34ch;
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.55);
}
.footer-col h5 {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sprout);
  margin-bottom: 1.5rem;
}
.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.footer-col a,
.footer-col address {
  font-size: 0.92rem;
  font-style: normal;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.35s var(--ease);
}
.footer-col a:hover {
  color: var(--white);
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-block: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.4);
}
.footer-bottom a:hover {
  color: var(--white);
}

/* ----- Custom cursor ----------------------------------------------------- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  will-change: transform;
}
.cursor-dot {
  width: 6px;
  height: 6px;
  background: #fff;
  transform: translate(-50%, -50%);
}
.cursor-ring {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease), height 0.3s var(--ease),
    border-color 0.3s var(--ease), opacity 0.3s var(--ease);
}
.cursor-ring.is-hover {
  width: 64px;
  height: 64px;
  border-color: rgba(255, 255, 255, 0.9);
}
.cursor-ring.is-down {
  width: 30px;
  height: 30px;
}
body.has-cursor {
  cursor: none;
}
body.has-cursor a,
body.has-cursor button {
  cursor: none;
}

/* ----- Scroll reveal ----------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}
.reveal-img {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.1s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}
.reveal-img.is-in {
  clip-path: inset(0 0 0 0);
}

/* ----- Media frames ------------------------------------------------------ */
.media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--fog);
}
.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media--zoom img {
  transition: transform 1.2s var(--ease);
}
.media--zoom:hover img {
  transform: scale(1.05);
}
.media[data-parallax] img {
  width: 100%;
  height: 116%;
  will-change: transform;
}
.aspect-square {
  aspect-ratio: 1 / 1;
}
.aspect-4-3 {
  aspect-ratio: 4 / 3;
}
.aspect-3-4 {
  aspect-ratio: 3 / 4;
}
.aspect-16-9 {
  aspect-ratio: 16 / 9;
}
.aspect-3-2 {
  aspect-ratio: 3 / 2;
}

.tag-float {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
  background: rgba(17, 27, 22, 0.55);
  backdrop-filter: blur(6px);
  padding: 0.5em 0.9em;
  border-radius: 100px;
}

/* ----- Utilities --------------------------------------------------------- */
.text-center {
  text-align: center;
}
.mx-auto {
  margin-inline: auto;
}
.maxw-narrow {
  max-width: 56ch;
}
.accent {
  color: var(--canopy);
}
.section--dark .accent,
.section--forest .accent {
  color: var(--sprout);
}
.serif {
  font-family: var(--serif);
}
.hairline {
  height: 1px;
  background: var(--line);
  border: 0;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 2000;
  background: var(--forest);
  color: #fff;
  padding: 0.7em 1.2em;
  border-radius: var(--radius);
  transition: top 0.3s var(--ease);
}
.skip-link:focus {
  top: 1rem;
}

/* ----- Reduced motion ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal,
  .reveal-img {
    opacity: 1;
    transform: none;
    clip-path: none;
  }
  .cursor-dot,
  .cursor-ring {
    display: none;
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1080px) {
  :root {
    --header-h: 66px;
  }
  .nav {
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0.4rem;
    padding: var(--gutter);
    padding-top: calc(var(--header-h) + 2rem);
    background: var(--forest);
    transform: translateX(100%);
    transition: transform 0.55s var(--ease);
    z-index: 1;
  }
  .nav.is-open {
    transform: translateX(0);
  }
  .nav__link {
    font-family: var(--serif);
    font-size: clamp(1.8rem, 7vw, 2.6rem);
    color: rgba(255, 255, 255, 0.8);
    padding-block: 0.35rem;
  }
  .nav__link::after {
    background: var(--sprout);
  }
  .nav__link:hover,
  .nav__link[aria-current="page"] {
    color: var(--white);
  }
  .nav__cta {
    margin-left: 0;
    margin-top: 1.5rem;
    font-size: 1rem;
    background: var(--sprout) !important;
    color: var(--forest) !important;
    border: none !important;
  }
  .nav__toggle {
    display: flex;
  }
  .site-header.is-transparent .nav__link,
  .site-header.is-scrolled .nav__link {
    color: rgba(255, 255, 255, 0.8);
  }
  body.nav-open .nav__toggle span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
  }
  body.nav-open .nav__toggle span:nth-child(2) {
    opacity: 0;
  }
  body.nav-open .nav__toggle span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
  }
  body.nav-open .site-header .nav__toggle span,
  body.nav-open .site-header.is-transparent .nav__toggle span {
    background: var(--white);
  }
  body.nav-open {
    overflow: hidden;
  }
}

@media (max-width: 720px) {
  .cols-2,
  .cols-3,
  .cols-4 {
    grid-template-columns: 1fr;
  }
  .cols-3.keep-2-mobile,
  .cols-4.keep-2-mobile {
    grid-template-columns: 1fr 1fr;
  }
  p {
    max-width: none;
  }
}

/* Hide custom cursor on touch / coarse pointers */
@media (hover: none), (pointer: coarse) {
  .cursor-dot,
  .cursor-ring {
    display: none !important;
  }
  body.has-cursor,
  body.has-cursor a,
  body.has-cursor button {
    cursor: auto;
  }
}
