/* ===== Tokens ===== */
:root {
  --green: #24c46a;
  --green-deep: #0f8f47;
  --mint: #8ff5bd;
  --ink: #0c1712;
  --ink-2: #14241c;
  --ink-3: #1b2f25;
  --paper: #f0f7f2;
  --paper-dim: #9fb8ab;
  --amber: #ffc247;

  --font-display: "Archivo", "Helvetica Neue", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;

  --wrap: 1060px;
  --header-h: 68px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  line-height: 1.65;
  overflow-x: hidden;
}

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

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--green);
  color: var(--ink);
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip:focus { left: 0; }

/* ===== Header ===== */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 50;
  background: rgba(12, 23, 18, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(143, 245, 189, 0.12);
  transition: background 0.3s ease;
}

.header__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--paper);
  text-decoration: none;
}

.brand__mark {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(36, 196, 106, 0.6);
  animation: pulse 2.6s ease-out infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(36, 196, 106, 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(36, 196, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(36, 196, 106, 0); }
}

.nav {
  display: flex;
  gap: 1.8rem;
}

.nav a {
  position: relative;
  color: var(--paper-dim);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 4px 0;
  transition: color 0.2s ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.28s cubic-bezier(0.65, 0, 0.35, 1);
}

.nav a:hover { color: var(--paper); }
.nav a:hover::after,
.nav a.is-active::after { transform: scaleX(1); transform-origin: left; }
.nav a.is-active { color: var(--paper); }

.header__bar {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--green-deep), var(--mint));
}

.burger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
}
.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--paper);
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobilenav {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  z-index: 49;
  background: var(--ink-2);
  border-bottom: 1px solid rgba(143, 245, 189, 0.14);
  display: none;
  flex-direction: column;
  padding: 0.5rem 1.5rem 1rem;
}
.mobilenav a {
  color: var(--paper);
  text-decoration: none;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(143, 245, 189, 0.08);
  font-weight: 500;
}
.mobilenav a:last-child { border-bottom: 0; }

@media (max-width: 720px) {
  .nav { display: none; }
  .burger { display: flex; }
  .mobilenav:not([hidden]) { display: flex; }
}

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: calc(var(--header-h) + 5rem) 0 4rem;
  overflow: hidden;
}

.hero__glow {
  position: absolute;
  top: -30%;
  left: 50%;
  width: 900px;
  height: 900px;
  max-width: 140vw;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 35% 40%, rgba(36, 196, 106, 0.28), transparent 60%),
    radial-gradient(circle at 65% 55%, rgba(143, 245, 189, 0.16), transparent 62%);
  filter: blur(20px);
  animation: drift 16s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes drift {
  from { transform: translateX(-50%) translateY(0) scale(1); }
  to   { transform: translateX(-46%) translateY(40px) scale(1.08); }
}

.hero__inner { position: relative; }

.hero__kicker {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  color: var(--mint);
  margin: 0 0 1rem;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.6rem, 8vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0;
}

.hero__title > span { display: block; }

.hero__name {
  background: linear-gradient(96deg, var(--green) 0%, var(--mint) 55%, var(--green) 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 7s linear infinite;
}

@keyframes shine {
  to { background-position: 220% center; }
}

/* Name swap: letters cascade out upwards, the new ones roll in from below,
   while the container width eases to the new word's length. */
.hero__title .hero__name {
  display: inline-block;
  position: relative;
  white-space: nowrap;
  vertical-align: top;
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s;
}

.hero__name-word {
  display: inline-block;
  white-space: nowrap;
  perspective: 700px;
}

.hero__name-word.is-out {
  position: absolute;
  left: 0;
  top: 0;
}

/* The gradient lives on each letter: a transformed child cannot inherit the
   parent's background-clip, so the letters would render invisible otherwise. */
.hero__name-char {
  display: inline-block;
  transform-origin: 50% 100%;
  background: linear-gradient(96deg, var(--green) 0%, var(--mint) 55%, var(--green) 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: charIn 0.5s cubic-bezier(0.2, 0.85, 0.25, 1) backwards, shine 7s linear infinite;
  /* Let the outgoing word clear out first, then cascade in. */
  animation-delay: calc(260ms + var(--i) * 34ms);
}

/* No hand-off on first paint — the name should just be there. */
.hero__name-word.is-first .hero__name-char {
  animation-delay: calc(var(--i) * 34ms);
}

.is-out .hero__name-char {
  animation: charOut 0.34s cubic-bezier(0.5, 0, 0.75, 0) forwards, shine 7s linear infinite;
  animation-delay: calc(var(--i) * 20ms);
}

@keyframes charIn {
  from { opacity: 0; transform: translateY(0.55em) rotateX(-75deg); }
  to   { opacity: 1; transform: none; }
}

@keyframes charOut {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(-0.55em) rotateX(75deg); }
}

.hero__sub {
  margin: 1.4rem 0 0;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  color: var(--paper-dim);
}

.rotator {
  display: inline-block;
  position: relative;
  color: var(--paper);
  font-weight: 600;
}
.rotator::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--green);
  opacity: 0.8;
}
.rotator__word {
  display: inline-block;
  animation: wordIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes wordIn {
  from { opacity: 0; transform: translateY(0.5em) rotate(3deg); }
  to   { opacity: 1; transform: none; }
}

.hero__actions {
  margin-top: 2.2rem;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  border: 1px solid rgba(143, 245, 189, 0.35);
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn:hover {
  transform: translateY(-2px);
  border-color: var(--mint);
  background: rgba(36, 196, 106, 0.12);
}
.btn--solid {
  background: var(--green);
  border-color: var(--green);
  color: var(--ink);
}
.btn--solid:hover {
  background: var(--mint);
  border-color: var(--mint);
  color: var(--ink);
}

/* ===== Marquee ===== */
.marquee {
  border-top: 1px solid rgba(143, 245, 189, 0.14);
  border-bottom: 1px solid rgba(143, 245, 189, 0.14);
  background: var(--ink-2);
  overflow: hidden;
  padding: 0.8rem 0;
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: scrollx 30s linear infinite;
}
.marquee__group {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  padding-right: 1.6rem;
  flex: none;
}
.marquee__track span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--paper-dim);
  white-space: nowrap;
}
.marquee__track i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}
@keyframes scrollx {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ===== Sections ===== */
.section { padding: 4.5rem 0; }
.section--cta { padding-bottom: 5.5rem; }

.eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  color: var(--green);
  margin: 0 0 0.5rem;
}

.h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 1.6rem;
  max-width: 22ch;
}

/* ===== About ===== */
.about {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
.about__text p {
  color: var(--paper-dim);
  max-width: 52ch;
}
.about__text strong { color: var(--paper); }

.link {
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--green);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.link:hover { color: var(--mint); border-color: var(--mint); }
.about__text .h2 { margin-bottom: 1.1rem; }

.facts {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(143, 245, 189, 0.16);
  border-radius: 14px;
  overflow: hidden;
  background: var(--ink-2);
}
.facts li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid rgba(143, 245, 189, 0.1);
  font-size: 0.92rem;
}
.facts li:last-child { border-bottom: 0; }
.facts__k { color: var(--paper-dim); }
.facts__v { font-weight: 600; color: var(--paper); }

@media (max-width: 780px) {
  .about { grid-template-columns: 1fr; gap: 1.8rem; }
}

/* ===== Project tiles ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
}
.tile--wide { grid-column: 1 / -1; }

.tile {
  position: relative;
  padding: 1.6rem 1.7rem;
  border-radius: 16px;
  background: var(--ink-2);
  border: 1px solid rgba(143, 245, 189, 0.14);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(36, 196, 106, 0.16), transparent 65%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.tile:hover {
  transform: translateY(-4px);
  border-color: rgba(143, 245, 189, 0.4);
  background: var(--ink-3);
}
.tile:hover::before { opacity: 1; }

.tile__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.015em;
  margin: 0 0 0.5rem;
}
.tile__text {
  margin: 0 0 1rem;
  color: var(--paper-dim);
  font-size: 0.97rem;
}
.tile__text em { color: var(--paper); font-style: italic; }
.tile__tag {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
}

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

/* ===== Socials ===== */
.socials { display: flex; gap: 1rem; flex-wrap: wrap; }
.social {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.5rem 1rem 1.2rem;
  border-radius: 14px;
  border: 1px solid rgba(143, 245, 189, 0.2);
  background: var(--ink-2);
  color: var(--paper);
  text-decoration: none;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}
.social img { width: 24px; height: 24px; }
.social span { display: flex; flex-direction: column; line-height: 1.3; }
.social strong { font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
.social small { color: var(--paper-dim); font-size: 0.84rem; }
.social:hover {
  transform: translateY(-3px);
  border-color: var(--mint);
  background: var(--ink-3);
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid rgba(143, 245, 189, 0.12);
  padding: 1.8rem 0;
  color: var(--paper-dim);
  font-size: 0.88rem;
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.footer p { margin: 0; }
.footer__links { display: flex; gap: 1.2rem; }
.footer__links a {
  color: var(--paper-dim);
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer__links a:hover { color: var(--mint); }

/* ===== Reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease var(--d, 0s), transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) var(--d, 0s);
}
.reveal.is-in { opacity: 1; transform: none; }

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