/* ==========================================================================
   Mana Vuo — dark, minimal, accessible
   Plain CSS. No build step required.
   ========================================================================== */

:root {
  --bg: #050505;
  --bg-elev: #0d0d0f;
  --bg-elev-2: #141417;
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  --border: #26262a;
  --border-soft: #1a1a1d;
  --focus: #e4e4e7;
  --maxw: 1120px;
  --gap: clamp(1rem, 3vw, 2rem);
  --radius: 4px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--text-muted); }

h1, h2, h3 { line-height: 1.15; font-weight: 600; margin: 0; }

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---- Skip link ---------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
  color: var(--bg);
}

/* ---- Layout helpers ----------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1.125rem, 4vw, 2.5rem);
}

.section { padding-block: clamp(3rem, 8vw, 6rem); }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}
.section-head h2 {
  font-size: clamp(1.35rem, 1.1rem + 1.4vw, 2rem);
  letter-spacing: 0.02em;
}
.section-head .idx {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.15em;
}

.eyebrow {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ---- Header / nav ------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4rem;
  gap: 1rem;
}
.brand {
  font-weight: 700;
  letter-spacing: 0.22em;
  font-size: 0.95rem;
  text-transform: uppercase;
}
.nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}
.nav a {
  color: var(--text-muted);
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--text);
}

/* ---- Hero --------------------------------------------------------------- */
.hero {
  padding-block: clamp(4rem, 12vw, 8rem);
  border-bottom: 1px solid var(--border-soft);
}
.hero h1 {
  font-size: clamp(2.6rem, 1.5rem + 7vw, 6rem);
  letter-spacing: 0.02em;
  margin-bottom: 1.25rem;
}
.hero .lede {
  max-width: 46ch;
  color: var(--text-muted);
  font-size: clamp(1.05rem, 1rem + 0.5vw, 1.35rem);
  line-height: 1.55;
}
.hero .roles {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.6rem;
  list-style: none;
  padding: 0;
}
.hero .roles li {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
}

/* ---- Showcase / work grid ---------------------------------------------- */
.grid {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.75rem);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}

.card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--bg-elev);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover,
.card:focus-within { border-color: var(--border); }

/* Media frame that holds poster + lazy video, no layout shift */
.media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0a0a0b;
  overflow: hidden;
}
.media.square { aspect-ratio: 1 / 1; }
.media > img,
.media > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media > video {
  opacity: 0;
  transition: opacity 0.6s ease;
}
.media > video.is-playing { opacity: 1; }

.card-body { padding: 1rem 1.15rem 1.25rem; }
.card-body h3 {
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  margin-bottom: 0.35rem;
}
.card-body p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}
.card-meta {
  margin-top: 0.75rem;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* ---- FFGL plugin list --------------------------------------------------- */
.plugin {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1rem, 3vw, 1.75rem);
  align-items: center;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--bg-elev);
  transition: border-color 0.2s ease;
}
.plugin:hover,
.plugin:focus-within { border-color: var(--border); }
.plugin .thumb {
  width: clamp(72px, 14vw, 104px);
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
}
.plugin h3 {
  font-size: 1.15rem;
  margin-bottom: 0.3rem;
}
.plugin p {
  margin: 0 0 0.9rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ---- Buttons / links ---------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  padding: 0.55rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--bg-elev-2);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.btn:hover {
  color: var(--text);
  background: #1d1d21;
  border-color: #3a3a40;
}
.btn::after { content: "\2197"; font-size: 0.9em; opacity: 0.7; }

/* ---- Contact ------------------------------------------------------------ */
.contact {
  border-top: 1px solid var(--border-soft);
  background: var(--bg-elev);
}
.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}
.contact-list dt,
.contact-list .label {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}
.contact-list a { font-size: 1.05rem; border-bottom: 1px solid var(--border); }
.contact-list a:hover { border-bottom-color: var(--text); }

/* ---- Footer ------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border-soft);
  color: var(--text-dim);
  font-size: 0.85rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  padding-block: 2rem;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }

/* ---- Motion preferences ------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  /* Lazy videos never fade in; poster stays. See js/app.js. */
  .media > video { display: none; }
}
