/* ============================================================
   FORMA — 3D print landing. Mobile-first.
   ============================================================ */

:root {
  /* palette tweak sets these 4; the rest derive */
  --brand: #ff5a1f;
  --brand-2: #ffb068;
  --bg: #0d0d0f;
  --ink: #f4f1ea;

  --surface: color-mix(in oklab, var(--bg) 90%, var(--ink));
  --surface-2: color-mix(in oklab, var(--bg) 82%, var(--ink));
  --line: color-mix(in oklab, var(--ink) 13%, transparent);
  --line-soft: color-mix(in oklab, var(--ink) 7%, transparent);
  --ink-dim: color-mix(in oklab, var(--ink) 60%, transparent);
  --ink-faint: color-mix(in oklab, var(--ink) 34%, transparent);
  --brand-ink: #14110c;
  --glow: color-mix(in oklab, var(--brand) 40%, transparent);

  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --maxw: 1240px;
  --pad: clamp(20px, 5.5vw, 64px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  font-size: 16px;
  letter-spacing: 0.005em;
}

/* page bg texture: subtle grid + warm vignette */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(120% 80% at 80% -10%, var(--glow) 0%, transparent 45%),
    linear-gradient(transparent 0 0);
  opacity: 0.5;
}
.grid-lines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: clamp(48px, 12vw, 96px) clamp(48px, 12vw, 96px);
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
  opacity: 0.6;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--brand); color: var(--brand-ink); }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }
.app { position: relative; z-index: 1; }

/* ---------- typography helpers ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand);
}
.kicker::before {
  content: "";
  width: 1.8em;
  height: 2px;
  background: var(--brand);
}
.lead { color: var(--ink-dim); font-size: clamp(1rem, 3.6vw, 1.18rem); max-width: 46ch; }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(14px, 3.5vw, 22px) var(--pad);
  transition: background 0.4s var(--ease), backdrop-filter 0.4s var(--ease), border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--line);
}
.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.15rem, 4.5vw, 1.5rem);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.45em;
}
.brand .cube {
  width: 0.82em; height: 0.82em;
  background: var(--brand);
  border-radius: 3px;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 25%, transparent);
  transform: rotate(45deg);
}
.header-right { display: flex; align-items: center; gap: clamp(10px, 3vw, 18px); }

.lang-toggle {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  transition: border-color 0.3s, color 0.3s, background 0.3s;
}
.lang-toggle:hover { border-color: var(--brand); color: var(--brand); }

/* hamburger */
.burger {
  position: relative;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  z-index: 80;
  transition: border-color 0.3s, transform 0.3s var(--ease);
}
.burger:hover { border-color: var(--brand); }
.burger .bars { position: relative; width: 20px; height: 14px; }
.burger .bars span {
  position: absolute; left: 0; right: 0; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.45s var(--ease), opacity 0.3s var(--ease), background 0.3s;
}
.burger .bars span:nth-child(1) { top: 0; }
.burger .bars span:nth-child(2) { top: 6px; }
.burger .bars span:nth-child(3) { top: 12px; }
.burger.open { border-color: var(--brand); opacity: 0; pointer-events: none; transform: scale(0.7); }
.burger.open .bars span { background: var(--brand); }
.burger.open .bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger.open .bars span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.burger.open .bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ============================================================
   FULLSCREEN MENU OVERLAY
   ============================================================ */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: color-mix(in oklab, var(--bg) 96%, var(--brand));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--pad);
  padding-top: 18vh;
  clip-path: circle(0% at calc(100% - 44px) 44px);
  transition: clip-path 0.7s var(--ease);
  pointer-events: none;
}
.menu-overlay.open {
  clip-path: circle(150% at calc(100% - 44px) 44px);
  pointer-events: auto;
}
.menu-close {
  position: absolute;
  top: clamp(14px, 3.5vw, 22px);
  right: var(--pad);
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid color-mix(in oklab, var(--brand) 45%, var(--line));
  display: grid;
  place-items: center;
  color: var(--ink);
  z-index: 6;
  opacity: 0;
  transform: scale(0.5) rotate(-90deg);
  transition: opacity 0.4s var(--ease) 0.25s, transform 0.55s var(--ease) 0.25s, border-color 0.3s, color 0.3s, background 0.3s;
}
.menu-overlay.open .menu-close { opacity: 1; transform: none; }
.menu-close:hover { border-color: var(--brand); color: var(--brand); background: color-mix(in oklab, var(--brand) 12%, transparent); transform: rotate(90deg); }
.menu-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(80% 60% at 85% 10%, var(--glow), transparent 55%);
  opacity: 0.7;
}
.menu-bg-word {
  position: absolute;
  right: -0.1em;
  bottom: -0.18em;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 34vw;
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1.5px color-mix(in oklab, var(--ink) 12%, transparent);
  letter-spacing: -0.03em;
  pointer-events: none;
  z-index: 0;
}
.menu-nav { position: relative; z-index: 2; display: flex; flex-direction: column; gap: clamp(6px, 1.6vh, 14px); }
.menu-item {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 13vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 0.4em;
  width: fit-content;
  opacity: 0;
  transform: translateY(40px) skewY(4deg);
  transition: color 0.3s, opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.menu-overlay.open .menu-item { opacity: 1; transform: none; }
.menu-item .idx {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: var(--brand);
  transform: translateY(-0.2em);
}
.menu-item:hover { color: var(--brand); }
.menu-foot {
  position: relative;
  z-index: 2;
  margin-top: clamp(28px, 6vh, 56px);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 0.9rem;
  color: var(--ink-dim);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease) 0.5s, transform 0.6s var(--ease) 0.5s;
}
.menu-overlay.open .menu-foot { opacity: 1; transform: none; }
.menu-foot a:hover { color: var(--brand); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
  padding: 15px 26px;
  border-radius: 999px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s, color 0.3s;
  position: relative;
  white-space: nowrap;
}
.btn-primary {
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: 0 10px 30px -8px var(--glow), inset 0 0 0 1px color-mix(in oklab, #fff 20%, transparent);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 18px 44px -10px var(--glow); }
.btn-primary .arr { transition: transform 0.3s var(--ease); }
.btn-primary:hover .arr { transform: translate(4px, -4px); }
.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }

/* ============================================================
   SECTIONS — shared
   ============================================================ */
section { position: relative; z-index: 1; }
.section-pad { padding-block: clamp(72px, 16vw, 150px); }
.section-head { margin-bottom: clamp(34px, 7vw, 64px); }
.section-head h2 {
  margin-top: 16px;
  font-size: clamp(2.1rem, 9.5vw, 4.2rem);
}
.section-head .lead { margin-top: 16px; }

/* reveal-on-scroll — only hides when JS marks body.anim, so content is
   never stuck invisible if rAF/IO are paused or JS fails to run. */
.reveal { opacity: 1; transform: none; }
body.anim .reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
body.anim .reveal.in { opacity: 1; transform: none; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: clamp(110px, 22vh, 180px);
  padding-bottom: clamp(48px, 10vh, 90px);
  overflow: hidden;
}
.hero-bgword {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 42vw;
  line-height: 0.8;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1.5px color-mix(in oklab, var(--ink) 8%, transparent);
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}
.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  display: grid;
  gap: clamp(36px, 8vw, 48px);
}
.hero-eyebrow { margin-bottom: 22px; }
.hero-title { font-size: clamp(3rem, 16vw, 5.6rem); }
.hero-title .hl { color: var(--brand); display: inline-block; position: relative; }
.hero-title .hl::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.06em;
  height: 0.07em;
  background: var(--brand);
  opacity: 0.32;
  transform: scaleX(0);
  transform-origin: left;
  animation: underline 1s var(--ease) 0.6s forwards;
}
@keyframes underline { to { transform: scaleX(1); } }
.hero-sub { margin-top: 30px; font-size: clamp(1.05rem, 4.4vw, 1.3rem); color: var(--ink-dim); max-width: 40ch; }
.hero-actions { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 14px; }
.hero-stats {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: clamp(18px, 6vw, 40px);
  width: fit-content;
}
.hero-stats .st .n { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.1rem, 4.6vw, 1.5rem); }
.hero-stats .st .s { font-size: 0.82rem; color: var(--ink-faint); margin-top: 2px; }

/* 3D layer-stack object */
.stage3d {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
  perspective: 1100px;
  will-change: transform;
}
.stack {
  position: relative;
  width: min(70vw, 280px);
  height: min(70vw, 280px);
  transform-style: preserve-3d;
  transform: rotateX(58deg) rotateZ(var(--spin, 0deg));
  animation: float 7s ease-in-out infinite;
  cursor: grab;
  touch-action: none; /* prst preko objekta rotira, ne skroluje */
}
.stack.grabbing { cursor: grabbing; }
@keyframes float { 0%,100% { translate: 0 -6px; } 50% { translate: 0 6px; } }
.layer {
  position: absolute;
  inset: 0;
  margin: auto;
  border-radius: 14%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 1px 0 color-mix(in oklab, #000 30%, transparent);
  opacity: 0.96;
}
.layer::before {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 18%;
  background: color-mix(in oklab, var(--bg) 30%, transparent);
  mix-blend-mode: overlay;
}
.stack .shadow {
  position: absolute;
  inset: 6%;
  border-radius: 16%;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--brand) 60%, transparent), transparent);
  filter: blur(26px);
  transform: translateZ(-60px) scale(1.1);
  opacity: 0.5;
}
.float-chip {
  position: absolute;
  padding: 9px 14px;
  border-radius: 12px;
  background: color-mix(in oklab, var(--surface) 80%, transparent);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
  z-index: 3;
  box-shadow: 0 14px 30px -12px rgba(0,0,0,0.6);
  will-change: transform;
}
.float-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.float-chip.fc1 { top: 10%; left: -4%; }
.float-chip.fc2 { bottom: 16%; right: -6%; }

/* ============================================================
   SERVICES
   ============================================================ */
.svc-grid { display: grid; gap: 14px; }
.svc-card {
  position: relative;
  padding: clamp(22px, 5vw, 34px);
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s, background 0.4s;
  transform-style: preserve-3d;
}
.svc-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 80% at var(--mx,50%) var(--my,0%), var(--glow), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.svc-card:hover { border-color: color-mix(in oklab, var(--brand) 50%, var(--line)); }
.svc-card:hover::after { opacity: 0.5; }
.svc-card .num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  color: transparent;
  -webkit-text-stroke: 1.4px var(--brand);
  line-height: 1;
}
.svc-card h3 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.3rem, 5.4vw, 1.75rem); margin: 18px 0 10px; letter-spacing: -0.01em; }
.svc-card p { color: var(--ink-dim); font-size: 0.98rem; }
.svc-card .corner {
  position: absolute;
  top: 22px; right: 22px;
  width: 30px; height: 30px;
  border-top: 2px solid var(--brand);
  border-right: 2px solid var(--brand);
  opacity: 0.4;
  transition: opacity 0.4s, transform 0.4s var(--ease);
}
.svc-card:hover .corner { opacity: 1; transform: translate(3px, -3px); }

/* ============================================================
   MATERIALS — horizontal scroll rail
   ============================================================ */
.mat-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 78%;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 18px;
  margin-inline: calc(var(--pad) * -1);
  padding-inline: var(--pad);
  scrollbar-width: none;
}
.mat-rail::-webkit-scrollbar { display: none; }
.mat-card {
  scroll-snap-align: start;
  position: relative;
  padding: clamp(24px, 6vw, 34px);
  border-radius: 22px;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  min-height: 230px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.mat-card .big {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 12vw, 3.6rem);
  letter-spacing: -0.03em;
  line-height: 1;
}
.mat-card .tag {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--brand) 40%, transparent);
}
.mat-card p { color: var(--ink-dim); font-size: 0.95rem; margin-top: 14px; }
.mat-card .ghost-letter {
  position: absolute;
  right: -0.1em; bottom: -0.32em;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 11rem;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--line);
  pointer-events: none;
  z-index: 0;
}
.mat-card > * { position: relative; z-index: 1; }
.rail-hint { margin-top: 14px; font-size: 0.8rem; color: var(--ink-faint); display: flex; align-items: center; gap: 8px; }

/* ============================================================
   WORK / GALLERY
   ============================================================ */
.work-grid { display: grid; gap: 16px; }
.work-item { position: relative; }
.work-figure {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  aspect-ratio: 4 / 5;
  transition: transform 0.45s var(--ease), border-color 0.4s;
}
.work-item:hover .work-figure { transform: translateY(-5px); border-color: color-mix(in oklab, var(--brand) 45%, var(--line)); }
.work-figure image-slot { width: 100%; height: 100%; display: block; color: color-mix(in oklab, var(--ink) 50%, transparent); }
.work-figure image-slot::part(frame) { background: color-mix(in oklab, var(--bg) 70%, var(--ink)); }
.work-num {
  position: absolute;
  top: 14px; left: 14px;
  z-index: 5;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  color: var(--brand-ink);
  background: var(--brand);
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.work-meta { padding: 16px 4px 0; }
.work-meta h3 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.15rem, 5vw, 1.5rem); letter-spacing: -0.01em; }
.work-meta p { color: var(--ink-dim); font-size: 0.95rem; margin-top: 6px; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact {
  position: relative;
  border-radius: 28px;
  background:
    radial-gradient(90% 120% at 90% 0%, var(--glow), transparent 55%),
    linear-gradient(160deg, var(--surface-2), var(--bg));
  border: 1px solid var(--line);
  padding: clamp(30px, 8vw, 64px);
  overflow: hidden;
}
.contact h2 { font-size: clamp(2.2rem, 10vw, 4rem); margin-top: 14px; }
.contact .lead { margin-top: 16px; margin-bottom: 30px; }
.contact-links { display: grid; gap: 12px; margin-top: 30px; }
.cl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 16px;
  background: color-mix(in oklab, var(--bg) 55%, transparent);
  border: 1px solid var(--line);
  transition: border-color 0.3s, transform 0.3s var(--ease), background 0.3s;
}
.cl:hover { border-color: var(--brand); transform: translateX(4px); }
.cl > span { min-width: 0; flex: 1; }
.cl .cl-label { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); }
.cl .cl-val { display: block; font-family: var(--font-display); font-weight: 700; font-size: clamp(0.9rem, 4.4vw, 1.3rem); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.cl .cl-arr { flex: none; color: var(--brand); transition: transform 0.3s var(--ease); }
.cl:hover .cl-arr { transform: translate(4px, -4px); }
.contact-cta { margin-top: 28px; }
.contact .stage3d { display: none; }

@media (max-width: 420px) {
  .contact { padding: 22px 16px; border-radius: 22px; }
  .cl { padding: 14px 14px; gap: 10px; border-radius: 14px; }
}

/* ============================================================
   INQUIRY MODAL
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: color-mix(in oklab, var(--bg) 55%, transparent);
  backdrop-filter: blur(8px) saturate(1.1);
  display: grid;
  place-items: center;
  padding: clamp(16px, 5vw, 40px);
  overflow-y: auto;
  animation: backdrop-in 0.35s var(--ease);
}
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 90svh;
  overflow-y: auto;
  background:
    radial-gradient(120% 90% at 100% 0%, var(--glow), transparent 50%),
    linear-gradient(165deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: clamp(24px, 6vw, 38px);
  box-shadow: 0 40px 90px -30px rgba(0,0,0,0.8);
  animation: modal-in 0.45s var(--ease);
  scrollbar-width: none;
}
.modal::-webkit-scrollbar { display: none; }
@keyframes modal-in { from { opacity: 0; transform: translateY(24px) scale(0.96); } to { opacity: 1; transform: none; } }
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--ink);
  transition: border-color 0.3s, color 0.3s, transform 0.3s var(--ease);
}
.modal-close:hover { border-color: var(--brand); color: var(--brand); transform: rotate(90deg); }

.modal-head { margin-bottom: 22px; padding-right: 36px; }
.modal-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.6rem, 7vw, 2.1rem); letter-spacing: -0.02em; line-height: 1; margin-top: 12px; }
.modal-sub { color: var(--ink-dim); font-size: 0.95rem; margin-top: 10px; }
.modal-sub a { color: var(--brand); font-weight: 600; }

.modal-form { display: grid; gap: 15px; }
.field { display: grid; gap: 7px; }
.field-row { display: grid; gap: 15px; }
.field label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
.field input,
.field textarea,
.field select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: color-mix(in oklab, var(--bg) 60%, transparent);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px 15px;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.field input::placeholder,
.field textarea::placeholder { color: var(--ink-faint); }
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 22%, transparent);
  background: color-mix(in oklab, var(--bg) 40%, transparent);
}
.select-wrap { position: relative; }
.select-wrap select { cursor: pointer; padding-right: 40px; }
.select-wrap select option { background: var(--surface); color: var(--ink); }
.select-arr { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: var(--ink-dim); pointer-events: none; }
.field-note {
  font-size: 0.82rem;
  color: var(--ink-faint);
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: color-mix(in oklab, var(--brand) 6%, transparent);
}

/* file attach */
.file-drop {
  display: block;
  cursor: pointer;
  border: 1.5px dashed color-mix(in oklab, var(--ink) 22%, transparent);
  border-radius: 14px;
  background: color-mix(in oklab, var(--bg) 50%, transparent);
  padding: 18px 16px;
  transition: border-color 0.25s, background 0.25s;
}
.file-drop:hover, .file-drop.drag {
  border-color: var(--brand);
  background: color-mix(in oklab, var(--brand) 9%, transparent);
}
.file-drop.has { border-style: solid; border-color: color-mix(in oklab, var(--brand) 45%, var(--line)); cursor: default; }
.file-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 5px; color: var(--ink-dim); }
.file-empty svg { color: var(--brand); margin-bottom: 2px; }
.file-cta { font-size: 0.92rem; font-weight: 600; color: var(--ink); }
.file-types { font-size: 0.72rem; letter-spacing: 0.08em; color: var(--ink-faint); }
.file-chip { display: flex; align-items: center; gap: 11px; }
.file-chip svg:first-child { color: var(--brand); flex-shrink: 0; }
.file-name { font-weight: 600; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; width: 120px; }
.file-size { font-size: 0.76rem; color: var(--ink-faint); flex-shrink: 0; }
.file-remove {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.file-remove:hover { color: var(--brand); border-color: var(--brand); background: color-mix(in oklab, var(--brand) 12%, transparent); }
.modal-submit { width: 100%; margin-top: 4px; padding-block: 16px; }
.modal-submit:disabled { opacity: 0.7; cursor: progress; transform: none; }
.spinner {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid color-mix(in oklab, var(--brand-ink) 35%, transparent);
  border-top-color: var(--brand-ink);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.modal-error {
  font-size: 0.88rem;
  color: color-mix(in oklab, #ff4d4d 80%, var(--ink));
  background: color-mix(in oklab, #ff4d4d 12%, transparent);
  border: 1px solid color-mix(in oklab, #ff4d4d 35%, transparent);
  border-radius: 12px;
  padding: 12px 14px;
}
.modal-error a { color: inherit; font-weight: 700; text-decoration: underline; }

.modal-success { text-align: center; padding: 14px 6px 6px; }
.ms-badge {
  display: inline-grid;
  place-items: center;
  width: 64px; height: 64px;
  border-radius: 50%;
  color: var(--brand-ink);
  background: var(--brand);
  margin-bottom: 18px;
  box-shadow: 0 0 0 8px color-mix(in oklab, var(--brand) 16%, transparent);
}
.modal-success .modal-sub { margin-inline: auto; max-width: 36ch; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px; }

@media (min-width: 480px) {
  .field-row { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  padding-block: clamp(40px, 9vw, 70px);
  border-top: 1px solid var(--line);
  margin-top: clamp(60px, 12vw, 110px);
}
.footer-top { display: flex; flex-wrap: wrap; gap: 22px; justify-content: space-between; align-items: flex-end; }
.footer-brand { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.4rem, 10vw, 3rem); letter-spacing: -0.03em; line-height: 0.9; }
.footer-meta { color: var(--ink-dim); font-size: 0.9rem; text-align: right; }
.footer-bottom { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 10px 20px; justify-content: space-between; color: var(--ink-faint); font-size: 0.8rem; border-top: 1px solid var(--line-soft); padding-top: 20px; }

/* ============================================================
   RESPONSIVE — tablet / desktop
   ============================================================ */
@media (min-width: 760px) {
  .hero-inner { grid-template-columns: 1.15fr 0.85fr; align-items: center; }
  .stage3d { min-height: 420px; }
  .stack { width: 340px; height: 340px; }
  .svc-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .mat-rail { grid-auto-columns: 38%; }
  .work-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-inner { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
  .contact .stage3d { display: grid; }
}
@media (min-width: 1080px) {
  .svc-grid { grid-template-columns: repeat(4, 1fr); }
  .work-grid { grid-template-columns: repeat(4, 1fr); }
  .mat-rail { grid-auto-columns: 1fr; overflow: visible; grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); margin-inline: 0; padding-inline: 0; }
  .rail-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.05ms !important; }
  .stack { animation: none; }
}

/* ============================================================
   COOKIE CONSENT
   ============================================================ */
.consent {
  position: fixed;
  left: 50%;
  bottom: clamp(12px, 3vw, 22px);
  transform: translateX(-50%);
  z-index: 90;
  width: min(680px, calc(100% - 24px));
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.consent-text { font-size: 0.86rem; color: var(--ink-dim); flex: 1; min-width: 0; }
.consent-actions { display: flex; gap: 8px; flex: none; }
.consent-actions .btn { padding: 9px 16px; font-size: 0.82rem; }
@media (max-width: 560px) {
  .consent { flex-direction: column; align-items: stretch; gap: 12px; }
  .consent-actions { justify-content: flex-end; }
}
