/* ============================================================
   Artiplex GmbH — Acrylglas-Verarbeitung, Basel
   Shared design system — single hand-written stylesheet
   Aesthetic: clean, precise, light, slightly industrial.
   Signature: the "cut edge" — a thin cyan accent rule that
   evokes the glowing machined edge of cut acrylic glass.
   ============================================================ */

@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/opensans-latin.woff2") format("woff2-variations"),
       url("../fonts/opensans-latin.woff2") format("woff2");
}

:root {
  /* Accent — the cyan "edge glint" of cut acrylic */
  --edge-700: #0a6b8a;
  --edge-600: #0c87ab;
  --edge-500: #12a0c9;   /* primary accent */
  --edge-400: #3bb8da;
  --edge-300: #7fd3ea;
  --edge-100: #e2f4fa;

  /* Neutrals — cool, near-white surfaces + near-black ink */
  --ink:       #16191c;
  --body:      #444b52;
  --muted:     #7b848c;
  --line:      #e4e8ec;
  --bg:        #ffffff;
  --bg-soft:   #f3f6f8;   /* cool light grey, like frosted acrylic */
  --bg-dark:   #131a1f;
  --bg-darker: #0c1116;

  --container: 1160px;
  --gutter: clamp(20px, 4vw, 40px);
  --section-pad: clamp(60px, 9vw, 120px);

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

  --shadow-sm: 0 2px 8px rgba(18, 30, 38, 0.06);
  --shadow-md: 0 10px 30px rgba(18, 30, 38, 0.09);
  --shadow-lg: 0 25px 60px rgba(12, 25, 33, 0.20);

  --t-fast: 180ms cubic-bezier(.2,.7,.2,1);
  --t-med:  320ms cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, picture, svg { max-width: 100%; height: auto; display: block; }

a {
  color: var(--edge-600);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--edge-500); }

h1, h2, h3, h4, h5 {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.18;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
h4 { font-size: 1.125rem; }
p  { margin: 0 0 1.1em; }

p:last-child, ul:last-child { margin-bottom: 0; }

ul { padding-left: 1.2em; margin: 0 0 1.1em; }
li { margin-bottom: 0.4em; }
li strong, li b { color: var(--ink); font-weight: 700; }

/* Visible focus for keyboard users */
:focus-visible {
  outline: 3px solid var(--edge-400);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ===== Layout primitives ===== */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section { padding: var(--section-pad) 0; }
.section--soft { background: var(--bg-soft); }
.section--dark {
  background: var(--bg-dark);
  color: #c4ccd2;
}
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: #fff; }
.section--dark .kicker { color: var(--edge-400); }
.section--dark a { color: var(--edge-300); }

.section-head {
  max-width: 760px;
  margin: 0 auto clamp(40px, 6vw, 70px);
  text-align: center;
}
.section-head p { color: var(--muted); }
.section--dark .section-head p { color: #9aa4ab; }

/* Eyebrow / kicker — the "cut edge" mark: a short accent rule + label */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--edge-600);
  margin-bottom: 1rem;
}
.kicker::before {
  content: "";
  width: 26px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--edge-500));
}
.section-head .kicker { justify-content: center; }

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

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 28px;
  background: var(--edge-600);
  color: #fff;
  border: 1px solid var(--edge-600);
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform var(--t-fast), background var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
  box-shadow: 0 8px 22px rgba(12, 135, 171, 0.30);
}
.btn:hover {
  background: var(--edge-500);
  border-color: var(--edge-500);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(12, 135, 171, 0.40);
}
.btn svg { width: 16px; height: 16px; }

.btn--ghost {
  background: transparent;
  color: var(--edge-700);
  border-color: var(--line);
  box-shadow: none;
}
.btn--ghost:hover {
  background: var(--edge-100);
  border-color: var(--edge-300);
  color: var(--edge-700);
  box-shadow: var(--shadow-sm);
}

/* ===== Header / nav ===== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  padding: 16px 0;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid transparent;
  transition: background var(--t-med), padding var(--t-med), box-shadow var(--t-med), border-color var(--t-med);
}
.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  padding: 9px 0;
  border-bottom-color: var(--line);
  box-shadow: 0 6px 24px rgba(18, 30, 38, 0.08);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}
.brand:hover { color: var(--ink); opacity: 0.8; }
.brand img { height: 40px; width: auto; }
.brand-text {
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle svg { width: 22px; height: 22px; }

.nav-list {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 28px;
  align-items: center;
}
.nav-list a {
  color: var(--body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  position: relative;
  padding: 8px 0;
}
.nav-list a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 2px;
  background: var(--edge-500);
  transition: right var(--t-fast);
}
.nav-list a:hover { color: var(--ink); }
.nav-list a:hover::after, .nav-list a.is-active::after { right: 0; }
.nav-list a.is-active { color: var(--ink); }

@media (max-width: 860px) {
  /* No-JS default: nav wraps below brand as a visible horizontal list */
  .nav { flex-wrap: wrap; row-gap: 8px; }
  .nav-toggle { display: none; }
  .nav-list {
    flex-basis: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 18px;
  }
  .nav-list a { font-size: 0.8rem; padding: 4px 0; }
  .nav-list a::after { display: none; }

  /* JS-enhanced: collapse into a hamburger-driven dropdown */
  .js .nav-toggle { display: inline-flex; }
  .js .nav-list {
    position: absolute;
    top: 100%;
    left: var(--gutter);
    right: var(--gutter);
    flex-basis: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 8px 0;
    margin-top: 8px;
    transform-origin: top right;
    transform: scaleY(0.4);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--t-med), opacity var(--t-med);
    box-shadow: var(--shadow-lg);
  }
  .js .nav[data-open="true"] .nav-list {
    transform: scaleY(1);
    opacity: 1;
    pointer-events: auto;
  }
  .js .nav-list a {
    padding: 14px 22px;
    border-bottom: 1px solid var(--line);
    font-size: 0.9rem;
  }
  .js .nav-list li:last-child a { border-bottom: none; }
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  color: #fff;
  background: var(--bg-darker);
  overflow: hidden;
}
.hero__bg { position: absolute; inset: 0; z-index: 0; }
.hero__bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.5;
  transform: scale(1.05);
  animation: heroZoom 30s ease-out forwards;
}
@keyframes heroZoom { to { transform: scale(1.0); } }

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at 28% 35%, rgba(18,160,201,0.28), transparent 60%),
    linear-gradient(180deg, rgba(12,17,22,0.40) 0%, rgba(12,17,22,0.86) 100%);
}
/* Signature "cut edge": a bright cyan rule across the bottom of the hero */
.hero::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--edge-500) 30%, var(--edge-300) 70%, transparent);
}
.hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  text-align: center;
  padding: 150px 0 90px;
}
.hero h1 {
  color: #fff;
  margin: 0.4em 0 0.5em;
  text-shadow: 0 4px 30px rgba(0,0,0,0.4);
}
.hero h1 .accent {
  display: block;
  font-weight: 300;
  letter-spacing: 0;
  color: var(--edge-300);
}
.hero p {
  max-width: 660px;
  margin: 0 auto 2em;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: rgba(255,255,255,0.88);
}
.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.hero .btn { box-shadow: 0 8px 24px rgba(18,160,201,0.45); }
.hero__scroll {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  width: 28px;
  opacity: 0.7;
  color: #fff;
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 8px); }
}

/* ===== Article grid (products: picture, art.-nr, name, Anfragen) ===== */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: clamp(18px, 2.4vw, 30px);
}
.article-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--t-med), box-shadow var(--t-med), border-color var(--t-med);
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--edge-300);
}
.article-card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg-soft);
  overflow: hidden;
}
.article-card__media a { display: block; width: 100%; height: 100%; cursor: zoom-in; }
.article-card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(.2,.7,.2,1);
}
.article-card:hover .article-card__media img { transform: scale(1.05); }
.article-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 18px 20px;
}
.article-card__artnr {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--edge-600);
  margin-bottom: 6px;
}
.article-card__name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin: 0 0 16px;
}
.article-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

/* ===== Gallery grid (figures + lazy thumbnails; ~83 photos) =====
   Also reused for the Sonderanfertigungen grid (#sonder-grid). */
.gallery-grid,
#sonder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: clamp(10px, 1.4vw, 16px);
}
@media (min-width: 900px) {
  .gallery-grid,
  #sonder-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
}
.gallery-grid figure {
  position: relative;
  margin: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  box-shadow: var(--shadow-sm);
}
.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(.2,.7,.2,1), filter var(--t-med);
}
.gallery-grid figure:hover img { transform: scale(1.06); }
.js .gallery-grid [data-lightbox] { cursor: zoom-in; display: block; height: 100%; }

.gallery-grid figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 22px 12px 10px;
  background: linear-gradient(0deg, rgba(12,17,22,0.92) 0%, rgba(12,17,22,0) 100%);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transform: translateY(101%);
  transition: transform var(--t-med);
}
.gallery-grid figure:hover figcaption,
.gallery-grid [data-lightbox]:focus-visible + figcaption { transform: translateY(0); }

/* ===== Footer ===== */
.site-footer {
  background: var(--bg-darker);
  color: #8a9499;
  padding: 50px 0 30px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 0.9rem;
}
.site-footer a { color: #b6c0c5; }
.site-footer a:hover { color: #fff; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
}
.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}
.copyright { color: #6a7479; }

/* ===== Progressive enhancement: scroll-in animations =====
   Default (no .js) state is fully visible. */
.js [data-animate] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(.2,.7,.2,1);
}
.js [data-animate].is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .js [data-animate] { opacity: 1; transform: none; }
  .hero__bg img { transform: none; }
}

/* ===== Lightbox dialog ===== */
dialog.lightbox,
.lightbox {
  border: none;
  padding: 0;
  background: transparent;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  inset: 0;
}
.lightbox::backdrop {
  background: rgba(8, 12, 16, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox__img {
  max-width: 90vw;
  max-height: 86vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 30px 80px rgba(0,0,0,0.8);
}
.lightbox__close {
  position: absolute;
  top: 22px;
  right: 22px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  width: 46px; height: 46px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast), transform var(--t-fast);
}
.lightbox__close:hover { background: rgba(255,255,255,0.22); transform: rotate(90deg); }
.lightbox__close svg { width: 22px; height: 22px; }

/* ===== Sub-pages (Datenschutz / 404) ===== */
.page-hero {
  background: linear-gradient(160deg, var(--bg-dark), var(--bg-darker));
  color: #fff;
  padding: 170px 0 80px;
  text-align: center;
  position: relative;
}
.page-hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--edge-500) 30%, var(--edge-300) 70%, transparent);
}
.page-hero h1 { color: #fff; }
.page-hero p { color: rgba(255,255,255,0.85); max-width: 640px; margin: 0 auto; }

.prose {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--section-pad) 0;
}
.prose h2 { margin-top: 2.2em; font-size: 1.5rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.6em; font-size: 1.15rem; }
.prose ul { padding-left: 1.4em; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }

.notfound {
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px;
}
.notfound .big {
  font-size: clamp(6rem, 18vw, 12rem);
  margin: 0;
  color: var(--edge-500);
  line-height: 1;
  letter-spacing: -0.04em;
}
