/* =========================================================
   G3D PrintLab — VERSION 2: "Shop window"
   Ideas: a lit shop window with shelves (D), a live
   "build it" screen (E), and everything appears layer by layer
   like a 3D print (F).
   ========================================================= */

/* Lets the browser animate the "print progress" of an element */
@property --p { syntax: "<percentage>"; inherits: true; initial-value: 0%; }

:root {
  --red: #fe0100; /* the exact red from the logo */
  --font: "Readex Pro", "Rubik", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 68px;
  --max: 1200px;
  color-scheme: dark;

  /* Dark: a shop window at night */
  --bg: #0d0d0f;
  --wall: #141417;
  --wall-2: #1a1a1e;
  --text: #f3f3f4;
  --muted: #9b9ba3;
  --line: #2b2b31;
  --shelf-top: #3a3a42;
  --shelf-front: #26262c;
  --spot: rgba(255, 244, 230, 0.16);
  --glass: rgba(255, 255, 255, 0.05);
  --label-bg: #f3f3f4;
  --label-fg: #0d0d0f;
  --layer-dark: rgba(0, 0, 0, 0.22);
}
:root[data-theme="light"] {
  color-scheme: light;
  /* Light: the same shop in daylight */
  --bg: #f4f4f2;
  --wall: #e9e9e6;
  --wall-2: #ffffff;
  --text: #111113;
  --muted: #5d5d66;
  --line: #d6d6d2;
  --shelf-top: #ffffff;
  --shelf-front: #d9d9d4;
  --spot: rgba(255, 255, 255, 0.85);
  --glass: rgba(255, 255, 255, 0.35);
  --label-bg: #111113;
  --label-fg: #ffffff;
}
:root[lang="he"] { --font: "Rubik", "Readex Pro", system-ui, sans-serif; }

@view-transition { navigation: auto; }

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 106.25%; /* 17px base */ scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden;
  transition: background-color 0.4s, color 0.4s;
}
.loading body { opacity: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
.container { width: min(100% - 32px, var(--max)); margin-inline: auto; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.skip-link { position: absolute; inset-inline-start: 16px; top: -60px; z-index: 100; background: var(--red); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.mono { font-family: var(--mono); letter-spacing: 0.02em; }

/* =========== F: "printed" reveal — content grows up layer by layer =========== */
.reveal { --p: 100%; }
/* 1px stays visible so the browser can tell when it scrolls into view */
.js .reveal.print { --p: 0%; position: relative; clip-path: inset(calc(100% - var(--p) - 1px) -40px -40px -40px); }
.js .reveal.print.in { animation: print-up var(--dur, .5s) steps(var(--layers, 12), end) var(--d, 0s) forwards; }
@keyframes print-up { to { --p: 100%; } }
/* the red "nozzle line" that travels up while printing */
.js .reveal.print::after {
  content: ""; position: absolute; inset-inline: -6px; height: 2px; bottom: calc(var(--p) - 1px);
  background: var(--red); box-shadow: 0 0 12px 2px rgba(254, 1, 0, 0.6);
  opacity: 0; pointer-events: none;
}
.js .reveal.print.in::after { animation: nozzle var(--dur, .5s) var(--d, 0s) both; }
@keyframes nozzle { 0%, 92% { opacity: 1; } 100% { opacity: 0; } }

/* Thin bar at the very top: how far down the page you are */
.progress { position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 60; pointer-events: none; }
.progress i { display: block; height: 100%; width: 100%; background: var(--red); transform-origin: left; transform: scaleX(var(--s, 0)); }
[dir="rtl"] .progress i { transform-origin: right; }

/* ================= Header ================= */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color 0.3s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 20px; }
.logo { display: inline-flex; flex-direction: column; line-height: 1; direction: ltr; }
.nav { display: flex; gap: 2px; margin-inline-start: auto; align-items: center; }
.nav a { padding: 8px 14px; border-radius: 8px; color: var(--muted); font-weight: 500; transition: color 0.2s, background-color 0.2s; }
.nav a:hover { color: var(--text); background: var(--wall-2); }
.controls { display: flex; align-items: center; gap: 8px; }
.lang-switch { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--wall); }
.lang-switch button { border: 0; background: none; padding: 5px 10px; border-radius: 7px; font-size: 0.92rem; font-weight: 600; color: var(--muted); }
.lang-switch button[aria-pressed="true"] { background: var(--wall-2); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 10px; background: var(--wall); transition: transform 0.3s var(--ease); }
.icon-btn:hover { transform: rotate(-10deg); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: block; }
:root[data-theme="light"] .theme-toggle .moon { display: none; }
.menu-btn { display: none; }

/* ================= Buttons ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 22px; border-radius: 10px; border: 1.5px solid var(--text); background: none;
  font-weight: 600; transition: transform 0.25s var(--ease), background-color 0.25s, color 0.25s, box-shadow 0.25s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 -1px var(--text); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-red:hover { box-shadow: 0 6px 0 -1px #8a0400; }
.btn-sm { padding: 9px 16px; font-size: 1rem; }
.btn svg { width: 18px; height: 18px; }

/* ================= Hero ================= */
.hero { padding: 56px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.kicker { font-family: var(--mono); font-size: 0.92rem; color: var(--red); letter-spacing: 0.08em; text-transform: uppercase; display: inline-flex; gap: 10px; align-items: center; }
.kicker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
h1, h2, h3 { margin: 0 0 14px; line-height: 1.1; letter-spacing: -0.03em; text-wrap: balance; }
:root[lang="ar"] :is(h1, h2, h3) { letter-spacing: 0; line-height: 1.3; }
.hero h1 { font-size: clamp(2.8rem, 8vw, 6rem); font-weight: 700; margin-top: 14px; }
.hero h1 span { display: block; }
/* The second line is filled with horizontal "layer lines", like a real print */
.hero h1 .layered {
  color: transparent;
  background: repeating-linear-gradient(to bottom, var(--red) 0 4px, #b00500 4px 6px);
  -webkit-background-clip: text; background-clip: text;
}
.lead { color: var(--muted); font-size: 1.1rem; max-width: 56ch; margin: 0 0 28px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* The pedestal with a spotlight and the rotating model */
.pedestal { position: relative; aspect-ratio: 1 / 1.05; max-width: 480px; width: 100%; margin-inline: auto; }
.pedestal::before { /* spotlight cone */
  content: ""; position: absolute; inset: -10% 10% 20%;
  background: conic-gradient(from 180deg at 50% 0%, transparent 155deg, var(--spot) 172deg, var(--spot) 188deg, transparent 205deg);
  pointer-events: none;
}
.pedestal model-viewer, .pedestal .fallback { position: absolute; inset: 4% 8% 22%; width: auto; height: auto; --poster-color: transparent; }
.pedestal .fallback svg { width: 100%; height: 100%; }
.plinth { position: absolute; inset-inline: 18%; bottom: 6%; height: 18%; }
.plinth::before { /* top surface */
  content: ""; position: absolute; inset: 0 0 auto; height: 26%; border-radius: 50%;
  background: var(--shelf-top); box-shadow: inset 0 -4px 10px rgba(0,0,0,.25);
}
.plinth::after { /* front */
  content: ""; position: absolute; inset: 13% 0 0; z-index: -1;
  background: linear-gradient(90deg, var(--shelf-front), var(--shelf-top) 45%, var(--shelf-front));
  border-radius: 0 0 50% 50% / 0 0 18% 18%;
}
.spec-tag {
  position: absolute; top: 12%; inset-inline-end: 0; transform: rotate(4deg);
  background: var(--label-bg); color: var(--label-fg); border-radius: 6px; padding: 8px 12px 8px 22px;
  font-family: var(--mono); font-size: 0.85rem; line-height: 1.5; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  direction: ltr; text-align: left;
}
.spec-tag::before { content: ""; position: absolute; left: 8px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--bg); }
.spec-tag b { color: var(--red); display: block; font-family: var(--font); }

/* ================= Section heads ================= */
.section { padding: 88px 0; }
.head { margin-bottom: 36px; max-width: 720px; }
.head h2 { font-size: clamp(1.9rem, 4.4vw, 3rem); font-weight: 700; }
.head p { color: var(--muted); margin: 0; }

/* ================= D: gallery — cards with a lit little stage ================= */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip {
  border: 0; background: var(--wall); border-radius: 8px; padding: 8px 16px;
  font-weight: 500; color: var(--muted); transition: background-color .2s, color .2s;
}
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: var(--red); color: #fff; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.obj {
  position: relative; display: flex; flex-direction: column; text-align: start;
  border: 0; padding: 0; border-radius: 16px; overflow: hidden; background: var(--wall);
  transition: transform .25s var(--ease), box-shadow .25s;
}
.obj:hover { transform: translateY(-4px); box-shadow: 0 14px 30px -18px rgba(0,0,0,.6); }
.obj.hide { display: none; }
.obj-stage {
  position: relative; aspect-ratio: 1 / 1; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 14%;
  background: radial-gradient(ellipse 60% 70% at 50% 0%, var(--spot), transparent 70%), var(--wall-2);
}
.obj-stage::after { /* small round plinth */
  content: ""; position: absolute; bottom: 9%; left: 22%; right: 22%; height: 9%;
  border-radius: 50%; background: var(--shelf-top); box-shadow: inset 0 -3px 6px rgba(0,0,0,.25);
}
.obj-art { position: relative; z-index: 1; width: 52%; height: 68%; transition: transform .3s var(--ease); }
.obj-art svg, .obj-art img { width: 100%; height: 100%; object-fit: contain; overflow: visible; }
.obj-art img { border-radius: 8px; }
.obj:hover .obj-art { transform: translateY(-8px) rotate(-3deg); }
.obj:active .obj-art { transform: translateY(-3px) scale(.96); }
.obj-info { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 2px; }
.obj-info b { font-size: 1rem; font-weight: 600; }
.obj-info .mono { font-size: 0.85rem; color: var(--muted); }
.obj-cat { font-family: var(--mono); font-size: 0.78rem; color: var(--red); text-transform: uppercase; letter-spacing: .06em; }
.badge-3d { position: absolute; top: 10px; inset-inline-end: 10px; z-index: 2; background: var(--red); color: #fff; font-family: var(--mono); font-size: 0.78rem; font-weight: 600; padding: 2px 7px; border-radius: 4px; }

.custom-card {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  margin-top: 20px; padding: 22px 24px; border-radius: 16px; border: 1.5px dashed var(--muted);
}
.custom-card h3 { margin: 0 0 4px; font-size: 1.2rem; }
.custom-card p { margin: 0; color: var(--muted); }

/* ================= Steps ================= */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1.5px solid var(--text); }
.step { padding: 26px 26px 26px 0; border-inline-end: 1px solid var(--line); }
[dir="rtl"] .step { padding: 26px 0 26px 26px; }
.step + .step { padding-inline-start: 26px; }
.step:last-child { border-inline-end: 0; }
.step .mono { color: var(--red); font-size: 0.92rem; }
.step h3 { font-size: 1.3rem; margin: 10px 0 8px; }
.step p { margin: 0; color: var(--muted); }

/* ================= About + spools ================= */
.about-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; align-items: start; }
.spools { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.spool-card { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 14px; background: var(--wall); }
.spool-card svg { flex: 0 0 64px; width: 64px; height: 64px; transition: transform 0.6s var(--ease); }
.spool-card:hover svg { transform: rotate(-120deg); }
.spool-card b { display: block; font-size: 1.05rem; text-align: start; }
.spool-card p { margin: 2px 0 0; color: var(--muted); font-size: 0.92rem; line-height: 1.45; }
.faq { margin-top: 56px; display: grid; gap: 0; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 0; font-weight: 600; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--red); transition: transform 0.3s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer { padding: 0 0 18px; color: var(--muted); max-width: 70ch; }

/* ================= Instagram ================= */
.ig { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding: 36px 0; border-block: 1.5px solid var(--text); }
.ig h2 { margin: 0 0 4px; font-size: clamp(1.6rem, 3.6vw, 2.4rem); }
.ig p { margin: 0; color: var(--muted); }
.ig .handle { font-family: var(--mono); color: var(--red); }

.site-footer { padding: 40px 0; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; color: var(--muted); font-size: 1rem; }
.footer-inner a:hover { color: var(--red); }

/* ================= E: the builder ================= */
dialog.builder {
  width: min(100% - 20px, 1080px); max-height: calc(100dvh - 20px); padding: 0;
  border: 0; border-radius: 22px; background: var(--wall-2); color: var(--text); overflow: hidden;
}
dialog.builder[open] { animation: b-in 0.25s var(--ease); }
dialog.builder::backdrop { background: rgba(0,0,0,.7); }
@keyframes b-in { from { opacity: 0; transform: scale(0.97); } }
.b-grid { display: grid; grid-template-columns: 1.1fr 1fr; height: min(680px, calc(100dvh - 20px)); }
.b-stage { position: relative; background: radial-gradient(ellipse at 50% 0%, var(--spot), transparent 65%), var(--wall); overflow: hidden; }
.b-object { position: absolute; inset: 8% 12% 24%; display: flex; align-items: flex-end; justify-content: center; }
.b-object .scaler { width: 100%; height: 100%; display: flex; align-items: flex-end; justify-content: center; transform: scale(var(--scale, 1)); transform-origin: 50% 100%; transition: transform 0.5s var(--ease); }
.b-object svg { width: 70%; height: 100%; overflow: visible; }
.b-object img { max-height: 100%; border-radius: 10px; object-fit: contain; }
.b-object model-viewer { width: 100%; height: 100%; --poster-color: transparent; }
.b-stage .plinth { inset-inline: 22%; bottom: 8%; height: 16%; }
.b-ruler {
  position: absolute; inset-inline-start: 18px; top: 10%; bottom: 24%; width: 34px;
  border-inline-start: 1.5px solid var(--muted);
  background: repeating-linear-gradient(to bottom, var(--muted) 0 1px, transparent 1px 10%);
  background-size: 10px 100%; background-repeat: no-repeat;
}
.b-ruler span { position: absolute; top: 50%; inset-inline-start: 10px; transform: translateY(-50%); font-family: var(--mono); font-size: 0.85rem; white-space: nowrap; background: var(--wall); padding: 2px 4px; }
.b-hint { position: absolute; bottom: 12px; inset-inline: 0; text-align: center; font-size: 0.92rem; color: var(--muted); }
.b-close { position: absolute; top: 14px; inset-inline-end: 14px; z-index: 3; }

.b-panel { overflow-y: auto; padding: 30px 30px 24px; display: flex; flex-direction: column; }
.b-step { display: flex; flex-direction: column; gap: 22px; }
.b-step h2 { font-size: 1.8rem; margin: 0; }
.b-title-input { font: inherit; font-size: 1.4rem; font-weight: 700; color: var(--text); background: none; border: 0; border-bottom: 1.5px solid var(--line); padding: 4px 0; width: 100%; }
.b-title-input:focus { outline: none; border-color: var(--red); }
.b-cat { font-family: var(--mono); font-size: 0.85rem; color: var(--red); text-transform: uppercase; letter-spacing: 0.08em; }
.b-group > .b-label { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 10px; font-size: 1rem; }
.b-group > .b-label .mono { color: var(--muted); font-weight: 500; font-size: 0.92rem; }

/* colours shown as filament spools */
.spool-pick { display: flex; flex-wrap: wrap; gap: 10px; }
.spool-pick label { position: relative; cursor: pointer; }
.spool-pick input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.spool-pick svg { width: 42px; height: 42px; display: block; transition: transform 0.4s var(--ease); }
.spool-pick input:checked + svg { transform: rotate(-90deg) scale(1.12); filter: drop-shadow(0 0 0 var(--red)) drop-shadow(0 4px 8px rgba(0,0,0,.3)); }
.spool-pick input:checked + svg .rim { stroke: var(--red); stroke-width: 3; }
.spool-pick input:focus-visible + svg { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 50%; }

input[type="range"] { width: 100%; accent-color: var(--red); }

.mat-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mat-pick label { position: relative; }
.mat-pick input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.mat-pick span { display: block; padding: 10px 6px; border-radius: 10px; border: 1.5px solid var(--line); text-align: center; transition: all 0.2s; }
.mat-pick b { display: block; font-size: 1rem; }
.mat-pick small { display: block; color: var(--muted); font-size: 0.85rem; line-height: 1.3; }
.mat-pick input:checked + span { border-color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }
.mat-pick input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }

.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { width: 42px; height: 42px; border: 0; background: none; font-size: 1.2rem; }
.qty button:hover { color: var(--red); }
.qty input { width: 54px; text-align: center; border: 0; background: none; color: var(--text); font: inherit; font-weight: 600; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }

.summary { display: flex; flex-wrap: wrap; gap: 6px; font-family: var(--mono); font-size: 0.85rem; }
.summary span { padding: 4px 9px; border-radius: 6px; background: var(--wall); }
.b-foot { margin-top: auto; padding-top: 18px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 1rem; }
.field input, .field textarea {
  font: inherit; color: var(--text); background: var(--wall); border: 1.5px solid transparent;
  border-radius: 10px; padding: 11px 13px; transition: border-color 0.2s;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--red); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chips span { display: inline-block; padding: 6px 14px; border-radius: 8px; background: var(--wall); font-weight: 500; font-size: 1rem; transition: all 0.2s; }
.chips input:checked + span { background: var(--red); color: #fff; }
.chips input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }
.note { font-size: 0.92rem; color: var(--muted); margin: 0; }
.error { color: var(--red); }
.done { text-align: center; margin: auto 0; }
.done .ref { display: inline-block; font-family: var(--mono); font-size: 1.3rem; font-weight: 600; padding: 8px 18px; border: 1.5px dashed var(--red); border-radius: 10px; margin: 10px 0 20px; direction: ltr; }
.done .check { width: 72px; height: 72px; border-radius: 50%; background: var(--red); display: grid; place-items: center; margin: 0 auto 16px; }
.done .check svg { width: 36px; stroke: #fff; }

/* ================= Phones and tablets ================= */
@media (max-width: 900px) {
  .hero-grid, .about-grid { grid-template-columns: 1fr; }
  .pedestal { max-width: 360px; }
  .b-grid { grid-template-columns: 1fr; height: auto; max-height: calc(100dvh - 20px); overflow-y: auto; }
  .b-stage { height: 300px; flex: none; }
  .b-panel { overflow: visible; }
}
@media (max-width: 760px) {
  .menu-btn { display: grid; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 18px;
    opacity: 0; transform: translateY(-10px); pointer-events: none; transition: all 0.3s var(--ease);
  }
  .nav.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav a { padding: 14px 6px; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 1.05rem; }
  .controls { margin-inline-start: auto; }
  .lang-switch button { padding: 4px 7px; font-size: 0.85rem; }
  .icon-btn { width: 34px; height: 34px; }
  .logo-mark { font-size: 1.4rem; }
  .section { padding: 64px 0; }
  .window { border-width: 6px; border-radius: 16px; }
  .shelf-row { padding: 0 16px; }
  .shelf-tag { margin-inline-start: 16px; }
  .custom-card { margin-inline: 16px; }
  .steps { grid-template-columns: 1fr; }
  .step, [dir="rtl"] .step, .step + .step { padding: 22px 0; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .spools { grid-template-columns: 1fr; }
  .mat-pick { grid-template-columns: repeat(2, 1fr); }
  .b-panel { padding: 22px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .js .reveal.print { --p: 100%; clip-path: none; }
}

/* ================= Logo (white in dark mode, black in light mode) ================= */
.logo img { height: 40px; width: auto; }
.logo .logo-on-light { display: none; }
:root[data-theme="light"] .logo .logo-on-dark { display: none; }
:root[data-theme="light"] .logo .logo-on-light { display: block; }
.site-footer .logo img { height: 34px; }

/* ================= Materials: "?" button + help pop-up ================= */
.b-label .help-btn {
  width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--muted); background: none;
  font-family: var(--mono); font-size: 0.92rem; font-weight: 600; color: var(--muted); line-height: 1;
  transition: all .2s;
}
.b-label .help-btn:hover { border-color: var(--red); color: #fff; background: var(--red); }
.mat-pick { grid-template-columns: repeat(3, 1fr); }
.spool-card b small { font-weight: 500; font-size: 0.85rem; color: var(--red); margin-inline-start: 6px; }
#materials .spools { grid-template-columns: repeat(3, 1fr); }

dialog.mat-help {
  width: min(100% - 24px, 520px); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 18px;
  background: var(--wall-2); color: var(--text); overflow: auto;
}
dialog.mat-help[open] { animation: b-in .2s var(--ease); }
dialog.mat-help::backdrop { background: rgba(0,0,0,.55); }
.mh-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px 6px; }
.mh-head h2 { margin: 0; font-size: 1.25rem; }
.mat-help ul { list-style: none; margin: 0; padding: 8px 10px 14px; }
.mat-help li button {
  width: 100%; text-align: start; background: none; border: 1.5px solid transparent; border-radius: 12px;
  padding: 12px; display: block; transition: background-color .15s, border-color .15s;
}
.mat-help li button:hover { background: var(--wall); }
.mat-help li button.current { border-color: var(--red); }
.mat-help b { font-size: 1.05rem; }
.mat-help .tag { font-size: 0.85rem; color: var(--red); font-weight: 600; margin-inline-start: 6px; }
.mat-help .d { display: block; color: var(--muted); font-size: 1rem; line-height: 1.5; margin-top: 2px; }

/* Real product pictures fill more of the card than the drawings */
.obj-art.photo { width: 84%; height: 80%; }
.obj-art.photo img { border-radius: 0; filter: drop-shadow(0 10px 12px rgba(0,0,0,.35)); }
/* Dark mode: a slightly brighter stage so black prints stay visible */
:root:not([data-theme="light"]) .obj-stage { background: radial-gradient(ellipse 70% 75% at 50% 15%, #34343b, transparent 75%), var(--wall-2); }

/* ================= Fixes ================= */
/* Red button inside the menu keeps its own colours */
.nav a.btn-red, .nav a.btn-red:hover { color: #fff; background: var(--red); margin-inline-start: 8px; }

/* Arabic and Hebrew: the technical font is English-only, so use the normal font with no extra spacing */
:root:not([lang="en"]) :is(.mono, .kicker, .b-cat, .summary, .obj-cat, .step .mono, .hint-3d) { font-family: var(--font); letter-spacing: 0; text-transform: none; }

.pedestal .fallback { display: flex; justify-content: center; align-items: flex-end; padding-bottom: 2%; }
.pedestal .fallback svg { width: 60%; }

/* Phones: skip the background blur behind the header (it slows scrolling) */
@media (max-width: 900px) { #materials .spools { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) {
  .logo img { height: 32px; }
  #materials .spools { grid-template-columns: 1fr; }
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .obj-info { padding: 10px 11px 12px; }
  .obj-info b { font-size: 1rem; }
  .custom-card { padding: 18px; }
}

/* Order pop-up: grow with its content so it only scrolls on short screens */
dialog.builder { overflow-y: auto; }
.b-grid { height: auto; min-height: min(620px, calc(100dvh - 20px)); }
.b-panel { overflow: visible; }

/* Order number + copy button */
.ref-row { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 20px; }
.ref-row .ref { margin: 0; user-select: all; }
#b-copy.copied { border-color: var(--red); color: var(--red); }

/* "Colour: White" / "Height: 24 cm" — the value sits right after its label */
.b-group > .b-label.with-value { justify-content: flex-start; gap: 6px; }
.b-label.with-value > span:first-child::after { content: ":"; }
.b-label .value { font-weight: 500; color: var(--muted); }
/* the "?" sits right after "Material" too */
.b-group > .b-label:has(.help-btn) { justify-content: flex-start; gap: 8px; align-items: center; }
.pedestal .fallback img { width: 85%; object-fit: contain; }
/* Hero: the model is long and low, so its viewing area sits right on the stand */
.pedestal model-viewer { inset: 26% 0 14%; }
.spec-tag { top: 6%; }

/* ===== No bases: models float on a soft shadow that moves with them ===== */
.pedestal model-viewer { inset: 8% 0 4%; }
.b-object { inset: 6% 8% 10%; }
.obj-stage::after { display: none; }
.obj-stage { padding-bottom: 10%; }

/* Language buttons always read: ع EN ע */
.lang-switch { direction: ltr; }
.lang-switch button { min-width: 36px; font-size: .95rem; }

/* After ordering */
.done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* Small notice at the bottom of the screen */
.toast {
  position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%);
  max-width: min(92vw, 460px); padding: 12px 18px; border-radius: 12px;
  background: var(--text); color: var(--bg); font-weight: 500; text-align: center;
  box-shadow: 0 12px 30px rgba(0,0,0,.35); animation: b-in .25s var(--ease);
}
/* Order screen: the 3D view uses the full width so long models never touch the edge while turning */
.b-object { inset: 4% 0 10%; }

/* Height row: "Height: 24 cm" + reset button, then all dimensions under the slider */
.size-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.size-head label { display: flex; gap: 6px; }

.reset-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); background: none;
  border-radius: 8px; padding: 5px 10px; font-size: .85rem; font-weight: 600; color: var(--muted); transition: all .2s;
}
.reset-btn:hover { border-color: var(--red); color: var(--red); }
.reset-btn svg { width: 15px; height: 15px; }
.dims { margin: 10px 0 0; font-size: .95rem; color: var(--muted); }
.dims b { color: var(--text); font-weight: 600; direction: ltr; unicode-bidi: isolate; }

/* ===== Hero slideshow ===== */
.pedestal model-viewer { inset: 4% 0 18%; transition: opacity .35s ease, transform .35s ease; }
.pedestal model-viewer.fading { opacity: 0; transform: scale(.96); }
.hero-caption {
  position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); white-space: nowrap;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 0; background: none; padding: 4px 10px; text-align: center;
}
.hero-caption b { font-size: 1.05rem; }
.hero-caption span { font-size: .85rem; color: var(--red); font-weight: 600; }
.hero-dots { position: absolute; left: 50%; bottom: 1%; transform: translateX(-50%); display: flex; gap: 6px; }
.hero-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: background-color .3s, width .3s; }
.hero-dots i.on { background: var(--red); width: 18px; border-radius: 4px; }
/* each language button uses a font that has its letters */
.lang-switch button[lang="ar"] { font-family: "Readex Pro", sans-serif; }
.lang-switch button[lang="he"] { font-family: "Rubik", sans-serif; }

#b-size[hidden] { display: none; }

/* ===== About me: story + lab photos ===== */
#about .about-grid { grid-template-columns: 1fr 1.15fr; align-items: center; }
.about-text p { color: var(--muted); margin: 0 0 14px; font-size: 1.05rem; line-height: 1.75; max-width: 62ch; }
.about-text p:first-of-type { color: var(--text); font-size: 1.15rem; }
/* landscape + portrait photo at the same height: widths 4:3 vs 3:4 -> 16fr 9fr */
.about-photos { display: grid; grid-template-columns: 16fr 9fr; gap: 12px; }
.about-photos img { width: 100%; height: 100%; object-fit: cover; border-radius: 16px; }
#faq .faq { max-width: 860px; }
@media (max-width: 900px) { #about .about-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .about-text { margin-bottom: 8px; } #about .about-grid { gap: 20px; } }

/* ===== Colour swatches (filled from js/filaments.js) ===== */
.swatch-pick { display: flex; flex-wrap: wrap; gap: 9px; }
.sw { position: relative; }
.sw input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.sw span {
  display: block; width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid var(--line); transition: transform .15s, box-shadow .15s;
}
.sw input:checked + span { transform: scale(1.12); box-shadow: 0 0 0 2px var(--wall-2), 0 0 0 4px var(--red); }
.sw input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 4px; }
.sw span[data-effect="glow"] { box-shadow: 0 0 10px 2px rgba(121, 225, 236, .7); }
.sw input:checked + span[data-effect="glow"] { box-shadow: 0 0 0 2px var(--wall-2), 0 0 0 4px var(--red), 0 0 14px 4px rgba(121, 225, 236, .7); }
.sw span[data-effect="marble"] { background-image: radial-gradient(circle at 30% 40%, #6d6b6c 0 1px, transparent 2px), radial-gradient(circle at 65% 70%, #6d6b6c 0 1px, transparent 2px), radial-gradient(circle at 70% 25%, #8a8889 0 1px, transparent 2px) !important; background-color: #e2dfe0 !important; }
.sw span[data-effect="wood"] { background: repeating-linear-gradient(100deg, #46372e 0 3px, #5d4c3e 3px 6px, #4f3f34 6px 8px) !important; }
.sw span[data-effect="galaxy"] { background-image: radial-gradient(circle at 30% 35%, #f5d77a 0 1px, transparent 2px), radial-gradient(circle at 60% 65%, #9fd4ff 0 1px, transparent 2px), radial-gradient(circle at 75% 30%, #fff 0 1px, transparent 2px), linear-gradient(160deg, #434e67, #373b53) !important; }
@media (min-width: 901px) { #materials .spools { grid-template-columns: repeat(3, 1fr); } }

/* PLA card: full width, with its three types (Silk / Dual / Special) inside */
#materials .spool-card.pla-card { grid-column: 1 / -1; align-items: flex-start; }
.pla-types { list-style: none; margin: 14px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pla-types li { display: flex; gap: 10px; align-items: flex-start; }
.pla-types svg.mini { flex: 0 0 40px; width: 40px; height: 40px; }
.pla-types b { font-size: .98rem; }
@media (max-width: 900px) { .pla-types { grid-template-columns: 1fr; } }

/* PLA type row (Normal / Silk / Dual / Special) — only visible when PLA is chosen */
.pla-type-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; animation: b-in .2s var(--ease); }
.pla-type-label { font-weight: 600; font-size: .92rem; color: var(--muted); }

/* 3D views share one drawing canvas sized to the largest view. In Arabic/Hebrew (right-to-left)
   the browser would line it up from the right, pushing the model off-centre — keep it left-to-right. */
model-viewer { direction: ltr; }

/* "PLA – Everyday": the name first (right side in Arabic/Hebrew), then a dash and the feature */
.spool-card b small::before, .mat-help .tag::before { content: "– "; }
.spool-card b small { margin-inline-start: 4px; }
/* keep the intro of a section on one line where there is room */
#materials .head, #shop .head { max-width: none; }
#materials .head p, #shop .head p { max-width: none; }

/* Product description: under the name in the order screen, and (2 lines) on the gallery card */
.b-desc { margin: 6px 0 0; color: var(--muted); font-size: .98rem; line-height: 1.6; max-width: 52ch; }
.b-desc:empty { display: none; }
.card-desc { color: var(--muted); font-size: .88rem; line-height: 1.5; margin: 2px 0 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Instagram message window */
dialog.ig-dialog { width: min(100% - 24px, 460px); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 18px; background: var(--wall-2); color: var(--text); overflow: auto; }
dialog.ig-dialog[open] { animation: b-in .2s var(--ease); }
dialog.ig-dialog::backdrop { background: rgba(0,0,0,.55); }
.igd-body { padding: 4px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.igd-msg { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--wall); font-family: var(--font); font-size: .95rem; line-height: 1.6; white-space: pre-wrap; user-select: all; }
.igd-steps { margin: 0; padding-inline-start: 20px; color: var(--muted); font-size: .92rem; display: grid; gap: 4px; }
.igd-go { align-self: stretch; }

/* Phones: the 3D preview stays pinned at the top of the order screen while the options scroll below it */
@media (max-width: 900px) {
  dialog.builder { overflow-y: auto; overscroll-behavior: contain; }
  dialog.builder .b-grid { max-height: none; overflow: visible; }
  dialog.builder .b-stage {
    position: sticky; top: 0; z-index: 3;
    height: min(300px, 34dvh);
    box-shadow: 0 10px 18px -14px rgba(0, 0, 0, .5);
  }
  dialog.builder .b-hint { bottom: 6px; font-size: .78rem; }
}

/* Custom name field + design credit */
.b-text { width: 100%; font: inherit; font-size: 1.15rem; font-weight: 600; color: var(--text); background: var(--wall);
  border: 1.5px solid transparent; border-radius: 10px; padding: 11px 14px; }
.b-text:focus { outline: none; border-color: var(--red); }
.b-credit { margin: 4px 0 0; font-size: .82rem; color: var(--muted); }
.b-credit a { color: inherit; text-decoration: underline; }
/* Several colour rows (one per part of the model) */
#b-colors.multi { display: grid; gap: 14px; }
.part-label { margin-bottom: 8px !important; font-size: .92rem; }
.part-label { display: flex; gap: 6px; }
.part-label > span:first-child::after { content: ":"; }

/* PLA heat warning in the order screen */
.heat-note { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; font-size: .9rem; line-height: 1.5;
  background: color-mix(in srgb, #f4c20d 16%, transparent); border: 1px solid color-mix(in srgb, #f4c20d 45%, transparent); }
/* less empty space between "how it works" and the gallery */
#how { padding-bottom: 24px; }
#shop { padding-top: 40px; }
@media (max-width: 760px) { #how { padding-bottom: 8px; } #shop { padding-top: 32px; } }

/* Hero: taller stage so the model + its shadow are never cut; name and dots sit below the model */
.pedestal { aspect-ratio: 1 / 1.22; }
.pedestal model-viewer { inset: 0 0 21%; }
.hero-caption { bottom: 6%; }
.hero-dots { bottom: 1%; }
/* Hero: caption a little closer to the model (still clear of its shadow) */
.pedestal { aspect-ratio: 1 / 1.15; }
.pedestal model-viewer { inset: 0 0 17%; }
.hero-caption { bottom: 6.5%; }
.hero-dots { bottom: 1.5%; }

/* Design picker (sets like the 6 tealight holders) */
.variant-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.variant { border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--wall); opacity: .6; transition: opacity .2s, border-color .2s; }
.variant.picked { opacity: 1; }
.variant.active { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.v-pick { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; border: 0; background: none; padding: 8px 6px 4px; }
.v-pick img { width: 72%; aspect-ratio: 1; object-fit: contain; }
.v-name { font-size: .74rem; line-height: 1.3; text-align: center; color: var(--text); }
.v-qty { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); }
.v-qty button { width: 34px; height: 30px; border: 0; background: none; font-size: 1.05rem; }
.v-qty button:hover { color: var(--red); }
.v-qty b { font-size: .95rem; }
.variant-total { margin: 10px 0 0; font-weight: 600; font-size: .95rem; }
.size-head .reset-btn span { pointer-events: none; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.shake { animation: shake .25s 2; }

/* Computers: the 3D view keeps a screen-sized height and stays in place while long option lists scroll */
@media (min-width: 901px) {
  dialog.builder .b-stage { position: sticky; top: 0; align-self: start; height: min(680px, calc(100dvh - 20px)); }
}
/* the 3D view in the order screen takes every finger movement (rotate in any direction) */
#b-object model-viewer { touch-action: none; }
