:root {
  --bg-0: #06070a;
  --bg-1: #0b0d12;
  --ink-0: #f4f5f7;
  --ink-1: #b9bec7;
  --ink-2: #7a8087;
  --accent: #5eead4;
  --accent-2: #f0b45c;
  --line: rgba(255, 255, 255, 0.08);
  --header-h: 84px;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg-0);
}

body {
  font-family: var(--font-body);
  color: var(--ink-0);
  background: radial-gradient(120% 90% at 50% 0%, #10141c 0%, #06070a 55%, #030304 100%);
  overflow-x: hidden;
  min-height: 100vh;
}

section[id] {
  scroll-margin-top: var(--header-h);
}

::selection {
  background: var(--accent);
  color: #06070a;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* ---------- Fixed 3D layer ---------- */

#webgl {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 0;
  touch-action: none;
}

#labels {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

.layer-label {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate3d(-50%, -50%, 0);
  opacity: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  will-change: transform, opacity, top;
  transition: top 0.35s ease;
  /* Forces its own GPU compositor layer so per-frame transform updates move
     an already-rasterized bitmap instead of re-rasterizing the text glyphs
     at a new sub-pixel offset every frame — that repaint-every-frame effect
     is what reads as jitter/vibration during camera rotation. */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.layer-label .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.15), 0 0 16px rgba(94, 234, 212, 0.6);
  flex: none;
}

.layer-label .card {
  background: rgba(15, 17, 22, 0.72);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 10px;
  padding: 10px 16px;
  max-width: 260px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  /* Isolates the blurred card into its own layer too, so the expensive
     backdrop-filter isn't recomposited against a shifting parent transform
     at a fresh sub-pixel offset every frame. */
  transform: translateZ(0);
}

.layer-label .card h4 {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-0);
  margin-bottom: 2px;
}

.layer-label .card p {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--ink-1);
}

.layer-label.flip {
  flex-direction: row-reverse;
}

/* ---------- Top bar / nav ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
  padding: 0 32px;
  background: linear-gradient(to bottom, rgba(6, 7, 10, 0.72), rgba(6, 7, 10, 0));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.brand-thin {
  font-weight: 400;
  color: var(--ink-2);
  letter-spacing: 0.08em;
}

.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: inline-block;
  flex: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-1);
}

.nav-links a {
  transition: color 0.2s ease;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--ink-0);
}

.nav-links .nav-cta {
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #06070a;
  font-weight: 600;
}

.nav-links .nav-cta:hover {
  color: #06070a;
  filter: brightness(1.08);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  flex: none;
}

.nav-toggle span {
  display: block;
  height: 1.5px;
  margin: 0 8px;
  background: var(--ink-0);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ---------- Layout scaffolding ---------- */

main {
  position: relative;
  z-index: 2;
}

.section-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 8vw;
}

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
  font-weight: 500;
}

.lede {
  font-size: 1.02rem;
  line-height: 1.65;
  color: #dadee4;
  max-width: 46ch;
  font-weight: 400;
}

/* Solid glass card wrapper for any text block that floats over the 3D scene —
   guarantees legibility no matter what the model is doing behind it. */
.text-panel {
  background: linear-gradient(160deg, rgba(6, 7, 10, 0.86), rgba(6, 7, 10, 0.58));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 40px 44px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.4);
}

.text-panel :is(h1, h2, p, .eyebrow) {
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
}

.text-panel-compact {
  padding: 26px 30px;
  border-radius: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.2s ease, filter 0.2s ease, background 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #34c6ad);
  color: #06070a;
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink-0);
  background: rgba(255, 255, 255, 0.02);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.btn-block {
  width: 100%;
}

/* ---------- Hero ---------- */

/* Solid, opaque hero — the 3D viewer lives in its own section directly below,
   so the two never share the same screen space and text needs no scrim/blur. */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 0 8vw;
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, #10141c 0%, #090b10 65%, #06070a 100%);
}

.hero-grid {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 60px;
}

.hero-inner {
  max-width: 640px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 5vw, 3.9rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

.hero h1 span {
  color: var(--accent);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 36px;
}

/* Right-side hero showcase — 100% automatic "Előtte / Utána" comparison
   widget. Two full-bleed photoreal canvas textures (generated in main.js)
   are stacked; the "before" pane is clipped to --split via clip-path, which
   a continuous sine-wave loop in main.js sweeps back and forth on its own —
   no pointer interaction is wired up or required. */
.hero-visual {
  display: flex;
  justify-content: center;
}

.hero-visual-frame {
  position: relative;
  width: 100%;
  max-width: 440px;
  aspect-ratio: 4 / 5;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.ba-widget {
  --split: 50%;
}

.ba-pane {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.ba-after {
  z-index: 1;
  background-color: #0a4a3c;
  background-image: url("epoxy-after.jpg");
}

.ba-before {
  z-index: 2;
  clip-path: inset(0 calc(100% - var(--split)) 0 0);
  background-color: #8a8a83;
  background-image: url("concrete-before.jpg");
}

.ba-pane::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(4, 5, 7, 0.82) 100%);
  pointer-events: none;
}

.ba-label {
  position: absolute;
  bottom: 20px;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 600;
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(6, 7, 10, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  white-space: nowrap;
}

.ba-label-before {
  left: 18px;
}

.ba-label-after {
  right: 18px;
}

.ba-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split);
  z-index: 3;
  width: 2px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.5);
  transform: translateX(-50%);
  pointer-events: none;
}

.ba-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.12), 0 8px 20px rgba(0, 0, 0, 0.45);
  animation: baPulse 2.6s ease-in-out infinite;
}

@keyframes baPulse {
  0%, 100% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.12), 0 8px 20px rgba(0, 0, 0, 0.45); }
  50% { box-shadow: 0 0 0 11px rgba(255, 255, 255, 0.18), 0 8px 20px rgba(0, 0, 0, 0.45); }
}

.ba-hint {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-0);
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(6, 7, 10, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
  white-space: nowrap;
}

.scroll-cue {
  margin-top: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  width: fit-content;
  transition: color 0.2s ease;
}

.scroll-cue:hover {
  color: var(--ink-0);
}

.scroll-cue span {
  width: 1px;
  height: 34px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  position: relative;
  overflow: hidden;
}

.scroll-cue span::after {
  content: "";
  position: absolute;
  left: 0;
  top: -100%;
  width: 100%;
  height: 100%;
  background: var(--accent);
  animation: scrollDrip 1.8s ease-in-out infinite;
}

@keyframes scrollDrip {
  0% { top: -100%; }
  60% { top: 100%; }
  100% { top: 100%; }
}

/* ---------- Explode section ---------- */

.explode-section {
  position: relative;
  height: 420vh;
  z-index: 1;
}

.explode-heading {
  position: sticky;
  top: calc(var(--header-h) + 26px);
  padding: 0 8vw;
  max-width: 560px;
  pointer-events: none;
}

.explode-heading h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  font-weight: 600;
  margin-bottom: 10px;
}

.explode-hint {
  margin-top: 14px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-1);
}

/* ---------- Services / Why-us shared cards ---------- */

.services,
.why-us {
  position: relative;
  z-index: 2;
  padding: 14vh 0;
  background: linear-gradient(180deg, transparent, rgba(5, 6, 9, 0.75) 12%, #05060a 32%);
}

.why-us {
  background: #05060a;
  padding-top: 6vh;
}

.section-lede {
  margin-top: -6px;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.8vw, 2.7rem);
  font-weight: 600;
  margin-bottom: 20px;
  max-width: 20ch;
}

.card-grid {
  margin-top: 52px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.service-card,
.why-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 24px;
  background: rgba(255, 255, 255, 0.025);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.service-card:hover,
.why-card:hover {
  transform: translateY(-4px);
  border-color: rgba(94, 234, 212, 0.35);
  background: rgba(255, 255, 255, 0.04);
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(94, 234, 212, 0.1);
  color: var(--accent);
  margin-bottom: 20px;
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

.service-card h3,
.why-card h3 {
  font-family: var(--font-display);
  font-size: 1.04rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.service-card p,
.why-card p {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--ink-1);
}

.why-index {
  display: block;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--accent-2);
  margin-bottom: 16px;
  opacity: 0.85;
}

.stats-strip {
  margin-top: 64px;
  padding-top: 44px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stat {
  text-align: left;
}

.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--ink-0);
  margin-bottom: 6px;
}

.stat span {
  font-size: 0.82rem;
  color: var(--ink-2);
}

/* ---------- References ---------- */

.references {
  position: relative;
  z-index: 2;
  padding: 12vh 0 14vh;
  background: #05060a;
}

.reference-grid {
  margin-top: 52px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.reference-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.025);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.reference-card:hover {
  transform: translateY(-6px);
  border-color: rgba(94, 234, 212, 0.4);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
}

.reference-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 14px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.reference-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(3, 4, 6, 0.55));
  transition: opacity 0.3s ease;
}

.reference-card:hover .reference-thumb::after {
  opacity: 0.7;
}

.reference-thumb > * {
  position: relative;
  z-index: 1;
}

.reference-thumb img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reference-thumb {
  transition: transform 0.5s ease;
}

.reference-card:hover .reference-thumb {
  transform: scale(1.05);
}

.thumb-industrial {
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 26px),
    linear-gradient(135deg, #3a4550, #171c22 70%);
}

.thumb-marble {
  background-image: url("marble-reference.jpg");
}

.thumb-garage {
  background:
    radial-gradient(rgba(255, 255, 255, 0.22) 1.5px, transparent 1.6px) 0 0/14px 14px,
    linear-gradient(135deg, #f0b45c, #8a5a2b 75%);
}

.thumb-workshop {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 22px),
    linear-gradient(135deg, #2c333b, #101317 75%);
}

.reference-tag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(6, 7, 10, 0.6);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--ink-0);
}

.reference-body {
  padding: 20px 22px 24px;
}

.reference-body h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.reference-body p {
  font-size: 0.83rem;
  line-height: 1.5;
  color: var(--ink-1);
  margin-bottom: 14px;
}

.reference-meta {
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  color: var(--accent);
  font-weight: 500;
}

/* ---------- Contact ---------- */

.contact {
  position: relative;
  z-index: 2;
  padding: 14vh 0 12vh;
  background: #05060a;
  border-top: 1px solid var(--line);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.contact-details {
  list-style: none;
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.contact-details li {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.ci {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 10px;
  background: rgba(94, 234, 212, 0.1);
  color: var(--accent);
  font-size: 1rem;
}

.contact-details strong {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  margin-bottom: 4px;
  font-weight: 500;
}

.contact-details a,
.contact-details span {
  font-size: 0.98rem;
  color: var(--ink-0);
}

.contact-details a:hover {
  color: var(--accent);
}

.contact-form {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 36px;
  background: rgba(255, 255, 255, 0.025);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
  font-weight: 500;
}

.form-row input,
.form-row textarea {
  font-family: var(--font-body);
  font-size: 0.94rem;
  color: var(--ink-0);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  resize: vertical;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.form-row input::placeholder,
.form-row textarea::placeholder {
  color: var(--ink-2);
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(94, 234, 212, 0.05);
}

.form-status {
  min-height: 1.2em;
  font-size: 0.85rem;
  color: var(--ink-1);
  text-align: center;
  transition: color 0.2s ease;
}

.form-status.form-status-success {
  color: var(--accent);
}

.form-status.form-status-error {
  color: #ef7a6d;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.form-row-consent {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
}

.consent-checkbox {
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 3px;
  accent-color: var(--accent);
  cursor: pointer;
}

.consent-text {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ink-1);
}

.consent-text label {
  cursor: pointer;
}

.consent-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.consent-link:hover {
  color: var(--ink-0);
}

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  z-index: 2;
  background: #030304;
  border-top: 1px solid var(--line);
  padding: 56px 8vw 28px;
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-brand .brand-mark {
  margin-bottom: 2px;
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--ink-2);
  max-width: 30ch;
  margin-top: 4px;
}

.footer-links,
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--ink-1);
}

.footer-links a:hover,
.footer-contact a:hover {
  color: var(--accent);
}

.footer-legal-info {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.footer-legal-info h4 {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 16px;
}

.footer-legal-info dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 32px;
}

.footer-legal-info dl > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.footer-legal-info dt {
  font-size: 0.72rem;
  color: var(--ink-2);
}

.footer-legal-info dd {
  font-size: 0.85rem;
  color: var(--ink-1);
}

.footer-bottom {
  max-width: 1180px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.footer-bottom p {
  font-size: 0.75rem;
  color: var(--ink-2);
  letter-spacing: 0.02em;
}

.footer-legal-links {
  display: flex;
  gap: 20px;
  font-size: 0.75rem;
  color: var(--ink-2);
}

.footer-legal-links a:hover {
  color: var(--accent);
}

/* ---------- Legal modals (Adatkezelési Tájékoztató / Impresszum) ---------- */

.legal-modal {
  max-width: min(640px, 90vw);
  max-height: min(80vh, 720px);
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #0b0d12;
  color: var(--ink-0);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55);
  /* The global `* { margin: 0 }` reset clobbers <dialog>'s default
     `margin: auto`, which is what centers it — restore it explicitly or the
     dialog renders pinned to the top-left corner instead. */
  margin: auto;
}

.legal-modal::backdrop {
  background: rgba(3, 4, 6, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.legal-modal-inner {
  display: flex;
  flex-direction: column;
  max-height: min(80vh, 720px);
}

.legal-modal-header {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
}

.legal-modal-header h2 {
  font-size: 1.2rem;
  margin-bottom: 0;
}

.legal-modal-close {
  flex: none;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-1);
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.legal-modal-close:hover {
  color: var(--ink-0);
  border-color: rgba(255, 255, 255, 0.25);
}

.legal-modal-body {
  overflow-y: auto;
  padding: 24px 28px 32px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--ink-1);
}

.legal-modal-body h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-0);
  margin: 24px 0 8px;
}

.legal-modal-body h3:first-child {
  margin-top: 0;
}

.legal-modal-body p {
  margin-bottom: 4px;
}

.legal-modal-body a {
  color: var(--accent);
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
  .footer-legal-info dl {
    grid-template-columns: repeat(2, 1fr);
  }
  .reference-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .hero-visual {
    order: 2;
  }
  .hero-visual-frame {
    max-width: 420px;
  }
}

@media (max-width: 760px) {
  :root {
    --header-h: 68px;
  }

  .topbar { padding: 0 20px; }

  .nav-links {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 18px 24px 28px;
    background: rgba(6, 7, 10, 0.97);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .nav-links a {
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-links .nav-cta {
    margin-top: 10px;
    text-align: center;
    border-bottom: none;
  }

  .nav-links.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

  .hero { padding: 120px 6vw 60px; min-height: auto; }
  .hero-grid { gap: 40px; }
  .hero-visual-frame { max-width: 320px; aspect-ratio: 4 / 3.4; }
  .section-inner { padding: 0 6vw; }

  .card-grid { grid-template-columns: 1fr; }
  .stats-strip { grid-template-columns: 1fr 1fr; gap: 28px; }
  .reference-grid { grid-template-columns: 1fr; }

  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .footer-legal-info dl { grid-template-columns: 1fr; gap: 14px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }

  .legal-modal {
    max-width: 94vw;
    max-height: 86vh;
  }
  .legal-modal-inner { max-height: 86vh; }
  .legal-modal-header { padding: 18px 20px; }
  .legal-modal-body { padding: 18px 20px 26px; }

  .text-panel {
    padding: 28px 26px;
    border-radius: 18px;
  }

  .hero-inner {
    max-width: 100%;
  }
}

/* ---------- Exploded-layer labels: fixed mobile column ----------
   Below 768px, main.js stops projecting labels from their 3D anchor points
   (too little horizontal room on narrow/portrait screens) and instead pins
   every visible card to a single right-edge column via inline `top`/`right`,
   evenly spaced top-to-bottom in physical layer order. These rules size that
   column for readability and cancel the desktop dot/card reversal so every
   card reads in the same left-to-right order regardless of layer index. */
@media (max-width: 768px) {
  .layer-label {
    width: min(46vw, 168px);
    gap: 8px;
  }

  .layer-label.flip {
    flex-direction: row;
  }

  .layer-label .dot {
    width: 7px;
    height: 7px;
    box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.15), 0 0 8px rgba(94, 234, 212, 0.55);
  }

  .layer-label .card {
    max-width: 100%;
    padding: 7px 10px;
    border-radius: 9px;
  }

  .layer-label .card h4 {
    font-size: 0.68rem;
    margin-bottom: 2px;
  }

  .layer-label .card p {
    font-size: 0.6rem;
    line-height: 1.28;
  }
}
