/* ==========================================================================
   M.E.L.B.A. Industries — stylesheet
   Light, editorial direction (matching the DATAPAT house style):
   white canvas, serif headings, plasma-blue + gold accents, soft shadows.
   ========================================================================== */

:root {
  /* Brand — MELBA plasma blue + bolometer gold */
  --blue:       #1f6ea0;   /* primary (≈ DATAPAT plum role) */
  --blue-deep:  #154d72;
  --blue-soft:  #5a97bf;
  --accent:     #c2962f;   /* refined gold */
  --accent-soft:#e6c873;

  /* Neutrals */
  --ink:    #16202c;
  --body:   #44505e;
  --muted:  #7c8896;
  --line:   #e3e8ee;
  --bg:     #ffffff;
  --bg-alt: #f5f8fb;
  --bg-deep:#102230;       /* dark bands */

  /* System */
  --maxw:   1120px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20,30,45,.04), 0 12px 40px rgba(21,77,114,.08);
  --shadow-lg: 0 20px 56px rgba(21,77,114,.14);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--body);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.16;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.3rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.45rem); }
h3 { font-size: 1.22rem; }
p { margin: 0 0 1.1em; }

a { color: var(--blue); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent); }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }

.brandmark { font-family: var(--serif); font-weight: 600; color: var(--blue); letter-spacing: .01em; }
.gold { color: var(--accent); }
.grad { color: var(--blue); }   /* serif headline accent — solid, not gradient */

.eyebrow {
  display: inline-block;
  font-family: var(--sans);
  text-transform: uppercase; letter-spacing: .18em;
  font-size: .72rem; font-weight: 700; color: var(--blue-soft);
  margin: 0 0 1rem;
}

/* ---- Language-switched content blocks --------------------------------- */
/* :not(html) is essential — the <html> element itself carries data-lang. */
[data-lang]:not(html) { display: none; }
html[data-lang="en"] [data-lang="en"],
html[data-lang="de"] [data-lang="de"],
html[data-lang="fr"] [data-lang="fr"] { display: block; }
html[data-lang="en"] .tl[data-lang="en"],
html[data-lang="de"] .tl[data-lang="de"],
html[data-lang="fr"] .tl[data-lang="fr"] { display: inline; }

/* ==========================================================================
   Header / nav
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 18px; height: 70px; }
.logo { display: inline-flex; align-items: center; }
.logo img { height: 30px; width: auto; display: block; }

.nav-links { display: flex; align-items: center; gap: 1.6rem; margin-left: auto; }
.nav-links a { color: var(--body); font-size: .94rem; font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--blue); }

.lang {
  display: inline-flex; margin-left: .4rem;
  border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
}
.lang button {
  background: #fff; border: 0; cursor: pointer;
  color: var(--muted); font: 700 .76rem/1 var(--sans); letter-spacing: .05em;
  padding: 8px 11px; transition: .15s ease;
}
.lang button:hover { color: var(--ink); }
.lang button.active { background: var(--blue); color: #fff; }

.nav-toggle {
  display: none; margin-left: auto;
  background: none; border: 0; cursor: pointer; padding: 8px;
}
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; transition: .25s; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.6rem; border-radius: 999px;
  font-weight: 600; font-size: .95rem; font-family: var(--sans);
  cursor: pointer; border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 8px 24px rgba(31,110,160,.28); }
.btn-primary:hover { background: var(--blue-deep); color: #fff; transform: translateY(-2px); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: #fff; }
.btn-ghost:hover { border-color: var(--blue-soft); color: var(--blue); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative; overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(1200px 500px at 82% -10%, rgba(31,110,160,.10), transparent 60%),
    radial-gradient(820px 420px at 0% 115%, rgba(194,150,47,.10), transparent 55%);
}
.hero-grid {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center;
  padding: 104px 0 100px;
}
.hero h1 { margin-bottom: .5rem; }
.hero p.lead, .lead { font-size: 1.18rem; color: var(--body); }
.hero p.lead { max-width: 48ch; margin: 0 0 2rem; }
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-visual {
  position: relative; border-radius: 18px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  aspect-ratio: 4 / 3; background: var(--bg-deep);
}
.hero-visual img, .hero-visual video { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-badge, .badge {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .45rem 1rem; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; font-size: .82rem; font-weight: 600; color: var(--blue);
}
.hero-badge { position: absolute; left: 14px; bottom: 14px; z-index: 2; box-shadow: var(--shadow); }
.hero-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* ==========================================================================
   Sections
   ========================================================================== */
section { padding: 88px 0; }
.alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-head { max-width: 60ch; margin-bottom: 48px; }
.section-head p { color: var(--body); font-size: 1.1rem; margin: 0; }

.lead-copy p { color: var(--body); font-size: 1.06rem; }

/* Patent strip */
.patents { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.patents .chip {
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: 999px;
  padding: .4rem .9rem; font-size: .85rem; font-weight: 600; color: var(--blue);
}
.patents .chip b { color: var(--accent); font-weight: 700; }

/* Feature cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card p { margin: 0; color: var(--body); font-size: .98rem; }
.card .ic {
  width: 46px; height: 46px; border-radius: 11px; margin-bottom: 18px;
  display: grid; place-items: center; font-size: 1.2rem; color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-soft));
}

/* Stat band */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat {
  text-align: center; padding: 28px 14px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.stat .n { font-family: var(--serif); font-size: clamp(1.9rem, 4vw, 2.7rem); font-weight: 600; color: var(--blue); line-height: 1; }
.stat .n .gold { color: var(--accent); }
.stat .l { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .09em; margin-top: .5rem; }

/* Split */
.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: start; }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.feature-list li { position: relative; padding-left: 30px; color: var(--body); }
.feature-list li::before {
  content: ""; position: absolute; left: 2px; top: .55em;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px rgba(194,150,47,.14);
}
.feature-list li b { color: var(--ink); font-weight: 600; }

/* Spec panel / tables */
.spec-panel {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow); position: sticky; top: 92px;
}
.spec-panel h3 { color: var(--ink); }
.spec-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.spec-table th, .spec-table td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--line); }
.spec-table th { color: var(--muted); font-weight: 600; width: 48%; }
.spec-table td { color: var(--ink); font-weight: 500; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }

/* Products */
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.product {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease;
}
.product:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.product .tag {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 8px;
}
.product h3 { margin-bottom: 16px; }
.product .mini { font-size: .9rem; color: var(--body); display: grid; gap: 7px; }
.product .mini div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 7px; }
.product .mini span:last-child { color: var(--ink); font-weight: 600; text-align: right; }

/* Gallery / image strips — caption below, light card style */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.gallery figure {
  margin: 0; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: #fff; box-shadow: var(--shadow);
}
.gallery figure img { width: 100%; aspect-ratio: 3/2; object-fit: cover; background: #16314a; }
.gallery figcaption { padding: 12px 16px; font-size: .85rem; font-weight: 600; color: var(--ink); }

/* Installations grid (fusion machines) — DATAPAT .logos style */
.installs {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.installs div {
  background: #fff; padding: 28px 16px; text-align: center;
  font-weight: 600; color: var(--blue-deep); font-size: .95rem;
}
.installs div small { display: block; font-weight: 500; color: var(--muted); font-size: .76rem; margin-top: .25rem; letter-spacing: .02em; }

/* Materials comparison table */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.mat-table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 680px; background: #fff; }
.mat-table thead th {
  text-align: left; font: 700 .72rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); padding: 16px; border-bottom: 2px solid var(--line); background: #fff;
}
.mat-table thead th.col-adv { color: #2e7d52; }
.mat-table thead th.col-drw { color: #b05a3c; }
.mat-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--body); }
.mat-table tr:last-child td { border-bottom: 0; }
.mat-table tr.grp td {
  background: var(--bg-alt); font-family: var(--serif); font-weight: 600; color: var(--ink);
  font-size: 1.05rem; padding: 12px 16px; letter-spacing: -.01em;
}
.mat-table .mat { font-weight: 600; color: var(--ink); white-space: nowrap; }
.mat-table .mat .std {
  display: inline-block; margin-top: 5px; font: 700 .6rem/1 var(--sans);
  letter-spacing: .06em; text-transform: uppercase; color: var(--accent);
  background: rgba(194,150,47,.12); border: 1px solid rgba(194,150,47,.32);
  border-radius: 999px; padding: 3px 7px; white-space: nowrap;
}

/* Geometry */
.geo-figure {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-lg); background: var(--bg-deep);
}
.geo-figure video, .geo-figure img { width: 100%; display: block; background: var(--bg-deep); }
.geo-figure figcaption {
  padding: 16px 20px; font-size: .9rem; color: var(--body);
  border-top: 1px solid var(--line); background: #fff;
}
.geo-figure figcaption b { color: var(--blue); }

.geo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.geo-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease;
}
.geo-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.geo-card .thumb { aspect-ratio: 3/2; background: #16314a; overflow: hidden; }
.geo-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.geo-card .cap { padding: 16px 18px; }
.geo-card .cap h4 { margin: 0 0 4px; font-size: 1.02rem; color: var(--ink); }
.geo-card .cap p { margin: 0; font-size: .86rem; color: var(--muted); }

/* Video */
.video-frame {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-lg); aspect-ratio: 16/9; background: var(--bg-deep);
}
.video-frame iframe, .video-frame video { width: 100%; height: 100%; border: 0; }
.video-frame video { object-fit: contain; background: var(--bg-deep); }

/* YouTube facade — poster + play button, no iframe until clicked (never errors on load) */
.yt-facade { position: absolute; inset: 0; display: block; cursor: pointer; background: var(--bg-deep); }
.yt-facade img { width: 100%; height: 100%; object-fit: cover; opacity: .8; }
.yt-facade::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(12,27,40,.2), rgba(12,27,40,.55)); }
.yt-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2;
  width: 74px; height: 74px; border-radius: 50%; background: rgba(8,14,22,.62);
  display: grid; place-items: center; border: 1px solid rgba(255,255,255,.25); transition: .18s ease;
}
.yt-play::before {
  content: ""; width: 0; height: 0; border-style: solid;
  border-width: 13px 0 13px 22px; border-color: transparent transparent transparent #fff; margin-left: 5px;
}
.yt-facade:hover .yt-play { background: #c00; border-color: #c00; transform: translate(-50%, -50%) scale(1.07); }
.yt-label { position: absolute; left: 16px; bottom: 14px; z-index: 2; color: #fff; font-weight: 600; font-size: .9rem; text-shadow: 0 1px 4px rgba(0,0,0,.55); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 56px; align-items: start; }
.info-block { display: grid; gap: 24px; }
.info-item { display: flex; gap: 14px; align-items: flex-start; }
.info-item .ic {
  flex: none; width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center;
  background: var(--bg-alt); border: 1px solid var(--line); font-size: 1.1rem; color: var(--blue);
}
.info-item .l { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.info-item .v { color: var(--ink); font-weight: 600; }

form.card { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-size: .82rem; color: var(--body); font-weight: 600; }
.field input, .field textarea {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--ink); padding: 12px 14px; font: inherit; font-size: .95rem; width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--blue-soft); box-shadow: 0 0 0 3px rgba(31,110,160,.12); }
.field textarea { resize: vertical; min-height: 130px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-status { margin: 0; font-size: .9rem; font-weight: 600; min-height: 1.1em; }
.form-status.ok  { color: #2e7d52; }
.form-status.err { color: #b05a3c; }

/* CTA band — dark, like DATAPAT cs-band */
.cta-band {
  position: relative; overflow: hidden; text-align: center;
  background: var(--bg-deep); color: #e9eef3;
  border-radius: 20px; padding: 64px 28px;
}
.cta-band::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(700px 320px at 50% -30%, rgba(194,150,47,.18), transparent 60%);
}
.cta-band h2 { color: #fff; position: relative; }
.cta-band p { color: #c4cfd9; max-width: 52ch; margin: .5rem auto 1.6rem; position: relative; }
.cta-band .btn { position: relative; }

/* ==========================================================================
   Research report
   ========================================================================== */
.prose { max-width: 70ch; }
.prose p { color: var(--body); font-size: 1.05rem; }
.prose strong, .prose b { color: var(--ink); }

.note-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); background: rgba(194,150,47,.10);
  border: 1px solid rgba(194,150,47,.32); border-radius: 999px; padding: 6px 14px;
}

.callout {
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  background: #fff; border-radius: var(--radius); padding: 24px 26px; margin: 24px 0; box-shadow: var(--shadow);
}
.callout.warn { border-left-color: #c0563b; }
.callout.warn .callout-title { color: #b14b30; }
.callout-title { font-family: var(--serif); font-weight: 600; color: var(--ink); margin: 0 0 8px; }
.callout p { margin: 0 0 .6em; color: var(--body); }
.callout p:last-child { margin-bottom: 0; }

.equation {
  font-family: "Cambria Math", var(--serif); font-size: 1.15rem; text-align: center; color: var(--ink);
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 18px 16px; margin: 18px 0; overflow-x: auto; line-height: 1.8;
}
.equation .var { font-style: italic; }
.equation sup, .equation sub { font-size: .72em; }

.steps-num { counter-reset: step; display: grid; gap: 18px; }
.steps-num .card { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; }
.steps-num .card::before {
  counter-increment: step; content: counter(step);
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 600; font-size: 1.1rem; color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-soft));
}
.steps-num .card > div { min-width: 0; }

/* ==========================================================================
   Footer — dark
   ========================================================================== */
.site-footer { background: #0c1b27; color: #b9c6d2; padding: 64px 0 32px; }
.site-footer a { color: #d3deea; }
.site-footer a:hover { color: var(--accent-soft); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 48px; margin-bottom: 44px; }
.footer-grid p { color: #8da0b1; font-size: .95rem; max-width: 34ch; }
.footer-col h4 { color: #fff; font-family: var(--sans); font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; margin: 0 0 1rem; }
.footer-col a { display: block; padding: .35rem 0; font-size: .94rem; }
.site-footer .logo { color: #fff; }
.site-footer .logo small { color: #8da0b1; }
.footer-bot {
  border-top: 1px solid rgba(255,255,255,.12); padding-top: 24px;
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  font-size: .85rem; color: #7e92a3;
}

/* ==========================================================================
   Reveal animation
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; padding: 64px 0 72px; }
  .hero-visual { order: -1; aspect-ratio: 16/10; }
  .cards, .stats { grid-template-columns: repeat(2, 1fr); }
  .split, .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .spec-panel { position: static; }
  .product-grid { grid-template-columns: 1fr; }
  .gallery, .installs, .geo-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }

  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; inset: 70px 0 auto 0; flex-direction: column; align-items: stretch;
    gap: 0; margin: 0; padding: 8px 24px 20px;
    background: #fff; border-bottom: 1px solid var(--line);
    transform: translateY(-130%); transition: transform .25s ease; box-shadow: var(--shadow);
  }
  .nav.open .nav-links { transform: none; }
  .nav-links a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .lang { margin: 12px 0 0; align-self: flex-start; }
}
@media (max-width: 560px) {
  section { padding: 60px 0; }
  .cards, .stats, .gallery, .installs, .geo-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .logo small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
