/* ============================================================
   ARTMAX Engineering — main stylesheet
   Tokens from brand-spec.md · dark stage canvas · blueprint grid
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  --bg:      oklch(16% 0.012 260);
  --surface: oklch(20% 0.014 260);
  --fg:      oklch(94% 0.006 250);
  --muted:   oklch(65% 0.015 255);
  --border:  oklch(100% 0 0 / 9%);
  --accent:  oklch(72% 0.13 250);
  --brand-navy: oklch(38% 0.055 262);

  --font-display: 'Unbounded', 'Avenir Next', system-ui, sans-serif;
  --font-body: 'Manrope', -apple-system, system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, monospace;

  --gutter: clamp(20px, 4vw, 64px);
  --maxw: 1440px;
}

/* ---------- 2. Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--brand-navy); color: var(--fg); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }

/* Blueprint grid — the logo's construction lines, site-wide */
.blueprint {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter);
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.blueprint span { border-left: 1px solid oklch(100% 0 0 / 4.5%); }
.blueprint span:last-child { border-right: 1px solid oklch(100% 0 0 / 4.5%); }

main, header.site, footer.site-footer { position: relative; z-index: 1; }

/* ---------- 3. Type ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex; align-items: center; gap: 12px;
}
.eyebrow::before { content: ''; width: 32px; height: 1px; background: var(--muted); }

h1, h2 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(38px, 6.2vw, 92px); line-height: 1.04; }
h2 { font-size: clamp(28px, 3.6vw, 52px); line-height: 1.1; }
h3 { font-family: var(--font-display); font-weight: 400; font-size: clamp(19px, 1.6vw, 24px); letter-spacing: -0.01em; }
.lead { font-size: clamp(17px, 1.4vw, 20px); color: var(--muted); max-width: 58ch; }

/* ---------- 4. Preloader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: grid; place-items: center;
  transition: opacity 0.6s ease 0.1s, visibility 0.6s ease 0.1s;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader-word {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(28px, 4vw, 56px); letter-spacing: -0.02em;
  display: flex; overflow: hidden;
}
.loader-word span {
  display: inline-block;
  transform: translateY(110%);
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--i) * 55ms);
}
@keyframes rise { to { transform: translateY(0); } }
.loader-beam {
  position: absolute; top: 0; bottom: 0; width: 140px;
  background: linear-gradient(90deg, transparent, oklch(72% 0.13 250 / 14%), transparent);
  transform: translateX(-60vw) skewX(-12deg);
  animation: sweep 1.1s cubic-bezier(0.65, 0, 0.35, 1) 0.5s forwards;
}
@keyframes sweep { to { transform: translateX(120vw) skewX(-12deg); } }

/* ---------- 5. Header ---------- */
header.site {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background 0.35s ease, border-color 0.35s ease;
  border-bottom: 1px solid transparent;
}
header.site.scrolled {
  background: oklch(16% 0.012 260 / 85%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}
.site-nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px;
}
.logo-img { height: 44px; width: auto; filter: brightness(0) invert(1); opacity: 0.95; }
.nav-links { display: flex; gap: clamp(18px, 3vw, 44px); list-style: none; }
.nav-links a {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  padding: 8px 0; position: relative; transition: color 0.25s;
}
.nav-links a:hover { color: var(--fg); }
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: 2px;
  width: 100%; height: 1px; background: var(--fg);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-phone { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.02em; color: var(--fg); }
@media (max-width: 820px) { .nav-links { display: none; } }

/* ---------- 6. Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  padding-bottom: clamp(40px, 7vh, 80px);
  padding-top: 76px;
  position: relative; overflow: hidden;
}
.hero-inner {
  flex: 1;
  display: flex; flex-direction: column; justify-content: space-between;
  gap: clamp(40px, 8vh, 120px);
  position: relative; z-index: 1; /* content above the searchlight layer */
}

/* Searchlights — three projector cones anchored at the hero's bottom
   edge, sweeping slowly upward behind the content */
.searchlights {
  position: absolute; inset: 0;
  overflow: hidden; pointer-events: none;
}
.searchlights i {
  position: absolute; bottom: -4%;
  left: var(--x);
  width: clamp(60px, 7vw, 110px); height: 78vh;
  background: linear-gradient(to top,
    oklch(62% 0.11 255 / 26%),
    oklch(62% 0.11 255 / 6%) 55%,
    transparent);
  clip-path: polygon(38% 100%, 62% 100%, 100% 0, 0 0);
  filter: blur(7px);
  transform-origin: 50% 100%;
  animation: sweep var(--dur) ease-in-out var(--del) infinite alternate;
}
@keyframes sweep {
  from { transform: rotate(-18deg); }
  to   { transform: rotate(20deg); }
}
.hero-word-block { padding-top: clamp(48px, 10vh, 128px); }
/* Neon wordmark — a stage sign in brand blue. Tight tracking is
   intentional: this is the brand lockup, not running caps. */
.beam-word {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(56px, 12.5vw, 182px);
  line-height: 0.95; letter-spacing: -0.01em;
}
.beam-word .lt {
  text-shadow:
    0 0 10px oklch(82% 0.09 252 / 50%),
    0 0 36px oklch(70% 0.13 252 / 32%),
    0 0 90px oklch(64% 0.14 252 / 20%);
}
/* Two letters flicker irregularly, like a tube warming up. Dips are dim
   (not off) and ≤3 per second — WCAG 2.3.1 flash-safe. */
.beam-word .lt-f1 { animation: neon-flicker 4.4s linear infinite; }
.beam-word .lt-f2 { animation: neon-flicker 6.2s linear 1.6s infinite; }
@keyframes neon-flicker {
  0%, 18.9%, 21.1%, 23.9%, 25.1%, 62.9%, 64.1%, 100% { opacity: 1; }
  19%, 21%, 24%, 25%, 63%, 64% { opacity: 0.35; text-shadow: none; }
}
.hero-sub {
  font-family: var(--font-mono);
  font-size: clamp(12px, 1.1vw, 15px);
  letter-spacing: 0.3em; /* echoes the wide ENGINEERING line in the logo lockup */
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 20px;
}
.hero-foot {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 32px; flex-wrap: wrap;
}
.hero-cta-col { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }

/* Projector cursor — hero only. JS adds .projector-on when active
   (mouse present, motion allowed); native cursor stays otherwise. */
.hero.projector-on { cursor: none; }
.hero.projector-on a, .hero.projector-on button { cursor: none; }
.projector-cursor {
  position: fixed; left: 0; top: 0; z-index: 45;
  pointer-events: none; opacity: 0;
  color: oklch(88% 0.02 250 / 85%);
  transition: opacity 0.25s ease;
  will-change: transform;
}
.projector-cursor.on { opacity: 1; }
.projector-cursor svg { display: block; overflow: visible; transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1); }
.projector-cursor.zoom svg { transform: scale(1.35); }
.projector-cursor .lens-glow {
  position: absolute; right: -3px; top: 50%;
  width: 9px; height: 9px; transform: translateY(-50%);
  border-radius: 50%;
  background: oklch(82% 0.1 252 / 95%);
  box-shadow: 0 0 14px 5px oklch(72% 0.13 250 / 40%);
}
.hero-meta {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); line-height: 2;
}

/* Buttons — accent budget: primary CTA only */
.btn {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--font-mono); font-size: 13px;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 18px 28px; border: 1px solid var(--border);
  background: transparent; color: var(--fg); cursor: pointer;
  transition: border-color 0.25s, background 0.25s, transform 0.15s;
}
.btn:active { transform: translateY(2px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: oklch(14% 0.02 260); }
.btn-primary:hover { background: oklch(78% 0.12 250); border-color: oklch(78% 0.12 250); }
.btn-ghost:hover { border-color: var(--muted); }
.btn .arr { transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
.btn:hover .arr { transform: translateX(5px); }

/* ---------- 7. Marquee ---------- */
.marquee {
  border-block: 1px solid var(--border);
  overflow: hidden; padding-block: 18px;
  display: flex; user-select: none;
}
.marquee-track {
  display: flex; gap: 56px; flex-shrink: 0; padding-right: 56px;
  animation: marquee 28s linear infinite;
  font-family: var(--font-mono); font-size: 13px;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap; align-items: center;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track i { font-style: normal; color: var(--brand-navy); font-size: 9px; }
@keyframes marquee { to { transform: translateX(-100%); } }

/* ---------- 8. Sections ---------- */
section { padding-block: clamp(72px, 12vh, 140px); }
.sec-head { display: flex; flex-direction: column; gap: 20px; margin-bottom: clamp(40px, 7vh, 80px); }

/* Services — numbered index rows */
.svc-list { list-style: none; border-top: 1px solid var(--border); }
.svc-row {
  display: grid; grid-template-columns: 80px 1fr 1.1fr 48px;
  gap: clamp(16px, 3vw, 48px); align-items: baseline;
  padding-block: clamp(24px, 4vh, 40px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s, padding-inline 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.svc-row:hover { background: oklch(100% 0 0 / 2.5%); padding-inline: 16px; }
.svc-num { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.02em; color: var(--muted); }
.svc-row p { color: var(--muted); font-size: 15.5px; max-width: 52ch; }
.svc-arr {
  justify-self: end; align-self: center; color: var(--muted);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), color 0.3s;
}
.svc-row:hover .svc-arr { transform: translate(4px, -4px); color: var(--fg); }
@media (max-width: 760px) {
  .svc-row { grid-template-columns: 48px 1fr; }
  .svc-row p { grid-column: 2; }
  .svc-arr { display: none; }
}

/* ---------- 9. Portfolio grid ---------- */
.works-grid {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: clamp(12px, 1.5vw, 20px);
}
.work { position: relative; overflow: hidden; }
.work:nth-child(1) { grid-column: span 4; aspect-ratio: 16/9; }
.work:nth-child(2) { grid-column: span 2; aspect-ratio: auto; }
.work:nth-child(3) { grid-column: span 2; aspect-ratio: 4/3.4; }
.work:nth-child(4) { grid-column: span 2; aspect-ratio: 4/3.4; }
.work:nth-child(5) { grid-column: span 2; aspect-ratio: 4/3.4; }
@media (max-width: 760px) {
  .works-grid { grid-template-columns: 1fr 1fr; }
  .work, .work:nth-child(1) { grid-column: span 2; aspect-ratio: 16/10; }
}

/* Honest photo placeholder: dark panel + beam + slot label.
   Swap each .ph-img for a real <img> when ARTMAX photos arrive. */
.ph-img {
  position: absolute; inset: 0;
  /* Layer 1: stage-truss blueprint linework (the product itself as motif,
     echoing the construction grid in the logo) over the beam + base coats. */
  background:
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='70' viewBox='0 0 140 70'><g fill='none' stroke='white' stroke-opacity='0.06' stroke-width='1.4'><path d='M0 8h140M0 62h140M0 62 35 8l35 54L105 8l35 54M35 8v54M105 8v54'/></g><g fill='white' fill-opacity='0.10'><circle cx='35' cy='8' r='2'/><circle cx='105' cy='8' r='2'/><circle cx='70' cy='62' r='2'/></g></svg>"),
    linear-gradient(118deg, transparent 30%, oklch(38% 0.055 262 / 30%) 52%, transparent 70%),
    linear-gradient(oklch(22% 0.016 260), oklch(18% 0.014 260));
  background-size: 140px 70px, auto, auto;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  display: grid; place-items: center;
}
.work:hover .ph-img { transform: scale(1.04); }
/* Vary the truss scale on alternating tiles so the grid doesn't tile visibly */
.work:nth-child(even) .ph-img { background-size: 190px 95px, auto, auto; }
.ph-img::after {
  content: attr(data-slot);
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: oklch(100% 0 0 / 38%);
  border: 1px dashed oklch(100% 0 0 / 24%);
  padding: 8px 14px;
}
.work-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 18px;
  background: linear-gradient(transparent, oklch(14% 0.012 260 / 85%));
}
.work-cap h3 { font-size: 16px; }
.work-cap span { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* ---------- 10. Statement ---------- */
.statement { border-block: 1px solid var(--border); }
.statement blockquote {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(24px, 3.2vw, 44px); line-height: 1.25; letter-spacing: -0.01em;
  max-width: 24ch; text-wrap: balance;
}
/* Word-cascade reveal — spans are injected by JS only when motion is allowed */
.statement blockquote .w {
  display: inline-block;
  opacity: 0; transform: translateY(0.55em);
  transition: opacity 0.5s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--wi) * 45ms);
}
.statement blockquote.in .w { opacity: 1; transform: none; }
.statement-grid {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(32px, 6vw, 96px);
  align-items: end;
}
.statement-side p { color: var(--muted); font-size: 15.5px; margin-bottom: 20px; }
.statement-side .eyebrow { margin-bottom: 24px; }
@media (max-width: 820px) { .statement-grid { grid-template-columns: 1fr; } }

/* ---------- 11. Contact ---------- */
.contact-grid {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(40px, 6vw, 110px);
}
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 26px; }
.field label {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.field input, .field select, .field textarea {
  background: transparent; border: 0; border-bottom: 1px solid var(--border);
  color: var(--fg); font-family: var(--font-body); font-size: 17px;
  padding: 12px 2px; outline: none; border-radius: 0;
  transition: border-color 0.3s;
  appearance: none; -webkit-appearance: none;
}
.field select { cursor: pointer; }
.field select option { background: var(--surface); color: var(--fg); }
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field select:focus, .field textarea:focus { border-bottom-color: var(--fg); }
.field.invalid input, .field.invalid textarea { border-bottom-color: oklch(60% 0.19 25); }
.field .err {
  font-size: 12.5px; letter-spacing: 0.01em; color: oklch(70% 0.16 25);
  display: none;
}
.field.invalid .err { display: block; }

.form-ok {
  display: none; border: 1px solid var(--border); padding: 32px;
  font-size: 16px; line-height: 1.6;
}
.form-ok.show { display: block; }
.form-ok strong { font-family: var(--font-display); font-weight: 400; display: block; margin-bottom: 8px; font-size: 20px; }

.contact-direct { display: flex; flex-direction: column; gap: 36px; }
.contact-direct .eyebrow { margin-bottom: 4px; }
.contact-direct a.big {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(19px, 1.8vw, 26px); letter-spacing: -0.01em;
  transition: color 0.25s;
}
.contact-direct a.big:hover { color: var(--muted); }
.socials { display: flex; gap: 24px; }
.socials a {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid transparent; padding-bottom: 3px;
  transition: color 0.25s, border-color 0.25s;
}
.socials a:hover { color: var(--fg); border-color: var(--fg); }

/* ---------- 12. Footer ---------- */
footer.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 40px;
}
.footer-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 24px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.footer-row .logo-img { height: 34px; opacity: 0.7; }

/* ---------- 13. Scroll reveals ---------- */
.rv { opacity: 0; transform: translateY(28px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1); }
.rv.in { opacity: 1; transform: none; }
.rv-d1 { transition-delay: 0.08s; }
.rv-d2 { transition-delay: 0.16s; }
.rv-d3 { transition-delay: 0.24s; }

/* ---------- 14. Ship polish: anchors, focus, mobile nav, select ---------- */
/* Anchored sections must clear the 76px fixed header */
section[id] { scroll-margin-top: 84px; }

.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 200;
  background: var(--fg); color: oklch(16% 0.012 260);
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 12px 18px;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--fg); outline-offset: 3px;
}
/* Underline fields keep outline off; focus = 2px high-contrast underline */
.field input:focus, .field select:focus, .field textarea:focus {
  box-shadow: 0 1px 0 0 var(--fg);
}

.field select {
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'><path d='M3 5l4 4 4-4' fill='none' stroke='%23929aa8' stroke-width='1.6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 4px center;
  background-size: 14px;
  padding-right: 30px;
}

/* Mobile navigation */
.menu-btn {
  display: none;
  width: 44px; height: 44px;
  background: transparent; border: 1px solid var(--border);
  color: var(--fg); cursor: pointer;
  place-items: center;
}
.menu-btn svg { display: block; }
@media (max-width: 820px) {
  .menu-btn { display: grid; }
}
@media (max-width: 480px) {
  .nav-phone { display: none; } /* the number lives inside the menu overlay */
}
.mobile-nav {
  position: fixed; inset: 0; z-index: 60;
  background: oklch(16% 0.012 260 / 97%);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  display: none; flex-direction: column; justify-content: center;
  padding: 0 var(--gutter);
}
.mobile-nav.open { display: flex; }
body.nav-open { overflow: hidden; }
.mobile-nav a {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(28px, 8vw, 44px); letter-spacing: -0.01em;
  padding: 16px 0; border-bottom: 1px solid var(--border);
}
.mobile-nav .mobile-nav-phone {
  font-family: var(--font-mono); font-size: 14px; letter-spacing: 0.08em;
  border-bottom: 0; margin-top: 28px;
}
.mobile-nav .close-btn { position: absolute; top: 16px; right: var(--gutter); display: grid; }

@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; }
  .statement blockquote .w { opacity: 1; transform: none; transition: none; }
  .marquee-track, .loader-word span, .loader-beam,
  .searchlights i, .beam-word .lt-f1, .beam-word .lt-f2 { animation: none !important; }
  .loader-word span { transform: none; }
  html { scroll-behavior: auto; }
}
