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

:root,
[data-theme="dark"] {
  --color-bg: #0a0a0a;
  --color-ink: #fafaf8;
  --color-muted: rgba(250, 250, 248, 0.84);
  --color-primary: #1b1bff;
  --color-accent: #00ff9c;
  --color-dark: #000000;
  --color-navy: #0d1b2a;
  --color-white: #ffffff;
  --color-surface: #1a1a1a;
  --color-surface-elevated: #232323;
  --color-border: rgba(255, 255, 255, 0.1);
  --color-bar-bg: #000000;
  --color-header-bg: rgba(10, 10, 10, 0.96);
  --color-button-bg: var(--color-primary);
  --color-button-text: #fafaf8;
  --color-button-hover-bg: #1414cc;
  --color-button-hover-text: #fafaf8;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-headline: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
  --header-height: 4.25rem;
  --top-bar-height: 2.5rem;
  --page-gutter: clamp(1.25rem, 4vw, 3.5rem);
  --content-max: 40rem;
}

[data-theme="light"] {
  --color-bg: #ffffff;
  --color-ink: #000000;
  --color-muted: #2e2e2e;
  --color-accent: #00875a;
  --color-surface: #f7f7f5;
  --color-surface-elevated: #0d1b2a;
  --color-border: rgba(0, 0, 0, 0.08);
  --color-bar-bg: #000000;
  --color-header-bg: rgba(255, 255, 255, 0.96);
}

html {
  scroll-behavior: smooth;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

body.is-menu-open {
  overflow: hidden;
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

p {
  margin: 0 0 1rem;
}

p:last-child {
  margin-bottom: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 300;
  padding: 0.75rem 1rem;
  background: var(--color-ink);
  color: var(--color-bg);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transform: translateY(-200%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Top bar */

.top-bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--top-bar-height);
  padding: 0 var(--page-gutter);
  background: var(--color-bar-bg);
  color: var(--color-white);
  text-align: center;
}

.top-bar p {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.top-bar a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Header */

.site-header {
  position: fixed;
  inset: var(--top-bar-height) 0 auto;
  z-index: 110;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--header-height);
  padding: 0 var(--page-gutter);
  background: var(--color-header-bg);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.site-logo {
  justify-self: center;
  font-family: var(--font-headline);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav {
  display: none;
  gap: 1.75rem;
}

.site-nav a {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: var(--color-surface);
}

.theme-toggle__icon {
  width: 1.25rem;
  height: 1.25rem;
}

.theme-toggle__bulb,
.theme-toggle__base {
  transition: fill 0.25s ease, stroke 0.25s ease, filter 0.25s ease;
}

[data-theme="dark"] .theme-toggle__bulb {
  fill: #fde68a;
  stroke: #fde68a;
  stroke-width: 0;
  filter: drop-shadow(0 0 6px rgba(253, 230, 138, 0.75));
}

[data-theme="dark"] .theme-toggle__base {
  fill: #fde68a;
  stroke: none;
}

[data-theme="light"] .theme-toggle__bulb {
  fill: none;
  stroke: #000000;
  stroke-width: 1.5;
  filter: none;
}

[data-theme="light"] .theme-toggle__base {
  fill: none;
  stroke: #000000;
  stroke-width: 1.5;
}

.menu-toggle {
  justify-self: start;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.4rem;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition: transform 0.3s ease;
}

.site-header.is-open .menu-toggle span:first-child {
  transform: translateY(0.5rem) rotate(45deg);
}

.site-header.is-open .menu-toggle span:last-child {
  transform: translateY(-0.5rem) rotate(-45deg);
}

@media (min-width: 768px) {
  .site-nav {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }
}

@media (max-width: 767px) {
  .site-header {
    grid-template-columns: auto 1fr auto;
  }

  .header-actions {
    gap: 0;
  }

  .site-nav {
    display: none;
  }

  .site-header.is-open .site-nav {
    display: flex;
    position: fixed;
    inset: calc(var(--top-bar-height) + var(--header-height)) 0 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    width: 100%;
    background: var(--color-bg);
  }
}

/* Shared typography */

.section-eyebrow {
  margin: 0 0 1rem;
  font-family: var(--font-headline);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.section-title,
.contact-title {
  margin: 0 0 1.5rem;
  font-family: var(--font-headline);
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.lead-label {
  font-family: var(--font-headline);
  color: var(--color-accent);
  font-weight: 700;
}

/* Hero */

.hero {
  padding-top: calc(var(--top-bar-height) + var(--header-height));
}

.hero-inner {
  max-width: 56rem;
  padding: clamp(2rem, 7vw, 4rem) var(--page-gutter) clamp(1.5rem, 4vw, 2.25rem);
}

.hero-eyebrow {
  margin: 0 0 1.25rem;
  font-family: var(--font-headline);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.hero-title {
  margin: 0 0 1rem;
  font-family: var(--font-headline);
  font-size: clamp(2rem, 5.5vw, 3.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-wrap: balance;
}

.hero-tagline {
  margin: 0 0 1.75rem;
  font-family: var(--font-headline);
  font-size: clamp(0.75rem, 1.8vw, 0.9rem);
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.hero-deck {
  max-width: 34rem;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.75;
  color: var(--color-muted);
}

/* Editorial sections */

.editorial {
  padding: clamp(2.5rem, 6vw, 4rem) var(--page-gutter);
  scroll-margin-top: calc(var(--top-bar-height) + var(--header-height));
}

.editorial-copy {
  max-width: var(--content-max);
  color: var(--color-muted);
  font-weight: 400;
}

.editorial-copy a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 0.15em;
}

.editorial-copy a:hover {
  opacity: 0.8;
}

.expertise-list {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  list-style: none;
}

.expertise-list li {
  position: relative;
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

.expertise-list li::before {
  content: "—";
  position: absolute;
  left: -1.25rem;
  color: var(--color-accent);
}

.expertise-list li:last-child {
  margin-bottom: 0;
}

.personal-closer {
  margin-top: 1.5rem;
  font-family: var(--font-headline);
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ink);
}

/* Case studies */

.experience-anchor {
  scroll-margin-top: calc(var(--top-bar-height) + var(--header-height));
}

.case-study {
  padding: clamp(2.5rem, 6vw, 4rem) var(--page-gutter);
  border-top: 1px solid var(--color-border);
}

.case-study-inner {
  max-width: 56rem;
}

.case-study-card {
  position: relative;
  margin: 0 0 clamp(1.5rem, 3.5vw, 2rem);
  aspect-ratio: 16 / 9;
  border-radius: 1rem;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(56, 92, 140, 0.35), transparent 45%),
    linear-gradient(145deg, #0d1b2a 0%, #152238 45%, #0a0a0a 100%);
}

.case-study-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

.case-study-card__media {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-study-card__media--contain {
  width: 100%;
  height: 100%;
  object-fit: contain;
  margin: 0;
}

.case-study-card__media--sky {
  transform: scale(1.15);
  transform-origin: 50% 38%;
}

.case-study-card--placeholder {
  display: grid;
  place-items: center;
}

.case-study-card--light {
  background: #e5e5e5;
}

.case-study-card--light::before {
  display: none;
}

.case-study-card--lesmills {
  background:
    radial-gradient(circle at 75% 25%, rgba(180, 60, 60, 0.25), transparent 40%),
    linear-gradient(145deg, #1a1428 0%, #2a1830 50%, #0a0a0a 100%);
}

.case-study-card--skytv {
  background:
    radial-gradient(circle at 30% 70%, rgba(0, 120, 200, 0.3), transparent 45%),
    linear-gradient(145deg, #0a1628 0%, #122640 50%, #050505 100%);
}

.case-study-card__label {
  position: relative;
  z-index: 1;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

.case-study-copy {
  max-width: var(--content-max);
}

.case-study-copy p {
  color: var(--color-muted);
  font-weight: 400;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: baseline;
  column-gap: 0.6em;
  row-gap: 0.4em;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.stat-row li {
  font-size: 0.92rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--color-muted);
}

.stat-row li:not(:first-child)::before {
  content: "|";
  display: inline-block;
  margin-right: 0.6em;
  opacity: 0.35;
}

.stat-row strong {
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--color-ink);
}

/* Contact */

.contact {
  padding: clamp(2.5rem, 6vw, 4rem) var(--page-gutter);
  background: var(--color-dark);
  color: var(--color-white);
  scroll-margin-top: calc(var(--top-bar-height) + var(--header-height));
  border-top: 1px solid var(--color-border);
}

.contact .section-eyebrow {
  /* The contact section keeps a fixed black background in both themes,
     so it always uses the vivid accent rather than the theme-swapped variable. */
  color: #00ff9c;
}

.contact-title {
  color: var(--color-white);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.solid-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(100%, 16rem);
  padding: 1rem 1.5rem;
  background: var(--color-button-bg);
  color: var(--color-button-text);
  border: 2px solid var(--color-primary);
  font-family: var(--font);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.solid-button:hover,
.solid-button:focus-visible {
  background: var(--color-button-hover-bg);
  color: var(--color-button-hover-text);
  border-color: var(--color-button-hover-bg);
}

.solid-button--outline {
  background: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
}

.solid-button--outline:hover,
.solid-button--outline:focus-visible {
  background: var(--color-white);
  color: var(--color-dark);
  border-color: var(--color-white);
}

@media (max-width: 480px) {
  .contact-links {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Footer */

.site-footer {
  padding: 1.5rem var(--page-gutter) 2.5rem;
  background: var(--color-dark);
  color: rgba(255, 255, 255, 0.45);
  text-align: left;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-footer p {
  margin: 0;
}
