/* ==========================================================================
   Buronic Energy — design system
   Sections: tokens · base · buttons · nav (+ mobile menu) · hero · sections
   · services · process · work · about · faq · contact · footer · 404
   · motion states · responsive (900px / 560px)
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #08080a;
  --bg-soft: #101013;
  --bg-card: #131316;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f5f5f7;
  --text-dim: #9a9aa2;
  --text-faint: #6a6a72; /* decorative only — too low-contrast for body copy */
  --accent: #cda86b;
  --accent-soft: rgba(205, 168, 107, 0.14);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --container: 1180px;

  --nav-h: 72px;
  --gutter: clamp(20px, 5vw, 40px);
  --radius: 20px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

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

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

ul,
ol {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--accent);
  color: #0b0b0d;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 300;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--accent);
  color: #0b0b0d;
  font-weight: 600;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 12px;
  outline-offset: 2px;
}

/* Lenis (smooth scroll) recommended rules */
html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.lenis.lenis-stopped {
  overflow: hidden;
}

/* Full-page grain (canvas painted by main.js) */
#grain {
  position: fixed;
  top: -96px;
  left: -96px;
  width: calc(100% + 192px);
  height: calc(100% + 192px);
  max-width: none;
  z-index: 50;
  pointer-events: none;
  opacity: 0.055;
}
@media (prefers-reduced-motion: no-preference) {
  #grain {
    animation: grain 0.9s steps(6) infinite;
  }
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  17% { transform: translate(-52px, 31px); }
  33% { transform: translate(38px, -64px); }
  50% { transform: translate(-71px, -22px); }
  67% { transform: translate(60px, 48px); }
  83% { transform: translate(-27px, 70px); }
  100% { transform: translate(0, 0); }
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  position: relative;
  padding: clamp(80px, 12vw, 150px) 0;
}

.section--flush-top {
  padding-top: 0;
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(40px, 6vw, 72px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--accent);
}

h2 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.028em;
}

h3 {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.lede {
  margin-top: 20px;
  max-width: 60ch;
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  color: var(--text-dim);
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.35s var(--ease), background-color 0.3s, border-color 0.3s,
    color 0.3s, box-shadow 0.35s;
}
.btn-primary {
  background: var(--accent);
  color: #0b0b0d;
}
.btn-primary:hover {
  background: #dcbb84;
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -12px rgba(205, 168, 107, 0.6);
}
.btn-ghost {
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}
.btn-lg {
  min-height: 58px;
  padding: 0 40px;
  font-size: 1.02rem;
}
.btn-sm {
  min-height: 44px;
  padding: 0 22px;
  font-size: 0.88rem;
}
.btn:focus-visible {
  border-radius: 999px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent);
  min-height: 44px;
}
.text-link .icon {
  width: 16px;
  height: 16px;
  transition: transform 0.4s var(--ease);
}
.text-link:hover .icon {
  transform: translateX(4px);
}

/* ---------- Social icons ---------- */
.socials {
  display: flex;
  gap: 12px;
}
.social {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text-dim);
  transition: color 0.3s, border-color 0.3s, background-color 0.3s, transform 0.35s var(--ease);
}
.social:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}
.social .icon {
  width: 18px;
  height: 18px;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
}
/* Frosted bar lives on a pseudo-element: backdrop-filter on .nav itself would
   trap the fixed mobile panel inside the 72px bar. */
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(8, 8, 10, 0.72);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  backdrop-filter: saturate(140%) blur(16px);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.nav.scrolled::before {
  opacity: 1;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: var(--container);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: none;
  min-height: 44px;
}
.brand-logo {
  height: 36px;
  width: auto;
}
/* Plain-text stand-in shown only if /images/logo.png is missing */
.brand-fallback {
  display: none;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand--text .brand-logo {
  display: none;
}
.brand--text .brand-fallback {
  display: inline;
}

.nav-panel {
  display: flex;
  align-items: center;
  margin: 0 24px 0 auto;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  position: relative;
  display: inline-block;
  padding: 10px 0;
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: color 0.3s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}
.nav-links a:hover,
.nav-links a[aria-current="true"] {
  color: var(--text);
}
.nav-links a:hover::after,
.nav-links a[aria-current="true"]::after {
  transform: scaleX(1);
}

.panel-foot {
  display: none;
}

.nav-actions {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.3s, background-color 0.3s;
}
.nav-toggle:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.nav-toggle:focus-visible {
  border-radius: 50%;
}
.nav-toggle span {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.45s var(--ease), top 0.45s var(--ease);
}
.nav-toggle span:nth-child(1) { top: 17px; }
.nav-toggle span:nth-child(2) { top: 25px; }
.menu-open .nav-toggle span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.menu-open .nav-toggle span:nth-child(2) { top: 21px; transform: rotate(-45deg); }

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: rgba(0, 0, 0, 0.62);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s var(--ease);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--nav-h) + 56px) 0 120px;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(55% 55% at 78% 36%, rgba(205, 168, 107, 0.17), transparent 70%),
    radial-gradient(40% 40% at 8% 92%, rgba(205, 168, 107, 0.07), transparent 70%);
  /* fade out at the bottom so the particles don't end in a hard edge */
  -webkit-mask-image: linear-gradient(to bottom, #000 68%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 68%, transparent 100%);
}
#hero-canvas {
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.8s var(--ease);
}
#hero-canvas.is-ready {
  opacity: 1;
}
.hero-inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 5.8rem);
  font-weight: 300;
  line-height: 1.03;
  letter-spacing: -0.025em;
}
.hero h1 .eyebrow {
  display: flex;
  font-family: var(--font-body);
  font-weight: 600;
  font-style: normal;
  line-height: 1.6;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
}
/* line mask for the line-by-line intro */
.line {
  display: block;
  text-wrap: balance;
  overflow: hidden;
  padding: 0 0.06em 0.14em 0;
  margin-bottom: -0.14em;
}
.line-inner {
  display: block;
}
.hero-sub {
  max-width: 54ch;
  margin-top: 30px;
  font-size: clamp(1.02rem, 1.5vw, 1.2rem);
  color: var(--text-dim);
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 40px;
}
.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  max-width: 820px;
  margin-top: clamp(48px, 8vw, 88px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.hero-meta dt {
  margin-bottom: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.hero-meta dd {
  font-size: 0.92rem;
  color: var(--text-dim);
}

.scroll-cue {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28px;
  width: max-content;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: opacity 0.5s;
}
.scroll-cue::after {
  content: "";
  width: 1px;
  height: 44px;
  background: linear-gradient(var(--accent), transparent);
  transform-origin: top;
}
@media (prefers-reduced-motion: no-preference) {
  .scroll-cue::after {
    animation: cue 2.2s var(--ease) infinite;
  }
}
@keyframes cue {
  0% { transform: scaleY(0); opacity: 1; }
  60% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}
.scroll-cue.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* ---------- Cards / services ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(26px, 3vw, 38px);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.5s var(--ease), background-color 0.4s, border-color 0.4s;
}
.card:hover {
  transform: translateY(-6px);
  background: var(--bg-card);
  border-color: rgba(205, 168, 107, 0.3);
}
.card-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}
.card-icon .icon {
  width: 26px;
  height: 26px;
}
.card p {
  color: var(--text-dim);
}
.card-list {
  display: grid;
  gap: 10px;
  padding-top: 18px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  font-size: 0.93rem;
  color: var(--text-dim);
}
.card-list li {
  position: relative;
  padding-left: 20px;
}
.card-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.card-note {
  font-size: 0.82rem;
  color: var(--text-dim);
}
.card .text-link {
  margin-top: auto;
}

/* ---------- Process ---------- */
.process {
  border-block: 1px solid var(--line);
}
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 clamp(28px, 4vw, 64px);
}
.step {
  position: relative;
  padding: 34px 0 44px;
  border-top: 1px solid var(--line);
}
.step::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 48px;
  height: 1px;
  background: var(--accent);
}
.step-num {
  display: block;
  margin-bottom: 18px;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 4vw, 3.6rem);
  font-weight: 300;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--accent);
}
.step h3 {
  margin-bottom: 10px;
}
.step p {
  max-width: 34ch;
  font-size: 0.97rem;
  color: var(--text-dim);
}

/* ---------- Work / projects ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: clamp(230px, 26vw, 330px);
  gap: 16px;
}
.tile {
  position: relative;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.tile:nth-child(1) { grid-column: span 4; }
.tile:nth-child(2) { grid-column: span 2; }
.tile:nth-child(3) { grid-column: span 2; }
.tile:nth-child(4) { grid-column: span 4; }
.tile:nth-child(5),
.tile:nth-child(6) { grid-column: span 3; }
.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.95) brightness(0.84);
  transition: transform 1.2s var(--ease), filter 0.7s var(--ease);
}
.tile:hover img {
  transform: scale(1.06);
  filter: saturate(0.2) brightness(0.68);
}
.tile figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 72px 24px 22px;
  background: linear-gradient(to top, rgba(8, 8, 10, 0.92), rgba(8, 8, 10, 0));
}
.tile .cat {
  display: block;
  margin-bottom: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.tile .name {
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---------- About / why ---------- */
.about {
  background: var(--bg-soft);
  border-block: 1px solid var(--line);
}
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(40px, 7vw, 110px);
  align-items: start;
}
.about-copy p {
  margin-top: 20px;
  max-width: 52ch;
  color: var(--text-dim);
}
.about-copy h2 + p {
  margin-top: 26px;
}
.stat-points {
  border-bottom: 1px solid var(--line);
}
.stat-point {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 0 20px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
}
.stat-point::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: 0.55em;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px 2px rgba(205, 168, 107, 0.45);
}
.stat-point strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.stat-point span {
  display: block;
  color: var(--text-dim);
  font-size: 0.97rem;
}

/* ---------- FAQ ---------- */
.faq {
  max-width: 860px;
  border-bottom: 1px solid var(--line);
}
.faq-item {
  border-top: 1px solid var(--line);
}
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 48px;
  padding: 24px 0;
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  list-style: none;
  transition: color 0.3s;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary:hover {
  color: var(--accent);
}
.faq-item summary:focus-visible {
  outline-offset: -2px;
}
.faq-plus {
  position: relative;
  flex: none;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: border-color 0.3s, background-color 0.3s, transform 0.5s var(--ease);
}
.faq-plus::before,
.faq-plus::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 11px;
  height: 1.5px;
  background: var(--accent);
  transform: translate(-50%, -50%);
}
.faq-plus::after {
  transform: translate(-50%, -50%) rotate(90deg);
  transition: transform 0.5s var(--ease);
}
.faq-item[open] .faq-plus {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.faq-item[open] .faq-plus::after {
  transform: translate(-50%, -50%) rotate(0deg);
}
.faq-a {
  max-width: 68ch;
  padding: 0 0 28px;
  color: var(--text-dim);
}
.faq-a p + p {
  margin-top: 12px;
}
.faq-item[open] .faq-a {
  animation: faq-in 0.55s var(--ease);
}
@keyframes faq-in {
  from { opacity: 0; transform: translateY(-8px); }
}

/* ---------- Contact / CTA ---------- */
.cta-panel {
  position: relative;
  padding: clamp(48px, 8vw, 104px) clamp(24px, 5vw, 72px);
  overflow: hidden;
  text-align: center;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 28px;
  isolation: isolate;
}
.cta-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(60% 70% at 50% 0%, rgba(205, 168, 107, 0.2), transparent 70%);
}
.cta-panel .eyebrow {
  justify-content: center;
}
.cta-panel h2 {
  max-width: 18ch;
  margin: 0 auto;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.6vw, 4.2rem);
  font-weight: 300;
  line-height: 1.06;
  letter-spacing: -0.02em;
}
.cta-panel h2 em {
  font-style: italic;
  color: var(--accent);
}
.cta-panel .lede {
  margin: 24px auto 0;
  max-width: 56ch;
}
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 40px;
}
.cta-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 28px;
  margin-top: 32px;
  font-size: 0.95rem;
  color: var(--text-dim);
}
.cta-meta a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  transition: color 0.3s;
}
.cta-meta a:hover {
  color: var(--accent);
}
.cta-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}
.cta-meta .icon {
  width: 18px;
  height: 18px;
  color: var(--accent);
}
.cta-panel .socials {
  justify-content: center;
  margin-top: 28px;
}

/* ---------- Footer ---------- */
.footer {
  padding: 56px 0 40px;
  border-top: 1px solid var(--line);
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-brand .brand-logo {
  height: 32px;
}
.footer-brand p {
  font-size: 0.92rem;
  color: var(--text-dim);
}
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--text-dim);
}
.footer-bottom--flat {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.footer-bottom a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  transition: color 0.3s;
}
.footer-bottom a:hover {
  color: var(--accent);
}

/* ---------- 404 ---------- */
.error-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--nav-h) + 40px) 0 80px;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}
.error-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(50% 50% at 50% 42%, rgba(205, 168, 107, 0.16), transparent 70%);
}
.error-code {
  font-family: var(--font-display);
  font-size: clamp(6rem, 22vw, 15rem);
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1px var(--accent);
}
.error-hero h1 {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4.4vw, 3.2rem);
  font-weight: 300;
  letter-spacing: -0.02em;
}
.error-hero p:not(.error-code) {
  max-width: 44ch;
  margin: 18px auto 0;
  color: var(--text-dim);
}
.error-hero .hero-cta {
  justify-content: center;
}

/* ---------- Motion states ----------
   Hero intro: pure CSS, starts on first paint — it must never wait for a CDN
   script, or the headline (the LCP element) would be delayed.
   Scroll reveals: hidden "before" states apply only when JS is running (.js)
   and reduced motion is not requested. main.js animates them with GSAP; if GSAP
   is unavailable it falls back to the CSS animations below (html.reveal-css). */
@media (prefers-reduced-motion: no-preference) {
  [data-hero] {
    animation: rise 0.95s var(--ease) var(--d, 0s) backwards;
  }
  .line-inner {
    animation: rise-line 1.15s var(--ease) var(--d, 0s) backwards;
  }

  .js [data-reveal]:not(.is-in),
  .js [data-stagger] > *:not(.is-in) {
    opacity: 0;
    transform: translateY(28px);
  }
  .js.reveal-css [data-reveal].is-in,
  .js.reveal-css [data-stagger] > .is-in {
    animation: rise 0.95s var(--ease) var(--d, 0s) backwards;
  }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(28px); }
}
@keyframes rise-line {
  from { transform: translateY(112%); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav-links { gap: 22px; }
}

@media (max-width: 900px) {
  :root { --nav-h: 68px; }

  /* Mobile menu: slide-in panel */
  .nav-toggle { display: block; }
  .nav-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: min(88vw, 380px);
    margin: 0;
    padding: calc(var(--nav-h) + 12px) 28px 32px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #0d0d10;
    border-left: 1px solid var(--line);
    box-shadow: -30px 0 80px -30px rgba(0, 0, 0, 0.8);
    transform: translateX(103%);
    visibility: hidden;
    transition: transform 0.55s var(--ease), visibility 0s linear 0.55s;
  }
  .menu-open .nav-panel {
    transform: none;
    visibility: visible;
    transition-delay: 0s;
  }
  .menu-open .nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .menu-open .nav-cta {
    visibility: hidden;
  }
  html.menu-open {
    overflow: hidden;
  }
  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }
  .nav-links li {
    border-bottom: 1px solid var(--line);
  }
  .nav-links a {
    display: flex;
    align-items: center;
    min-height: 58px;
    padding: 0;
    font-size: 1.3rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--text);
  }
  .nav-links a::after { display: none; }
  .nav-links a[aria-current="true"] { color: var(--accent); }
  .panel-foot {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 32px;
  }
  .panel-foot .btn { width: 100%; }
  .panel-phone {
    display: inline-flex;
    white-space: nowrap;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    color: var(--text-dim);
  }
  .panel-phone .icon { color: var(--accent); }

  /* Layout */
  .cards { grid-template-columns: 1fr; }
  .card-icon { width: 48px; height: 48px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-grid { grid-template-columns: 1fr; }
  .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: clamp(200px, 38vw, 300px);
  }
  .tile:nth-child(n) { grid-column: span 1; }
  .tile:nth-child(1) { grid-column: span 2; }
  .hero { padding-bottom: 130px; }
}

@media (max-width: 560px) {
  :root { --nav-h: 64px; }

  .nav-cta { display: none; }
  .brand-logo { height: 32px; }

  .section { padding: 72px 0; }
  .hero { padding-top: calc(var(--nav-h) + 40px); padding-bottom: 110px; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }
  .hero-meta {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .steps { grid-template-columns: 1fr; }
  .step { padding: 28px 0 32px; }
  .step p { max-width: none; }
  .work-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }
  .tile:nth-child(n) { grid-column: auto; }
  .tile { aspect-ratio: 4 / 3; }
  .tile figcaption { padding: 56px 18px 18px; }
  .cta-actions { flex-direction: column; }
  .cta-actions .btn { width: 100%; }
  .btn-lg { padding: 0 28px; }
  .footer-top { flex-direction: column; align-items: flex-start; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .error-hero .hero-cta { align-items: stretch; }
}

/* ---------- No-JS fallbacks ----------
   Without JS the hamburger cannot work, so show the links as a compact
   scrollable strip under the bar instead of hiding them. */
@media (max-width: 900px) {
  html:not(.js) .nav { height: auto; }
  html:not(.js) .nav::before { opacity: 1; }
  html:not(.js) .nav-inner { flex-wrap: wrap; height: auto; padding-block: 8px 0; }
  html:not(.js) .nav-toggle { display: none; }
  html:not(.js) .nav-backdrop { display: none; }
  html:not(.js) .nav-panel {
    position: static;
    order: 3;
    width: 100%;
    padding: 0;
    overflow-x: auto;
    background: none;
    border: 0;
    box-shadow: none;
    transform: none;
    visibility: visible;
  }
  html:not(.js) .nav-links { flex-direction: row; gap: 20px; width: max-content; }
  html:not(.js) .nav-links li { border: 0; }
  html:not(.js) .nav-links a { min-height: 44px; font-size: 0.95rem; }
  html:not(.js) .panel-foot { display: none; }
  html:not(.js) .hero,
  html:not(.js) .error-hero { padding-top: 150px; }
}
