/* ============================================================
   GENIKO — Modern UI 2026
   Refined design system: tokens, glass nav, layered hero,
   elegant cards, smooth motion. All legacy class names preserved.
   ============================================================ */

:root {
  /* Brand */
  --navy: #0a0b0d;
  --navy-2: #16181b;
  --navy-3: #202228;
  --ink: #141517;
  --charcoal: #17191c;
  --charcoal-2: #202228;

  /* Surfaces */
  --paper: #f6f7f9;
  --paper-2: #ffffff;
  --paper-3: #eef1f4;
  --surface-1: #ffffff;
  --surface-2: #fafbfc;
  --surface-3: #f1f3f6;

  /* Text */
  --text: #0e1622;
  --text-soft: #2a3547;
  --text-mute: #5b6776;
  --text-faint: #8693a3;
  --text-inverse: #eef3f8;
  --muted: #5b6776;
  --gray-400: #b9c5d1;
  --gray-500: #8f9aaa;
  --gray-600: #687381;

  /* Accent (warm crimson for engineering brand) */
  --primary: #a31f19;
  --primary-2: #c4271f;
  --primary-3: #de3b32;
  --primary-soft: rgba(163, 31, 25, 0.10);
  --primary-glow: rgba(196, 39, 31, 0.35);
  --accent: #d8a85b;       /* subtle warm gold for highlights */
  --accent-soft: rgba(216, 168, 91, 0.18);

  /* Lines */
  --line: rgba(7, 17, 31, 0.08);
  --line-strong: rgba(7, 17, 31, 0.16);
  --line-light: rgba(255, 255, 255, 0.10);
  --line-light-strong: rgba(255, 255, 255, 0.18);

  /* States */
  --success: #1f7a4c;
  --error: #9b2525;
  --warning: #c0851b;

  /* Radius scale */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* Shadows — layered, soft, premium */
  --shadow-xs: 0 1px 2px rgba(7, 17, 31, 0.06);
  --shadow-sm: 0 4px 12px rgba(7, 17, 31, 0.06), 0 1px 3px rgba(7, 17, 31, 0.04);
  --shadow: 0 14px 40px -12px rgba(7, 17, 31, 0.18), 0 4px 12px rgba(7, 17, 31, 0.06);
  --shadow-strong: 0 30px 70px -18px rgba(7, 17, 31, 0.28), 0 10px 24px rgba(7, 17, 31, 0.10);
  --shadow-glow: 0 0 0 1px rgba(196, 39, 31, 0.18), 0 18px 50px -12px rgba(196, 39, 31, 0.32);

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --d-fast: 0.18s;
  --d: 0.28s;
  --d-slow: 0.5s;

  /* Layout */
  --container: 1200px;
  --container-tight: 1080px;
  --section-y: 110px;
  --header-h: 84px;

  /* Gradients */
  --grad-navy: linear-gradient(135deg, #0a0b0d 0%, #16181b 50%, #24262c 100%);
  --grad-navy-soft: linear-gradient(180deg, #16181b 0%, #0a0b0d 100%);
  --grad-paper: linear-gradient(180deg, #fbfcfd 0%, #f3f5f8 100%);
  --grad-primary: linear-gradient(135deg, #a31f19 0%, #c4271f 60%, #de3b32 100%);
}

.settings-block-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.settings-help {
    color: #aebdcc;
    margin: -6px 0 0;
    font-size: 0.85rem;
    line-height: 1.5;
}

.field-help {
    display: block;
    margin-top: 7px;
    color: #aebdcc;
    font-size: 0.82rem;
    line-height: 1.45;
}

.icon-html-field {
    font-family: "IBM Plex Mono", Consolas, monospace;
    min-height: 118px;
    resize: vertical;
}

.admin-icon-preview {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(196, 39, 31, 0.22);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(196, 39, 31, 0.14), rgba(196, 39, 31, 0.06));
    color: var(--primary);
    line-height: 1;
}

.license-cards-editor {
    display: grid;
    gap: 16px;
}

.license-editor-card {
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 16px;
    background: rgba(255,255,255,0.035);
}

.license-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.license-editor-head h4 {
    margin: 0;
}

body.admin-light .settings-help {
    color: #8a99a8;
}

body.admin-light .field-help {
    color: #718094;
}

body.admin-light .license-editor-card {
    border-color: #d9e0e7;
    background: #f8fafc;
}

@media (max-width: 720px) {
    .settings-block-head,
    .license-editor-head {
        align-items: stretch;
        flex-direction: column;
    }
}

/* ----- Reset / base ----- */
* { box-sizing: border-box; }
*::selection { background: var(--primary); color: #fff; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  background: var(--paper);
  color: var(--text);
  line-height: 1.6;
  letter-spacing: -0.005em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.nav-open { overflow: hidden; }

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }

/* Custom scrollbar */
html { scrollbar-width: thin; scrollbar-color: var(--text-faint) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #c1cad4, #9aa5b3);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--primary), var(--primary-2)); background-clip: padding-box; }

/* Typography */
p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 1rem;
}

h1, h2, h3, h4, h5 {
  margin: 0 0 16px;
  line-height: 1.08;
  letter-spacing: -0.022em;
  color: var(--text);
  font-weight: 800;
}

h1 {
  max-width: 14ch;
  font-size: clamp(2.6rem, 5.4vw, 5rem);
  letter-spacing: -0.035em;
  font-weight: 850;
}

h2 {
  font-size: clamp(1.85rem, 3.4vw, 2.95rem);
  letter-spacing: -0.028em;
}

h3 {
  font-size: 1.22rem;
  font-weight: 750;
  letter-spacing: -0.012em;
}

h4 { font-size: 1rem; font-weight: 750; }

::-moz-selection { background: var(--primary); color: #fff; }

/* ----- Container & sections ----- */
.container {
  width: min(var(--container), calc(100% - 40px));
  margin-inline: auto;
}

.section {
  position: relative;
  padding: var(--section-y) 0;
  background: var(--paper);
  overflow: clip;
}

.section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 400px at 0% 0%, rgba(196, 39, 31, 0.04), transparent 60%),
    radial-gradient(700px 380px at 100% 100%, rgba(7, 17, 31, 0.05), transparent 60%);
  pointer-events: none;
}

/* Subtle dotted backdrop on light sections */
.section > .container { position: relative; z-index: 1; }

.section-dark {
  color: var(--text-inverse);
  background: var(--grad-navy);
}

.section-dark::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(800px 460px at 12% 18%, rgba(196, 39, 31, 0.18), transparent 55%),
    radial-gradient(700px 420px at 100% 100%, rgba(255, 255, 255, 0.06), transparent 60%),
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px) 0 0 / 56px 56px;
  pointer-events: none;
  mask-image: linear-gradient(180deg, #000, #000 70%, transparent);
}

.section-dark p,
.section-dark .project-meta,
.section-dark small {
  color: #b9c5d1;
}

/* Section heading */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 44px;
}

.section-head > div {
  min-width: 0;
}

.section-head h2 { max-width: 760px; }

.section-head > div h2 {
  margin-bottom: 0;
}

.section-more-link {
  flex: 0 0 auto;
  margin-bottom: 4px;
  white-space: nowrap;
}

/* Eyebrow */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 5px 14px 5px 12px;
  margin-bottom: 18px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(196, 39, 31, 0.16);
}

.section-dark .eyebrow,
.hero .eyebrow,
.page-hero .eyebrow {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: #ffd5d2;
  backdrop-filter: blur(10px);
}

.section-dark .eyebrow::before,
.hero .eyebrow::before,
.page-hero .eyebrow::before {
  background: #ffd5d2;
  box-shadow: 0 0 0 4px rgba(255, 213, 210, 0.18);
}

/* ============================================================
   HEADER / NAVIGATION
   ============================================================ */
.site-header {
  position: fixed;
  z-index: 60;
  top: 0; right: 0; left: 0;
  border-bottom: 1px solid transparent;
  /* Highly transparent glass — only a hint of tint */
  background: rgba(10, 11, 13, 0.04);
  backdrop-filter: saturate(135%) blur(8px);
  -webkit-backdrop-filter: saturate(135%) blur(8px);
  transition: background var(--d) var(--ease), border-color var(--d) var(--ease), box-shadow var(--d) var(--ease);
}

.site-header.is-scrolled,
.site-header:focus-within {
  background: rgba(10, 11, 13, 0.18);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: transform var(--d) var(--ease);
}
.brand:hover { transform: translateY(-1px); }

.brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(196, 39, 31, 0.35));
  transition: filter var(--d) var(--ease), transform var(--d) var(--ease);
}
.brand:hover img { transform: rotate(-3deg); filter: drop-shadow(0 6px 18px rgba(196, 39, 31, 0.55)); }

.brand span { white-space: nowrap; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.018);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.main-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  color: #d6e0eb;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  transition: color var(--d) var(--ease);
}

.main-nav a::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.85));
  opacity: 0;
  transform: scale(0.92);
  transition: opacity var(--d) var(--ease), transform var(--d) var(--ease-spring);
  z-index: -1;
  box-shadow: 0 8px 22px -6px rgba(255, 255, 255, 0.45);
}

.main-nav a:hover { color: var(--navy); }
.main-nav a:hover::before { opacity: 1; transform: scale(1); }

.main-nav a.active {
  color: #fff;
  background: var(--grad-primary);
  box-shadow: 0 10px 26px -8px rgba(196, 39, 31, 0.6);
}
.main-nav a.active::before { opacity: 0; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle,
.admin-theme-toggle,
.menu-toggle,
.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.025);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  backdrop-filter: blur(8px);
  transition: background var(--d) var(--ease), border-color var(--d) var(--ease), transform var(--d) var(--ease), color var(--d) var(--ease);
}

.theme-toggle:hover,
.admin-theme-toggle:hover,
.menu-toggle:hover,
.lang-toggle:hover {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.lang-toggle.is-active {
  border-color: transparent;
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 8px 18px -6px rgba(196, 39, 31, 0.55);
}

.menu-toggle { display: none; }

.mobile-nav {
  display: none;
  width: min(100% - 32px, 540px);
  margin: 0 auto 16px;
  padding: 10px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  background: rgba(10, 11, 13, 0.96);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-strong);
}

.mobile-nav.open {
  display: grid;
  animation: dropIn 0.32s var(--ease-out);
}

.mobile-nav a {
  padding: 13px 14px;
  border-radius: var(--radius-xs);
  color: #f2f6fa;
  font-weight: 650;
  transition: background var(--d) var(--ease);
}

.mobile-nav a:hover { background: rgba(255, 255, 255, 0.08); }

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100svh;
  overflow: hidden;
  color: #fff;
  background: var(--navy);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(800px 600px at 18% 30%, rgba(196, 39, 31, 0.22), transparent 60%),
    radial-gradient(700px 600px at 100% 100%, rgba(216, 168, 91, 0.10), transparent 60%);
  pointer-events: none;
  z-index: 1;
}

.hero::after {
  content: none;
}

.hero-slideshow,
.hero-slide,
.hero-grid { position: absolute; inset: 0; }

.hero-slideshow {
  inset: -32px;
}

.hero-grid {
  inset: -96px;
}

.hero-slide {
  background-size: cover;
  background-position: center;
  opacity: 0;
  filter: grayscale(60%) contrast(1.05) brightness(0.95);
  transform: scale(1.06);
  transition: opacity 1.2s var(--ease-out), transform 8s var(--ease-out);
}

.hero-slide.active {
  opacity: 0.5;
  transform: scale(1);
}

.hero-slideshow::after {
  content: "";
  position: absolute;
  inset: 0;
  /* Lighter overlay so the slideshow images are clearly visible */
  background:
    linear-gradient(90deg, rgba(10, 11, 13, 0.78), rgba(10, 11, 13, 0.42) 50%, rgba(10, 11, 13, 0.78)),
    linear-gradient(180deg, rgba(10, 11, 13, 0.05), rgba(10, 11, 13, 0.55));
}

.hero-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 72px 72px;
  opacity: 0.42;
  mask-image: radial-gradient(ellipse at 30% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 30%, transparent 75%);
  animation: floatGrid 22s linear infinite;
  z-index: 1;
}

@keyframes floatGrid {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(72px, 72px, 0); }
}

.hero-content {
  position: relative;
  z-index: 3;
  padding: 150px 0 80px;
}

.hero-content h1 {
  margin-bottom: 22px;
  color: #fff;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.3);
}

.hero-title-accent {
  color: var(--primary-3);
  text-shadow: 0 10px 34px rgba(196, 39, 31, 0.42);
}

/* Headline builds in word-by-word (JS splits into .reveal-word spans).
   Starts hidden so repeat page loads (no page-loader shield) don't flash
   plain text before JS wraps it — JS forces opacity back to 1 if it bails
   out (reduced motion) so the headline is never stuck invisible. */
.hero-content h1 { opacity: 0; }
.hero-content h1 .reveal-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.5em) rotate(3deg);
  filter: blur(6px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out), filter 0.6s var(--ease-out);
  transition-delay: calc(var(--i) * 40ms);
}
.hero-content h1.is-revealed {
  opacity: 1;
}
.hero-content h1.is-revealed .reveal-word {
  opacity: 1;
  transform: translateY(0) rotate(0deg);
  filter: blur(0);
}

.hero-content > .eyebrow { animation: floatIn 0.7s var(--ease-out) both; }
.hero-content > p { animation: floatIn 0.9s 0.16s var(--ease-out) both; }
.hero-content .hero-actions { animation: floatIn 0.9s 0.24s var(--ease-out) both; }
.hero-content .stats-row { animation: floatIn 0.95s 0.32s var(--ease-out) both; }

@keyframes floatIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-content p {
  max-width: 60ch;
  color: #d3dee9;
  font-size: 1.15rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 36px 0 38px;
}

/* Animated scroll cue (positioned on hero, hidden on small screens) */
.hero::before { z-index: 1; }

.scroll-cue {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 28px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 44px;
  border: 1.5px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  transform: translateX(-50%);
  opacity: 0.8;
  pointer-events: none;
}

.scroll-cue::after {
  content: "";
  width: 4px;
  height: 8px;
  background: #fff;
  border-radius: 4px;
  animation: scrollCue 1.8s var(--ease-out) infinite;
}

@keyframes scrollCue {
  0% { transform: translateY(-9px); opacity: 0; }
  40% { opacity: 1; }
  100% { transform: translateY(11px); opacity: 0; }
}

@media (max-width: 768px) {
  .scroll-cue { display: none; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn,
.btn-small,
.ref-link,
.career-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  font-weight: 700;
  letter-spacing: 0.005em;
  line-height: 1;
  white-space: nowrap;
  isolation: isolate;
  transition: transform var(--d) var(--ease), background var(--d) var(--ease),
              border-color var(--d) var(--ease), color var(--d) var(--ease),
              box-shadow var(--d) var(--ease);
}

.btn { min-height: 50px; padding: 0 22px; font-size: 0.95rem; }

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.16), transparent 40%);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--d) var(--ease);
}
.btn:hover::after { opacity: 1; }

.btn:hover,
.btn-small:hover,
.ref-link:hover,
.career-btn:hover { transform: translateY(-2px); }

.btn-primary,
.career-btn {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 12px 28px -10px rgba(196, 39, 31, 0.55), 0 2px 6px rgba(0,0,0,0.08);
}

.btn-primary:hover,
.career-btn:hover {
  box-shadow: 0 18px 38px -10px rgba(196, 39, 31, 0.7), 0 4px 12px rgba(0,0,0,0.1);
  background: linear-gradient(135deg, #b62321 0%, #d22d23 60%, #e8413a 100%);
}

.btn-secondary {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.14);
}

/* On light sections, adapt secondary */
.section:not(.section-dark) .btn-secondary,
.contact-cta-actions:not(.contact-cta .contact-cta-actions) {
  /* keep dark secondary for hero/CTA */
}

.btn-one-line { white-space: nowrap; }

/* Underlined text link with animated arrow */
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-weight: 750;
  font-size: 0.95rem;
  position: relative;
  transition: color var(--d) var(--ease);
}

.text-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  width: 100%; height: 1.5px;
  background: currentColor;
  transform-origin: 0 0;
  transform: scaleX(0.3);
  opacity: 0.5;
  transition: transform var(--d) var(--ease-out), opacity var(--d) var(--ease);
}

.text-link:hover::after { transform: scaleX(1); opacity: 1; }
.text-link:hover { color: var(--primary-2); }

.section-dark .text-link,
.hero .text-link { color: #fff; }

/* ============================================================
   STATS
   ============================================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 820px;
  gap: 14px;
  margin-top: 38px;
}

.stat-card {
  position: relative;
  min-height: 138px;
  padding: 22px 22px 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.04));
  backdrop-filter: blur(14px);
  overflow: hidden;
  transition: transform var(--d) var(--ease), border-color var(--d) var(--ease), background var(--d) var(--ease);
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 80px; height: 2px;
  background: var(--grad-primary);
  opacity: 0.85;
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: -50%;
  background: radial-gradient(200px 200px at 80% 80%, rgba(196, 39, 31, 0.18), transparent 70%);
  opacity: 0;
  transition: opacity var(--d) var(--ease);
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.28);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06));
}
.stat-card:hover::after { opacity: 1; }

.stat-card strong,
.stat-card span {
  color: #fff;
  font-family: "IBM Plex Mono", monospace;
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #fff 0%, #cfd2d8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-card p {
  margin: 12px 0 0;
  color: #cad6e2;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ============================================================
   TWO COLUMN
   ============================================================ */
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 48px;
  align-items: start;
}

.two-col > .reveal > p {
  max-width: 68ch;
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--text-soft);
}

.feature-panel { display: grid; gap: 14px; }

/* ============================================================
   CARDS (universal)
   ============================================================ */
.feature-item,
.card,
.project-card,
.team-card,
.reference-item,
.contact-panel,
.contact-form,
.license-card,
.career-card,
.admin-card,
.admin-form-card,
.admin-table-card,
.settings-block,
.login-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  box-shadow: var(--shadow-sm);
  transition: transform var(--d) var(--ease), border-color var(--d) var(--ease), box-shadow var(--d) var(--ease), background var(--d) var(--ease);
}

/* Cursor-tracking spotlight glow (JS sets --spot-x/--spot-y on mousemove) */
.feature-item,
.card,
.project-card,
.license-card,
.career-card,
.reference-item {
  --spot-x: 50%;
  --spot-y: 50%;
  position: relative;
  overflow: hidden;
}

.feature-item::after,
.card::after,
.project-card::after,
.license-card::after,
.career-card::after,
.reference-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(260px circle at var(--spot-x) var(--spot-y), rgba(196, 39, 31, 0.16), transparent 70%);
  opacity: 0;
  transition: opacity var(--d) var(--ease);
  pointer-events: none;
}

.feature-item:hover::after,
.card:hover::after,
.project-card:hover::after,
.license-card:hover::after,
.career-card:hover::after,
.reference-item:hover::after {
  opacity: 1;
}

.feature-item {
  position: relative;
  min-height: 168px;
  padding: 26px;
  overflow: hidden;
}

.feature-item::before,
.card::before,
.license-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--grad-primary);
  opacity: 0;
  transition: opacity var(--d) var(--ease);
}

.feature-item:hover::before,
.card:hover::before,
.license-card:hover::before { opacity: 1; }

.feature-item:hover,
.license-card:hover {
  transform: translateY(-4px);
  border-color: rgba(196, 39, 31, 0.28);
  box-shadow: var(--shadow);
}

.feature-item h3,
.card h3,
.license-card h3 { color: var(--navy); }

/* Dark variants */
.section-dark .feature-item,
.section-dark .card,
.section-dark .reference-item,
.section-dark .career-card {
  border-color: var(--line-light);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}

.section-dark .feature-item:hover,
.section-dark .card:hover,
.section-dark .reference-item:hover,
.section-dark .career-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

.section-dark .feature-item h3,
.section-dark .card h3,
.section-dark .reference-item span,
.section-dark .career-card h3 { color: #fff; }

/* ----- Service / generic card ----- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.card {
  position: relative;
  min-height: 250px;
  padding: 26px;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(196, 39, 31, 0.30);
  box-shadow: var(--shadow);
}

.card-icon,
.license-icon {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  margin-bottom: 20px;
  border: 1px solid rgba(196, 39, 31, 0.22);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(196, 39, 31, 0.14), rgba(196, 39, 31, 0.06));
  color: var(--primary);
  font-size: 1.35rem;
  font-weight: 900;
  transition: transform var(--d) var(--ease), background var(--d) var(--ease);
}

.card-icon svg,
.license-icon svg,
.admin-icon-preview svg {
  width: 27px;
  height: 27px;
  display: block;
}

.card:hover .card-icon,
.license-card:hover .license-icon {
  transform: rotate(-6deg) scale(1.06);
  background: linear-gradient(135deg, rgba(196, 39, 31, 0.22), rgba(196, 39, 31, 0.10));
}

/* ----- Project card ----- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.project-card {
  overflow: hidden;
  background: #fff;
}

.project-card:hover {
  transform: translateY(-7px);
  border-color: rgba(196, 39, 31, 0.32);
  box-shadow: var(--shadow-strong);
}

.project-card a { display: grid; height: 100%; }

.project-image {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #d3dde6, #aab8c5);
}

.project-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(7, 17, 31, 0.55));
  z-index: 1;
  opacity: 0.85;
  transition: opacity var(--d) var(--ease);
}

.project-card:hover .project-image::before { opacity: 0.65; }

.project-image::after {
  content: "→";
  position: absolute;
  inset: auto 18px 18px auto;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--navy);
  font-size: 1.2rem;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  z-index: 2;
  transform: translateY(8px) scale(0.85);
  opacity: 0;
  transition: transform var(--d) var(--ease-spring), opacity var(--d) var(--ease);
}

.project-card:hover .project-image::after {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.project-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out), filter 0.6s var(--ease-out);
}

.project-card:hover .project-image img {
  transform: scale(1.08);
  filter: saturate(1.1) contrast(1.05);
}

.project-body {
  display: grid;
  align-content: start;
  min-height: 230px;
  padding: 24px;
  gap: 4px;
}

.project-meta {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-body h3 { color: var(--navy); }

.project-body p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  line-clamp: 4;
}

/* ----- Filters ----- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: #fff;
  box-shadow: var(--shadow-xs);
  width: max-content;
  max-width: 100%;
}

.filters a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--navy);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.005em;
  transition: background var(--d) var(--ease), color var(--d) var(--ease), transform var(--d) var(--ease);
}

.filters a:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.filters a.active {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 8px 18px -6px rgba(196, 39, 31, 0.5);
}

/* ----- Team ----- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.team-card {
  position: relative;
  min-height: 400px;
  overflow: hidden;
  background: var(--charcoal);
  border-color: transparent;
  box-shadow: var(--shadow);
}

.team-card img {
  width: 100%; height: 100%;
  min-height: 400px;
  object-fit: cover;
  filter: grayscale(0.3) contrast(1.04);
  transition: transform 0.6s var(--ease-out), filter 0.45s var(--ease);
}

.team-card:hover img {
  transform: scale(1.06);
  filter: grayscale(0) contrast(1);
}

.team-overlay {
  position: absolute;
  right: 0; bottom: 0; left: 0;
  padding: 70px 22px 22px;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(10, 11, 13, 0.55) 35%, rgba(10, 11, 13, 0.96));
  transition: padding var(--d) var(--ease);
}

.team-overlay h3 { color: #fff; margin-bottom: 6px; }
.team-overlay p { color: #d7e2ed; margin-bottom: 8px; font-size: 0.92rem; }

.team-email {
  display: inline-flex;
  overflow-wrap: anywhere;
  font-size: 0.86rem;
  font-weight: 700;
  color: #ffd5d2 !important;
  transition: color var(--d) var(--ease);
}
.team-email:hover { color: #fff !important; }

/* ----- Ticker ----- */
.ticker {
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.section-dark .ticker {
  border-color: var(--line-light);
  background: rgba(255, 255, 255, 0.03);
}

.ticker-track {
  display: flex;
  width: max-content;
  gap: 14px;
  padding: 22px 0;
  animation: tickerMove 38s linear infinite;
}

.ticker:hover .ticker-track { animation-play-state: paused; }

.ticker-track span {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--navy);
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: var(--shadow-xs);
  transition: transform var(--d) var(--ease), border-color var(--d) var(--ease);
}

.ticker-track span:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.section-dark .ticker-track span {
  border-color: var(--line-light);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

@keyframes tickerMove {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ----- Reference list ----- */
.reference-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.reference-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 92px;
  padding: 20px;
}

.reference-item:hover {
  transform: translateY(-3px);
  border-color: rgba(196, 39, 31, 0.32);
  box-shadow: var(--shadow);
}

.reference-item > div { min-width: 0; }

.reference-item span {
  display: block;
  color: var(--navy);
  font-weight: 800;
  overflow-wrap: anywhere;
  letter-spacing: -0.012em;
}

.reference-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ref-link {
  min-height: 38px;
  padding: 0 14px;
  border-color: rgba(196, 39, 31, 0.26);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 750;
}

.ref-link:hover {
  background: var(--grad-primary);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 22px -8px rgba(196, 39, 31, 0.5);
}

/* ============================================================
   PAGE HERO
   ============================================================ */
.page-hero {
  position: relative;
  overflow: hidden;
  padding: 168px 0 92px;
  color: #fff;
  background: var(--grad-navy);
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(700px 500px at 15% 30%, rgba(196, 39, 31, 0.22), transparent 55%),
    radial-gradient(500px 360px at 88% 100%, rgba(216, 168, 91, 0.10), transparent 60%),
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px) 0 0 / 56px 56px;
  mask-image: linear-gradient(180deg, #000, #000 60%, transparent);
  -webkit-mask-image: linear-gradient(180deg, #000, #000 60%, transparent);
  pointer-events: none;
}

.page-hero::after {
  content: "";
  position: absolute;
  right: 6%;
  bottom: -64px;
  width: 320px;
  height: 200px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  transform: skewX(-18deg);
  pointer-events: none;
}

.page-hero .container { position: relative; z-index: 1; }

.page-hero h1 {
  max-width: 880px;
  color: #fff;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
}

.page-hero p {
  max-width: 760px;
  color: #d7e1eb;
  font-size: 1.08rem;
  line-height: 1.7;
}

/* ============================================================
   PROJECT DETAIL — EDITORIAL (IPM-inspired)
   ============================================================ */
.project-editorial {
  position: relative;
  padding-top: 0;
}

.project-editorial-hero {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 720px;
  overflow: hidden;
  background: var(--navy);
}

.project-editorial-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  animation: heroImgEntry 1.4s var(--ease-out) both;
}

@keyframes heroImgEntry {
  from { transform: scale(1.12); opacity: 0; }
  to { transform: scale(1.02); opacity: 1; }
}

.project-editorial-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 11, 13, 0.45) 0%, rgba(10, 11, 13, 0) 30%, rgba(10, 11, 13, 0) 55%, rgba(10, 11, 13, 0.85) 100%);
  pointer-events: none;
}

.project-editorial-hero-content {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: 36px 0 44px;
  color: #fff;
}

.project-editorial-hero-content .container { display: grid; gap: 18px; }

.project-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  margin-bottom: 12px;
  padding: 6px 14px 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
  transition: background var(--d) var(--ease), transform var(--d) var(--ease);
}
.project-back-link:hover { background: rgba(255, 255, 255, 0.18); transform: translateX(-3px); }

.project-editorial-hero-content h1 {
  max-width: 16ch;
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 4.6vw, 4rem);
  letter-spacing: -0.03em;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.project-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.005em;
  backdrop-filter: blur(8px);
}

.project-tag.is-accent {
  background: var(--grad-primary);
  border-color: transparent;
  box-shadow: 0 6px 18px -6px rgba(196, 39, 31, 0.55);
}

.project-tag svg {
  width: 14px; height: 14px;
  opacity: 0.9;
}

/* Body grid — description + sticky metadata */
.project-editorial-body {
  padding: 80px 0;
  background: var(--paper);
}

.project-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 56px;
  align-items: start;
}

.project-body-content {
  font-size: 1.08rem;
  line-height: 1.85;
  color: var(--text-soft);
  max-width: 68ch;
}

.project-body-content p { margin-bottom: 18px; color: var(--text-soft); }

.project-meta-card {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.project-meta-card h4 {
  margin: 0 0 18px;
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.project-meta-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}

.project-meta-list li {
  display: grid;
  gap: 4px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.project-meta-list li:last-child { padding-bottom: 0; border-bottom: none; }

.project-meta-list .meta-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.project-meta-list .meta-value {
  color: var(--navy);
  font-size: 1rem;
  font-weight: 700;
}

/* Editorial gallery */
.gallery-editorial {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  margin-top: 48px;
}

.gallery-editorial .gallery-frame {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: var(--surface-3);
  box-shadow: var(--shadow-xs);
  transition: transform var(--d) var(--ease), box-shadow var(--d) var(--ease);
}

.gallery-editorial .gallery-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.gallery-editorial .gallery-frame:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.gallery-editorial .gallery-frame:hover img { transform: scale(1.06); }

/* Mosaic pattern: 1st item full-width, then 2-col, then 3-col */
.gallery-editorial .gallery-frame:nth-child(1) { grid-column: span 6; aspect-ratio: 16 / 9; }
.gallery-editorial .gallery-frame:nth-child(2) { grid-column: span 3; aspect-ratio: 4 / 3; }
.gallery-editorial .gallery-frame:nth-child(3) { grid-column: span 3; aspect-ratio: 4 / 3; }
.gallery-editorial .gallery-frame:nth-child(n+4) { grid-column: span 2; aspect-ratio: 1 / 1; }

/* Other projects */
.related-projects {
  padding: 80px 0 100px;
  background: var(--surface-3);
  border-top: 1px solid var(--line);
}

.related-projects .section-head { margin-bottom: 32px; }

.related-projects .project-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 992px) {
  .project-editorial-hero { height: 100svh; min-height: 560px; }
  .project-body-grid { grid-template-columns: 1fr; gap: 36px; }
  .project-meta-card { position: static; }
  .gallery-editorial { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gallery-editorial .gallery-frame:nth-child(n+4) { grid-column: span 2; }
  .related-projects .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .project-editorial-hero { height: 86svh; min-height: 460px; }
  .project-editorial-hero-content { padding: 24px 0 28px; }
  .gallery-editorial { grid-template-columns: 1fr; }
  .gallery-editorial .gallery-frame:nth-child(2),
  .gallery-editorial .gallery-frame:nth-child(3),
  .gallery-editorial .gallery-frame:nth-child(n+4) { grid-column: span 1; aspect-ratio: 4 / 3; }
  .gallery-editorial .gallery-frame:nth-child(1) { grid-column: span 1; aspect-ratio: 16 / 9; }
  .related-projects .project-grid { grid-template-columns: 1fr; }
}

/* Light mode tweaks */
body.light-mode .project-editorial-body { background: var(--paper); }
body.light-mode .related-projects { background: #eef1f5; border-top-color: var(--line); }

/* ============================================================
   PROJECT DETAIL — legacy classes kept for compat
   ============================================================ */
.project-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(320px, 0.96fr);
  gap: 32px;
  align-items: start;
}

.project-detail-image,
.project-detail-content {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.project-detail-image { overflow: hidden; }

.project-detail-image img {
  width: 100%; height: 100%;
  min-height: 480px;
  object-fit: cover;
  transition: transform 0.7s var(--ease-out);
}
.project-detail-image:hover img { transform: scale(1.03); }

.project-detail-content { padding: 32px; }

.detail-list {
  display: grid;
  gap: 10px;
  padding: 0 0 22px;
  margin: 0 0 24px;
  border-bottom: 1px solid var(--line);
  list-style: none;
}

.detail-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.detail-list strong {
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  min-width: 110px;
}

.rich-text {
  color: var(--text-soft);
  line-height: 1.75;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.project-gallery-item {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-xs);
  transition: transform var(--d) var(--ease), box-shadow var(--d) var(--ease), border-color var(--d) var(--ease);
}

.project-gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(196, 39, 31, 0.32);
}

.project-gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-out);
}

.project-gallery-item:hover img { transform: scale(1.06); }

/* ============================================================
   LICENSES
   ============================================================ */
.licenses-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.license-card {
  position: relative;
  min-height: 230px;
  padding: 26px;
  overflow: hidden;
}

.licenses-note {
  max-width: 920px;
  margin: 32px 0 0;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-xs);
  color: var(--text-soft);
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: 26px;
  align-items: stretch;
}

.contact-panel,
.contact-form {
  padding: 32px;
}

.contact-mail-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 20px;
}

.contact-panel h2,
.contact-form h2 { color: var(--navy); }

.contact-form label { color: var(--navy); }

.contact-panel a {
  color: var(--primary);
  font-weight: 800;
}

.contact-panel p {
  color: var(--text-soft);
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.contact-panel p strong {
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  min-width: 92px;
}

.contact-panel p:nth-of-type(3) {
  flex-wrap: nowrap;
  white-space: nowrap;
}

.contact-panel p:nth-of-type(3) strong {
  flex: 0 0 auto;
  min-width: auto;
}

.map-embed {
  overflow: hidden;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-3);
  box-shadow: var(--shadow-xs);
}

.map-embed iframe { display: block; width: 100%; }

.contact-email-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.005em;
}

.contact-cta-section {
  position: relative;
  background: var(--grad-navy);
  overflow: hidden;
}
.contact-cta-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 400px at 10% 20%, rgba(196, 39, 31, 0.18), transparent 60%),
    radial-gradient(500px 360px at 95% 95%, rgba(216, 168, 91, 0.10), transparent 60%);
}

.contact-cta {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: center;
  color: #fff;
  z-index: 1;
}

.contact-cta h2 { color: #fff; }
.contact-cta p { max-width: 720px; color: #d5e0ea; font-size: 1.05rem; }

.contact-more-link {
  margin-top: 4px;
  color: #ffd5d2;
}

body:not(.light-mode):not(.admin-body) .section-more-link,
body:not(.light-mode):not(.admin-body) .contact-more-link {
  color: #fff;
}

body:not(.light-mode):not(.admin-body) .section-more-link:hover,
body:not(.light-mode):not(.admin-body) .contact-more-link:hover {
  color: #ffd5d2;
}

.contact-cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

/* ============================================================
   CAREER
   ============================================================ */
.career-section { padding: var(--section-y) 0; background: var(--paper); }

.career-wrap {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(340px, 1.15fr);
  gap: 32px;
}

.career-intro {
  position: sticky;
  top: 116px;
  align-self: start;
}

.career-list { display: grid; gap: 14px; }

.career-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
}

.career-card:hover {
  transform: translateY(-4px);
  border-color: rgba(196, 39, 31, 0.30);
  box-shadow: var(--shadow);
}

.career-card h3 { color: var(--navy); margin-bottom: 6px; }
.career-card p { margin-bottom: 4px; font-size: 0.92rem; color: var(--text-soft); }

.career-btn {
  min-height: 42px;
  padding: 0 18px;
  font-size: 0.88rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  position: relative;
  color: #d9e4ef;
  border-top: 2px solid var(--primary-2);
  background: var(--grad-navy);
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(800px 460px at 0% 0%, rgba(196, 39, 31, 0.10), transparent 55%),
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px) 0 0 / 64px 64px;
  mask-image: linear-gradient(180deg, transparent, #000 30%);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%);
  pointer-events: none;
}

.footer-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.85fr) minmax(180px, 0.6fr);
  gap: 40px;
  padding: 72px 0 44px;
}

.site-footer h3,
.site-footer h4 { color: #fff; }

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.footer-brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 5px 14px rgba(196, 39, 31, 0.35));
}

.footer-brand h3 {
  margin: 0;
}

.site-footer h4 {
  margin-bottom: 18px;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #ffd5d2;
}

.site-footer p,
.site-footer a {
  color: #c7d4e0;
  transition: color var(--d) var(--ease);
}

.site-footer p { margin-bottom: 10px; line-height: 1.65; }
.site-footer a:hover { color: #fff; }

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.social-link {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  transition: background var(--d) var(--ease), transform var(--d) var(--ease), border-color var(--d) var(--ease), box-shadow var(--d) var(--ease);
}

.social-link:hover {
  border-color: transparent;
  background: var(--grad-primary);
  transform: translateY(-3px) rotate(-4deg);
  box-shadow: 0 12px 24px -8px rgba(196, 39, 31, 0.6);
}

.footer-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0 28px;
  border-top: 1px solid var(--line-light);
  color: #aebdcc;
  font-size: 0.88rem;
}

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.85s var(--ease-out), transform 0.85s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ============================================================
   PAGE LOADER — premium first-visit reveal
   ============================================================ */
.page-loader {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: none;
  place-items: center;
  justify-items: center;
  align-content: center;
  gap: 26px;
  padding: 28px;
  text-align: center;
  background:
    radial-gradient(900px 700px at 50% 45%, rgba(196, 39, 31, 0.22), transparent 65%),
    radial-gradient(600px 500px at 50% 100%, rgba(216, 168, 91, 0.10), transparent 60%),
    var(--grad-navy);
  overflow: hidden;
}

.page-loader::before,
.page-loader::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Subtle scan-line / vignette */
.page-loader::before {
  background:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px) 0 0 / 56px 56px;
  mask-image: radial-gradient(ellipse at center, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, transparent 75%);
}

.page-loader::after {
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.45));
}

.page-loader.is-active { display: grid; }

.page-loader.is-hidden {
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}

/* ---------- Кранот ---------- */
.loader-crane {
  position: relative;
  z-index: 1;
  width: min(620px, 92vw);
  height: auto;
  overflow: visible;
}

/* Челична конструкција */
.lc-st {
  fill: none;
  stroke: #aeb7c2;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lc-thin { stroke: #8d96a3; stroke-width: 1.2; }
.lc-hair { stroke-width: 1; }
.lc-fill { fill: #aeb7c2; }
.lc-cab  { fill: #3a414b; stroke: #8d96a3; stroke-width: 1.4; }
.lc-cw   { fill: #7b8592; stroke: #5f6772; stroke-width: 1.4; }
.lc-hook { fill: #8d96a3; }
.lc-red,
.lc-cable { fill: var(--primary-3); }
.lc-hookline { stroke: var(--primary-3); stroke-width: 1.8; }

/* 1 · вклештување и темел */
.lc-ground { animation: lcFade 0.17s var(--ease-out) 0s both; }

/* 2 · кулата расте */
.lc-mast {
  transform-box: fill-box;
  transform-origin: bottom;
  animation: lcRiseY 0.49s var(--ease-out) 0.09s both;
}

/* 3 · врв и кабина */
.lc-top { animation: lcDropIn 0.21s var(--ease-out) 0.56s both; }

/* 4 · противстрела, па стрела */
.lc-cjib {
  transform-box: fill-box;
  transform-origin: right;
  animation: lcGrowX 0.22s var(--ease-out) 0.65s both;
}
.lc-jib {
  transform-box: fill-box;
  transform-origin: left;
  animation: lcGrowX 0.43s var(--ease-out) 0.73s both;
}
.lc-pend {
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
  animation: lcDraw 0.3s var(--ease-out) 1.02s both;
}

/* 5 · количката патува по стрелата */
.lc-trolley { animation: lcTrolley 0.39s var(--ease-out) 1.12s both; }

/* 6 · јажето се крати додека товарот се крева */
.lc-cable {
  transform-box: fill-box;
  transform-origin: top;
  animation: lcCable 0.42s var(--ease-out) 1.48s both;
}
.lc-load { animation: lcLoad 0.42s var(--ease-out) 1.48s both; }

/* 7 · текст веднаш под логото */
.loader-brand {
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.6px;
  fill: #fff;
  animation: lcLetter 0.3s var(--ease-out) both;
  animation-delay: calc(1.84s + var(--i, 0) * 0.04s);
}
.loader-tagline {
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.8px;
  fill: rgba(255, 255, 255, 0.6);
  animation: lcFade 0.34s var(--ease-out) 2.08s both;
}

@keyframes lcFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lcRiseY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes lcGrowX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes lcDraw { to { stroke-dashoffset: 0; } }

@keyframes lcDropIn {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes lcTrolley {
  0%   { opacity: 0; transform: translateX(-150px); }
  30%  { opacity: 1; }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes lcCable {
  0%   { opacity: 0; transform: scaleY(2.032); }
  12%  { opacity: 1; }
  75%  { transform: scaleY(0.96); }
  100% { opacity: 1; transform: scaleY(1); }
}

@keyframes lcLoad {
  0%   { opacity: 0; transform: translateY(32px); }
  12%  { opacity: 1; }
  75%  { transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes lcLetter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Намалено движење: без анимација, сѐ веднаш во крајна положба */
@media (prefers-reduced-motion: reduce) {
  .lc-ground, .lc-mast, .lc-top, .lc-cjib, .lc-jib, .lc-pend,
  .lc-trolley, .lc-cable, .lc-load, .loader-brand, .loader-tagline {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    stroke-dashoffset: 0 !important;
  }
}

/* ============================================================
   SCROLL PROGRESS BAR (NEW)
   ============================================================ */
.scroll-progress {
  position: fixed;
  z-index: 70;
  top: 0; left: 0;
  width: 0%;
  height: 3px;
  background: var(--grad-primary);
  box-shadow: 0 0 12px rgba(196, 39, 31, 0.5);
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ============================================================
   BACK TO TOP (NEW)
   ============================================================ */
.back-to-top {
  position: fixed;
  z-index: 55;
  right: 22px;
  bottom: 22px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line-light);
  border-radius: 50%;
  background: rgba(10, 11, 13, 0.92);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(16px) scale(0.9);
  pointer-events: none;
  transition: opacity var(--d) var(--ease), transform var(--d) var(--ease-spring), background var(--d) var(--ease);
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--grad-primary);
  border-color: transparent;
  transform: translateY(-3px) scale(1.05);
}

/* ============================================================
   DARK THEME (default) — overrides for surfaces that were
   previously light/white. Light-mode toggle removes these.
   ============================================================ */
body:not(.light-mode):not(.admin-body):not(.login-body) {
  background: #0e0f11;
  color: var(--text-inverse);
}

/* Public sections — dark by default */
body:not(.light-mode):not(.admin-body) .section {
  background:
    radial-gradient(900px 500px at 0% 0%, rgba(196, 39, 31, 0.06), transparent 60%),
    radial-gradient(700px 460px at 100% 100%, rgba(196, 39, 31, 0.04), transparent 60%),
    linear-gradient(180deg, #141517 0%, #0e0f11 100%);
}

body:not(.light-mode):not(.admin-body) .section::before {
  background:
    radial-gradient(800px 460px at 12% 18%, rgba(196, 39, 31, 0.10), transparent 55%),
    radial-gradient(700px 420px at 100% 100%, rgba(255, 255, 255, 0.04), transparent 60%),
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px) 0 0 / 56px 56px;
  mask-image: linear-gradient(180deg, #000, #000 70%, transparent);
  -webkit-mask-image: linear-gradient(180deg, #000, #000 70%, transparent);
}

body:not(.light-mode):not(.admin-body) .section h1,
body:not(.light-mode):not(.admin-body) .section h2,
body:not(.light-mode):not(.admin-body) .section h3,
body:not(.light-mode):not(.admin-body) .section h4 { color: #fff; }

body:not(.light-mode):not(.admin-body) .section p,
body:not(.light-mode):not(.admin-body) .section .two-col > .reveal > p { color: #b9c5d1; }

/* Cards in dark default */
body:not(.light-mode):not(.admin-body) .feature-item,
body:not(.light-mode):not(.admin-body) .card,
body:not(.light-mode):not(.admin-body) .project-card,
body:not(.light-mode):not(.admin-body) .reference-item,
body:not(.light-mode):not(.admin-body) .career-card,
body:not(.light-mode):not(.admin-body) .license-card,
body:not(.light-mode):not(.admin-body) .contact-panel,
body:not(.light-mode):not(.admin-body) .contact-form {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border-color: rgba(255, 255, 255, 0.10);
  color: var(--text-inverse);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(10px);
}

body:not(.light-mode):not(.admin-body) .feature-item:hover,
body:not(.light-mode):not(.admin-body) .card:hover,
body:not(.light-mode):not(.admin-body) .reference-item:hover,
body:not(.light-mode):not(.admin-body) .career-card:hover,
body:not(.light-mode):not(.admin-body) .license-card:hover {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.04));
  border-color: rgba(255, 255, 255, 0.22);
}

body:not(.light-mode):not(.admin-body) .project-card { background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)); }
body:not(.light-mode):not(.admin-body) .project-card:hover { background: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)); border-color: rgba(196, 39, 31, 0.45); }

body:not(.light-mode):not(.admin-body) .feature-item h3,
body:not(.light-mode):not(.admin-body) .card h3,
body:not(.light-mode):not(.admin-body) .license-card h3,
body:not(.light-mode):not(.admin-body) .career-card h3,
body:not(.light-mode):not(.admin-body) .contact-panel h2,
body:not(.light-mode):not(.admin-body) .contact-form h2,
body:not(.light-mode):not(.admin-body) .reference-item span { color: #fff; }

body:not(.light-mode):not(.admin-body) .feature-item p,
body:not(.light-mode):not(.admin-body) .card p,
body:not(.light-mode):not(.admin-body) .license-card p,
body:not(.light-mode):not(.admin-body) .career-card p,
body:not(.light-mode):not(.admin-body) .reference-item small,
body:not(.light-mode):not(.admin-body) .contact-panel p { color: #b9c5d1; }

body:not(.light-mode):not(.admin-body) .contact-panel p strong { color: #fff; }
body:not(.light-mode):not(.admin-body) .contact-panel a { color: #ffd5d2; }

body:not(.light-mode):not(.admin-body) .project-body h3 { color: #fff; }
body:not(.light-mode):not(.admin-body) .project-body p { color: #b9c5d1; }
body:not(.light-mode):not(.admin-body) .project-meta { color: #ffb5af; }

/* Project images get a slightly different background while loading */
body:not(.light-mode):not(.admin-body) .project-image {
  background: linear-gradient(135deg, #24262c, #141517);
}

/* Filters bar in dark default */
body:not(.light-mode):not(.admin-body) .filters {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}
body:not(.light-mode):not(.admin-body) .filters a { color: #d6e0eb; }
body:not(.light-mode):not(.admin-body) .filters a:hover { background: rgba(196, 39, 31, 0.18); color: #ffd5d2; }
body:not(.light-mode):not(.admin-body) .filters a.active { background: var(--grad-primary); color: #fff; }

/* Ticker in dark default */
body:not(.light-mode):not(.admin-body) .ticker {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.10);
}
body:not(.light-mode):not(.admin-body) .ticker-track span {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.10);
  color: #fff;
}

/* Project editorial body — was light, now dark */
body:not(.light-mode):not(.admin-body) .project-editorial-body {
  background:
    radial-gradient(700px 500px at 0% 0%, rgba(196, 39, 31, 0.06), transparent 60%),
    linear-gradient(180deg, #141517 0%, #0e0f11 100%);
}
body:not(.light-mode):not(.admin-body) .project-editorial-body h2 { color: #fff; }
body:not(.light-mode):not(.admin-body) .project-body-content { color: #c8d3df; }
body:not(.light-mode):not(.admin-body) .project-body-content p { color: #c8d3df; }
body:not(.light-mode):not(.admin-body) .project-body-content > p[style*="font-weight:600"] { color: #fff !important; }
body:not(.light-mode):not(.admin-body) .rich-text { color: #c8d3df; }

body:not(.light-mode):not(.admin-body) .project-meta-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border-color: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(10px);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
}
body:not(.light-mode):not(.admin-body) .project-meta-card h4 { color: #ffd5d2; }
body:not(.light-mode):not(.admin-body) .project-meta-list .meta-label { color: #8ea0b3; }
body:not(.light-mode):not(.admin-body) .project-meta-list .meta-value { color: #fff; }
body:not(.light-mode):not(.admin-body) .project-meta-list li { border-color: rgba(255, 255, 255, 0.08); }

/* Related projects section */
body:not(.light-mode):not(.admin-body) .related-projects {
  background:
    radial-gradient(700px 500px at 100% 0%, rgba(196, 39, 31, 0.05), transparent 60%),
    linear-gradient(180deg, #0a0b0d 0%, #0e0f11 100%);
  border-top-color: rgba(255, 255, 255, 0.06);
}
body:not(.light-mode):not(.admin-body) .related-projects h2 { color: #fff; }

/* Career section */
body:not(.light-mode):not(.admin-body) .career-section {
  background:
    radial-gradient(700px 500px at 100% 100%, rgba(196, 39, 31, 0.05), transparent 60%),
    linear-gradient(180deg, #141517 0%, #0e0f11 100%);
}
body:not(.light-mode):not(.admin-body) .career-section h2 { color: #fff; }
body:not(.light-mode):not(.admin-body) .career-card h3 { color: #fff; }
body:not(.light-mode):not(.admin-body) .career-card p { color: #b9c5d1; }

/* Licenses note */
body:not(.light-mode):not(.admin-body) .licenses-note {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border-color: rgba(255, 255, 255, 0.10);
  border-left-color: var(--primary);
  color: #c8d3df;
}

/* Project detail (legacy) */
body:not(.light-mode):not(.admin-body) .project-detail-image,
body:not(.light-mode):not(.admin-body) .project-detail-content {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border-color: rgba(255, 255, 255, 0.10);
}
body:not(.light-mode):not(.admin-body) .detail-list li { color: #c8d3df; }
body:not(.light-mode):not(.admin-body) .detail-list strong { color: #fff; }
body:not(.light-mode):not(.admin-body) .detail-list { border-color: rgba(255, 255, 255, 0.08); }

/* Form inputs on public site */
body:not(.light-mode):not(.admin-body) .contact-form input,
body:not(.light-mode):not(.admin-body) .contact-form textarea,
body:not(.light-mode):not(.admin-body) .contact-form select {
  background: rgba(2, 8, 14, 0.55);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Eyebrow on dark default sections — keep red text but allow on dark surface */
body:not(.light-mode):not(.admin-body) .section .eyebrow {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffd5d2;
  backdrop-filter: blur(10px);
}
body:not(.light-mode):not(.admin-body) .section .eyebrow::before {
  background: #ffd5d2;
  box-shadow: 0 0 0 4px rgba(255, 213, 210, 0.18);
}

/* Map embed */
body:not(.light-mode):not(.admin-body) .map-embed {
  background: rgba(2, 8, 14, 0.55);
  border-color: rgba(255, 255, 255, 0.10);
}

/* ============================================================
   THEME-SWITCH CROSSFADE
   Brief transition applied to common surfaces during a toggle.
   ============================================================ */
body.is-theme-switching,
body.is-theme-switching .site-header,
body.is-theme-switching .hero,
body.is-theme-switching .page-hero,
body.is-theme-switching .section,
body.is-theme-switching .section-dark,
body.is-theme-switching .contact-cta-section,
body.is-theme-switching .site-footer,
body.is-theme-switching .stat-card,
body.is-theme-switching .feature-item,
body.is-theme-switching .card,
body.is-theme-switching .project-card,
body.is-theme-switching .reference-item,
body.is-theme-switching .career-card,
body.is-theme-switching .license-card,
body.is-theme-switching .contact-panel,
body.is-theme-switching .contact-form,
body.is-theme-switching .ticker,
body.is-theme-switching .ticker-track span,
body.is-theme-switching .main-nav,
body.is-theme-switching .main-nav a,
body.is-theme-switching .theme-toggle,
body.is-theme-switching .lang-toggle,
body.is-theme-switching .menu-toggle,
body.is-theme-switching .back-to-top,
body.is-theme-switching .social-link {
  transition:
    background 0.5s var(--ease),
    background-color 0.5s var(--ease),
    color 0.5s var(--ease),
    border-color 0.5s var(--ease),
    box-shadow 0.5s var(--ease) !important;
}

/* ============================================================
   LIGHT MODE — comprehensive theme
   ============================================================ */
body.light-mode {
  background: linear-gradient(180deg, #ffffff, #f4f6f9);
  color: var(--text);
}

/* ---------- Header ---------- */
body.light-mode .site-header.is-scrolled,
body.light-mode .site-header:focus-within {
  background: rgba(255, 255, 255, 0.34);
  border-color: var(--line);
  box-shadow: 0 10px 30px rgba(7, 17, 31, 0.06);
}

body.light-mode .site-header.is-scrolled .brand,
body.light-mode .site-header:focus-within .brand { color: var(--navy); }

body.light-mode .site-header.is-scrolled .main-nav,
body.light-mode .site-header:focus-within .main-nav {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--line);
}

body.light-mode .site-header.is-scrolled .main-nav a,
body.light-mode .site-header:focus-within .main-nav a { color: var(--navy); }

body.light-mode .site-header.is-scrolled .main-nav a.active,
body.light-mode .site-header:focus-within .main-nav a.active { color: #fff; }

body.light-mode .site-header.is-scrolled .theme-toggle,
body.light-mode .site-header.is-scrolled .lang-toggle:not(.is-active),
body.light-mode .site-header.is-scrolled .menu-toggle,
body.light-mode .site-header:focus-within .theme-toggle,
body.light-mode .site-header:focus-within .lang-toggle:not(.is-active),
body.light-mode .site-header:focus-within .menu-toggle {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.32);
  color: var(--navy);
}

/* Always-glass header in light mode — highly transparent */
body.light-mode .site-header {
  background: rgba(255, 255, 255, 0.06);
  border-color: transparent;
}
body.light-mode .site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(7, 17, 31, 0.05);
}
body.light-mode .site-header:not(.is-scrolled) .brand { color: var(--navy); }
body.light-mode .site-header:not(.is-scrolled) .main-nav {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(7, 17, 31, 0.06);
  backdrop-filter: blur(8px);
}
body.light-mode .site-header:not(.is-scrolled) .main-nav a { color: var(--navy); }
body.light-mode .site-header:not(.is-scrolled) .theme-toggle,
body.light-mode .site-header:not(.is-scrolled) .lang-toggle:not(.is-active),
body.light-mode .site-header:not(.is-scrolled) .menu-toggle {
  border-color: rgba(7, 17, 31, 0.08);
  background: rgba(255, 255, 255, 0.12);
  color: var(--navy);
  backdrop-filter: blur(8px);
}

/* Mobile nav */
body.light-mode .mobile-nav {
  background: rgba(255, 255, 255, 0.96);
  border-color: var(--line);
  box-shadow: var(--shadow);
}
body.light-mode .mobile-nav a { color: var(--navy); }
body.light-mode .mobile-nav a:hover { background: rgba(7, 17, 31, 0.06); }

/* ---------- Hero ---------- */
body.light-mode .hero {
  color: var(--text);
  background: linear-gradient(180deg, #fafbfd 0%, #eef1f5 100%);
}

body.light-mode .hero::before {
  background:
    radial-gradient(800px 600px at 18% 30%, rgba(196, 39, 31, 0.10), transparent 60%),
    radial-gradient(700px 600px at 100% 100%, rgba(216, 168, 91, 0.06), transparent 60%);
}

body.light-mode .hero::after {
  border-color: rgba(7, 17, 31, 0.10);
  background:
    linear-gradient(45deg, transparent 49%, rgba(7, 17, 31, 0.08) 50%, transparent 51%),
    linear-gradient(135deg, transparent 49%, rgba(7, 17, 31, 0.06) 50%, transparent 51%);
  opacity: 0.4;
}

body.light-mode .hero-slide {
  filter: grayscale(15%) contrast(1.05) brightness(1.0);
}
body.light-mode .hero-slide.active { opacity: 0.55; }

body.light-mode .hero-slideshow::after {
  /* Lighter veil so the building photos are clearly visible */
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.30) 50%, rgba(255, 255, 255, 0.65)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(245, 247, 250, 0.55));
}

body.light-mode .hero-grid {
  background-image:
    linear-gradient(rgba(7, 17, 31, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 17, 31, 0.05) 1px, transparent 1px);
  opacity: 0.55;
}

body.light-mode .hero-content h1 { color: var(--navy); text-shadow: none; }
body.light-mode .hero-title-accent { color: var(--primary-2); text-shadow: none; }
body.light-mode .hero-content p { color: var(--text-soft); }
body.light-mode .hero .text-link { color: var(--primary); }

body.light-mode .hero .eyebrow,
body.light-mode .page-hero .eyebrow,
body.light-mode .section-dark .eyebrow {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
  backdrop-filter: none;
}
body.light-mode .hero .eyebrow::before,
body.light-mode .page-hero .eyebrow::before,
body.light-mode .section-dark .eyebrow::before {
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(196, 39, 31, 0.16);
}

/* Stat cards (hero) — glossy glass */
body.light-mode .stat-card {
  border-color: rgba(255, 255, 255, 0.55);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.30) 0%, rgba(255, 255, 255, 0.06) 45%, rgba(255, 255, 255, 0.14) 100%);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
}
body.light-mode .stat-card strong,
body.light-mode .stat-card span {
  background: linear-gradient(180deg, var(--navy) 0%, #4a5468 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
body.light-mode .stat-card p { color: var(--muted); }
body.light-mode .stat-card:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.40) 0%, rgba(255, 255, 255, 0.10) 45%, rgba(255, 255, 255, 0.20) 100%);
  border-color: rgba(196, 39, 31, 0.30);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

/* Scroll cue */
body.light-mode .scroll-cue { border-color: rgba(7, 17, 31, 0.4); opacity: 0.7; }
body.light-mode .scroll-cue::after { background: var(--navy); }

/* Hero secondary button */
body.light-mode .hero .btn-secondary {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.7);
  color: var(--navy);
  backdrop-filter: blur(10px);
}
body.light-mode .hero .btn-secondary:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

/* ---------- Page hero ---------- */
body.light-mode .page-hero {
  color: var(--text);
  background: linear-gradient(180deg, #fafbfd 0%, #eef1f5 100%);
}

body.light-mode .page-hero::before {
  background:
    radial-gradient(700px 500px at 15% 30%, rgba(196, 39, 31, 0.10), transparent 55%),
    radial-gradient(500px 360px at 88% 100%, rgba(216, 168, 91, 0.06), transparent 60%),
    linear-gradient(rgba(7, 17, 31, 0.04) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(7, 17, 31, 0.04) 1px, transparent 1px) 0 0 / 56px 56px;
}

body.light-mode .page-hero::after { border-color: rgba(7, 17, 31, 0.16); }
body.light-mode .page-hero h1 { color: var(--navy); }
body.light-mode .page-hero p { color: var(--text-soft); }

/* ---------- Dark sections (now light) ---------- */
body.light-mode .section-dark {
  color: var(--text);
  background: linear-gradient(180deg, #f5f7fa 0%, #eef1f5 100%);
}

body.light-mode .section-dark::before {
  background:
    radial-gradient(800px 460px at 12% 18%, rgba(196, 39, 31, 0.08), transparent 55%),
    radial-gradient(700px 420px at 100% 100%, rgba(7, 17, 31, 0.04), transparent 60%),
    linear-gradient(rgba(7,17,31,0.04) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(7,17,31,0.04) 1px, transparent 1px) 0 0 / 56px 56px;
}

body.light-mode .section-dark p,
body.light-mode .section-dark .project-meta,
body.light-mode .section-dark small { color: var(--muted); }

body.light-mode .section-dark h1,
body.light-mode .section-dark h2,
body.light-mode .section-dark h3,
body.light-mode .section-dark h4 { color: var(--navy); }

/* Content cards — glossy glass, almost fully transparent (light mode) */
body.light-mode .feature-item,
body.light-mode .card,
body.light-mode .project-card,
body.light-mode .license-card,
body.light-mode .career-card,
body.light-mode .reference-item {
  border-color: rgba(255, 255, 255, 0.55);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.30) 0%, rgba(255, 255, 255, 0.06) 45%, rgba(255, 255, 255, 0.14) 100%);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

body.light-mode .feature-item:hover,
body.light-mode .card:hover,
body.light-mode .project-card:hover,
body.light-mode .license-card:hover,
body.light-mode .career-card:hover,
body.light-mode .reference-item:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.40) 0%, rgba(255, 255, 255, 0.10) 45%, rgba(255, 255, 255, 0.20) 100%);
  border-color: rgba(196, 39, 31, 0.30);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

body.light-mode .section-dark .feature-item h3,
body.light-mode .section-dark .card h3,
body.light-mode .section-dark .reference-item span,
body.light-mode .section-dark .career-card h3 { color: var(--navy); }

body.light-mode .section-dark .ticker {
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--line);
}
body.light-mode .section-dark .ticker-track span {
  border-color: var(--line);
  background: #fff;
  color: var(--navy);
  box-shadow: var(--shadow-xs);
}

body.light-mode .section-dark .text-link { color: var(--primary); }

/* Team grid sits on dark/light section — keep card chrome consistent */
body.light-mode .section-dark .team-card {
  border-color: var(--line);
  box-shadow: var(--shadow);
}

body.light-mode .team-card .team-overlay {
  color: #fff;
  background: linear-gradient(180deg, transparent 0%, rgba(10, 11, 13, 0.58) 34%, rgba(10, 11, 13, 0.96) 100%);
}

body.light-mode .team-card .team-overlay h3 {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

body.light-mode .team-card .team-overlay p {
  color: #d7e2ed;
}

body.light-mode .team-card .team-email {
  color: #ffd5d2 !important;
}

/* ---------- Contact CTA ---------- */
body.light-mode .contact-cta-section {
  background: linear-gradient(180deg, #f5f7fa 0%, #eef1f5 100%);
}
body.light-mode .contact-cta-section::before {
  background:
    radial-gradient(600px 400px at 10% 20%, rgba(196, 39, 31, 0.10), transparent 60%),
    radial-gradient(500px 360px at 95% 95%, rgba(216, 168, 91, 0.06), transparent 60%);
}
body.light-mode .contact-cta { color: var(--text); }
body.light-mode .contact-cta h2 { color: var(--navy); }
body.light-mode .contact-cta p { color: var(--text-soft); }
body.light-mode .contact-more-link { color: var(--primary); }
body.light-mode .contact-cta .btn-secondary {
  border-color: var(--line-strong);
  background: #ffffff;
  color: var(--navy);
}
body.light-mode .contact-cta .btn-secondary:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

/* ---------- Footer ---------- */
body.light-mode .site-footer {
  color: var(--text-soft);
  background: linear-gradient(180deg, #f3f5f8 0%, #e9edf2 100%);
  border-top: 2px solid var(--primary-2);
}
body.light-mode .site-footer::before {
  background:
    radial-gradient(800px 460px at 0% 0%, rgba(196, 39, 31, 0.06), transparent 55%),
    linear-gradient(rgba(7,17,31,0.04) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(90deg, rgba(7,17,31,0.04) 1px, transparent 1px) 0 0 / 64px 64px;
}
body.light-mode .site-footer h3 { color: var(--navy); }
body.light-mode .site-footer h4 { color: var(--primary); }
body.light-mode .site-footer p,
body.light-mode .site-footer a { color: var(--text-soft); }
body.light-mode .site-footer a:hover { color: var(--primary); }
body.light-mode .social-link {
  border-color: var(--line);
  background: #ffffff;
  color: var(--navy);
  box-shadow: var(--shadow-xs);
}
body.light-mode .social-link:hover {
  background: var(--grad-primary);
  border-color: transparent;
  color: #fff;
}
body.light-mode .footer-bottom {
  border-color: var(--line);
  color: var(--text-faint);
}

/* ---------- Back to top ---------- */
body.light-mode .back-to-top {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--line);
  color: var(--navy);
  box-shadow: var(--shadow);
}
body.light-mode .back-to-top:hover {
  background: var(--grad-primary);
  border-color: transparent;
  color: #fff;
}

/* ---------- Page loader (light mode opening) ---------- */
body.light-mode .page-loader {
  background:
    radial-gradient(800px 600px at 50% 50%, rgba(196, 39, 31, 0.14), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #eef1f5 100%);
}
body.light-mode .lc-st { stroke: #5f6772; }
body.light-mode .lc-thin { stroke: #79818d; }
body.light-mode .lc-fill { fill: #5f6772; }
body.light-mode .lc-cab { fill: #cfd5dd; stroke: #5f6772; }
body.light-mode .lc-cw { fill: #8d95a1; stroke: #5f6772; }
body.light-mode .lc-hook { fill: #8d95a1; }
body.light-mode .lc-red,
body.light-mode .lc-cable { fill: var(--primary-2); }
body.light-mode .lc-hookline { stroke: var(--primary-2); }
body.light-mode .loader-brand { fill: var(--navy); }
body.light-mode .loader-tagline { fill: rgba(10, 11, 13, 0.72); }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-body {
  --line: rgba(255, 255, 255, 0.10);
  min-height: 100vh;
  background:
    radial-gradient(900px 600px at 8% 0%, rgba(196, 39, 31, 0.10), transparent 60%),
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(180deg, #141517, #0a0b0d);
  color: #e8eef5;
}

.admin-topbar {
  position: sticky;
  z-index: 80;
  top: 0;
  border-bottom: 1px solid var(--line-light);
  background: rgba(14, 15, 17, 0.86);
  backdrop-filter: blur(18px);
}

.admin-topbar-inner {
  display: flex;
  align-items: center;
  width: min(1380px, calc(100% - 32px));
  min-height: 76px;
  margin-inline: auto;
  gap: 18px;
}

.admin-brand-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 850;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.admin-topnav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  gap: 6px;
}

.admin-topnav a,
.admin-topnav summary {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  color: #d9e3ee;
  font-size: 0.88rem;
  font-weight: 650;
  list-style: none;
  transition: background var(--d) var(--ease), border-color var(--d) var(--ease), color var(--d) var(--ease);
}

.admin-topnav a:hover,
.admin-topnav a.is-active,
.admin-topnav summary:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.admin-topnav a.is-active {
  background: var(--grad-primary);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px -6px rgba(196, 39, 31, 0.5);
}

.admin-topnav summary::-webkit-details-marker { display: none; }

.admin-nav-group { position: relative; }

.admin-nav-group summary { cursor: pointer; }

.admin-nav-group summary::after {
  content: "";
  width: 7px; height: 7px;
  margin-left: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.admin-nav-group[open] summary,
.admin-nav-group.is-active summary {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.admin-nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  display: grid;
  min-width: 220px;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  background: rgba(16, 26, 39, 0.96);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-strong);
  animation: dropIn 0.22s var(--ease-out);
}

.admin-nav-dropdown a { justify-content: flex-start; }

.admin-logout { color: #ffb5af !important; }

.admin-simple-wrap {
  width: min(1380px, calc(100% - 32px));
  margin-inline: auto;
  padding: 36px 0 88px;
}

.admin-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

.admin-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 800;
}

.admin-back-link::before {
  content: "<";
  color: var(--primary-2);
  font-weight: 900;
}

.admin-back-link:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.11);
}

.admin-head h1 {
  margin-bottom: 8px;
  color: #fff;
  font-size: 2.2rem;
  letter-spacing: -0.02em;
}

.admin-head p { color: #aebdcc; }

.admin-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.admin-card {
  position: relative;
  min-height: 138px;
  padding: 24px;
  overflow: hidden;
  border-color: var(--line-light);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(10px);
}

.admin-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 60px; height: 2px;
  background: var(--grad-primary);
}

.admin-card::after {
  content: "";
  position: absolute;
  right: 18px; bottom: 18px;
  width: 56px; height: 56px;
  border-right: 2px solid rgba(255, 255, 255, 0.18);
  border-bottom: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 0 0 8px 0;
}

.admin-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.22);
}

.admin-card strong {
  display: block;
  color: #fff;
  font-size: 2.5rem;
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: 1;
  background: linear-gradient(180deg, #fff 0%, #c9d6e4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.admin-card span {
  display: block;
  margin-top: 10px;
  color: #c8d4df;
  font-weight: 750;
  letter-spacing: 0.005em;
}

.admin-form-card,
.admin-table-card,
.settings-block {
  margin-bottom: 24px;
  padding: 24px;
  border-color: var(--line-light);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(10px);
}

.admin-form-card h2,
.settings-block h2 {
  color: #fff;
  font-size: 1.28rem;
  letter-spacing: -0.018em;
}

.admin-form-grid,
.settings-bilingual,
.settings-row-single {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.settings-stat-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.admin-form-grid label,
.settings-block label,
.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #dbe5ee;
  font-size: 0.85rem;
  font-weight: 750;
  letter-spacing: 0.005em;
}

.admin-form-grid label.lang-mk,
.settings-bilingual label.lang-mk {
  border-left: 3px solid rgba(196, 39, 31, 0.65);
  padding-left: 12px;
}

.admin-form-grid label.lang-en,
.settings-bilingual label.lang-en {
  border-left: 3px solid rgba(31, 107, 196, 0.62);
  padding-left: 12px;
}

.admin-muted-line {
  display: block;
  margin-top: 4px;
  color: var(--gray-400);
  font-size: 0.76rem;
  font-weight: 600;
}

.project-template-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
}

.project-template-panel .alert-error {
  grid-column: 1 / -1;
  margin: 0;
}

.project-template-actions {
  display: grid;
  gap: 8px;
  align-content: end;
}

.project-template-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-template-actions small {
  color: var(--gray-400);
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.45;
}

.category-order-form {
  display: grid;
  gap: 14px;
}

.category-order-list {
  display: grid;
  gap: 8px;
}

.category-order-row {
  display: grid;
  grid-template-columns: 34px 82px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.04);
  cursor: grab;
}

.category-order-row:active { cursor: grabbing; }
.category-order-row.is-sorting { opacity: 0.62; transform: scale(0.99); }

.category-order-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--primary-2);
  font-size: 1rem;
  font-weight: 900;
}

.category-order-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.category-order-text strong {
  color: #fff;
  font-size: 0.92rem;
}

.category-order-text small {
  color: var(--gray-400);
  font-size: 0.76rem;
  font-weight: 650;
}

.category-order-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.category-order-actions small {
  color: var(--gray-400);
  font-size: 0.76rem;
  font-weight: 650;
}

.admin-form-grid input,
.admin-form-grid textarea,
.admin-form-grid select,
.settings-block input,
.settings-block textarea,
.settings-block select,
.contact-form input,
.contact-form textarea,
.contact-form select,
.login-card input {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xs);
  outline: none;
  background: rgba(2, 8, 14, 0.55);
  color: #fff;
  font-size: 0.95rem;
  transition: border-color var(--d) var(--ease), box-shadow var(--d) var(--ease), background var(--d) var(--ease);
}

.admin-form-grid textarea,
.settings-block textarea,
.contact-form textarea {
  min-height: 112px;
  resize: vertical;
}

.admin-form-grid input:focus,
.admin-form-grid textarea:focus,
.admin-form-grid select:focus,
.settings-block input:focus,
.settings-block textarea:focus,
.settings-block select:focus,
.contact-form input:focus,
.contact-form textarea:focus,
.login-card input:focus {
  border-color: rgba(196, 39, 31, 0.6);
  background: rgba(2, 8, 14, 0.75);
  box-shadow: 0 0 0 4px rgba(196, 39, 31, 0.18);
}

.checkbox-label {
  flex-direction: row !important;
  align-items: center;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--primary);
}

/* ── Admin entry popup ────────────────────────────────────────────
   The create/edit form of every admin content page opens in a real,
   separate browser window (window.open) instead of living inline on
   the page — this bar is just the „Додај ново" launcher button. The
   popup window itself reuses .admin-form-card/.admin-body as-is, plus
   .admin-popup-body below for the page chrome around it. */

.admin-entry-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.admin-entry-add span { font-weight: 900; }

.admin-popup-body {
  padding: 28px;
  min-height: 100vh;
}

.admin-popup-body .admin-form-card { margin-bottom: 0; }

/* Project gallery thumbnails — only ever rendered inside the projects
   add/edit popup window now, kept in the shared stylesheet so the popup's
   own minimal <head> doesn't need a page-specific inline <style>. */
.gallery-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }

.gallery-thumb {
  position: relative;
  width: 90px;
  height: 70px;
  cursor: grab;
  touch-action: none;
  transition: opacity .15s ease, transform .15s ease, box-shadow .15s ease;
}

.gallery-thumb:active { cursor: grabbing; }

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--line);
}

.gallery-thumb.dragging { opacity: .55; transform: scale(.96); }

.gallery-thumb .drag-handle {
  position: absolute;
  left: 4px;
  top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
  pointer-events: none;
}

.gallery-thumb label {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #7f1714;
  border-radius: 4px;
  padding: 2px 5px;
  cursor: pointer;
  font-size: 11px;
  color: #fff;
}

.gallery-thumb input[type=checkbox] { display: none; }

.gallery-thumb.marked img { opacity: .4; border-color: #7f1714; }

.gallery-thumb.marked { cursor: not-allowed; }

.gallery-thumb .mark-del { font-size: 11px; color: #fff; }

body.admin-light .gallery-thumb .drag-handle { background: rgba(7, 17, 31, .72); }

.admin-table-card { overflow-x: auto; padding: 14px; }

.admin-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 14px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #dbe5ee;
  font-size: 0.88rem;
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: #9eacba;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-table tr:hover td { background: rgba(255, 255, 255, 0.04); }

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.actions form {
  display: inline-flex;
  margin: 0;
}

.admin-feature-form {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.admin-feature-toggle {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
}

.admin-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-table-toolbar form {
  display: inline-flex;
  margin: 0;
}

.admin-order-form {
  display: inline-grid;
  gap: 4px;
  margin: 0;
}

.admin-order-input {
  width: 74px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-weight: 800;
}

.admin-order-form small {
  color: #8f9eae;
  font-size: 0.72rem;
  font-weight: 700;
}

.current-image-box {
  display: grid;
  gap: 8px;
  align-content: start;
  margin-bottom: 8px;
}

.remove-image-check {
  margin-top: 4px;
  color: #dbe5ee;
  font-size: 0.82rem;
  font-weight: 750;
}

.btn-small {
  min-height: 34px;
  padding: 0 12px;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

.btn-small:hover {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.12);
}

.btn-small.danger,
.danger {
  border-color: rgba(255, 181, 175, 0.3);
  background: rgba(155, 37, 37, 0.18);
  color: #ffcbc7;
}

.btn-small.danger:hover {
  background: rgba(155, 37, 37, 0.32);
  border-color: rgba(255, 181, 175, 0.5);
}

.alert-success,
.alert-error {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 750;
  letter-spacing: 0.005em;
  margin-bottom: 16px;
}

.alert-success {
  border: 1px solid rgba(31, 122, 76, 0.35);
  background: linear-gradient(135deg, rgba(31, 122, 76, 0.22), rgba(31, 122, 76, 0.10));
}

.alert-error {
  border: 1px solid rgba(155, 37, 37, 0.42);
  background: linear-gradient(135deg, rgba(155, 37, 37, 0.24), rgba(155, 37, 37, 0.10));
}

.settings-form { display: grid; gap: 6px; }

.settings-block {
  display: grid;
  gap: 16px;
}

.settings-block h2 {
  padding-bottom: 14px;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.settings-submit {
  position: sticky;
  bottom: 0;
  z-index: 20;
  padding: 18px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  background: rgba(14, 15, 17, 0.92);
  backdrop-filter: blur(18px);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.18);
}

/* Login */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(700px 500px at 50% 30%, rgba(196, 39, 31, 0.18), transparent 55%),
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px) 0 0 / 56px 56px,
    var(--grad-navy);
}

.login-card {
  width: min(440px, 100%);
  padding: 36px;
  border-color: var(--line-light);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.04));
  color: #fff;
  backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.login-card h1 {
  max-width: none;
  color: #fff;
  font-size: 2rem;
  letter-spacing: -0.025em;
}

.login-logo {
  width: 88px; height: 88px;
  object-fit: contain;
  margin-bottom: 20px;
  filter: drop-shadow(0 8px 22px rgba(196, 39, 31, 0.45));
}

.login-card p { color: #cbd8e4; }

.login-card label {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  color: #e8eef5;
  font-weight: 750;
}

.login-card .btn { width: 100%; margin-top: 22px; }

.admin-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  padding: 26px;
  border-right: 1px solid var(--line-light);
  background: rgba(14, 15, 17, 0.92);
}

.admin-brand {
  display: block;
  margin-bottom: 26px;
  color: #fff;
  font-weight: 850;
}

.admin-sidebar nav { display: grid; gap: 6px; }

.admin-sidebar nav a {
  padding: 12px 14px;
  border-radius: var(--radius-xs);
  color: #d9e3ee;
  font-weight: 700;
  transition: background var(--d) var(--ease);
}

.admin-sidebar nav a:hover { background: rgba(255, 255, 255, 0.08); }

.admin-main { padding: 30px; }

/* Admin light mode */
body.admin-light {
  --line: rgba(7, 17, 31, 0.12);
  background: #f3f5f7 !important;
  color: var(--text) !important;
}

body.admin-light .admin-topbar,
body.admin-light .settings-submit {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.92);
}

body.admin-light .admin-brand-inline,
body.admin-light .admin-topnav a,
body.admin-light .admin-topnav summary,
body.admin-light .admin-head h1,
body.admin-light .admin-form-card h2,
body.admin-light .settings-block h2 {
  color: var(--navy);
}

body.admin-light .admin-topnav a:hover,
body.admin-light .admin-nav-group.is-active summary,
body.admin-light .admin-topnav summary:hover,
body.admin-light .admin-nav-group[open] summary {
  border-color: var(--line);
  background: rgba(7, 17, 31, 0.06);
}

body.admin-light .admin-topnav a.is-active { color: #fff; }

body.admin-light .admin-nav-dropdown {
  border-color: var(--line);
  background: #fff;
}

body.admin-light .admin-card,
body.admin-light .admin-form-card,
body.admin-light .admin-table-card,
body.admin-light .settings-block {
  border-color: var(--line);
  background: #fff;
}

body.admin-light .project-template-panel {
  border-color: var(--line);
  background: #f7f9fb;
}

body.admin-light .category-order-row {
  border-color: var(--line);
  background: #f7f9fb;
}

body.admin-light .category-order-handle {
  background: #fff;
}

body.admin-light .category-order-text strong {
  color: var(--navy);
}

body.admin-light .admin-card strong {
  background: linear-gradient(180deg, var(--navy) 0%, #3a4a5e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.admin-light .admin-card span,
body.admin-light .admin-form-grid label,
body.admin-light .settings-block label,
body.admin-light .admin-table td {
  color: var(--text);
}

body.admin-light .settings-block h4,
body.admin-light .admin-form-card h4,
body.admin-light .upload-box p,
body.admin-light .upload-box strong {
  color: var(--navy) !important;
}

body.admin-light .admin-muted-line,
body.admin-light .upload-box-hint,
body.admin-light .upload-box-current {
  color: var(--muted) !important;
}

body.admin-light .admin-table th { color: var(--muted); }

body.admin-light .admin-table th,
body.admin-light .admin-table td,
body.admin-light .settings-block h2 {
  border-color: var(--line);
}

body.admin-light .admin-form-grid input,
body.admin-light .admin-form-grid textarea,
body.admin-light .admin-form-grid select,
body.admin-light .settings-block input,
body.admin-light .settings-block textarea,
body.admin-light .settings-block select {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

body.admin-light .admin-order-input {
  border-color: var(--line);
  background: #fff;
  color: var(--navy);
}

body.admin-light .admin-order-form small {
  color: var(--muted);
}

body.admin-light .project-template-actions small {
  color: var(--muted);
}

body.admin-light .category-order-text small,
body.admin-light .category-order-actions small {
  color: var(--muted);
}

body.admin-light .btn-small {
  border-color: var(--line);
  background: #f4f6f8;
  color: var(--navy);
}

body.admin-light .admin-back-link {
  border-color: var(--line);
  background: #fff;
  color: var(--navy);
}

body.admin-light .admin-back-link:hover {
  border-color: rgba(196, 39, 31, 0.28);
  background: var(--primary-soft);
}

body.admin-light .admin-theme-toggle {
  border-color: var(--line);
  background: #fff;
  color: var(--navy);
}

.theme-toggle,
.admin-theme-toggle {
  position: relative;
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  overflow: hidden;
  border-color: rgba(7, 17, 31, 0.10);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(244, 247, 250, 0.52));
  color: transparent;
  font-size: 0;
  letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 10px 24px -18px rgba(7, 17, 31, 0.55);
}

.theme-toggle::before,
.admin-theme-toggle::before {
  content: "";
  display: block;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #f4b23c;
  box-shadow: 0 0 0 4px rgba(244, 178, 60, 0.16), 0 0 18px rgba(244, 178, 60, 0.35);
  transition: transform var(--d) var(--ease), background var(--d) var(--ease), box-shadow var(--d) var(--ease);
}

body:not(.light-mode) .theme-toggle,
body.admin-body:not(.admin-light) .admin-theme-toggle {
  border-color: rgba(255, 255, 255, 0.18);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 12px 28px -18px rgba(0, 0, 0, 0.7);
}

body:not(.light-mode) .theme-toggle::before,
body.admin-body:not(.admin-light) .admin-theme-toggle::before {
  background: transparent;
  box-shadow: inset -5px -3px 0 0 #f6ead1;
  transform: rotate(-18deg);
}

.theme-toggle:hover,
.admin-theme-toggle:hover {
  border-color: rgba(196, 39, 31, 0.22);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(250, 244, 244, 0.68));
}

body:not(.light-mode) .theme-toggle:hover,
body.admin-body:not(.admin-light) .admin-theme-toggle:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
}

.theme-toggle:hover::before,
.admin-theme-toggle:hover::before {
  transform: scale(1.05);
}

body:not(.light-mode) .theme-toggle:hover::before,
body.admin-body:not(.admin-light) .admin-theme-toggle:hover::before {
  transform: rotate(-18deg) scale(1.05);
}

.header-actions {
  gap: 8px;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 30px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  background: rgba(10, 11, 13, 0.64);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.language-switch .lang-toggle {
  min-width: 30px;
  height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: #dce5ef;
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.03em;
  box-shadow: none;
  backdrop-filter: none;
}

.language-switch .lang-toggle:hover {
  background: rgba(255, 255, 255, 0.10);
  transform: none;
}

.language-switch .lang-toggle.is-active {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 5px 12px -7px rgba(196, 39, 31, 0.8);
}

.theme-toggle {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(10, 11, 13, 0.64);
  color: #dce5ef;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.theme-toggle::before,
.theme-toggle::after {
  content: none !important;
}

.theme-icon {
  display: none;
  width: 16px;
  height: 16px;
  color: currentColor;
}

.theme-icon svg,
.menu-toggle svg {
  width: 100%;
  height: 100%;
}

body.light-mode .theme-icon-moon,
body:not(.light-mode) .theme-icon-sun {
  display: block;
}

.theme-toggle:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  transform: none;
}

.menu-toggle svg {
  width: 19px;
  height: 19px;
}

body.light-mode .site-header .language-switch {
  border-color: rgba(7, 17, 31, 0.10);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 20px -18px rgba(7, 17, 31, 0.35);
}

body.light-mode .site-header .language-switch .lang-toggle:not(.is-active) {
  color: var(--navy);
}

body.light-mode .site-header.is-scrolled .language-switch .lang-toggle:not(.is-active),
body.light-mode .site-header:focus-within .language-switch .lang-toggle:not(.is-active),
body.light-mode .site-header:not(.is-scrolled) .language-switch .lang-toggle:not(.is-active) {
  min-width: 30px;
  height: 24px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--navy);
  box-shadow: none;
}

body.light-mode .site-header .language-switch .lang-toggle.is-active {
  border: 0;
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 5px 12px -7px rgba(196, 39, 31, 0.8);
}

body.light-mode .site-header .theme-toggle {
  border-color: rgba(7, 17, 31, 0.10);
  background: rgba(255, 255, 255, 0.58);
  color: var(--navy);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 20px -18px rgba(7, 17, 31, 0.35);
}

body.light-mode .site-header.is-scrolled .theme-toggle,
body.light-mode .site-header:focus-within .theme-toggle,
body.light-mode .site-header:not(.is-scrolled) .theme-toggle {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  border-color: rgba(7, 17, 31, 0.10);
  background: rgba(255, 255, 255, 0.58);
  color: var(--navy);
}

body.light-mode .site-header .theme-toggle:hover {
  border-color: rgba(196, 39, 31, 0.30);
  background: #fff;
  color: var(--primary);
}

body.page-project-detail .site-header:not(.is-scrolled),
body.page-project-detail .site-header:not(.is-scrolled):focus-within {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

body.page-project-detail .site-header:not(.is-scrolled) .brand,
body.page-project-detail.light-mode .site-header:not(.is-scrolled) .brand,
body.page-project-detail .site-header:not(.is-scrolled):focus-within .brand,
body.page-project-detail.light-mode .site-header:not(.is-scrolled):focus-within .brand {
  color: #fff;
}

body.page-project-detail .site-header:not(.is-scrolled) .main-nav,
body.page-project-detail.light-mode .site-header:not(.is-scrolled) .main-nav,
body.page-project-detail .site-header:not(.is-scrolled):focus-within .main-nav,
body.page-project-detail.light-mode .site-header:not(.is-scrolled):focus-within .main-nav {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(10, 11, 13, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(12px);
}

body.page-project-detail .site-header:not(.is-scrolled) .main-nav a,
body.page-project-detail.light-mode .site-header:not(.is-scrolled) .main-nav a,
body.page-project-detail .site-header:not(.is-scrolled):focus-within .main-nav a,
body.page-project-detail.light-mode .site-header:not(.is-scrolled):focus-within .main-nav a {
  color: #f4f7fb;
}

body.page-project-detail .site-header:not(.is-scrolled) .main-nav a.active,
body.page-project-detail.light-mode .site-header:not(.is-scrolled) .main-nav a.active,
body.page-project-detail .site-header:not(.is-scrolled):focus-within .main-nav a.active,
body.page-project-detail.light-mode .site-header:not(.is-scrolled):focus-within .main-nav a.active {
  color: #fff;
}

body.page-project-detail .site-header:not(.is-scrolled) .language-switch,
body.page-project-detail.light-mode .site-header:not(.is-scrolled) .language-switch,
body.page-project-detail .site-header:not(.is-scrolled):focus-within .language-switch,
body.page-project-detail.light-mode .site-header:not(.is-scrolled):focus-within .language-switch,
body.page-project-detail .site-header:not(.is-scrolled) .theme-toggle,
body.page-project-detail.light-mode .site-header:not(.is-scrolled) .theme-toggle,
body.page-project-detail .site-header:not(.is-scrolled):focus-within .theme-toggle,
body.page-project-detail.light-mode .site-header:not(.is-scrolled):focus-within .theme-toggle,
body.page-project-detail .site-header:not(.is-scrolled) .menu-toggle,
body.page-project-detail.light-mode .site-header:not(.is-scrolled) .menu-toggle,
body.page-project-detail .site-header:not(.is-scrolled):focus-within .menu-toggle,
body.page-project-detail.light-mode .site-header:not(.is-scrolled):focus-within .menu-toggle {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(10, 11, 13, 0.34);
  color: #fff;
}

body.page-project-detail .site-header:not(.is-scrolled) .language-switch .lang-toggle:not(.is-active),
body.page-project-detail.light-mode .site-header:not(.is-scrolled) .language-switch .lang-toggle:not(.is-active),
body.page-project-detail .site-header:not(.is-scrolled):focus-within .language-switch .lang-toggle:not(.is-active),
body.page-project-detail.light-mode .site-header:not(.is-scrolled):focus-within .language-switch .lang-toggle:not(.is-active) {
  color: #fff;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1180px) {
  h1 { font-size: 4rem; }
  h2 { font-size: 2.55rem; }
  .main-nav { display: none; }
  .menu-toggle { display: inline-flex; }
  .card-grid,
  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-topbar-inner,
  .admin-topnav {
    align-items: flex-start;
  }
  .admin-topbar-inner {
    flex-direction: column;
    padding: 14px 0;
  }
  .admin-topnav {
    justify-content: flex-start;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .admin-nav-dropdown {
    position: static;
    min-width: 100%;
    margin-top: 6px;
  }
}

@media (max-width: 992px) {
  :root { --section-y: 80px; }
  h1 { font-size: 3.4rem; }
  h2 { font-size: 2.2rem; }
  .hero { min-height: auto; }
  .hero-content { padding: 132px 0 80px; }
  .hero::after { width: 50%; opacity: 0.22; }
  .two-col,
  .project-detail,
  .contact-grid,
  .career-wrap,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .career-intro { position: static; }
  .project-grid,
  .licenses-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stats-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  :root { --section-y: 64px; }
  .container,
  .admin-simple-wrap,
  .admin-topbar-inner {
    width: min(100% - 24px, 1180px);
  }
  h1, .page-hero h1 { font-size: 2.7rem; }
  h2 { font-size: 2rem; }
  .header-row { min-height: 72px; }
  .brand img { width: 50px; height: 50px; }
  .brand span {
    max-width: 148px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .hero-actions,
  .section-head,
  .footer-bottom,
  .career-card,
  .reference-item {
    flex-direction: column;
    align-items: stretch;
  }
  .contact-cta { grid-template-columns: 1fr; }
  .contact-cta-actions { justify-content: stretch; }
  .hero-actions .btn,
  .contact-cta-actions .btn,
  .career-btn,
  .ref-link {
    width: 100%;
  }
  .stats-row,
  .card-grid,
  .project-grid,
  .team-grid,
  .reference-list,
  .licenses-grid,
  .project-gallery,
  .admin-cards,
  .admin-form-grid,
  .settings-bilingual,
  .settings-row-single,
  .settings-stat-row {
    grid-template-columns: 1fr;
  }
  .stat-card { min-height: 116px; }
  .team-card,
  .team-card img { min-height: 360px; }
  .page-hero { padding: 132px 0 72px; }
  .project-detail-image img { min-height: 320px; }
  .filters {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    border-radius: var(--radius);
  }
  .admin-topnav {
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
  }
  .admin-topnav a,
  .admin-topnav summary {
    width: 100%;
    justify-content: flex-start;
  }
  .back-to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; }
}

@media (max-width: 480px) {
  :root { --section-y: 56px; }
  .container,
  .admin-simple-wrap,
  .admin-topbar-inner {
    width: min(100% - 20px, 1180px);
  }
  h1, .page-hero h1 { font-size: 2.2rem; }
  h2 { font-size: 1.7rem; }
  .contact-panel p:nth-of-type(3) {
    flex-wrap: wrap;
    white-space: normal;
  }
  .page-loader {
    padding-inline: 0;
    gap: 0;
  }
  /* На мал екран цртежот се шири преку празните маргини за да остане читлив.
     Негативните маргини го враќаат на 100vw како кутија, за да остане центриран —
     без нив grid-от го подава кон левиот раб и композицијата бега надесно. */
  .loader-crane {
    width: 126vw;
    max-width: none;
    margin-inline: -13vw;
  }
  .header-actions { gap: 6px; }
  .theme-toggle,
  .lang-toggle,
  .menu-toggle {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
  }
  .theme-toggle,
  .admin-theme-toggle {
    width: 36px;
    min-width: 36px;
    padding: 0;
  }
  .hero-content { padding: 116px 0 64px; }
  .hero-content p,
  .page-hero p { font-size: 1rem; }
  .feature-item,
  .card,
  .project-body,
  .contact-panel,
  .contact-form,
  .license-card,
  .career-card,
  .admin-form-card,
  .admin-table-card,
  .settings-block,
  .login-card {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   Drag & drop upload zone (admin forms)
   ============================================================ */
.dropzone {
  position: relative;
  display: block;
  margin-top: 8px;
  border: 1.5px dashed rgba(255, 255, 255, 0.20);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 18px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover { border-color: rgba(255, 255, 255, 0.38); background: rgba(255, 255, 255, 0.04); }
.dropzone.is-drag { border-color: var(--primary-3); background: rgba(196, 39, 31, 0.12); }
.dropzone .dz-file { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone-prompt { display: flex; flex-direction: column; align-items: center; gap: 5px; pointer-events: none; }
.dropzone .dz-icon { color: var(--primary-3); line-height: 0; }
.dropzone .dz-text { font-size: 13px; color: #e6e6e6; }
.dropzone .dz-text u { color: #fff; text-underline-offset: 2px; }
.dropzone .dz-hint { font-size: 11px; color: var(--gray-500); }
.dropzone-preview { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 14px; }
.dropzone-preview:empty { display: none; }
.dz-thumb { width: 88px; }
.dz-thumb[draggable="true"] { cursor: grab; transition: opacity 0.15s ease, transform 0.15s ease; }
.dz-thumb[draggable="true"]:active { cursor: grabbing; }
.dz-thumb.is-sorting { opacity: 0.55; transform: scale(0.96); }
.dz-thumb img { width: 88px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.18); display: block; }
.dz-file-ic { width: 88px; height: 64px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.18); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; letter-spacing: 1px; color: #cfd2d8; background: rgba(255, 255, 255, 0.04); }
.dz-thumb span { display: block; font-size: 10px; color: var(--gray-500); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.admin-light .dropzone { border-color: rgba(7, 17, 31, 0.18); background: rgba(7, 17, 31, 0.02); }
body.admin-light .dropzone:hover { border-color: rgba(7, 17, 31, 0.34); background: rgba(7, 17, 31, 0.04); }
body.admin-light .dropzone .dz-text { color: #1a2230; }
body.admin-light .dropzone .dz-text u { color: #000; }
body.admin-light .dz-file-ic { color: #44505f; background: rgba(7, 17, 31, 0.03); border-color: var(--line); }

/* Image-upload section boxes (projects form) — theme aware */
.upload-box {
  grid-column: 1 / -1;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.upload-box-title {
  margin-bottom: 12px;
  color: var(--gray-400);
  font-size: 13px;
}

.upload-box-title strong {
  color: #e2e2e2;
}

.upload-box-hint {
  margin: 10px 0 6px;
  color: var(--gray-500);
  font-size: 12px;
}

.upload-box-current {
  margin-top: 8px;
  color: var(--gray-400);
  font-size: 12px;
}

.upload-box-current a {
  color: var(--primary);
}

body.admin-light .upload-box {
  background: #f7f9fb;
  border-color: var(--line);
}
body.admin-light .upload-box p,
body.admin-light .upload-box label { color: #1a2230 !important; }

/* ============================================================
   POLISH PACK — 2026-07-03
   (sr-only, gallery lightbox, hero accent shimmer,
   cross-document view transitions, gallery zoom hint)
   ============================================================ */

/* Screen-reader-only text (stat counters expose the real value here) */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Cross-document view transition: soft crossfade between pages
   (progressive enhancement — ignored by unsupporting browsers) */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.28s;
  animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Gallery frames are now real buttons */
.gallery-editorial .gallery-frame {
  width: 100%;
  padding: 0;
  border: none;
  cursor: zoom-in;
  text-align: inherit;
}

.gallery-editorial .gallery-frame:focus-visible {
  outline: 3px solid var(--primary-2);
  outline-offset: 3px;
}

.gallery-zoom-hint {
  position: absolute;
  right: 14px; bottom: 14px;
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(10, 11, 13, 0.72);
  color: #fff;
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(8px) scale(0.85);
  transition: opacity var(--d) var(--ease), transform var(--d) var(--ease-spring);
  pointer-events: none;
}

.gallery-zoom-hint svg { width: 18px; height: 18px; }

.gallery-editorial .gallery-frame:hover .gallery-zoom-hint,
.gallery-editorial .gallery-frame:focus-visible .gallery-zoom-hint {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ---------- Lightbox ---------- */
body.lightbox-open { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.32s var(--ease), visibility 0s 0.32s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.32s var(--ease);
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 9, 11, 0.9);
  backdrop-filter: blur(14px);
  cursor: zoom-out;
}

.lightbox-stage {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: min(1400px, calc(100vw - 120px));
  max-height: calc(100svh - 96px);
  pointer-events: none;
}

.lightbox-img {
  max-width: 100%;
  max-height: calc(100svh - 96px);
  width: auto; height: auto;
  border-radius: var(--radius);
  box-shadow: 0 40px 120px -20px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: scale(0.94) translateY(10px);
  transition: opacity 0.38s var(--ease-out), transform 0.38s var(--ease-out);
}

.lightbox-img.is-loaded {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.lightbox-btn {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 1.15rem;
  backdrop-filter: blur(10px);
  transition: background var(--d) var(--ease), transform var(--d) var(--ease-spring), border-color var(--d) var(--ease);
}

.lightbox-btn:hover {
  background: var(--grad-primary);
  border-color: transparent;
  transform: scale(1.08);
}

.lightbox-btn:focus-visible {
  outline: 3px solid var(--primary-2);
  outline-offset: 3px;
}

.lightbox-close { top: 22px; right: 22px; }
.lightbox-prev { left: 22px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 22px; top: 50%; transform: translateY(-50%); }
.lightbox-prev:hover { transform: translateY(-50%) scale(1.08); }
.lightbox-next:hover { transform: translateY(-50%) scale(1.08); }

.lightbox-count {
  position: absolute;
  z-index: 2;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-pill);
  background: rgba(10, 11, 13, 0.72);
  color: #e8eef5;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  backdrop-filter: blur(10px);
}

@media (max-width: 640px) {
  .lightbox-stage { max-width: calc(100vw - 24px); }
  .lightbox-btn { width: 44px; height: 44px; }
  .lightbox-close { top: 14px; right: 14px; }
  .lightbox-prev { left: 12px; }
  .lightbox-next { right: 12px; }
}

/* Project-card image gets a gentle "settle" as its card reveals */
.project-card.reveal .project-image img { transform: scale(1.12); }
.project-card.reveal.visible .project-image img { transform: scale(1); }
.project-card.reveal.visible:hover .project-image img { transform: scale(1.08); }
