/* ==========================================================================
   webfire portfolio
   Palette notes (contrast on #171717):
   --green  #00FF8D  ~12.6:1   --white #FFFFFF ~17.2:1   --muted #BDBDBD ~9.1:1
   Dark text on green buttons: #171717 on #00FF8D ~12.6:1
   ========================================================================== */

@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/space-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #171717;
  --surface: #202020;
  --surface-2: #2a2a2a;
  --line: #4a4a4a;        /* decorative dividers only */
  --line-strong: #767676; /* borders of interactive elements, 3:1+ on #171717 */
  --green: #00ff8d;
  --white: #ffffff;
  --muted: #bdbdbd;
  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --max: 78rem;
  --radius: 1rem;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

html {
  background: var(--bg);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--green); text-underline-offset: 0.2em; text-decoration-thickness: 0.08em; }
a:hover { color: var(--white); }

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--green);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 600;
}
h2 { font-size: clamp(2.25rem, 6vw, 4.5rem); margin-bottom: 1.25rem; }
h3 { font-size: 1.5rem; line-height: 1.2; }
p { margin: 0 0 1rem; }

/* Focus: always visible, high contrast on the dark surface */
:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 100;
  background: var(--bg);
  color: var(--green);
  border: 2px solid var(--green);
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* --------------------------------------------------------------- Header */
.site-header {
  position: relative;
  z-index: 5;
}
.notice {
  margin: 0;
  padding: 0.65rem var(--gutter);
  background: var(--green);
  color: var(--bg);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
}
.notice-dot { display: none; }

.header-bar {
  max-width: var(--max);
  margin-inline: auto;
  padding: 1.25rem var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.logo-link { display: inline-block; border-radius: 6px; }
.logo-link img { height: clamp(2.75rem, 5vw, 3.75rem); width: auto; }

.nav-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
}
.nav-list a {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.0625rem;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid transparent;
}
.nav-list a:hover { color: var(--green); border-color: var(--line); }

/* ----------------------------------------------------------------- Hero */
/* The notice bar, header and hero together fill one screen. --header-h is set
   from the real header height in main.js (9rem is the fallback without JS). */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100svh - var(--header-h, 9rem));
  padding-block: clamp(1.5rem, 5vh, 5rem);
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: auto -20% -40% auto;
  width: 70vw; height: 70vw;
  max-width: 60rem; max-height: 60rem;
  background: radial-gradient(circle at center, rgba(0, 255, 141, 0.16), rgba(0, 255, 141, 0) 65%);
  z-index: -1;
}
.hero::after {
  /* faint grid for the agency feel; decorative only */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 4.5rem 4.5rem;
  mask-image: linear-gradient(to bottom, #000 30%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 100%);
  z-index: -1;
}
.eyebrow {
  font-family: var(--font-display);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.hero .eyebrow { margin-bottom: clamp(0.75rem, 2.2vh, 1.25rem); }
/* Two lines on desktop: "Twenty-five years of" / "digital work".
   Size is the smaller of (a) what fits the content width (first line is 9.76em wide)
   and (b) 12% of the window height, so the whole first screen stays in view. */
.hero-title {
  font-size: clamp(2.5rem, min(calc((min(100vw, 78rem) - 2 * var(--gutter)) / 10.3), 12vh), 8rem);
  line-height: 0.95;
  max-width: 11em;
  margin-bottom: clamp(1rem, 3.5vh, 2rem);
}
.hero-title .accent { color: var(--white); }
.lead {
  font-size: clamp(1rem, min(1.4vw, 2.4vh), 1.375rem);
  line-height: 1.5;
  max-width: 52rem;
  color: var(--white);
  margin-bottom: clamp(1.25rem, 4vh, 2.25rem);
}
.actions { display: flex; flex-wrap: wrap; gap: 1rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.6rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  text-decoration: none;
  border: 2px solid var(--green);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn-primary { background: var(--green); color: var(--bg); }
.btn-primary:hover { background: var(--white); border-color: var(--white); color: var(--bg); }
.btn-ghost { background: transparent; color: var(--green); }
.btn-ghost:hover { background: var(--green); color: var(--bg); }

/* -------------------------------------------------------------- Sections */
.section {
  padding-block: clamp(4rem, 9vw, 7.5rem);
  border-top: 1px solid var(--line);
  scroll-margin-top: 1rem;
}
.section-intro {
  max-width: 40rem;
  color: var(--muted);
  font-size: 1.125rem;
  margin-bottom: 3rem;
}
.body-large { font-size: clamp(1.15rem, 2vw, 1.5rem); line-height: 1.5; max-width: 40rem; }
.noscript { color: var(--muted); }

/* ------------------------------------------------------------- Projects */
.project-grid {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
}
.project-grid > li { display: flex; }
.project-grid > li.is-featured { grid-column: 1 / -1; }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.25s ease, background-color 0.25s ease;
}
.card:hover { border-color: var(--green); background: var(--surface-2); transform: translateY(-4px); }

/* Featured card: image runs full width, text sits underneath */
.is-featured .card { flex-direction: column; }
.is-featured .card-media { aspect-ratio: var(--ratio, 16 / 9); }
.is-featured .card-body { padding: clamp(1.5rem, 4vw, 2.5rem); }
.is-featured .card-title { font-size: clamp(2rem, 4vw, 3rem); }
.is-featured .card-summary { max-width: 46rem; font-size: 1.125rem; }
@media (max-width: 40rem) {
  /* on phones, show the left of a wide image so the focal point stays legible */
  .is-featured .card-media { aspect-ratio: 4 / 3; }
  .is-featured .card-media img { object-position: left center; }
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #101010;
  overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }
/* Logo tiles (white on #2E2E2E) are shown whole instead of cropped */
.card-media--contain, .dialog-media--contain { background: #2e2e2e; }
.card-media--contain img, .dialog-media--contain img { object-fit: contain; }
.card-mono {
  /* placeholder artwork used until a project has an image */
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(4rem, 12vw, 7rem);
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 2px rgba(0, 255, 141, 0.55);
  background:
    radial-gradient(circle at 80% 20%, rgba(0, 255, 141, 0.18), transparent 55%),
    linear-gradient(135deg, #1b1b1b, #101010);
  transition: -webkit-text-stroke-color 0.25s ease;
}
.card:hover .card-mono { -webkit-text-stroke-color: var(--green); }

.card-body { display: flex; flex-direction: column; flex: 1; padding: 1.5rem; gap: 0.5rem; }
.badge {
  align-self: flex-start;
  background: var(--green);
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
}
.card-meta { margin: 0; color: var(--muted); font-size: 0.9375rem; }
.card-title { margin: 0; font-size: 1.75rem; line-height: 1.1; color: var(--white); }
.card-title button {
  all: unset;
  cursor: pointer;
}
.card-title button::after {
  /* stretches the click target across the whole card */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}
.card-title button:focus-visible::after { outline: 3px solid var(--white); outline-offset: 3px; }
.card-summary { margin: 0; color: var(--muted); }
.card-cta {
  margin-top: auto;
  padding-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--green);
  font-family: var(--font-display);
  font-weight: 600;
}
.card-cta svg { transition: transform 0.3s var(--ease); }
.card:hover .card-cta svg { transform: translateX(6px); }

.tags { list-style: none; margin: 0.25rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tags li {
  font-size: 0.8125rem;
  padding: 0.15rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--white);
}

/* --------------------------------------------------------------- Clients */
/* Logo tiles are supplied as white-on-#2E2E2E SVGs, so each tile carries its own ground. */
.client-list {
  list-style: none;
  margin: 2.5rem 0 0; padding: 0;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 40rem) { .client-list { grid-template-columns: repeat(3, 1fr); gap: 1rem; } }
@media (min-width: 64rem) { .client-list { grid-template-columns: repeat(4, 1fr); } }
.client-list li {
  border-radius: 0.75rem;
  overflow: hidden;
  background: #2e2e2e;
  transition: transform 0.35s var(--ease);
}
.client-list li:hover { transform: translateY(-3px); }
.client-list img { display: block; width: 100%; height: auto; aspect-ratio: 1135 / 955; }

/* ----------------------------------------------------------------- About */
.about-grid { display: grid; gap: 3rem 5rem; grid-template-columns: 1fr; }
@media (min-width: 60rem) { .about-grid { grid-template-columns: 1.1fr 1fr; } }
.about-grid h3 { margin: 2.5rem 0 1rem; color: var(--white); }
.about-grid h3.spaced-top { margin-top: 0; }
.values { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.values li {
  padding: 0.4rem 1.1rem;
  border: 1px solid var(--green);
  color: var(--green);
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 500;
}
.expertise { margin: 0; }
.expertise > div { padding: 1.25rem 0; border-top: 1px solid var(--line); }
.expertise > div:last-child { border-bottom: 1px solid var(--line); }
.expertise dt {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--green);
  margin-bottom: 0.25rem;
}
.expertise dd { margin: 0; color: var(--muted); }
.quote {
  margin: 2.5rem 0 0;
  padding: 1.75rem;
  background: var(--surface);
  border-left: 4px solid var(--green);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.quote blockquote { margin: 0; }
.quote p { font-family: var(--font-display); font-size: 1.35rem; line-height: 1.4; margin-bottom: 1rem; }
.quote figcaption { color: var(--muted); font-size: 0.9375rem; }

/* --------------------------------------------------------------- Contact */
.contact-list {
  list-style: none;
  margin: 2rem 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 1rem;
}

/* ---------------------------------------------------------------- Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 3rem;
  color: var(--muted);
  font-size: 0.9375rem;
}
.footer-grid { display: grid; gap: 2rem 4rem; grid-template-columns: 1fr; }
@media (min-width: 52rem) { .footer-grid { grid-template-columns: 1.4fr 1fr; } }
.footer-title { font-size: 1.25rem; color: var(--white); margin-bottom: 0.75rem; letter-spacing: 0; }
.footer-meta p:last-child, .footer-grid p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- Dialog */
.project-dialog {
  width: min(100% - 2rem, 52rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  border: 1px solid var(--green);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--white);
  overflow: auto;
}
.project-dialog::backdrop { background: rgba(0, 0, 0, 0.78); }
.dialog-inner { padding: clamp(1.5rem, 4vw, 3rem); }
.dialog-close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 2;
  margin: 1rem 1rem 0 0;
  min-height: 2.75rem;
  padding: 0.5rem 1.1rem;
  background: var(--bg);
  color: var(--green);
  border: 2px solid var(--green);
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}
.dialog-close:hover { background: var(--green); color: var(--bg); }
.dialog-media { aspect-ratio: var(--ratio, 16 / 9); background: #101010; border-radius: 0.75rem; overflow: hidden; margin-bottom: 1.25rem; }
.dialog-media img { width: 100%; height: 100%; object-fit: cover; }
.dialog-title { font-size: clamp(2.25rem, 6vw, 3.75rem); margin: 0.5rem 0 1rem; }
.dialog-facts { display: grid; gap: 1rem 2rem; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); margin: 1.5rem 0; padding: 1.25rem 0; border-block: 1px solid var(--line); }
.dialog-facts dt { color: var(--muted); font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.1em; }
.dialog-facts dd { margin: 0.15rem 0 0; font-weight: 500; }
.dialog-links { list-style: none; margin: 1.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.dialog-quote { margin: 1.75rem 0; padding: 1.25rem 1.5rem; background: var(--surface); border-left: 4px solid var(--green); border-radius: 0 0.75rem 0.75rem 0; }
.dialog-quote p { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 0.5rem; }
.dialog-quote footer { color: var(--muted); font-size: 0.9375rem; }
html.dialog-open { overflow: hidden; }

/* -------------------------------------------------- Heading entrance anim */
/* Only applied when JS is running and motion is allowed (main.js adds .anim). */
.anim .reveal .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}
.anim .reveal .word-inner {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  transition: transform 0.9s var(--ease), opacity 0.6s ease;
  transition-delay: calc(var(--i, 0) * 70ms);
  will-change: transform;
}
.anim .reveal.is-in .word-inner { transform: translateY(0); opacity: 1; }

.anim .fade-up {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 0.7s ease, transform 0.8s var(--ease);
  transition-delay: var(--d, 0ms);
}
.anim .fade-up.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  .card:hover { transform: none; }
}

@media (max-width: 40rem) {
  body { font-size: 1rem; }
  .header-bar { padding-block: 1rem; }
  .nav-list a { padding: 0.5rem 0.7rem; }
}
