/*
 * static/css/app.css
 * nle-web — Northern Lights Epoxy public site
 * (C) 2026 Chena Innovations LLC
 * Intellectual Property of Chena Innovations LLC & Northern Lights Epoxy
 * Created by Billy Jack Wiglesworth on April 20, 2026.
 *
 * Mobile-first. Palette derived from the NLE logo: night-sky base, aurora
 * green/teal/violet ribbons, snow-white surfaces. System fonts only.
 */

:root {
  --nav-h:      64px;      /* pinned topbar height — offsets content + anchors */
  --night-1:    #0a1428;   /* deep sky base */
  --night-2:    #101a30;   /* mid sky */
  --night-3:    #1a2540;   /* lifted surface */
  --ink:        #0d1119;   /* text on light */
  --ink-2:      #2a313d;
  --ink-3:      #5a6470;

  --paper:      #ffffff;
  --paper-2:    #f6f8fa;
  --paper-3:    #eef1f4;
  --paper-line: rgba(13, 17, 25, 0.08);

  --aurora-green:  #54eab2;   /* primary aurora */
  --aurora-teal:   #40bba8;
  --aurora-cyan:   #5fffd4;
  --aurora-violet: #6887b7;
  --aurora-indigo: #5a5f89;

  --accent:        #0a8757;   /* aurora green at AA contrast on white */
  --accent-hi:     #086d47;
  --accent-bg:     rgba(10, 135, 87, 0.08);

  --danger:        #b3203b;

  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-display: var(--font-sans);

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 14px;

  --max-w:     1180px;
  --max-w-narrow: 760px;
}

* { box-sizing: border-box; }

html {
  /* Anchor jumps (#section) land below the pinned topbar, not under it. */
  scroll-padding-top: var(--nav-h);
}
html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { overflow-x: hidden; }

/* Page content clears the fixed topbar so the first section isn't hidden. */
#main { padding-top: var(--nav-h); }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); }

h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.15; letter-spacing: -0.02em; }

.sr-skip {
  position: absolute; left: -9999px;
}
.sr-skip:focus {
  position: fixed; top: 8px; left: 8px;
  background: var(--accent); color: white;
  padding: 8px 14px; border-radius: var(--radius-sm); z-index: 1000;
}

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: var(--max-w-narrow); }

.muted { color: var(--ink-3); }

/* ============================================================ Topbar */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  box-sizing: border-box;
  background: rgba(10, 20, 40, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
}
.topbar-brand img { border-radius: 50%; }
.topbar-name {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.topbar-name strong { font-size: 15px; font-weight: 600; }
.topbar-name em { font-size: 11px; font-style: normal; color: var(--aurora-green); letter-spacing: 0.04em; }

.topbar-nav {
  display: none;
  gap: 4px;
  align-items: center;
}
.topbar-nav a {
  color: rgba(255, 255, 255, 0.85);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background 100ms, color 100ms;
}
.topbar-nav a:hover { color: white; background: rgba(255, 255, 255, 0.06); }
.topbar-nav a.cta {
  background: var(--aurora-green);
  color: var(--night-1);
  font-weight: 600;
  margin-left: 4px;
}
.topbar-nav a.cta:hover { background: var(--aurora-cyan); }

.topbar-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 32px; height: 24px;
  background: transparent; border: none; cursor: pointer; padding: 0;
}
.topbar-toggle span {
  height: 2px; background: white; border-radius: 1px;
  transition: transform 200ms, opacity 100ms;
}

.mnav {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--night-1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mnav[hidden] { display: none; }
.mnav a {
  color: white;
  padding: 12px 0;
  font-size: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.mnav a:last-child { border-bottom: none; color: var(--aurora-green); font-weight: 600; }

@media (min-width: 768px) {
  .topbar-nav { display: flex; }
  .topbar-toggle { display: none; }
  .mnav { display: none !important; }
}

/* ============================================================ Hero */

.hero {
  position: relative;
  background: radial-gradient(ellipse 120% 80% at 50% 10%, #0b1e30 0%, #060e1a 40%, #030810 100%);
  color: white;
  padding: 80px 20px 240px;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-aurora {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Base atmospheric glow — sky-wide color wash behind the curtains */
.aurora-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 30% 15%, rgba(40, 200, 120, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 50% 55% at 65% 10%, rgba(120, 220, 60, 0.08) 0%, transparent 65%),
    radial-gradient(ellipse 80% 40% at 50% 5%, rgba(60, 180, 140, 0.06) 0%, transparent 60%);
}

/* Vertical aurora curtain bands — each is a tall narrow gradient streak
   positioned to create the look of real aurora columns sweeping across
   the sky. Varying widths, opacities, rotations, and color shifts. */
.curtain {
  position: absolute;
  top: -20%;
  height: 90%;
  filter: blur(18px);
  border-radius: 50%;
  will-change: opacity;
  animation: curtain-pulse 8s ease-in-out infinite alternate;
}

.curtain.c1 {
  left: 8%;
  width: 90px;
  background: linear-gradient(180deg,
    rgba(50, 210, 130, 0.7) 0%,
    rgba(50, 210, 130, 0.4) 25%,
    rgba(40, 180, 120, 0.15) 60%,
    transparent 85%);
  transform: rotate(-6deg);
  opacity: 0.45;
  animation-delay: 0s;
}

.curtain.c2 {
  left: 18%;
  width: 140px;
  background: linear-gradient(180deg,
    rgba(60, 230, 150, 0.8) 0%,
    rgba(60, 230, 150, 0.5) 20%,
    rgba(50, 200, 130, 0.2) 55%,
    transparent 80%);
  transform: rotate(-3deg);
  opacity: 0.52;
  filter: blur(22px);
  animation-delay: -2s;
}

.curtain.c3 {
  left: 30%;
  width: 120px;
  background: linear-gradient(180deg,
    rgba(80, 235, 170, 0.75) 0%,
    rgba(70, 225, 150, 0.45) 22%,
    rgba(60, 200, 130, 0.15) 58%,
    transparent 82%);
  transform: rotate(2deg);
  opacity: 0.48;
  filter: blur(16px);
  animation-delay: -4s;
}

.curtain.c4 {
  left: 43%;
  width: 160px;
  background: linear-gradient(180deg,
    rgba(100, 240, 160, 0.8) 0%,
    rgba(90, 235, 140, 0.5) 18%,
    rgba(80, 210, 120, 0.2) 50%,
    transparent 78%);
  transform: rotate(-1deg);
  opacity: 0.55;
  filter: blur(24px);
  animation-delay: -1s;
}

.curtain.c5 {
  left: 56%;
  width: 130px;
  background: linear-gradient(180deg,
    rgba(140, 240, 100, 0.75) 0%,
    rgba(120, 235, 90, 0.45) 20%,
    rgba(100, 215, 80, 0.18) 55%,
    transparent 80%);
  transform: rotate(4deg);
  opacity: 0.48;
  filter: blur(20px);
  animation-delay: -5s;
}

.curtain.c6 {
  left: 68%;
  width: 180px;
  background: linear-gradient(180deg,
    rgba(160, 245, 70, 0.7) 0%,
    rgba(140, 240, 60, 0.42) 22%,
    rgba(120, 220, 50, 0.15) 52%,
    transparent 78%);
  transform: rotate(-2deg);
  opacity: 0.52;
  filter: blur(26px);
  animation-delay: -3s;
}

.curtain.c7 {
  left: 82%;
  width: 110px;
  background: linear-gradient(180deg,
    rgba(180, 240, 50, 0.6) 0%,
    rgba(160, 235, 45, 0.35) 25%,
    rgba(140, 215, 40, 0.12) 55%,
    transparent 80%);
  transform: rotate(3deg);
  opacity: 0.42;
  filter: blur(20px);
  animation-delay: -6s;
}

/* Horizon glow — warm green wash along the bottom where aurora meets mountains */
.horizon-glow {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 45%;
  background: linear-gradient(0deg,
    rgba(40, 180, 100, 0.15) 0%,
    rgba(60, 200, 120, 0.08) 30%,
    transparent 70%);
  pointer-events: none;
}

/* Subtle breathing animation for the curtains */
@keyframes curtain-pulse {
  0%   { opacity: var(--pulse-lo, 0.35); }
  100% { opacity: var(--pulse-hi, 0.60); }
}
.curtain.c1 { --pulse-lo: 0.35; --pulse-hi: 0.50; }
.curtain.c2 { --pulse-lo: 0.40; --pulse-hi: 0.58; }
.curtain.c3 { --pulse-lo: 0.38; --pulse-hi: 0.52; }
.curtain.c4 { --pulse-lo: 0.42; --pulse-hi: 0.60; }
.curtain.c5 { --pulse-lo: 0.38; --pulse-hi: 0.52; }
.curtain.c6 { --pulse-lo: 0.40; --pulse-hi: 0.55; }
.curtain.c7 { --pulse-lo: 0.32; --pulse-hi: 0.48; }

/* Dense starfield — two layers at different densities and sizes */
.stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.stars.s1 {
  background-image:
    radial-gradient(1px 1px at 5% 12%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 12% 45%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.2px 1.2px at 18% 8%, rgba(255,255,255,1), transparent),
    radial-gradient(1px 1px at 25% 62%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 33% 28%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1.5px 1.5px at 40% 5%, rgba(255,255,255,0.95), transparent),
    radial-gradient(1px 1px at 48% 38%, rgba(255,255,255,0.65), transparent),
    radial-gradient(1px 1px at 55% 18%, rgba(255,255,255,0.75), transparent),
    radial-gradient(1.3px 1.3px at 62% 52%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 70% 15%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 78% 42%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1.4px 1.4px at 85% 8%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 92% 55%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 97% 22%, rgba(255,255,255,0.65), transparent);
  opacity: 0.75;
}
.stars.s2 {
  background-image:
    radial-gradient(0.8px 0.8px at 3% 32%, rgba(255,255,255,0.5), transparent),
    radial-gradient(0.8px 0.8px at 9% 68%, rgba(255,255,255,0.45), transparent),
    radial-gradient(0.8px 0.8px at 16% 25%, rgba(255,255,255,0.55), transparent),
    radial-gradient(0.8px 0.8px at 22% 78%, rgba(255,255,255,0.4), transparent),
    radial-gradient(0.8px 0.8px at 29% 48%, rgba(255,255,255,0.5), transparent),
    radial-gradient(0.8px 0.8px at 37% 15%, rgba(255,255,255,0.55), transparent),
    radial-gradient(0.8px 0.8px at 44% 72%, rgba(255,255,255,0.4), transparent),
    radial-gradient(0.8px 0.8px at 52% 58%, rgba(255,255,255,0.45), transparent),
    radial-gradient(0.8px 0.8px at 59% 35%, rgba(255,255,255,0.5), transparent),
    radial-gradient(0.8px 0.8px at 66% 82%, rgba(255,255,255,0.4), transparent),
    radial-gradient(0.8px 0.8px at 74% 28%, rgba(255,255,255,0.5), transparent),
    radial-gradient(0.8px 0.8px at 81% 65%, rgba(255,255,255,0.45), transparent),
    radial-gradient(0.8px 0.8px at 88% 38%, rgba(255,255,255,0.5), transparent),
    radial-gradient(0.8px 0.8px at 95% 75%, rgba(255,255,255,0.4), transparent);
  opacity: 0.55;
}

.hero-mountains {
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 200px;
  z-index: 1;
  pointer-events: none;
}
.hero-mountains svg { width: 100%; height: 100%; display: block; }

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 820px;
  margin: 0 auto;
}
.hero-logo {
  border-radius: 50%;
  margin: 0 auto 20px;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.4));
}
.hero-headline {
  font-size: clamp(28px, 6vw, 48px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.4);
}
.hero-sub {
  font-size: clamp(15px, 2.4vw, 19px);
  color: rgba(255, 255, 255, 0.85);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.55;
}
.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---- Aurora responsive: widen curtains + increase blur for larger screens ---- */

@media (min-width: 768px) {
  .curtain.c1 { width: 160px; filter: blur(28px); }
  .curtain.c2 { width: 220px; filter: blur(32px); }
  .curtain.c3 { width: 190px; filter: blur(26px); }
  .curtain.c4 { width: 260px; filter: blur(36px); }
  .curtain.c5 { width: 210px; filter: blur(30px); }
  .curtain.c6 { width: 280px; filter: blur(38px); }
  .curtain.c7 { width: 180px; filter: blur(30px); }

  .aurora-glow {
    background:
      radial-gradient(ellipse 55% 50% at 25% 15%, rgba(40, 200, 120, 0.14) 0%, transparent 70%),
      radial-gradient(ellipse 45% 55% at 60% 10%, rgba(120, 220, 60, 0.10) 0%, transparent 65%),
      radial-gradient(ellipse 70% 40% at 45% 5%, rgba(60, 180, 140, 0.08) 0%, transparent 60%);
  }
}

@media (min-width: 1200px) {
  .curtain.c1 { left: 5%;  width: 240px; filter: blur(38px); }
  .curtain.c2 { left: 14%; width: 320px; filter: blur(44px); }
  .curtain.c3 { left: 26%; width: 280px; filter: blur(36px); }
  .curtain.c4 { left: 38%; width: 380px; filter: blur(50px); }
  .curtain.c5 { left: 52%; width: 300px; filter: blur(40px); }
  .curtain.c6 { left: 65%; width: 400px; filter: blur(52px); }
  .curtain.c7 { left: 80%; width: 260px; filter: blur(42px); }

  .aurora-glow {
    background:
      radial-gradient(ellipse 50% 50% at 22% 12%, rgba(40, 200, 120, 0.16) 0%, transparent 70%),
      radial-gradient(ellipse 40% 55% at 55% 8%, rgba(120, 220, 60, 0.12) 0%, transparent 65%),
      radial-gradient(ellipse 60% 40% at 42% 5%, rgba(60, 180, 140, 0.10) 0%, transparent 60%),
      radial-gradient(ellipse 35% 45% at 78% 15%, rgba(150, 235, 55, 0.08) 0%, transparent 60%);
  }

  .horizon-glow {
    height: 50%;
    background: linear-gradient(0deg,
      rgba(40, 180, 100, 0.12) 0%,
      rgba(60, 200, 120, 0.06) 35%,
      transparent 65%);
  }
}

/* ============================================================ Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 24px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 80ms, background 100ms, border-color 100ms, color 100ms;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--aurora-green);
  color: var(--night-1);
  border-color: var(--aurora-green);
}
.btn-primary:hover {
  background: var(--aurora-cyan);
  border-color: var(--aurora-cyan);
  color: var(--night-1);
}
.btn-ghost {
  background: transparent;
  color: white;
  border-color: rgba(255, 255, 255, 0.4);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: white;
  color: white;
}
.btn-block { width: 100%; padding: 14px; }

/* ============================================================ Sections */

.section { padding: 72px 0; }
.section-light { background: var(--paper); color: var(--ink); }
.section-dark  { background: var(--night-2); color: white; }
.section-aurora {
  background: linear-gradient(180deg, var(--night-2) 0%, var(--night-1) 100%);
  color: white;
  position: relative;
}

.section-head {
  text-align: center;
  margin-bottom: 48px;
}
.section-head h2 {
  font-size: clamp(24px, 4.5vw, 36px);
  font-weight: 700;
}
.section-head p { margin: 12px 0 0; }
.section-dark .section-head p { color: rgba(255, 255, 255, 0.7); }
.section-aurora .section-head p { color: rgba(255, 255, 255, 0.78); }

/* ============================================================ Services */

.services-grid {
  display: grid;
  /* Phones (≤640px): single column, cards stacked. */
  grid-template-columns: 1fr;
  gap: 16px;
}
/* Tablet portrait (≥641px, e.g. iPad portrait at 768px): 2 columns × 3 rows. */
@media (min-width: 641px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}
/* iPad landscape and desktop up: 3 columns × 2 rows.
   - Any viewport ≥1025px, OR
   - A landscape tablet (≥768px wide, landscape orientation) — so an iPad
     rotating from portrait (768px wide → 2 col) to landscape (1024px wide)
     switches up to 3 columns rather than staying at 2. */
@media (min-width: 1025px),
       (min-width: 768px) and (orientation: landscape) {
  .services-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}
.service-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--paper-2);
  border: 1px solid var(--paper-line);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: transform 120ms, border-color 120ms;
}
/* Reuse the hero aurora (same .hero-aurora/.curtain/.aurora-glow markup) as a
   subtle per-card accent at 40%. Aurora is a light-green wash on the light card,
   so the near-black title/body text stays well above AA contrast; the body is
   layered above the aurora. Motion is the hero's calm 8s curtain-pulse. */
.service-card .hero-aurora { opacity: 0.4; }
.service-card-body { position: relative; z-index: 1; }
.service-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.service-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 8px;
  text-align: center;
}
.service-card p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-2);
}

/* ============================================================ Process diagram */

.process-diagram {
  max-width: 1000px;
  margin: 0 auto;
}
.process-diagram img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg);
}

/* ============================================================ Color gallery */

.color-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (min-width: 540px) {
  .color-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 768px) {
  .color-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (min-width: 1024px) {
  .color-grid { grid-template-columns: repeat(6, 1fr); gap: 20px; }
}
@media (min-width: 1200px) {
  .color-grid { grid-template-columns: repeat(8, 1fr); }
}
.color-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.color-swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: none;
  box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.2);
}
.color-swatch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Every swatch type is a circle now (square 1:1 container + 50% radius +
   object-fit:cover crops mixed-aspect images to fill). Chips already used
   this; the rule is kept so chips stay circular even if the base changes. */
.color-swatch-chip {
  border-radius: 50%;
}
.color-name {
  font-size: 13px;
  font-weight: 500;
  color: inherit;
  text-align: center;
  opacity: 0.85;
}
.color-code {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink-3);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.color-desc {
  font-size: 11px;
  color: var(--ink-3);
  text-align: center;
  line-height: 1.35;
  max-width: 16ch;
}
/* Catalog areas (solid / variegated / fluorescent / chip) stacked in the white colors section. */
.color-area + .color-area { margin-top: 56px; }
.color-area-title {
  font-size: 20px;
  margin: 0 0 4px;
  color: var(--ink);
}
.color-area-sub { margin: 0 0 16px; }
/* Per-type caveat note (e.g. fluorescent: not UV stable / indoor only). */
.color-area-note {
  margin: 0 0 24px;
  padding: 10px 14px;
  max-width: 640px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: #92400e;
  background: #fef3c7;
  border-left: 3px solid #d97706;
  border-radius: 6px;
}

/* Preview limit: phones show 3 swatches inline, tablet/desktop show 6. The
   rest live in the "view all" modal (.color-grid-modal is exempt so it shows
   the full set). The button is rendered whenever a section has >3 colors so it
   appears on phones; on ≥641px it's hidden unless the section has >6 (.viewall-gt6). */
/* Default (phones): preview 3 — hide the 4th+ inline swatch. */
.color-grid:not(.color-grid-modal) > .color-card:nth-child(n + 4) {
  display: none;
}
/* Tablet / iPad / desktop: preview 6 — restore 4th–6th, hide the 7th+. */
@media (min-width: 641px) {
  .color-grid:not(.color-grid-modal) > .color-card:nth-child(n + 4) {
    display: flex;
  }
  .color-grid:not(.color-grid-modal) > .color-card:nth-child(n + 7) {
    display: none;
  }
  /* 6 are previewed on ≥641px, so only sections with >6 keep a "view all". */
  .color-area-actions:not(.actions-gt6) {
    display: none;
  }
}

/* iPad-landscape and desktop: center the swatch grid so a partial last row
   centers rather than left-aligning. Mobile/portrait keep the column grid. */
@media (min-width: 1024px) {
  .color-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
  }
  .color-grid > .color-card {
    flex: 0 0 130px;
  }
}

/* "View all [type]" button row. */
.color-area-actions {
  margin-top: 24px;
  text-align: center;
}
/* "View all" trigger sits on the white (section-light) colors section, so it
   must NOT inherit the white-on-white .btn-ghost look — render a clearly
   visible dark pill instead. */
.btn-viewall {
  cursor: pointer;
  background: var(--night-2);
  color: #fff;
  border-color: var(--night-2);
}
.btn-viewall:hover {
  background: var(--night-1);
  border-color: var(--night-1);
}

/* Color "view all" modal — in-page overlay, dimmed backdrop, scrollable. */
.cmodal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 8, 16, 0.92);
}
.cmodal[hidden] { display: none; }
.cmodal-panel {
  position: relative;
  width: 100%;
  max-width: min(1100px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;            /* panel stays put; inner .cmodal-scroll scrolls */
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius-lg);
}
/* Scrollable content area inside the panel. */
.cmodal-scroll {
  overflow-y: auto;
  padding: 28px;
}
.cmodal-title {
  margin: 0 0 20px;
  font-size: 22px;
  color: var(--ink);
  text-align: center;
}
/* Close button lives INSIDE the white panel, pinned to its top-right corner. */
.cmodal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  font-size: 26px;
  line-height: 1;
  color: var(--ink-3);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.cmodal-close:hover { background: var(--paper-3); color: var(--ink); }

/* ============================================================ Gallery */

.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 540px)  { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px)  { .gallery { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .gallery { grid-template-columns: repeat(4, 1fr); } }
.gallery-item {
  margin: 0;
  border: none;
  border-radius: 8px;
  overflow: hidden;
  background: var(--night-3);
  aspect-ratio: 4 / 3;
  position: relative;
  box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.2);
}
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.gallery-trigger {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.gallery-trigger:focus-visible {
  outline: 2px solid var(--aurora-green);
  outline-offset: -2px;
}
.gallery-item figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 10px 14px;
  background: linear-gradient(0deg, rgba(0,0,0,0.78), rgba(0,0,0,0));
  color: white;
  font-size: 13px;
}
.gallery-empty {
  text-align: center;
  padding: 40px 20px;
  background: var(--night-3);
  border-radius: var(--radius);
}
.gallery-empty p { margin: 0 0 6px; }
.gallery-empty .muted { color: rgba(255, 255, 255, 0.6); }

/* Recent-work lightbox popup */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 8, 16, 0.92);
}
.lightbox[hidden] { display: none; }
.lightbox-figure {
  margin: 0;
  max-width: min(1100px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox-img {
  max-width: 100%;
  max-height: 86vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
}
.lightbox-caption {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  text-align: center;
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 44px;
  height: 44px;
  font-size: 30px;
  line-height: 1;
  color: white;
  background: rgba(255, 255, 255, 0.1);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.2); }

/* ============================================================ About */

.prose {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-2);
  text-align: center;
}

/* ============================================================ Form */

.quote-form {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 28px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
@media (min-width: 600px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}
.quote-form label {
  display: block;
  margin-bottom: 16px;
}
.quote-form label > span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}
.quote-form label em {
  margin-left: 8px;
  font-style: normal;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.quote-form input[type="text"],
.quote-form input[type="email"],
.quote-form input[type="tel"],
.quote-form input[type="number"],
.quote-form select,
.quote-form textarea {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 15px;
  transition: box-shadow 100ms, background 100ms;
}
.quote-form input:focus,
.quote-form select:focus,
.quote-form textarea:focus {
  outline: none;
  background: white;
  box-shadow: 0 0 0 3px var(--aurora-green);
}
.quote-form textarea { resize: vertical; min-height: 110px; }
.quote-form .form-foot { margin: 14px 0 0; font-size: 13px; text-align: center; }

/* Honeypot — invisible to humans, present in DOM for bots */
.hp {
  position: absolute;
  left: -10000px; top: auto;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ============================================================ Footer */

.foot {
  background: var(--night-1);
  color: rgba(255, 255, 255, 0.7);
  padding: 40px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.foot-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  text-align: center;
}
@media (min-width: 768px) {
  .foot-inner {
    grid-template-columns: 1fr auto 1fr;
    text-align: left;
    align-items: center;
  }
  .foot-inner .foot-legal { text-align: right; }
}
.foot strong { color: white; font-size: 15px; }
.foot p { margin: 4px 0 0; font-size: 13px; }
.foot-links {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}
.foot-links a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}
.foot-links a:hover { color: var(--aurora-green); }
.foot-legal { font-size: 12px; }

/* ============================================================ Blank pages */

.page-blank {
  min-height: 100vh;
  background: linear-gradient(180deg, var(--night-1), var(--night-2));
  color: white;
}
.msg-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.msg-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
  max-width: 420px;
  width: 100%;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.msg-card img { margin: 0 auto 20px; border-radius: 50%; }
.msg-card h1 { font-size: 22px; font-weight: 600; margin-bottom: 12px; }
.msg-card .muted { color: rgba(255, 255, 255, 0.7); margin-bottom: 24px; }
.msg-card .btn { background: var(--aurora-green); color: var(--night-1); border-color: var(--aurora-green); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}