/* ==========================================================================
   Alson Entuna — site styles
   Tokens first, then base, layout, components. Dark/light via tokens.
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #f6f8f7;
  --surface: #ffffff;
  --surface-2: #edf2ef;
  --text: #14211c;
  --muted: #55665f;
  --border: #dbe3df;
  --accent: #1e6b52;
  --accent-strong: #154d3b;
  --accent-soft: #dcefe6;
  --on-accent: #ffffff;
  --header-bg: rgb(246 248 247 / 0.78);
  --shadow: 0 1px 2px rgb(20 33 28 / 0.06), 0 8px 24px rgb(20 33 28 / 0.08);
  --logo-filter: brightness(0) opacity(0.8);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2: clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --step-3: clamp(2rem, 1.6rem + 2vw, 3rem);
  --step-4: clamp(2.6rem, 1.9rem + 3.6vw, 4.6rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: clamp(3.5rem, 2.5rem + 5vw, 6.5rem);

  --radius: 14px;
  --radius-sm: 8px;
  --container: 1120px;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1311;
    --surface: #111c19;
    --surface-2: #16241f;
    --text: #e7efeb;
    --muted: #9db0a8;
    --border: #22332d;
    --accent: #5fd3a0;
    --accent-strong: #8ae6bd;
    --accent-soft: #173a2e;
    --on-accent: #062018;
    --header-bg: rgb(11 19 17 / 0.72);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px rgb(0 0 0 / 0.35);
    --logo-filter: none;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1311;
  --surface: #111c19;
  --surface-2: #16241f;
  --text: #e7efeb;
  --muted: #9db0a8;
  --border: #22332d;
  --accent: #5fd3a0;
  --accent-strong: #8ae6bd;
  --accent-soft: #173a2e;
  --on-accent: #062018;
  --header-bg: rgb(11 19 17 / 0.72);
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px rgb(0 0 0 / 0.35);
  --logo-filter: none;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img,
iframe,
video {
  max-width: 100%;
  display: block;
}
img {
  height: auto;
}
h1,
h2,
h3,
h4 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-3);
  font-weight: 700;
}
h1 {
  font-size: var(--step-4);
  letter-spacing: -0.035em;
}
h2 {
  font-size: var(--step-3);
}
h3 {
  font-size: var(--step-1);
}
p {
  margin: 0 0 var(--space-3);
}
p:last-child {
  margin-bottom: 0;
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--accent-strong);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
ul,
ol {
  padding-left: 1.2em;
  margin: 0 0 var(--space-3);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  background: var(--accent);
  color: var(--on-accent);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
}
.skip-link:focus {
  top: var(--space-2);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Layout ---------- */
.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}
.container--narrow {
  --container: 760px;
}
.section {
  padding-block: var(--space-6);
}
.section--alt {
  background: var(--surface-2);
}
.section--tight {
  padding-block: var(--space-5);
}
.section-head {
  max-width: 680px;
  margin-bottom: var(--space-5);
}
.section-head p {
  color: var(--muted);
  font-size: var(--step-1);
  line-height: 1.5;
}
.eyebrow {
  display: inline-block;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-2);
}
.lead {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--muted);
}
.muted {
  color: var(--muted);
}
.center {
  text-align: center;
  margin-inline: auto;
}
.prose {
  max-width: 70ch;
}
.prose p,
.prose li {
  color: var(--text);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-right: auto;
}
.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
.brand:hover {
  color: var(--text);
}
.nav {
  display: flex;
  gap: var(--space-1);
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  transition:
    color 0.2s,
    background 0.2s;
}
.nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}
.nav a[aria-current="page"] {
  color: var(--text);
  background: var(--accent-soft);
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.icon-btn:hover {
  border-color: var(--accent);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}
.theme-toggle .icon-sun {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}
:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: block;
  }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: none;
  }
}
.menu-toggle {
  display: none;
}

@media (max-width: 760px) {
  .menu-toggle {
    display: inline-grid;
  }
  .nav {
    position: absolute;
    inset: 64px 0 auto 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: var(--space-2) var(--gutter) var(--space-3);
    display: none;
  }
  .nav.is-open {
    display: flex;
  }
  .nav a {
    padding: 0.8rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    transform 0.15s,
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn--primary:hover {
  background: var(--accent-strong);
  color: var(--on-accent);
}
.btn--ghost {
  border-color: var(--border);
  color: var(--text);
  background: var(--surface);
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--text);
}
.btn--light {
  border-color: rgb(255 255 255 / 0.4);
  color: #fff;
  background: rgb(255 255 255 / 0.08);
}
.btn--light:hover {
  background: rgb(255 255 255 / 0.18);
  color: #fff;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  color: #fff;
  min-height: 62vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.hero--full {
  min-height: calc(100svh - 64px);
}
.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgb(5 12 10 / 0.25) 0%,
    rgb(5 12 10 / 0.55) 50%,
    rgb(5 12 10 / 0.9) 100%
  );
}
.hero__content {
  padding-block: var(--space-6) var(--space-5);
  max-width: 760px;
}
.hero h1 {
  margin-bottom: var(--space-3);
}
.hero .lead {
  color: rgb(255 255 255 / 0.85);
}
.hero .eyebrow {
  color: #8ae6bd;
}
.hero--plain {
  min-height: 0;
  color: var(--text);
  background: var(--surface-2);
}
.hero--plain::after {
  display: none;
}
.hero--plain .lead {
  color: var(--muted);
}
.hero--plain .eyebrow {
  color: var(--accent);
}

/* ---------- Split (media + text) ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.split + .split {
  margin-top: var(--space-6);
}
.split--reverse > :first-child {
  order: 2;
}
.split__media img,
.split__media .video {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
}
.split__media--portrait img {
  max-height: 640px;
  object-fit: cover;
}
@media (max-width: 820px) {
  .split {
    grid-template-columns: 1fr;
  }
  .split--reverse > :first-child {
    order: 0;
  }
}

/* ---------- Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: var(--space-4);
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition:
    transform 0.25s,
    box-shadow 0.25s,
    border-color 0.25s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}
.card__media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-2);
}
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.card:hover .card__media img {
  transform: scale(1.04);
}
.card__body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card__body p {
  color: var(--muted);
  font-size: 0.95rem;
}
.card__title a {
  color: var(--text);
  text-decoration: none;
}
.card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
} /* whole card clickable */
.card__links {
  margin-top: auto;
  padding-top: var(--space-3);
  display: flex;
  gap: var(--space-3);
  font-size: 0.9rem;
  font-weight: 600;
}
.card__links a {
  position: relative;
  z-index: 1;
}
.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: var(--space-2);
  align-self: flex-start;
}

/* ---------- Features ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: var(--space-4);
}
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
}
.feature p {
  color: var(--muted);
  font-size: 0.95rem;
}
.icon {
  display: block;
  width: 44px;
  height: 44px;
  margin-bottom: var(--space-3);
  background: var(--accent);
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

/* ---------- Logos (white source images) ---------- */
.logo-mono {
  filter: var(--logo-filter);
  max-height: 56px;
  width: auto;
  margin-bottom: var(--space-3);
}

/* ---------- Timeline ---------- */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}
.timeline > li {
  position: relative;
  padding-left: 2.25rem;
  padding-bottom: var(--space-5);
}
.timeline > li:last-child {
  padding-bottom: 0;
}
.timeline > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.4rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
}
.timeline__meta {
  font-size: var(--step--1);
  color: var(--muted);
  margin-bottom: var(--space-2);
}
.timeline__meta strong {
  color: var(--accent);
  font-weight: 600;
}
.timeline h3 {
  margin-bottom: var(--space-1);
}

/* ---------- Video ---------- */
.video {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}
.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Gallery ---------- */
.gallery {
  columns: 3 260px;
  column-gap: var(--space-3);
}
.gallery figure {
  margin: 0 0 var(--space-3);
  break-inside: avoid;
}
.gallery button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.gallery img {
  width: 100%;
  transition:
    transform 0.4s,
    opacity 0.3s;
}
.gallery button:hover img {
  transform: scale(1.03);
}
.gallery figcaption {
  font-size: var(--step--1);
  color: var(--muted);
  padding-top: var(--space-1);
}

.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
}
.lightbox::backdrop {
  background: rgb(0 0 0 / 0.9);
}
.lightbox[open] {
  display: grid;
  place-items: center;
}
.lightbox img {
  max-width: 92vw;
  max-height: 84vh;
  width: auto;
  border-radius: var(--radius-sm);
}
.lightbox__caption {
  color: #ddd;
  text-align: center;
  font-size: var(--step--1);
  margin-top: var(--space-2);
}
.lightbox__btn {
  position: fixed;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.3);
  background: rgb(0 0 0 / 0.4);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}
.lightbox__btn:hover {
  background: rgb(255 255 255 / 0.15);
}
.lightbox__close {
  top: 16px;
  right: 16px;
}
.lightbox__prev {
  left: 16px;
  top: 50%;
  translate: 0 -50%;
}
.lightbox__next {
  right: 16px;
  top: 50%;
  translate: 0 -50%;
}

/* ---------- Misc blocks ---------- */
.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 3rem);
  text-align: center;
}
.callout .actions {
  justify-content: center;
}
.ranked {
  counter-reset: rank;
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: var(--space-2);
}
.ranked li {
  counter-increment: rank;
  display: flex;
  gap: var(--space-2);
  align-items: baseline;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
}
.ranked li::before {
  content: counter(rank);
  font-weight: 700;
  color: var(--accent);
  min-width: 1.4em;
}
.figure-full img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.figure-full figcaption {
  color: var(--muted);
  font-size: var(--step--1);
  margin-top: var(--space-2);
  text-align: center;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: var(--space-3);
}
.contact-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  color: var(--text);
  text-decoration: none;
  transition:
    border-color 0.2s,
    transform 0.2s;
}
.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  color: var(--text);
}
.contact-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
.contact-card strong {
  display: block;
  margin-bottom: var(--space-1);
}
.note {
  font-size: var(--step--1);
  color: var(--muted);
  text-align: center;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-block: var(--space-5) var(--space-4);
  font-size: 0.95rem;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-4);
}
.site-footer h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: var(--space-2);
}
.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-1);
}
.site-footer a {
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.site-footer a:hover {
  color: var(--accent);
}
.site-footer__bottom {
  margin-top: var(--space-5);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: var(--step--1);
}
@media (max-width: 760px) {
  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
  }
  .site-footer__grid > :first-child {
    grid-column: 1 / -1;
  }
}

/* ---------- Reveal on scroll ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    translate: 0 18px;
    transition:
      opacity 0.7s ease,
      translate 0.7s ease;
  }
  .js .reveal.is-visible {
    opacity: 1;
    translate: 0 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
