/* Ember theme — tokens are the single source of truth.
   Spec: docs/superpowers/specs/2026-07-06-ember-theme-design.md */

/* ---------- fonts (self-hosted, OFL — see assets/fonts/LICENSES.md) ---------- */

@font-face {
  font-family: "Archivo";
  src: url("../assets/fonts/Archivo-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62.5% 125%;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/IBMPlexMono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

/* ---------- design tokens ---------- */

:root {
  /* ground */
  --char: #100d0b;
  --coal: #1a1613;
  --seam: rgba(231, 222, 209, 0.1);

  /* greys (warm) */
  --ash: #8d857c;
  --smoke: #c7c0b7;
  --bone: #efeae2;

  /* ember — the single interactive accent */
  --ember: #d2622b;
  --ember-hot: #e8834e;
  --ember-deep: #7a3416;

  /* teal — ambient/live layer only (flow field, selection) */
  --teal: #3e8e85;
  --teal-bright: #6fb5aa;

  /* type */
  --font-body: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* radius system */
  --r-s: 6px;
  --r-l: 16px;

  /* motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* layout */
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --measure: 62ch;
}

/* ---------- reset-lite ---------- */

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

body,
h1,
h2,
h3,
p {
  margin: 0;
}

/* ---------- base ---------- */

html {
  scroll-behavior: smooth;
}

body {
  background: var(--char);
  color: var(--smoke);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--teal);
  color: var(--char);
}

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

/* skip-link landing target: focus is programmatic, the scroll is the feedback */
main:focus {
  outline: none;
}

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

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  background: var(--coal);
  color: var(--bone);
  border: 1px solid var(--seam);
  border-radius: var(--r-s);
  transform: translateY(-300%);
}
.skip-link:focus-visible {
  transform: none;
}

/* ---------- ambient layer: flow field + vignette ---------- */

#flow {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(110% 80% at 50% 12%, transparent 40%, rgba(16, 13, 11, 0.5) 100%),
    linear-gradient(rgba(16, 13, 11, 0) 55%, rgba(16, 13, 11, 0.55) 100%);
}

.top-sentinel {
  position: absolute;
  top: 0;
  height: 1px;
  width: 1px;
}

/* ---------- nav ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding-inline: var(--gutter);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav.scrolled {
  background: rgba(16, 13, 11, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--seam);
}

.wordmark {
  font-stretch: 125%;
  font-weight: 640;
  font-size: 0.8125rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone);
}

.nav nav {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.5rem);
}

.nav nav a {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ash);
  transition: color 0.25s ease;
}

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

/* ---------- hero ---------- */

.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh; /* fallback where svh is unsupported */
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-inline: var(--gutter);
}

.hero-inner {
  max-width: 1140px;
  margin-inline: auto;
  width: 100%;
}

.hero-inner > * {
  animation: rise 0.9s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 110ms + 120ms);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero-name {
  display: flex;
  flex-direction: column;
  color: var(--bone);
  font-size: clamp(4rem, 11vw, 8.5rem);
  line-height: 0.96;
  letter-spacing: -0.015em;
}

.hero-name .line-a {
  font-stretch: 125%;
  font-weight: 640;
}

.hero-name .line-b {
  font-stretch: 125%;
  font-weight: 260;
}

.hero-sub {
  margin-top: 2rem;
  max-width: 38ch;
  font-size: 1.125rem;
  color: var(--smoke);
}

.cta {
  display: inline-block;
  margin-top: 2.75rem;
  padding: 0.85rem 1.7rem;
  border: 1px solid var(--seam);
  border-radius: var(--r-s);
  color: var(--bone);
  font-weight: 500;
  transition: border-color 0.25s ease, color 0.25s ease, transform 0.25s var(--ease);
}

.cta:hover {
  border-color: var(--ember);
  color: var(--ember-hot);
  transform: translateY(-2px);
}

/* ---------- sections ---------- */

.section {
  position: relative;
  z-index: 1;
  max-width: 1140px;
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: clamp(5.5rem, 11vh, 8.5rem);
}

.section h2 {
  font-stretch: 125%;
  font-weight: 600;
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  letter-spacing: -0.01em;
  color: var(--bone);
  margin-bottom: 2.75rem;
}

.meta {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ash);
}

/* work panels — asymmetric pair, one washed, one plain */

.panels {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 1.5rem;
}

.panel {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 2rem;
  background: var(--coal);
  border: 1px solid var(--seam);
  border-radius: var(--r-l);
}

.panel-a {
  background:
    radial-gradient(120% 100% at 18% 0%, rgba(122, 52, 22, 0.38), transparent 58%),
    var(--coal);
}

.panel .meta {
  margin-bottom: auto;
}

.panel h3 {
  font-stretch: 118%;
  font-weight: 570;
  font-size: 1.4rem;
  color: var(--bone);
}

.panel p:last-child {
  color: var(--ash);
  font-size: 0.9375rem;
}

/* about */

.prose {
  max-width: var(--measure);
}

.prose p + p {
  margin-top: 1.25rem;
}

/* contact closer */

.contact {
  text-align: left;
}

.contact-link {
  display: inline-block;
  font-stretch: 125%;
  font-weight: 640;
  font-size: clamp(2.6rem, 7vw, 5.25rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--bone);
  border-bottom: 2px solid var(--seam);
  padding-bottom: 0.35rem;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.contact-link:hover {
  color: var(--ember-hot);
  border-bottom-color: var(--ember);
}

.contact .meta {
  margin-top: 1.5rem;
}

/* footer */

.footer {
  position: relative;
  z-index: 1;
  max-width: 1140px;
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: 2.25rem;
  border-top: 1px solid var(--seam);
}

/* ---------- scroll reveals ---------- */

/* hidden state only when JS is present to reveal it again */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}

[data-reveal].in {
  opacity: 1;
  transform: none;
}

/* ---------- responsive ---------- */

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

  .panel {
    min-height: 220px;
  }

  .hero-sub {
    font-size: 1.0625rem;
  }
}

.wm-short {
  display: none;
}

@media (max-width: 480px) {
  .wm-full {
    display: none;
  }

  .wm-short {
    display: inline;
  }

  .nav nav {
    gap: 1.25rem;
  }
}

/* ---------- reduced motion ---------- */

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

  .hero-inner > * {
    animation: none;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .cta,
  .cta:hover {
    transform: none;
  }
}
