/* ==========================================================================
   TRUE Products & Tooling Engineering — Stylesheet
   Theming: [data-theme="dark"] (default) / [data-theme="light"]
   ========================================================================== */

/* ============ TOKENS — DARK (default) ============ */
:root,
[data-theme="dark"]{
  --bg:#0B0F14;
  --bg-alt:#0E141C;
  --surface:#131A24;
  --surface-2:#171F2B;
  --line:#233242;
  --line-bright:#2E5A78;
  --blue:#4FA3D1;
  --blue-dim:#2E5A78;
  --steel:#B9C4CE;
  --steel-dim:#7C8B99;
  --ink:#F2F6F8;              /* primary heading / high-contrast text */
  --safety:#d7bd6c;
  --safety-dim:#C99400;
  --rust:#C1502E;
  --grid-major:rgba(46,90,120,.35);
  --grid-opacity:.35;
  --backdrop-blur:rgba(11,15,20,.82);
  --shadow-color:rgba(0,0,0,.35);
  --scrim:rgba(6,9,13,.94);
  --ink-gallery-super: #F2F6F8;
  --bg-gallery-arrow: rgba(6,9,13,.62);
}

/* ============ TOKENS — LIGHT ============ */
[data-theme="light"]{
  --bg:#F6F4EE;
  --bg-alt:#FFFFFF;
  --surface:#FFFFFF;
  --surface-2:#EFEBDF;
  --line:#DAD4C3;
  --line-bright:#3E6E93;
  --blue:#2E6690;
  --blue-dim:#5F8FAE;
  --steel:#3C4550;
  --steel-dim:#6B7480;
  --ink:#12181F;
  --safety:#846712;
  --safety-dim:#8F5D08;
  --rust:#A8431F;
  --grid-major:rgba(62,110,147,.22);
  --grid-opacity:.55;
  --backdrop-blur:rgba(246,244,238,.86);
  --shadow-color:rgba(20,30,40,.10);
  --scrim:rgba(246,244,238,.94);
  --ink-gallery-super: #ffd875;
  --bg-gallery-arrow: rgba(246,244,238,.62);
}

/* ============ BASE ============ */
:root{
  --radius:2px;
  --maxw:1200px;
  --ease:cubic-bezier(.22,.61,.36,1);
}

*,*::before,*::after{box-sizing:border-box;}
html{scroll-behavior:smooth;}
@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto;}
  *,*::before,*::after{animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; scroll-behavior:auto !important;}
}
body{
  margin:0;
  background:var(--bg);
  color:var(--steel);
  font-family:'Inter',sans-serif;
  font-size:16px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
  transition:background .35s var(--ease), color .35s var(--ease);
}
h1,h2,h3,h4{
  font-family:'Barlow Condensed',sans-serif;
  color:var(--ink);
  margin:0;
  text-transform:uppercase;
  letter-spacing:.01em;
}
a{color:inherit;text-decoration:none;}
img{max-width:100%;display:block;}
button{font-family:inherit;}
::selection{background:var(--safety);color:#0B0F14;}
:focus-visible{outline:2px solid var(--safety); outline-offset:3px;}
.mono{font-family:'JetBrains Mono',monospace;}

/* ============ BLUEPRINT GRID BACKDROP ============ */
.grid-backdrop{
  position:fixed; inset:0; z-index:0; pointer-events:none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px);
  background-size: 16px 16px, 16px 16px, 96px 96px, 96px 96px;
  background-position:center;
  opacity:var(--grid-opacity);
  -webkit-mask-image:radial-gradient(ellipse 90% 70% at 50% 0%, black 40%, transparent 85%);
          mask-image:radial-gradient(ellipse 90% 70% at 50% 0%, black 40%, transparent 85%);
  transition:opacity .35s var(--ease);
}

.wrap{max-width:var(--maxw); margin:0 auto; padding:0 28px; position:relative; z-index:1;}
@media (max-width:480px){ .wrap{padding:0 18px;} }

/* ============ NAVBAR ============ */
.navbar{
  position:fixed; top:0; left:0; right:0; z-index:100;
  background:var(--backdrop-blur);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line);
  transition:background .35s var(--ease), border-color .35s var(--ease);
}
.navbar .wrap{display:flex; align-items:center; justify-content:space-between; height:72px; gap:16px;}
.brand{display:flex; align-items:center; gap:12px; min-width:0;}
.brand-mark{width:34px; height:34px; flex:0 0 auto;}
.brand-mark path, .brand-mark rect, .brand-mark circle{transition:stroke .35s var(--ease);}
.brand-text{display:flex; flex-direction:column; line-height:1.1; min-width:0;}
.brand-text strong{
  font-family:'Barlow Condensed',sans-serif; font-weight:700; font-size:18px;
  color:var(--ink); letter-spacing:.04em; text-transform:uppercase;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.brand-text span{
  font-family:'JetBrains Mono',monospace; font-size:9.5px; letter-spacing:.14em;
  color:var(--safety); text-transform:uppercase;
}
.nav-links{display:flex; align-items:center; gap:32px;}
.nav-links a{
  font-family:'JetBrains Mono',monospace; font-size:16px; letter-spacing:.08em;
  text-transform:uppercase; color:var(--steel-dim); position:relative; padding:4px 0;
  transition:color .25s var(--ease);
  font-weight: 800;
}
.nav-links a:hover, .nav-links a:focus-visible{color:var(--ink);}
.nav-links a::before{content:"— "; color:var(--blue);}
.nav-right{display:flex; align-items:center; gap:14px;}
.nav-cta{
  font-family:'JetBrains Mono',monospace; font-size:14px; letter-spacing:.08em; text-transform:uppercase;
  padding:10px 18px; border:1px solid var(--safety); color:var(--safety);
  background:transparent; transition:background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease); white-space:nowrap;
  font-weight: bolder;
}
.nav-cta:hover, .nav-cta:focus-visible{background:var(--safety); border-color:var(--safety); color:var(--bg);}

/* Theme toggle */
.theme-toggle{
  width:40px; height:40px; border-radius:50%; border:1px solid var(--line-bright);
  background:var(--surface); display:flex; align-items:center; justify-content:center;
  cursor:pointer; flex:0 0 auto; transition:all .25s var(--ease); position:relative;
}
.theme-toggle:hover{border-color:var(--safety);}
.theme-toggle svg{width:18px; height:18px; stroke:var(--ink); transition:stroke .25s var(--ease);}
.theme-toggle .icon-moon{display:none;}
[data-theme="dark"] .theme-toggle .icon-sun{display:none;}
[data-theme="dark"] .theme-toggle .icon-moon{display:block;}

.nav-toggle{display:none; flex-direction:column; gap:5px; background:none; border:none; cursor:pointer; padding:8px; z-index:110;}
.nav-toggle span{width:24px; height:2px; background:var(--ink); display:block; transition:all .3s var(--ease);}

@media (max-width:900px){
  .nav-links, .nav-cta.desktop-only{display:none;}
  .nav-toggle{display:flex;}
  .mobile-panel{
    position:fixed; inset:72px 0 0 0; background:var(--bg-alt); z-index:99;
    transform:translateX(100%); transition:transform .35s var(--ease);
    border-top:1px solid var(--line); overflow-y:auto;
  }
  .mobile-panel.open{transform:translateX(0);}
  .mobile-panel .wrap{display:flex; flex-direction:column; gap:0; padding-top:8px;}
  .mobile-panel a{
    font-family:'JetBrains Mono',monospace; font-size:15px; letter-spacing:.06em; text-transform:uppercase;
    padding:20px 0; border-bottom:1px solid var(--line); color:var(--steel);
  }
  .mobile-panel .nav-cta{margin:24px 0; text-align:center;}
}
@media (min-width:901px){ .mobile-panel{display:none;} }

/* ============ SECTION SCAFFOLDING ============ */
section{position:relative; z-index:1; padding:120px 0;}
.sheet-label{
  display:inline-flex; align-items:center; gap:10px;
  font-family:'JetBrains Mono',monospace; font-size:12px; letter-spacing:.18em;
  text-transform:uppercase; color:var(--safety); margin-bottom:22px;
}
.sheet-label::before{content:""; width:28px; height:1px; background:var(--safety);}
.section-head{max-width:680px; margin-bottom:64px;}
.section-head h2{font-size:clamp(30px,4.2vw,48px); font-weight:700; line-height:1.05;}
.section-head p{margin-top:18px; font-size:16.5px; color:var(--steel-dim); max-width:560px;}

.reveal{opacity:0; transform:translateY(28px); transition:opacity .7s var(--ease), transform .7s var(--ease);}
.reveal.visible{opacity:1; transform:translateY(0);}

@media (max-width:768px){ section{padding:88px 0;} }
@media (max-width:480px){ section{padding:64px 0;} }

/* ============ HERO ============ */
.hero{
  min-height:100vh; display:flex; align-items:center; padding:150px 0 80px;
  position:relative; overflow:hidden;
}
.hero .wrap{display:grid; grid-template-columns:1.15fr .85fr; gap:40px; align-items:center;}
.hero-eyebrow{
  font-family:'JetBrains Mono',monospace; font-size:16px; letter-spacing:.2em; text-transform:uppercase;
  color:var(--blue); margin-bottom:22px; display:flex; align-items:center; gap:12px;
  font-weight: 600;
  width: max-content;
}
.hero-eyebrow .dot{width:7px;height:7px;border-radius:50%;background:var(--safety); box-shadow:0 0 0 4px rgba(245,183,0,.15); flex:0 0 auto;}
.hero h1{font-size:clamp(38px,5.6vw,72px); font-weight:800; line-height:.98; letter-spacing:0;}
.hero h1 em{font-style:normal; color:var(--blue);}
.hero-sub{
  margin-top:24px; font-size:19px; color:var(--steel); max-width:520px; font-weight:500;
  border-left:2px solid var(--line-bright); padding-left:18px;
}
.hero-actions{margin-top:44px; display:flex; gap:16px; flex-wrap:wrap;}
.btn{
  font-family:'JetBrains Mono',monospace; font-size:16px; letter-spacing:.08em; text-transform:uppercase;
  padding:15px 26px; display:inline-flex; align-items:center; gap:10px; cursor:pointer;
  border:1px solid transparent; transition:all .25s var(--ease);
}
.btn--primary{background:var(--safety); color:var(--bg); font-weight: 800;}
.btn--primary:hover{background:var(--ink); transform:translateY(-2px);}
.btn--ghost{border-color:var(--line-bright); color:var(--ink);}
.btn--ghost:hover{border-color:var(--blue); color:var(--blue); transform:translateY(-2px);}

.hero-diagram{position:relative; aspect-ratio:1/1; width:100%;}
.hero-diagram svg{width:100%; height:100%; display:block;}
.dim-path{stroke-dasharray:1400; stroke-dashoffset:1400; animation:draw 2.6s var(--ease) forwards .3s;}
@keyframes draw{to{stroke-dashoffset:0;}}
@media (prefers-reduced-motion: reduce){ .dim-path{stroke-dashoffset:0; animation:none;} }

.hero-titleblock{
  position:absolute; bottom:-70px; right:0; z-index:2;
  border:1px solid var(--line-bright); background:var(--backdrop-blur); backdrop-filter:blur(6px);
  font-family:'JetBrains Mono',monospace; font-size:10.5px; color:var(--steel-dim);
  width:320px; max-width:90vw; box-sizing:border-box;
}
.hero-titleblock .tb-title{
  padding:10px 14px; border-bottom:1px solid var(--line-bright); color:var(--ink);
  letter-spacing:.08em; text-transform:uppercase; font-weight:600;
}
.hero-titleblock .tb-grid{display:grid; grid-template-columns:repeat(3, minmax(0,1fr));}
.hero-titleblock .tb-cell{padding:9px 12px; border-top:1px solid var(--line); border-left:1px solid var(--line); min-width:0; overflow:hidden;}
.hero-titleblock .tb-cell:nth-child(-n+3){border-top:none;}
.hero-titleblock .tb-cell:nth-child(3n+1){border-left:none;}
.hero-titleblock .tb-cell b{display:block; color:var(--safety); font-size:9px; letter-spacing:.1em; margin-bottom:3px; font-weight:500;}
.hero-titleblock .tb-cell span{display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}

/* Compact single-line stand-in for the title-block, mobile only */
.hero-meta-mobile{
  display:none;
  font-size:11.5px; letter-spacing:.08em; color:var(--steel-dim); text-transform:uppercase;
}

/* ---- Mobile / tablet hero — simplified, not a squeezed-down desktop layout ---- */
@media (max-width:1100px){
  .hero{
    min-height:auto; padding:104px 0 56px; overflow:hidden;
  }
  .hero .wrap{
    display:block; position:relative; z-index:1;
  }
  .hero .wrap:first-of-type{ position:relative; }

  /* Desktop title-block panel doesn't suit narrow screens — replaced below */
  .hero-titleblock{ display:none; }
  .hero-meta-mobile{ display:block; margin-top:28px; }

  /* Diagram becomes a quiet background accent, not a stacked content block —
     taken out of flow entirely so it can never push content around or overlap it. */
  .hero-diagram{
    position:absolute; z-index:0; pointer-events:none;
    top:96px; right:-70px; width:260px; height:260px;
    opacity:.16; margin:0;
  }

  .hero-eyebrow{ font-size:12px; margin-bottom:16px; }
  .hero h1{ font-size:clamp(30px,8.4vw,42px); line-height:1.06; }
  .hero-sub{ font-size:16px; margin-top:18px; padding-left:14px; max-width:none; }
  .hero-actions{ margin-top:30px; gap:12px; }
  .btn{ padding:14px 20px; font-size:16px; }
}
@media (max-width:520px){
  .hero{ padding:96px 0 48px; }
  .hero-diagram{ width:210px; height:210px; top:88px; right:-60px; opacity:.14; }
  .hero h1{ font-size:clamp(28px,9vw,34px); }
  .hero-sub{ font-size:15px; }
  .hero-actions{ flex-direction:column; }
  .btn{ width:100%; justify-content:center; }
}
@media (max-width:340px){
  .hero-diagram{ display:none; }
}

/* ============ ABOUT ============ */
.about .wrap{display:grid; grid-template-columns:1fr 1fr; gap:80px; align-items:start;}
.about-copy p{font-size:17px; color:var(--steel); margin:0 0 20px;}
.notes-box{
  border:1px solid var(--line-bright); background:var(--surface); padding:32px;
  transition:background .35s var(--ease), border-color .35s var(--ease);
}
.notes-box .nb-head{
  display:flex; justify-content:space-between; align-items:center; margin-bottom:22px;
  padding-bottom:16px; border-bottom:1px dashed var(--line-bright);
}
.notes-box .nb-head span:first-child{
  font-family:'JetBrains Mono',monospace; font-size:11px; letter-spacing:.14em; color:var(--blue); text-transform:uppercase;
}
.notes-box h3{font-size:22px; color:var(--ink); margin-bottom:14px; font-weight:700;}
.notes-box p{font-size:15.5px; color:var(--steel-dim); margin:0;}
.note-num{
  font-family:'JetBrains Mono',monospace; color:var(--safety); font-weight:600; font-size:14px; margin-right:8px;
}
@media (max-width:900px){ .about .wrap{grid-template-columns:1fr; gap:44px;} }
@media (max-width:480px){ .notes-box{padding:24px 20px;} }

/* ============ SERVICES (BOM TABLE) ============ */
.bom{border-top:1px solid var(--line-bright); border-left:1px solid var(--line-bright);}
.bom-row{
  display:grid; grid-template-columns:90px 1fr 200px; border-right:1px solid var(--line-bright); border-bottom:1px solid var(--line-bright);
  transition:background .2s var(--ease);
}
.bom-row.bom-head{background:var(--surface-2);}
.bom-row.bom-head .bom-cell{
  font-family:'JetBrains Mono',monospace; font-size:10.5px; letter-spacing:.14em; color:var(--blue); text-transform:uppercase; padding:14px 20px;
}
.bom-row:not(.bom-head):hover{background:var(--surface);}
.bom-cell{padding:22px 20px; display:flex; align-items:center; border-left:1px solid var(--line);}
.bom-cell:first-child{border-left:none;}
.bom-num{
  font-family:'JetBrains Mono',monospace; font-size:15px; color:var(--safety); font-weight:600;
}
.bom-desc{font-family:'Barlow Condensed',sans-serif; font-size:20px; font-weight:600; color:var(--ink); text-transform:none; letter-spacing:.01em;}
.bom-cat{font-family:'JetBrains Mono',monospace; font-size:11px; color:var(--steel-dim); letter-spacing:.05em; text-transform:uppercase;}

@media (max-width:900px){ .bom-row{grid-template-columns:80px 1fr 140px;} }
@media (max-width:720px){
  .bom-row{grid-template-columns:56px 1fr;}
  .bom-row.bom-head{display:none;}
  .bom-cat{display:none;}
  .bom-desc{font-size:17px;}
  .bom-cell{padding:16px;}
}
@media (max-width:380px){ .bom-desc{font-size:15.5px;} .bom-cell{padding:14px 12px;} }

/* ============ INDUSTRIES ============ */
.industries-grid{display:grid; grid-template-columns:repeat(2,1fr); gap:1px; background:var(--line-bright); border:1px solid var(--line-bright);}
.industry-tile{
  background:var(--bg-alt); padding:28px 26px; text-align:left;
  display:flex; flex-direction:column; gap:18px;
  transition:background .25s var(--ease);
}
.industry-tile:hover{background:var(--surface);}
.tile-head{ display:flex; align-items:center; gap:14px; }
.industry-tile .stamp{
  width:40px;height:40px; margin:0; flex:0 0 auto; border:1.5px solid var(--safety-dim); border-radius:50%;
  display:flex; align-items:center; justify-content:center; color:var(--safety); font-family:'JetBrains Mono',monospace; font-size:18px; font-weight:800;
}
.industry-tile .wrapper-title{
  display: flex;
  align-items: center;
  gap: 8px;
}
.industry-tile span{font-family:'Barlow Condensed',sans-serif; font-size:26px; font-weight:600; color:var(--ink); text-transform:uppercase; letter-spacing:.02em; line-height:1.15;}

/* Inline gallery — visible by default, no tap required.
   Always exactly 3 grid slots, same width everywhere. Cards with fewer than
   3 photos get a dashed "placeholder" slot instead of dead empty space —
   see renderTileGalleries() in script.js, which now always emits 3 items:
   real thumbnails first, placeholders filling out the rest. */
.tile-gallery{ display:grid; grid-template-columns:repeat(3, 1fr); gap:8px; }
.tile-thumb-wrap{ position:relative; aspect-ratio:1/1; min-width:0; }
.tile-thumb{
  width:100%; height:100%; aspect-ratio:1/1; object-fit:cover; display:block;
  border:1px solid var(--line-bright); cursor:pointer;
  transition:border-color .2s var(--ease), transform .2s var(--ease);
}
.tile-thumb:hover, .tile-thumb:focus-visible{ border-color:var(--safety); transform:translateY(-2px); }
.tile-thumb-more{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  background:rgba(6,9,13,.62); color:var(--ink-gallery-super); font-family:'JetBrains Mono',monospace; font-size:20px; font-weight:600;
  pointer-events:none;
}
.tile-thumb-placeholder{
  aspect-ratio:1/1; border:1px dashed var(--line);
  display:flex; align-items:center; justify-content:center;
  color:var(--steel-dim); transition:border-color .2s var(--ease), color .2s var(--ease);
  cursor: not-allowed;
}
.tile-thumb-placeholder svg{ width:22%; height:22%; min-width:16px; min-height:16px; }
.industry-tile:hover .tile-thumb-placeholder{ border-color:var(--line-bright); color:var(--blue-dim); }
.tile-gallery-empty{
  grid-column:1 / -1;
  font-family:'JetBrains Mono',monospace; font-size:10.5px; letter-spacing:.06em; color:var(--steel-dim);
  border:1px dashed var(--line); padding:14px 16px; text-align:center; text-transform:uppercase;
}

@media (max-width:900px){ .industries-grid{grid-template-columns:1fr;} }
@media (max-width:420px){ .industry-tile{padding:22px 20px;} }

/* ============ SOFTWARE ============ */
.software-row{display:flex; gap:20px; flex-wrap:wrap;}
.soft-card{
  flex:1 1 220px; border:1px solid var(--line-bright); background:var(--surface); padding:30px;
  position:relative; overflow:hidden; transition:background .35s var(--ease);
}
.soft-card::before{content:""; position:absolute; top:0; left:0; width:100%; height:3px; background:var(--safety);}
.soft-card .sc-tag{font-family:'JetBrains Mono',monospace; font-size:10.5px; color:var(--blue); letter-spacing:.14em; text-transform:uppercase; margin-bottom:14px; display:block;}
.soft-card h4{font-size:26px; color:var(--ink); font-weight:700;}

/* ============ CONTACT ============ */
.contact .wrap{display:grid; grid-template-columns:.9fr 1.1fr; gap:80px;}
.contact-list{list-style:none; margin:0; padding:0;}
.contact-list li{
  display:flex; gap:16px; padding:22px 0; border-bottom:1px solid var(--line);
}
.contact-list li .cnum{font-family:'JetBrains Mono',monospace; color:var(--safety); font-size:14px; font-weight:600; flex:0 0 26px;}
.contact-list li b{display:block; color:var(--ink); font-size:13px; letter-spacing:.08em; text-transform:uppercase; font-family:'JetBrains Mono',monospace; margin-bottom:6px;}
.contact-list li p, .contact-list li a{margin:0; font-size:16px; color:var(--steel);}
.contact-list li a:hover{color:var(--blue);}

form{display:flex; flex-direction:column; gap:20px;}
.field{display:flex; flex-direction:column; gap:8px;}
.field label{font-family:'JetBrains Mono',monospace; font-size:11px; letter-spacing:.1em; text-transform:uppercase; color:var(--steel-dim);}
.field input, .field textarea{
  background:var(--surface); border:1px solid var(--line-bright); color:var(--ink);
  padding:14px 16px; font-family:'Inter',sans-serif; font-size:15px; resize:vertical;
  transition:border-color .2s var(--ease), background .35s var(--ease);
}
.field input:focus, .field textarea:focus{border-color:var(--safety); outline:none;}
.form-status{font-family:'JetBrains Mono',monospace; font-size:12.5px; color:var(--blue); min-height:18px;}

@media (max-width:900px){ .contact .wrap{grid-template-columns:1fr; gap:44px;} }

/* ============ DIVIDER ============ */
.dim-divider{position:relative; height:1px; background:var(--line); margin:0 auto; max-width:var(--maxw);}
.dim-divider::before, .dim-divider::after{
  content:""; position:absolute; top:-3px; width:1px; height:7px; background:var(--line-bright);
}
.dim-divider::before{left:28px;} .dim-divider::after{right:28px;}

/* ============ FOOTER ============ */
footer{position:relative; z-index:1; border-top:1px solid var(--line-bright); padding:56px 0 32px; background:var(--bg-alt); transition:background .35s var(--ease);}
.footer-grid{display:flex; justify-content:space-between; align-items:flex-end; flex-wrap:wrap; gap:32px;}
.footer-brand{display:flex; align-items:center; gap:12px;}
.footer-tb{
  display:flex; gap:0; border:1px solid var(--line-bright); font-family:'JetBrains Mono',monospace; font-size:10.5px;
}
.footer-tb div{padding:10px 16px; border-left:1px solid var(--line-bright);}
.footer-tb div:first-child{border-left:none;}
.footer-tb b{display:block; color:var(--safety); font-size:9px; letter-spacing:.1em; margin-bottom:3px;}
.footer-tb span{color:var(--steel);}
.footer-bottom{
  margin-top:40px; padding-top:24px; border-top:1px solid var(--line);
  display:flex; justify-content:space-between; flex-wrap:wrap; gap:12px;
  font-family:'JetBrains Mono',monospace; font-size:11.5px; color:var(--steel-dim); letter-spacing:.04em;
}
@media (max-width:600px){
  .footer-tb{flex-wrap:wrap;}
  .footer-tb div{border-left:none; border-top:1px solid var(--line-bright);}
  .footer-tb div:first-child{border-top:none;}
  .footer-bottom{flex-direction:column;}
}

::-webkit-scrollbar{width:10px;}
::-webkit-scrollbar-track{background:var(--bg);}
::-webkit-scrollbar-thumb{background:var(--line-bright); border:2px solid var(--bg);}

/* ============ LARGE DESKTOP REFINEMENT ============ */
@media (min-width:1440px){
  :root{--maxw:1280px;}
  body{font-size:17px;}
}

/* ============ SHORT / LANDSCAPE MOBILE ============ */
@media (max-width:900px) and (max-height:480px) and (orientation:landscape){
  .hero{min-height:auto; padding:120px 0 60px;}
}

/* ============ LIGHTBOX GALLERY ============ */
.gallery-overlay{
  position:fixed; inset:0; z-index:200;
  background:var(--scrim); backdrop-filter:blur(6px);
  display:flex; align-items:center; justify-content:center; padding:32px;
  opacity:0; visibility:hidden; transition:opacity .3s var(--ease), background .35s var(--ease);
}

.gallery-disclaimer{
  position:absolute; top:24px; left:50%; transform:translateX(-50%);
  font-family:'JetBrains Mono',monospace; font-size:11px; color:var(--steel-dim);
  text-align:center; max-width:90vw; z-index: 1; width: max-content;
}

.gallery-overlay.open{ opacity:1; visibility:visible; }

.gallery-box{ width:100%; max-width:860px; }
.gallery-frame{
  position:relative; background:var(--surface); border:1px solid var(--line-bright);
  display:flex; align-items:center; justify-content:center;
  min-height:280px; max-height:64vh; overflow:hidden;
}
.gallery-frame img{
  width:100%; height:100%; max-height:64vh; object-fit:contain; display:block;
  transition:transform .3s var(--ease); transform-origin:center;
}
.gallery-frame.is-zoomed img{ transform:scale(1.8); }
.gallery-zoom{
  position:absolute; right:14px; bottom:14px; z-index:2; width:42px; height:42px;
  display:none; align-items:center; justify-content:center; padding:0;
  background:var(--surface-2); border:1px solid var(--line-bright); color:var(--ink);
  box-shadow:0 6px 18px var(--shadow-color); cursor:pointer; opacity:0;
  transition:opacity .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.gallery-zoom svg{ width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; }
.gallery-zoom-minus{ display:none; }
.gallery-frame.is-zoomed .gallery-zoom-plus{ display:none; }
.gallery-frame.is-zoomed .gallery-zoom-minus{ display:block; }
.gallery-zoom:hover, .gallery-zoom:focus-visible,
.gallery-zoom[aria-pressed="true"]{ background:var(--safety); border-color:var(--safety); color:var(--bg); }
@media (hover:hover) and (pointer:fine){
  .gallery-zoom{ display:flex; }
  .gallery-frame:hover .gallery-zoom, .gallery-zoom:focus-visible{ opacity:1; }
  .gallery-frame img{ cursor:zoom-in; }
  .gallery-frame.is-zoomed img{ cursor:zoom-out; }
}
.gallery-corner{ position:absolute; width:18px; height:18px; z-index:1; pointer-events:none; }
.gallery-corner.tl{ top:-1px; left:-1px; border-top:2px solid var(--safety); border-left:2px solid var(--safety); }
.gallery-corner.tr{ top:-1px; right:-1px; border-top:2px solid var(--safety); border-right:2px solid var(--safety); }
.gallery-corner.bl{ bottom:-1px; left:-1px; border-bottom:2px solid var(--safety); border-left:2px solid var(--safety); }
.gallery-corner.br{ bottom:-1px; right:-1px; border-bottom:2px solid var(--safety); border-right:2px solid var(--safety); }

.gallery-caption{
  display:flex; align-items:baseline; gap:14px; margin-top:16px;
  font-size:15px; color:var(--steel);
}
.gallery-count{ color:var(--safety); font-size:12px; flex:0 0 auto; }

.gallery-thumbs{ display:flex; gap:10px; margin-top:18px; flex-wrap:wrap; }
.gallery-thumb{
  width:64px; height:64px; object-fit:cover; cursor:pointer;
  border:1px solid var(--line-bright); opacity:.5; transition:all .2s var(--ease);
}
.gallery-thumb:hover{ opacity:.85; }
.gallery-thumb.active{ opacity:1; border-color:var(--safety); }

.gallery-close{
  position:absolute; top:24px; right:28px; width:40px; height:40px;
  background:var(--surface-2); border:1px solid var(--line-bright); color:var(--ink);
  box-shadow:0 6px 18px var(--shadow-color); font-size:22px; line-height:1; cursor:pointer;
  transition:background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.gallery-close:hover, .gallery-close:focus-visible{ background:var(--safety); border-color:var(--safety); color:var(--bg); }

.gallery-arrow{
  position:absolute; top:45%; transform:translateY(-50%);
  width:48px; height:48px; background:var(--surface-2); border:1px solid var(--line-bright);
  color:var(--ink); box-shadow:0 6px 18px var(--shadow-color); font-size:26px; cursor:pointer;
  transition:background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
  z-index: 100;
}
.gallery-arrow:hover, .gallery-arrow:focus-visible{ background:var(--safety); border-color:var(--safety); color:var(--bg); }
.gallery-arrow--prev{ left:16px; }
.gallery-arrow--next{ right:16px; }

@media (max-width:640px){
  .gallery-overlay{ padding:16px; }
  .gallery-arrow{ width:38px; height:38px; font-size:20px; }
  .gallery-arrow--prev{ left:4px; } .gallery-arrow--next{ right:4px; }
  .gallery-close{ top:12px; right:14px; }
  .gallery-caption{ flex-direction:column; gap:4px; }
}
