/* =========================================================================
   Bortolutti Digital Ltd — Design System
   ========================================================================= */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { min-height: 100vh; overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul { list-style: none; }

/* ---------- Tokens ---------- */
:root {
  /* Backgrounds — deep blue-black tuned to the logo */
  --bg0:   #07090d;
  --bg1:   #0a0c12;
  --bg2:   #10131b;
  --bg3:   #161a25;
  --bg4:   #1d2230;

  /* Text */
  --text:   #eef1f7;
  --subtle: #a5adbf;
  --muted:  #6d7689;
  --faint:  #3a4152;

  /* Lines */
  --line:       rgba(255, 255, 255, 0.07);
  --line-2:     rgba(255, 255, 255, 0.12);
  --line-gold:  rgba(201, 169, 97, 0.28);

  /* Brand */
  --gold:        #c9a961;
  --gold-bright: #e3c787;
  --gold-dim:    rgba(201, 169, 97, 0.08);
  --gold-border: rgba(201, 169, 97, 0.35);

  /* Accent — pulled from the logo's teal */
  --teal:        #4ea3d6;
  --teal-dim:    rgba(78, 163, 214, 0.10);

  /* Status */
  --live: #5ee59b;

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 18px;
  --r-xl: 28px;

  /* Type */
  --f-serif: 'Instrument Serif', 'Times New Roman', serif;
  --f-sans:  'Geist', -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  --f-mono:  'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* Layout */
  --page-max: 1180px;
  --pad-x: 2rem;
}

/* ---------- Base ---------- */
body {
  font-family: var(--f-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg0);
  letter-spacing: -0.005em;
}

/* Subtle film-grain overlay (the whole page) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(78, 163, 214, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(201, 169, 97, 0.04) 0%, transparent 60%);
}

.pg { position: relative; z-index: 2; min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- Selection ---------- */
::selection { background: var(--gold); color: #0a0c12; }

/* ---------- Language toggling ---------- */
.lang-en, html[data-lang="en"] .lang-it { display: none; }
html[data-lang="en"] .lang-en { display: inline; }
html[data-lang="en"] .lang-en.block, html[data-lang="en"] span.lang-en.block { display: inline; }
html[data-lang="en"] .fg-it { display: none; }
html:not([data-lang="en"]) .fg-en { display: none; }

/* =========================================================================
   Navigation
   ========================================================================= */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(7, 9, 13, 0.7);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 0.5px solid var(--line);
  transition: padding 0.25s ease, background 0.25s ease;
}
.site-nav.scrolled {
  padding: 0.65rem 2rem;
  background: rgba(7, 9, 13, 0.92);
}
.nav-logo a { display: flex; align-items: center; gap: 10px; }
.nav-logo img { height: 32px; width: auto; transition: height 0.25s ease; }
.site-nav.scrolled .nav-logo img { height: 26px; }

.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links li a {
  display: inline-block;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--subtle);
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
  position: relative;
}
.nav-links li a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-links li a.active { color: var(--text); background: rgba(255,255,255,0.06); }
.nav-links li a.active::before {
  content: '';
  position: absolute;
  left: 12px;
  bottom: 4px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.nav-controls { display: flex; align-items: center; gap: 8px; }
.lang-btn {
  padding: 7px 12px;
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--subtle);
  border: 0.5px solid var(--line-2);
  border-radius: 999px;
  transition: all 0.2s;
  letter-spacing: 0.08em;
}
.lang-btn:hover { color: var(--gold); border-color: var(--gold-border); }

.nav-hamburger {
  display: none;
  width: 36px; height: 36px;
  border: 0.5px solid var(--line-2);
  border-radius: 8px;
  position: relative;
}
.nav-hamburger span {
  position: absolute;
  left: 9px;
  right: 9px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.25s;
}
.nav-hamburger span:nth-child(1) { top: 12px; }
.nav-hamburger span:nth-child(2) { top: 17px; }
.nav-hamburger span:nth-child(3) { top: 22px; }
.nav-hamburger[aria-expanded="true"] span:nth-child(1) { top: 17px; transform: rotate(45deg); }
.nav-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-hamburger[aria-expanded="true"] span:nth-child(3) { top: 17px; transform: rotate(-45deg); }

.nav-mobile-drawer {
  position: fixed;
  top: 0; right: 0;
  width: min(320px, 82vw);
  height: 100vh;
  background: var(--bg1);
  border-left: 0.5px solid var(--line);
  padding: 6rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.33, 1, 0.68, 1);
  z-index: 45;
}
.nav-mobile-drawer.open { transform: translateX(0); }
.nav-mobile-drawer a {
  padding: 14px 16px;
  font-size: 16px;
  color: var(--subtle);
  border-radius: var(--r-md);
  transition: background 0.2s, color 0.2s;
}
.nav-mobile-drawer a:hover,
.nav-mobile-drawer a.active { color: var(--text); background: rgba(255,255,255,0.04); }

/* =========================================================================
   Buttons
   ========================================================================= */
.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.btn-primary {
  background: var(--gold);
  color: #0a0c12;
  box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 12px 30px -12px rgba(201, 169, 97, 0.5);
}
.btn-primary:hover {
  background: var(--gold-bright);
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 18px 36px -12px rgba(201, 169, 97, 0.6);
}
.btn-primary svg { transition: transform 0.25s ease; }
.btn-primary:hover svg { transform: translateX(3px); }

.btn-ghost {
  border: 0.5px solid var(--line-2);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--gold-border); color: var(--gold); }

/* =========================================================================
   Shared visual atoms
   ========================================================================= */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 10px;
  border: 0.5px solid var(--line-2);
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--subtle);
  text-transform: uppercase;
  margin-bottom: 2rem;
  background: rgba(255,255,255,0.015);
}
.pulse-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--live);
  position: relative;
}
.pulse-dot::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--live);
  opacity: 0.4;
  animation: pulse-anim 2s ease-out infinite;
}
@keyframes pulse-anim {
  0%   { transform: scale(0.6); opacity: 0.5; }
  100% { transform: scale(2.2); opacity: 0; }
}

.section-label {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::before {
  content: '';
  width: 20px;
  height: 1px;
  background: var(--gold);
  opacity: 0.6;
}

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* =========================================================================
   Hero background (shared)
   ========================================================================= */
.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.hero-orb {
  position: absolute;
  top: -20%;
  right: -10%;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%,
    rgba(78, 163, 214, 0.25),
    rgba(78, 163, 214, 0.08) 40%,
    transparent 70%);
  filter: blur(40px);
}
.hero-orb-2 {
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle at 70% 70%,
    rgba(201, 169, 97, 0.15),
    rgba(201, 169, 97, 0.04) 40%,
    transparent 70%);
  filter: blur(50px);
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 80%);
}

/* =========================================================================
   Marquee
   ========================================================================= */
.marquee-bar {
  border-top: 0.5px solid var(--line);
  border-bottom: 0.5px solid var(--line);
  overflow: hidden;
  background: var(--bg1);
  padding: 1.15rem 0;
  position: relative;
}
.marquee-bar::before,
.marquee-bar::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 100px;
  z-index: 2;
  pointer-events: none;
}
.marquee-bar::before { left: 0; background: linear-gradient(90deg, var(--bg1), transparent); }
.marquee-bar::after  { right: 0; background: linear-gradient(-90deg, var(--bg1), transparent); }

.marquee-track {
  display: flex;
  gap: 3rem;
  animation: marquee 45s linear infinite;
  white-space: nowrap;
  width: max-content;
}
.marquee-item {
  font-family: var(--f-serif);
  font-size: 20px;
  font-style: italic;
  color: var(--subtle);
  display: flex;
  align-items: center;
  gap: 3rem;
  opacity: 0.85;
}
.marquee-sep {
  color: var(--gold);
  font-family: var(--f-sans);
  font-size: 14px;
  font-style: normal;
  opacity: 0.7;
}
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
  margin-top: auto;
  border-top: 0.5px solid var(--line);
  background: var(--bg1);
  position: relative;
  overflow: hidden;
}
.footer-grid {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 4rem 2rem 2rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
.footer-brand-col h3 {
  font-family: var(--f-serif);
  font-size: 32px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0.6rem;
}
.footer-brand-col h3 em { font-style: italic; color: var(--gold); }
.footer-brand-col p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  max-width: 320px;
}

.footer-col h5 {
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}
.footer-col a,
.footer-col li {
  display: block;
  font-size: 13px;
  color: var(--subtle);
  line-height: 2.1;
  transition: color 0.2s;
  cursor: pointer;
}
.footer-col a:hover { color: var(--gold); }

.footer-bottom {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 1.4rem 2rem 1.4rem;
  border-top: 0.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-copy { font-size: 12px; color: var(--muted); font-family: var(--f-mono); }
.footer-brand-mark {
  font-family: var(--f-serif);
  font-size: 16px;
  font-style: italic;
  color: var(--gold);
  opacity: 0.9;
}
.footer-legal-info {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0.75rem 2rem 1.5rem;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--faint);
  text-align: center;
}

/* =========================================================================
   Cookie wall + Legal modal (shared)
   ========================================================================= */
.cookie-overlay {
  position: fixed; inset: 0;
  background: rgba(4, 6, 10, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.cookie-overlay.active { opacity: 1; visibility: visible; }
.cookie-box {
  max-width: 500px;
  background: var(--bg2);
  border: 0.5px solid var(--line-2);
  border-radius: var(--r-lg);
  padding: 2rem;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.7);
}
.cookie-box h3 {
  font-family: var(--f-serif);
  font-size: 26px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 1rem;
}
.cookie-box p { font-size: 13px; color: var(--subtle); line-height: 1.7; margin-bottom: 1.5rem; }
.cookie-box p a { color: var(--gold); cursor: pointer; border-bottom: 0.5px dotted var(--gold-border); }
.cookie-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-cookie-accept {
  flex: 1;
  min-width: 180px;
  padding: 12px 18px;
  background: var(--gold);
  color: #0a0c12;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.2s;
}
.btn-cookie-accept:hover { background: var(--gold-bright); }
.btn-cookie-reject {
  padding: 12px 18px;
  border: 0.5px solid var(--line-2);
  color: var(--subtle);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  transition: border-color 0.2s, color 0.2s;
}
.btn-cookie-reject:hover { color: var(--text); border-color: var(--line-2); }

/* Legal modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(4, 6, 10, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 210;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.3s;
}
.modal-overlay.active { display: flex; opacity: 1; }
.modal-content {
  max-width: 720px;
  width: 100%;
  max-height: 84vh;
  background: var(--bg2);
  border: 0.5px solid var(--line-2);
  border-radius: var(--r-lg);
  padding: 2.5rem;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.7);
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 0.5px solid var(--line-2);
  color: var(--subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s;
}
.modal-close:hover { color: var(--gold); border-color: var(--gold-border); }
.modal-close svg { width: 16px; height: 16px; }
.modal-body h2 {
  font-family: var(--f-serif);
  font-size: 34px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 0.3rem;
}
.last-updated {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}
.modal-body h3 {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin: 1.5rem 0 0.5rem;
}
.modal-body p,
.modal-body li {
  font-size: 14px;
  color: var(--subtle);
  line-height: 1.75;
  margin-bottom: 0.5rem;
}
.modal-body ul { margin-left: 1.2rem; margin-bottom: 1rem; }
.modal-body ul li { list-style: disc; }
.modal-body code {
  font-family: var(--f-mono);
  font-size: 12px;
  padding: 2px 6px;
  background: var(--bg3);
  border-radius: 4px;
  color: var(--gold);
}
.modal-body strong { color: var(--text); font-weight: 500; }
