/* ==========================================================================
   RONNIE DUDLEY ENGINEERING LTD
   --------------------------------------------------------------------------
   Table of contents
     1.  Design tokens
     2.  Reset & base
     3.  Utilities (container, logo treatment, eyebrows, buttons)
     4.  Loading screen
     5.  Ambient background (canvas glow, grid, grain)
     6.  Scroll progress
     7.  Header & navigation
     8.  Mobile menu
     9.  Hero
     10. Marquee
     11. Sections (shared)
     12. About
     13. Services
     14. Values
     15. Projects
     16. Contact & form
     17. Footer
     18. Scroll-to-top
     19. Reveal-on-scroll animation system
     20. Responsive
     21. Reduced motion
   ========================================================================== */


/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */

:root {
  /* Surfaces */
  --bg:          #0a0a0b;   /* page background — near black          */
  --bg-panel:    #0d0d0f;   /* alternating section background        */
  --bg-raised:   #101013;   /* cards & panels                        */
  --bg-raised-2: #141418;   /* hover state for raised surfaces       */

  /* Type */
  --text:        #f5f5f2;   /* headings / primary text               */
  --text-soft:   rgba(245, 245, 242, 0.62);  /* body copy            */
  --text-faint:  rgba(245, 245, 242, 0.38);  /* microcopy, meta      */

  /* Accent — muted gold, used sparingly */
  --gold:        #c9a876;
  --gold-bright: #e6cfa4;
  --gold-08:     rgba(201, 168, 118, 0.08);
  --gold-15:     rgba(201, 168, 118, 0.15);
  --gold-35:     rgba(201, 168, 118, 0.35);

  /* Hairlines */
  --line:        rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);

  /* Typography */
  --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-mono:  "Geist Mono", "SF Mono", ui-monospace, monospace;

  /* Motion */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);   /* premium decelerate */
  --ease-soft:  cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --container:  1160px;
  --gutter:     clamp(20px, 4vw, 48px);
  --header-h:   76px;
}


/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Freeze scrolling while the loader or mobile menu is open */
body.is-loading,
body.menu-open {
  overflow: hidden;
}

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

ul {
  list-style: none;
}

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

::selection {
  background: var(--gold-35);
  color: var(--text);
}

/* Keyboard focus — visible, elegant */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 300;
  padding: 10px 18px;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 14px;
  transform: translateY(-200%);
  transition: transform 0.3s var(--ease-out);
}

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


/* ==========================================================================
   3. UTILITIES
   ========================================================================== */

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

/*
 * Logo treatment.
 * The site uses pre-generated white-on-transparent versions of the
 * supplied logos (logo/*-white.png) so the marks sit cleanly on any
 * dark surface. The originals are kept untouched in /logo.
 */
.logo-white {
  user-select: none;
  -webkit-user-drag: none;
}

/* Serif accent — the single italic flourish used in headings */
.serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* Section eyebrow — mono label with gold index */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.eyebrow__num {
  color: var(--gold);
  letter-spacing: 0.1em;
}

.eyebrow__num::after {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--gold-35);
  margin-left: 12px;
  vertical-align: middle;
}

/* Small gold square used in the hero eyebrow */
.tick {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--gold);
  margin-right: 12px;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 30px;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 0.35s var(--ease-out),
    background-color 0.35s var(--ease-soft),
    border-color 0.35s var(--ease-soft),
    color 0.35s var(--ease-soft),
    box-shadow 0.35s var(--ease-soft);
}

.btn--small {
  padding: 11px 22px;
  font-size: 14px;
}

.btn--primary {
  background: var(--text);
  color: #0a0a0b;
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -8px rgba(245, 245, 242, 0.25);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
}

.btn--ghost:hover {
  border-color: var(--gold-35);
  color: var(--gold-bright);
  transform: translateY(-2px);
}

.btn__arrow {
  transition: transform 0.35s var(--ease-out);
}

.btn:hover .btn__arrow {
  transform: translateX(4px);
}


/* ==========================================================================
   4. LOADING SCREEN
   ========================================================================== */

.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition:
    transform 0.9s var(--ease-out),
    visibility 0s linear 0.9s;
}

.loader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.loader__icon {
  width: 88px;
  height: auto;
  animation: loader-breathe 1.6s var(--ease-soft) infinite alternate;
}

@keyframes loader-breathe {
  from { opacity: 0.55; transform: scale(0.97); }
  to   { opacity: 1;    transform: scale(1); }
}

.loader__bar {
  width: 160px;
  height: 1px;
  background: var(--line);
  overflow: hidden;
}

.loader__bar-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--gold);
  transform: translateX(-100%);
  animation: loader-fill 1.1s var(--ease-out) forwards;
}

@keyframes loader-fill {
  to { transform: translateX(0); }
}

/* Loader exits by sliding up like a curtain */
.loader.is-done {
  transform: translateY(-100%);
  visibility: hidden;
}

/* Returning visitors within a session skip the loader entirely */
.loader.is-skipped {
  display: none;
}


/* ==========================================================================
   5. AMBIENT BACKGROUND
   ========================================================================== */

/* Slow-drifting glow, painted by js/main.js */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
}

/* Faint blueprint grid */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 30%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 30%, black 30%, transparent 100%);
}

/* Film grain — kills gradient banding, adds texture */
.grain {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}


/* ==========================================================================
   6. SCROLL PROGRESS
   ========================================================================== */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 150;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  transform-origin: left;
  transform: scaleX(0);
}


/* ==========================================================================
   7. HEADER & NAVIGATION
   ========================================================================== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition:
    background-color 0.4s var(--ease-soft),
    border-color 0.4s var(--ease-soft),
    backdrop-filter 0.4s var(--ease-soft);
  border-bottom: 1px solid transparent;
}

/* Solidify once the page is scrolled */
.header.is-scrolled {
  background: rgba(10, 10, 11, 0.72);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom-color: var(--line);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  height: var(--header-h);
}

.header__logo img {
  height: 34px;
  width: auto;
  transition: opacity 0.3s var(--ease-soft);
}

.header__logo:hover img {
  opacity: 0.8;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  position: relative;
  display: inline-block;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-soft);
  transition: color 0.3s var(--ease-soft);
}

/* Animated underline, grows from the left */
.nav-link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
}

.nav-link:hover::after,
.nav-link.is-active::after {
  transform: scaleX(1);
}

/* Burger — hidden on desktop */
.menu-toggle {
  display: none;
  position: relative;
  z-index: 130;
  width: 44px;
  height: 44px;
  background: none;
  border: 0;
  cursor: pointer;
}

.menu-toggle__line {
  position: absolute;
  left: 10px;
  width: 24px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.4s var(--ease-out), top 0.4s var(--ease-out);
}

.menu-toggle__line:nth-child(1) { top: 18px; }
.menu-toggle__line:nth-child(2) { top: 26px; }

.menu-toggle[aria-expanded="true"] .menu-toggle__line:nth-child(1) {
  top: 22px;
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__line:nth-child(2) {
  top: 22px;
  transform: rotate(-45deg);
}


/* ==========================================================================
   8. MOBILE MENU
   ========================================================================== */

.mobile-menu {
  position: fixed;
  inset: 0;
  /* Sits just below the fixed header so the logo and close button stay visible */
  z-index: 96;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--header-h) var(--gutter) 48px;
  background: rgba(10, 10, 11, 0.97);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s var(--ease-soft), visibility 0s linear 0.45s;
}

.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.mobile-menu__list {
  display: flex;
  flex-direction: column;
}

.mobile-menu__link {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  font-size: clamp(28px, 7vw, 40px);
  font-weight: 600;
  letter-spacing: -0.03em;
  /* Staggered entrance, driven by --i set in the markup order */
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.mobile-menu.is-open .mobile-menu__link {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger each row */
.mobile-menu.is-open li:nth-child(1) .mobile-menu__link { transition-delay: 0.08s; }
.mobile-menu.is-open li:nth-child(2) .mobile-menu__link { transition-delay: 0.14s; }
.mobile-menu.is-open li:nth-child(3) .mobile-menu__link { transition-delay: 0.2s; }
.mobile-menu.is-open li:nth-child(4) .mobile-menu__link { transition-delay: 0.26s; }
.mobile-menu.is-open li:nth-child(5) .mobile-menu__link { transition-delay: 0.32s; }

.mobile-menu__index {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--gold);
}

.mobile-menu__footer {
  margin-top: 48px;
}

.mobile-menu__email {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
  transition: color 0.3s;
}

.mobile-menu__email:hover {
  color: var(--gold);
}


/* ==========================================================================
   9. HERO
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--header-h);
  /* Reserve room for the absolutely-positioned base strip */
  padding-bottom: 110px;
}

.hero__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: clamp(40px, 8vh, 96px);
}

.hero__eyebrow {
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 36px;
}

.hero__title {
  font-size: clamp(44px, 8.4vw, 104px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.04;
}

/* Masked line reveal: each line slides up from behind its mask */
.hero__line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;   /* room for descenders inside the mask */
  margin-bottom: -0.08em;
}

.hero__line-inner {
  display: block;
  transform: translateY(115%);
  transition: transform 1.1s var(--ease-out);
  transition-delay: var(--d, 0s);
}

.hero__line-inner--serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  /* Gradient gold — the one big accent moment on the page */
  background: linear-gradient(100deg, var(--gold-bright) 10%, var(--gold) 55%, #9a7d50 95%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

body.is-ready .hero__line-inner {
  transform: translateY(0);
}

.hero__lede {
  max-width: 560px;
  margin-top: 36px;
  font-size: clamp(16px, 1.9vw, 18px);
  line-height: 1.7;
  color: var(--text-soft);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 44px;
}

/* Bottom strip — scroll hint + meta */
.hero__base {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 28px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.hero__scroll-hint {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero__scroll-line {
  display: inline-block;
  width: 48px;
  height: 1px;
  background: var(--line-strong);
  position: relative;
  overflow: hidden;
}

/* A gold pulse travels along the scroll line */
.hero__scroll-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: translateX(-100%);
  animation: scroll-pulse 2.6s var(--ease-soft) infinite;
}

@keyframes scroll-pulse {
  0%   { transform: translateX(-100%); }
  55%  { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

/* Simple fade-up entrance used for hero furniture */
.anim-fade {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: var(--d, 0s);
}

body.is-ready .anim-fade {
  opacity: 1;
  transform: translateY(0);
}


/* ==========================================================================
   10. MARQUEE
   ========================================================================== */

.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding-block: 22px;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 36s linear infinite;
}

.marquee:hover .marquee__track {
  animation-play-state: paused;
}

.marquee__group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.marquee__group span {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}

/* Gold dot separators */
.marquee__group i {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  margin-inline: 36px;
  opacity: 0.6;
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}


/* ==========================================================================
   11. SECTIONS — SHARED
   ========================================================================== */

.section {
  position: relative;
  padding-block: clamp(96px, 14vw, 176px);
}

/* Alternating "panel" sections get a slightly lifted surface */
.section--panel {
  background: var(--bg-panel);
  border-block: 1px solid var(--line);
}

.section__head {
  max-width: 720px;
  margin-bottom: clamp(56px, 7vw, 96px);
}

.section__title {
  margin-top: 28px;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.section__note {
  margin-top: 24px;
  font-size: 15px;
  color: var(--text-faint);
}

/* Two-column layout: sticky eyebrow left, content right */
.section__grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: start;
}

.section__side {
  position: sticky;
  top: calc(var(--header-h) + 40px);
}


/* ==========================================================================
   12. ABOUT
   ========================================================================== */

.about__copy {
  max-width: 620px;
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.about__copy p {
  font-size: clamp(16px, 1.9vw, 18px);
  line-height: 1.75;
  color: var(--text-soft);
}

.about__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 44px;
}

.about__tags li {
  padding: 9px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
  transition: border-color 0.35s var(--ease-soft), color 0.35s var(--ease-soft);
}

.about__tags li:hover {
  border-color: var(--gold-35);
  color: var(--gold-bright);
}


/* ==========================================================================
   13. SERVICES
   ========================================================================== */

.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  position: relative;
  overflow: hidden;
  padding: 36px 32px 40px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 18px;
  transition:
    transform 0.5s var(--ease-out),
    border-color 0.5s var(--ease-soft),
    background-color 0.5s var(--ease-soft);
}

/* Cursor-tracked spotlight — --mx / --my are set by js/main.js */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 0%),
    var(--gold-08),
    transparent 65%
  );
  opacity: 0;
  transition: opacity 0.5s var(--ease-soft);
  pointer-events: none;
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--gold-35);
  background: var(--bg-raised-2);
}

.card:hover::before {
  opacity: 1;
}

.card__index {
  position: absolute;
  top: 30px;
  right: 30px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  transition: color 0.4s var(--ease-soft);
}

.card:hover .card__index {
  color: var(--gold);
}

.card__icon {
  width: 40px;
  height: 40px;
  color: var(--text-soft);
  transition: color 0.4s var(--ease-soft), transform 0.5s var(--ease-out);
}

.card:hover .card__icon {
  color: var(--gold);
  transform: translateY(-2px);
}

.card__title {
  margin-top: 26px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.card__text {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-soft);
}


/* ==========================================================================
   14. VALUES
   ========================================================================== */

.values__list {
  border-top: 1px solid var(--line);
}

.values__row {
  display: grid;
  grid-template-columns: 90px 1fr 1.1fr;
  align-items: baseline;
  gap: 24px;
  padding: 34px 20px;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.4s var(--ease-soft);
}

.values__row:hover {
  background: rgba(255, 255, 255, 0.022);
}

.values__num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
  transition: color 0.4s var(--ease-soft);
}

.values__row:hover .values__num {
  color: var(--gold);
}

.values__name {
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 600;
  letter-spacing: -0.03em;
  transition: transform 0.5s var(--ease-out);
}

.values__row:hover .values__name {
  transform: translateX(10px);
}

.values__desc {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-soft);
}


/* ==========================================================================
   15. PROJECTS
   ========================================================================== */

.projects__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project__media {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 11;
  background: var(--bg-raised);
}

.project__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease-out), opacity 0.5s var(--ease-soft);
}

.project:hover .project__media img {
  transform: scale(1.045);
}

.project__info {
  padding: 22px 6px 0;
}

.project__tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.project__title {
  margin-top: 10px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.project__meta {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-faint);
}


/* ==========================================================================
   16. CONTACT & FORM
   ========================================================================== */

.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(48px, 6vw, 96px);
  align-items: start;
}

.contact__lede {
  margin-top: 28px;
  max-width: 420px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-soft);
}

.contact__channels {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  margin-top: 44px;
}

.contact__email {
  position: relative;
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 500;
  letter-spacing: -0.02em;
  transition: color 0.35s var(--ease-soft);
}

/* Underline sweep on hover */
.contact__email::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease-out);
}

.contact__email:hover {
  color: var(--gold-bright);
}

.contact__email:hover::after {
  transform: scaleX(1);
}

/* Form panel */
.contact__panel {
  padding: clamp(28px, 4vw, 44px);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.form__honeypot {
  position: absolute;
  left: -9999px;
}

.form__field {
  margin-bottom: 28px;
}

.form__label {
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.form__input {
  width: 100%;
  padding: 12px 2px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--text);
  transition: border-color 0.35s var(--ease-soft);
}

.form__input:focus {
  outline: none;
  border-bottom-color: var(--gold);
}

.form__input--area {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.form__input.is-invalid {
  border-bottom-color: #b0574f;
}

.form__error {
  display: block;
  min-height: 18px;
  margin-top: 6px;
  font-size: 12.5px;
  color: #cf7b73;
}

.form__submit {
  width: 100%;
  margin-top: 8px;
}

.form__status {
  min-height: 22px;
  margin-top: 16px;
  text-align: center;
  font-size: 14px;
  color: var(--text-soft);
}

.form__status.is-success { color: var(--gold-bright); }
.form__status.is-error   { color: #cf7b73; }


/* ==========================================================================
   17. FOOTER
   ========================================================================== */

.footer {
  border-top: 1px solid var(--line);
  background: #070708;
  padding-block: 64px 40px;
}

.footer__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 32px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line);
}

.footer__logo img {
  height: 40px;
  width: auto;
  opacity: 0.92;
  transition: opacity 0.3s var(--ease-soft);
}

.footer__logo:hover img {
  opacity: 1;
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
}

.footer__nav a {
  font-size: 14px;
  color: var(--text-soft);
  transition: color 0.3s var(--ease-soft);
}

.footer__nav a:hover {
  color: var(--text);
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 32px;
}

.footer__copy {
  font-size: 13px;
  color: var(--text-faint);
}

.footer__strap {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.75;
}


/* ==========================================================================
   18. SCROLL-TO-TOP
   ========================================================================== */

.to-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition:
    opacity 0.4s var(--ease-soft),
    visibility 0.4s,
    transform 0.4s var(--ease-out),
    border-color 0.4s var(--ease-soft);
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  border-color: var(--gold-35);
  transform: translateY(-3px);
}

.to-top img {
  width: 24px;
  height: auto;
}


/* ==========================================================================
   19. REVEAL-ON-SCROLL
   Elements with .reveal fade & rise when they enter the viewport.
   --d (set inline) staggers siblings.
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 1s var(--ease-out),
    transform 1s var(--ease-out);
  transition-delay: var(--d, 0s);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}


/* ==========================================================================
   20. RESPONSIVE
   ========================================================================== */

@media (max-width: 1023px) {
  .services__grid  { grid-template-columns: repeat(2, 1fr); }
  .projects__grid  { grid-template-columns: repeat(2, 1fr); }
  .section__grid   { grid-template-columns: 1fr; gap: 8px; }
  .section__side   { position: static; }
}

@media (max-width: 767px) {
  /* Switch to burger navigation */
  .header__nav,
  .header__cta { display: none; }
  .menu-toggle  { display: block; }

  .header__logo img { height: 28px; }

  .hero__content { text-align: left; align-items: flex-start; }
  .hero__actions { justify-content: flex-start; }
  .hero__title   { font-size: clamp(40px, 11.5vw, 64px); }
  .hero__meta    { display: none; }

  .services__grid,
  .projects__grid { grid-template-columns: 1fr; }

  .values__row {
    grid-template-columns: 48px 1fr;
    row-gap: 8px;
    padding-inline: 4px;
  }

  .values__desc { grid-column: 2; }

  .contact__grid { grid-template-columns: 1fr; }

  .footer__top,
  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .to-top { right: 18px; bottom: 18px; }
}


/* ==========================================================================
   21. REDUCED MOTION
   Every animation collapses to its resting state.
   ========================================================================== */

@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;
  }

  .reveal,
  .anim-fade,
  .hero__line-inner {
    opacity: 1;
    transform: none;
  }

  .marquee__track { animation: none; }
}
