:root{
  --bg-image: url("images/bg_main.jpg");
  --fg-light: rgba(255,255,255,0.92);
  --fg-dark: rgba(0,0,0,0.88);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  overflow-x:hidden;
}

/* Fixed background (parallax via JS updates background-position) */
.bg-fixed{
  position: fixed;
  inset: 0;
  background-image: var(--bg-image);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center 0%;
  filter: blur(0px) brightness(0.95);
  transform: scale(1.02);
  z-index: -2;
  will-change: background-position;
}
.bg-overlay{
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(255,255,255,0.02), rgba(0,0,0,0.14));
  z-index: -1;
  pointer-events:none;
}

/* Header */
header{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 18px 64px;
  background: rgba(0,0,0,0.18);
  backdrop-filter: blur(9px) saturate(115%);
  -webkit-backdrop-filter: blur(9px) saturate(115%);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.header-inner{
  max-width: 1600px;
  margin: 0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.logo-link{
  display:inline-flex;
  align-items:center;
  gap:24px;
  text-decoration:none;
  color: inherit;
}
.logo-link img{ height:48px; width:auto; display:block; }
.brand{
  font-size: 28px;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.92);
}
nav{
  display:flex;
  gap:28px;
}
nav a{
  text-decoration:none;
  color: rgba(255,255,255,0.82);
  font-size: 14px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
nav a:hover{ color: rgba(255,255,255,0.98); }

/* Sections */
.section{
  height: 100vh;
  min-height: 100vh;
  display:flex;
  align-items:center;
  padding: 110px 64px 56px; /* account for fixed header */
}
.section-inner{
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  display:grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items:center;
}

.section-dark{
  color: var(--fg-light);
  background: rgba(0,0,0,0.74);
  backdrop-filter: blur(7px) saturate(115%);
  -webkit-backdrop-filter: blur(7px) saturate(115%);
}
.section-light{
  color: var(--fg-dark);
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(7px) saturate(115%);
  -webkit-backdrop-filter: blur(7px) saturate(115%);
}

.h1{
  font-size: clamp(32px, 3.4vw, 52px);
  line-height: 1.05;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
}
.p{
  margin:0 0 18px;
  font-size: 16px;
  line-height: 1.7;
  opacity: 0.9;
  max-width: 56ch;
}
.kv{
  display:flex;
  gap:18px;
  flex-wrap:wrap;
  margin-top: 18px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
}
.kv span{
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
}
.section-light .kv span{
  border: 1px solid rgba(0,0,0,0.14);
}

.media{
  width:100%;
  border-radius: 22px;
  overflow:hidden;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
}
.section-light .media{
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.02);
}
.media img{
  width:100%;
  height:auto;
  display:block;
}

/* Screen 3: Spline full screen + transparent glass */
.section-spline{
  height: 100vh;
  min-height: 100vh;
  padding: 0;
  margin: 0;
  background: rgba(0,0,0,0.12);
  backdrop-filter: blur(7px) saturate(115%);
  -webkit-backdrop-filter: blur(7px) saturate(115%);
}
.spline-wrapper{ width:100%; height:100%; }
.spline-wrapper iframe{ width:100%; height:100%; border:none; display:block; }

footer{
  padding: 34px 64px;
  color: rgba(255,255,255,0.55);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Mobile */
@media (max-width: 1239px){
  header{ padding: 14px 18px; }
  .section{
    padding: 96px 18px 42px;
    height: auto;         /* was fixed 100vh — content taller than the screen was overflowing into the next section */
    min-height: 100vh;
    display: block;       /* flex+align-items:center was also compressing/overlapping tall content */
  }
  .section-inner{ grid-template-columns: 1fr; gap: 22px; }
  .h1{ font-size: 40px; }

  /* Header nav was overflowing off-screen on narrow phones */
  .header-inner{ flex-wrap: wrap; row-gap: 10px; }
  .logo-link img{ height: 34px; }
  .brand{ font-size: 18px; }
  nav{ gap: 16px; }
  nav a{ font-size: 12px; }
}

/* =========================================================
   Home hero sections (desktop, >=1240px)
   Screen 1 (dark): text left, image fills right edge-to-edge at
     its natural ratio (height follows content, like Screen 2).
   Screen 2 (light): image fills left edge-to-edge at its natural
     ratio (height follows content), text right.
   Both screens use auto height (not locked to viewport height).
   Screen 1 originally locked its height to 100vh so Screen 2 would
   "peek" in below the fold, but that broke badly at in-between
   desktop widths once Screen 1's text grew a longer Highlights
   list: narrower width -> text wraps taller -> fixed-height box
   can't grow -> content spills over the image, and the image's
   own box (width shrinking, height pinned to viewport) warped out
   of proportion so object-fit:cover cropped it oddly. Auto height
   (matching Screen 2's already-correct approach) fixes both.
   Consolidated from what used to be ~8 overlapping !important
   patches on the same selectors — that version worked at full
   desktop width but broke at in-between widths because later
   patches only partially cancelled earlier ones. This is the
   single, final intended state, with the two fixed-pixel offsets
   (120px / 140px nudges) made to scale down on narrower desktop
   widths instead of staying fixed.
   ========================================================= */
@media (min-width: 1240px){
  /* ---- Screen 1 ---- */
  .section:first-of-type{
    height: auto;
    min-height: 0;
    display: flex;
    align-items: flex-start;
    padding-right: 0;
    padding-bottom: 0;
  }
  .section:first-of-type .section-inner{
    max-width: none;
    margin: 0;
    width: 100%;
    height: auto;
    display: grid;
    align-items: start;
    grid-template-columns: 0.4fr 2.1fr;
    gap: 40px;
  }
  .section:first-of-type .section-inner > :first-child{
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
  }
  .section:first-of-type .media{
    width: 100%;
    height: auto;
    align-self: start;
    border-radius: 22px;
  }
  .section:first-of-type .media img{
    width: 100%;
    height: auto;
    display: block;
  }

  /* ---- Screen 2 removed — see index.html. Manufacturing section
     (now the 2nd .section in the DOM) has its own dedicated #manufacturing
     rules below and is NOT targeted by anything here, intentionally:
     nth-of-type(2) rules used to live here and would otherwise silently
     hijack whatever section lands in that position next. ---- */

  /* ---- Screen 3 (Spline) spacing ---- */
  .section-spline{
    margin-top: 48px;
  }
}


/* =========================================================
   "View More" tag link (pill)
   Usage in HTML: <a class="tag view-more-tag" href="anyitx_products.html">View More</a>
   ========================================================= */
.view-more-tag{
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  backdrop-filter: none; /* keep it as a normal (non-glass) tag */
}


/* =========================================================
   Home Screen 2 (light): force readable dark text + pills
   ========================================================= */
#home2 .h1{ color: rgba(0,0,0,.92); }
#home2 .p{ color: rgba(0,0,0,.72); }
#home2 .kv span{
  color: rgba(0,0,0,.80);
  border-color: rgba(0,0,0,.18);
  background: rgba(0,0,0,.03);
}
#home2 .view-more-tag{
  color: rgba(0,0,0,.82);
  border: 1px solid rgba(0,0,0,.18);
  background: rgba(0,0,0,.04);
}
#home2 .view-more-tag:hover{
  color: rgba(0,0,0,.92);
  border-color: rgba(0,0,0,.28);
  background: rgba(0,0,0,.06);
}


/* =========================================================
   Fix: View More pill styling + spacing (Home Screen 1 & 2)
   - Screen 1: white text + bordered pill like other tags
   - Screen 2: keep dark style, add vertical gap from row above
   ========================================================= */

/* Screen 1 (dark) */
#home .view-more-tag,
#home .view-more-tag:visited{
  color: rgba(255,255,255,.88);
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.04);
}
#home .view-more-tag:hover{
  color: rgba(255,255,255,.95);
  border-color: rgba(255,255,255,.28);
  background: rgba(255,255,255,.08);
}

/* Spacing: put View More clearly on the second line under the tag row */
#home .view-more-tag{ margin-top: 14px; }

/* Screen 2 (light) spacing only (keep black pill rules above) */
#home2 .view-more-tag{ margin-top: 14px; }


/* =========================================================
   Home Screen 1: SPECS label (non-link) + inline specs grid
   ========================================================= */
#home .specs-label{
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.78);
  background: rgba(255,255,255,.03);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-top: 10px;
}

#home .specs-mini{
  margin-top: 14px;
  max-width: 520px;
}

#home .specs-grid{
  display: grid;
  gap: 10px;
}

#home .spec-row{
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid rgba(255,255,255,.10);
}

#home .spec-row:first-child{
  border-top: 1px solid rgba(255,255,255,.10);
}

#home .spec-k{
  color: rgba(255,255,255,.70);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

#home .spec-v{
  color: rgba(255,255,255,.88);
  font-size: 13px;
  line-height: 1.35;
}

/* =========================================================
   Home Screen 1: specs bullet list (matches provided image)
   ========================================================= */
#home .specs-bullets{
  margin-top: 14px;
  max-width: 720px;
}
#home .specs-bullet{
  display: grid;
  grid-template-columns: 18px 150px 1fr;
  gap: 14px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid rgba(255,255,255,.10);
}
#home .specs-bullet:first-child{
  border-top: 1px solid rgba(255,255,255,.10);
}
#home .specs-bullet .dot{
  color: rgba(255,255,255,.80);
  line-height: 1.2;
}
#home .specs-bullet .k{
  color: rgba(255,255,255,.92);
  font-weight: 700;
  letter-spacing: .01em;
}
#home .specs-bullet .v{
  color: rgba(255,255,255,.88);
  line-height: 1.35;
}
@media (max-width: 1239px){
  #home .specs-bullet{
    grid-template-columns: 18px 1fr;
  }
  #home .specs-bullet .k{
    grid-column: 2;
  }
  #home .specs-bullet .v{
    grid-column: 2;
    margin-top: 4px;
  }
}


/* GPU value: split into 3 sub-lines */
#home .specs-bullet .v.v-gpu{
  display: grid;
  gap: 4px;
}
#home .specs-bullet .v.v-gpu .vline{
  display: block;
}


/* =========================================================
   Home Screen 2 (light): specs bullet list colors
   ========================================================= */
#home2 .specs-bullets{
  margin-top: 14px;
  max-width: 720px;
}
#home2 .specs-bullet{
  border-top: 1px solid rgba(0,0,0,.10);
}
#home2 .specs-bullet .dot{ color: rgba(0,0,0,.60); }
#home2 .specs-bullet .k{ color: rgba(0,0,0,.90); font-weight: 700; }
#home2 .specs-bullet .v{ color: rgba(0,0,0,.78); }


/* =========================================================
   Specs list layout: keep Home 2 consistent with Home 1
   ========================================================= */
#home .specs-bullets,
#home2 .specs-bullets{
  margin-top: 14px;
  max-width: 720px;
}

#home .specs-bullet,
#home2 .specs-bullet{
  display: grid;
  grid-template-columns: 18px 150px 1fr;
  gap: 14px;
  align-items: start;
  padding: 10px 0;
}

#home .specs-bullet .dot,
#home2 .specs-bullet .dot{
  line-height: 1.2;
}

#home .specs-bullet .k,
#home2 .specs-bullet .k{
  font-weight: 700;
  letter-spacing: .01em;
}

#home .specs-bullet .v,
#home2 .specs-bullet .v{
  line-height: 1.35;
}

#home .specs-bullet .v.v-gpu,
#home2 .specs-bullet .v.v-gpu{
  display: grid;
  gap: 4px;
}

@media (max-width: 1239px){
  #home .specs-bullet,
  #home2 .specs-bullet{
    grid-template-columns: 18px 1fr;
  }
  #home .specs-bullet .k,
  #home2 .specs-bullet .k{
    grid-column: 2;
  }
  #home .specs-bullet .v,
  #home2 .specs-bullet .v{
    grid-column: 2;
    margin-top: 4px;
  }
}

/* Home 2: title */
#home2 .specs-title{
  margin-top: 12px;
  margin-bottom: 2px;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(0,0,0,.55);
}


/* Home 2: dividers similar to Home 1 */
#home2 .specs-bullet{
  border-top: 1px solid rgba(0,0,0,.10);
}
#home2 .specs-bullet .dot{ color: rgba(0,0,0,.55); }
#home2 .specs-bullet .k{ color: rgba(0,0,0,.90); }
#home2 .specs-bullet .v{ color: rgba(0,0,0,.78); }


/* =========================================================
   Products page: COOJ-like 4-up product grid (glass bg stays)
   ========================================================= */
.products-section{
  padding-top: 96px;
  padding-bottom: 96px;
}

.products-inner{
  display: block;
}

.products-header{
  max-width: 1239px;
  margin: 0 auto 34px auto;
}

.product-grid{
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.product-card{
  display: block;
  text-decoration: none;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.product-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0,0,0,.12);
  background: rgba(255,255,255,.70);
}

.product-media{
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: rgba(255,255,255,.25);
}

.product-img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .55s ease;
}

.product-img.secondary{
  opacity: 0;
}

.product-card:hover .product-img.secondary{
  opacity: 1;
}

.product-card:hover .product-img.primary{
  opacity: 0;
}

.product-meta{
  padding: 14px 14px 16px 14px;
}

.product-title{
  font-size: 14px;
  font-weight: 600;
  color: rgba(0,0,0,.88);
  letter-spacing: .01em;
  line-height: 1.25;
}

.product-price{
  margin-top: 6px;
  font-size: 13px;
  color: rgba(0,0,0,.62);
}

@media (max-width: 1100px){
  .product-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px){
  .products-section{
    padding-top: 72px;
    padding-bottom: 72px;
  }
  .product-grid{
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .product-media{
    aspect-ratio: 4 / 3;
  }
}

/* Products: single-image + hover slideshow (JS swaps src) */
.product-media .product-img{
  opacity: 1 !important;
}
.product-media .product-img.primary,
.product-media .product-img.secondary{
  opacity: 1 !important;
}

/* =========================================================
   Products page: disable hero 100vh centering (match COOJ layout)
   ========================================================= */
.products-section{
  height: auto;
  min-height: 0;
  display: block;
  padding: 110px 64px 96px; /* keep space for fixed header, reduce "empty hero" */
}

@media (max-width: 1239px){
  .products-section{
    padding: 96px 22px 72px;
  }
}

/* Ensure products content starts at top, not vertically centered */
.products-section .products-inner{
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

/* Header spacing like a collection page (not a hero) */
.products-header{
  text-align: center;
  margin: 0 auto 34px auto;
}

.products-header .h1{
  margin: 0;
}

.products-header .p{
  margin-top: 10px;
}

/* =========================================================
   FORCE Products page to behave like a collection grid page
   (override any global .section 100vh / flex centering rules)
   ========================================================= */
body.products-page #products.products-section{
  height: auto !important;
  min-height: 0 !important;
  display: block !important;
  align-items: initial !important;
  justify-content: initial !important;
  padding-top: 110px !important;
  padding-bottom: 96px !important;
}

body.products-page #products.products-section .section-inner,
body.products-page #products.products-section .products-inner{
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  max-width: 1600px;
  margin: 0 auto !important;
  width: 100% !important;
}

body.products-page #products .products-header{
  text-align: center;
  margin: 0 auto 34px auto !important;
}

body.products-page #products .product-grid{
  margin-top: 10px !important;
}

@media (max-width: 1239px){
  body.products-page #products.products-section{
    padding-top: 96px !important;
    padding-left: 22px !important;
    padding-right: 22px !important;
    padding-bottom: 72px !important;
  }
}

/* =========================================================
   Products cards: 2-layer crossfade (JS swaps src)
   ========================================================= */
.product-media{
  position: relative;
  overflow: hidden;
}

.product-media .product-img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .55s ease;
  will-change: opacity;
}

.product-media .product-img.is-visible{ opacity: 1; }
.product-media .product-img.is-hidden{ opacity: 0; }

/* Make sure hover targets the image area */
.product-media{
  cursor: pointer;
}

/* =========================================================
   Manufacturing / "How it's made" section (homepage)
   Content sourced from the product PPT (extrusion + CNC story).
   Explicitly height:auto — base .section defaults to 100vh, which
   this text-heavy section would overflow (same bug class fixed
   earlier for Screen 2).
   ========================================================= */
#manufacturing{
  height: auto;
  min-height: 0;
  display: block;
  padding: 96px 64px;
}
#manufacturing .manufacturing-inner{
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}
#manufacturing .tag{
  display: inline-block;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.60);
  margin-bottom: 10px;
}
#manufacturing .h2{
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.15;
  margin: 0 0 16px;
  color: rgba(255,255,255,.94);
}
#manufacturing .p{
  color: rgba(255,255,255,.72);
  line-height: 1.6;
  margin: 0 0 14px;
  max-width: 60ch;
}
#manufacturing .mfg-stats{
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 18px;
  margin-top: 22px;
}
#manufacturing .mfg-num{
  font-size: 20px;
  font-weight: 700;
  color: rgba(255,255,255,.94);
  margin-bottom: 4px;
}
#manufacturing .mfg-label{
  font-size: 12px;
  color: rgba(255,255,255,.58);
  line-height: 1.4;
}
#manufacturing .manufacturing-media{
  width: 100%;
  height: auto;
  border-radius: 22px;
  overflow: hidden;
}
#manufacturing .manufacturing-media img{
  width: 100%;
  height: auto;
  display: block;
}

@media (min-width: 1240px){
  #manufacturing{ padding: 110px 64px; }
  #manufacturing .manufacturing-inner{
    grid-template-columns: 1fr 1fr;
    gap: 56px;
  }
}

/* =========================================================
   Homepage Screen 1 hero: auto-cycling slideshow through all
   X1 product images. Two stacked layers — the top layer frosts
   (blurs) and fades out every cycle to reveal the sharp next
   image already sitting underneath on the bottom layer.
   ========================================================= */
.hero-slideshow{
  position: relative;
  aspect-ratio: 16 / 9;
}
/* Extra-specific selector needed: the earlier Screen-1 rule
   ".section:first-of-type .media img{width:100%;height:auto;display:block}"
   outranks a plain ".hero-slideshow .hero-img" rule on specificity alone
   (it has one more class/pseudo-class level), so without this prefix these
   overrides get silently discarded and the two layers stack in normal
   flow instead of overlapping. */
.section:first-of-type .hero-slideshow .hero-img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-slideshow .layer-bottom{
  z-index: 1;
}
.hero-slideshow .layer-top{
  z-index: 2;
  opacity: 1;
  filter: blur(0px);
  transition: opacity 1.7s ease, filter 1.7s ease;
}
.hero-slideshow .layer-top.is-fading{
  opacity: 0;
  filter: blur(40px);
}

@media (max-width: 1239px){
  .hero-slideshow{ aspect-ratio: 4 / 3; }
}
