/* ─────────────────────────────────────────────────────────────────────────
   VIABLE shared site stylesheet
   Canonical design tokens, typography, navigation, hero, sections, cards,
   footer, and cookie banner. Linked from every page BEFORE the page's
   inline <style> so per-page rules can still override when needed.
   ───────────────────────────────────────────────────────────────────────── */

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── DESIGN TOKENS ── */
:root {
  --ink: #003154;
  --ink-soft: #1a4a6e;
  --ink-deep: #001a30;
  --haze: #f4f6fa;
  --surface: #ffffff;
  --accent: #7cc9b5;
  --accent-solid: #0ea472;
  --accent-soft: #a8d8c8;
  --muted-fg: #5a6b7a;
  --border: #dfe3e9;
  --hero-from: #2d3b5e;
  --hero-via: #1a2440;
  --hero-to: #141d33;
  --shadow-soft: 0 8px 24px -12px rgba(20, 29, 51, 0.18);
  --shadow-elevated: 0 20px 60px -20px rgba(20, 29, 51, 0.35);
  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

/* ── BASE TYPOGRAPHY ── */
html, body {
  font-family: var(--font-body);
  background: var(--haze);
  color: var(--ink);
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.55;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  color: var(--ink);
}

h3 { font-size: 1.05rem; line-height: 1.3; }

.accent { color: var(--accent-solid); }

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2.5rem;
  background: rgba(244, 246, 250, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: background 0.25s ease, backdrop-filter 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  border-bottom: 1px solid transparent;
}
nav.scrolled {
  background: rgba(244, 246, 250, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.nav-logo { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.nav-logo img { height: 48px; width: auto; display: block; }
.nav-logo .logo-navy { display: none; }
.nav-logo .logo-white { display: block; }
nav.scrolled .nav-logo .logo-navy { display: block; }
nav.scrolled .nav-logo .logo-white { display: none; }

.nav-links { display: flex; gap: 2.25rem; list-style: none; }
.nav-links a {
  color: rgba(255,255,255,0.82);
  text-decoration: none; font-size: 0.9rem; font-weight: 500;
  transition: color 0.2s; white-space: nowrap;
}
.nav-links a.active { color: #ffffff; font-weight: 600; }
.nav-links a:hover { color: #ffffff; }
nav.scrolled .nav-links a { color: var(--muted-fg); }
nav.scrolled .nav-links a.active { color: var(--ink); }
nav.scrolled .nav-links a:hover { color: var(--ink); }

.nav-right { display: flex; align-items: center; gap: 0.85rem; }

.btn-demo {
  background: var(--ink); color: #ffffff;
  border: none; border-radius: 999px;
  padding: 0.6rem 1.4rem; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-body);
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.btn-demo:hover { background: var(--ink-soft); transform: translateY(-1px); box-shadow: var(--shadow-soft); }
nav:not(.scrolled) .btn-demo { background: #ffffff; color: var(--ink); }
nav:not(.scrolled) .btn-demo:hover { background: rgba(255,255,255,0.92); }

.lang-select {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.9);
  font-family: var(--font-body);
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.1em;
  cursor: pointer; padding: 0.38rem 1.55rem 0.38rem 0.65rem;
  border-radius: 6px;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3e%3cpath d='M1 1l4 4 4-4' stroke='%23ffffff' stroke-opacity='0.7' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  background-size: 9px;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}
.lang-select:hover { color: #ffffff; border-color: rgba(255,255,255,0.55); }
.lang-select option { background: var(--ink); color: #ffffff; font-family: var(--font-body); }
nav.scrolled .lang-select {
  color: var(--ink); border-color: var(--border);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3e%3cpath d='M1 1l4 4 4-4' stroke='%23003154' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
}
nav.scrolled .lang-select:hover { border-color: var(--ink); }
nav.scrolled .lang-select option { background: var(--surface); color: var(--ink); }

/* ── USE CASES DROPDOWN ── */
.nav-dropdown { position: relative; }
.nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%; left: 0; right: 0;
  height: 1.1rem;
  pointer-events: auto;
  background: transparent;
}
.nav-dropdown > a {
  display: inline-flex; align-items: center; gap: 0.3rem;
  line-height: inherit;
}
.nav-dropdown > a::after {
  content: '';
  display: inline-block; width: 8px; height: 5px; flex-shrink: 0;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5' fill='none'%3e%3cpath d='M1 1l3 3 3-3' stroke='%23ffffff' stroke-opacity='0.8' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: center;
  transition: transform 0.2s;
}
nav.scrolled .nav-dropdown > a::after {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5' fill='none'%3e%3cpath d='M1 1l3 3 3-3' stroke='%23003154' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
}
.nav-dropdown:hover > a::after { transform: rotate(180deg); }

.dropdown-panel {
  display: none; position: absolute; top: calc(100% + 0.75rem); left: 50%;
  transform: translateX(-50%);
  background: #ffffff; border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  padding: 1rem; min-width: 340px; z-index: 200;
}
.nav-dropdown:hover .dropdown-panel,
.nav-dropdown:focus-within .dropdown-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }

.dropdown-section { padding: 0.5rem; }
.dropdown-section-label {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted-fg);
  padding: 0 0.25rem 0.5rem; margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}
.dropdown-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.5rem; border-radius: 8px;
  text-decoration: none; color: var(--ink) !important;
  font-size: 0.85rem; font-weight: 500;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.dropdown-item:hover { background: var(--surface); color: var(--accent) !important; }
.dropdown-item-icon {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--haze); color: var(--ink);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.wallet-badge {
  display: flex; align-items: center; gap: 0.3rem;
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--muted-fg);
  padding: 0.2rem 0.25rem 0.45rem;
  border-bottom: 1px solid var(--border); margin-bottom: 0.2rem;
}
.wallet-badge svg { flex-shrink: 0; }
.wallet-badge-status {
  background: rgba(14,164,114,0.1); color: #0ea472;
  border: 1px solid rgba(14,164,114,0.25);
  border-radius: 3px; padding: 0.08rem 0.3rem;
  font-size: 0.55rem; margin-left: 0.2rem;
}
.dropdown-item-text { line-height: 1.2; }
.dropdown-item-sub { font-size: 0.72rem; color: var(--muted-fg); font-weight: 400; }

.mobile-dropdown-section { margin-bottom: 1.25rem; }
.mobile-dropdown-label {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted-fg); margin-bottom: 0.5rem;
}
.mobile-dropdown-item {
  display: block; padding: 0.5rem 0; color: var(--ink);
  text-decoration: none; font-size: 0.95rem; font-weight: 500;
}
.mobile-dropdown-item:hover { color: var(--accent); }

/* ── HAMBURGER BUTTON ── */
.nav-hamburger {
  display: none;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  width: 36px; height: 36px; background: none; border: none; cursor: pointer;
  padding: 4px; border-radius: 6px;
}
.nav-hamburger span {
  display: block; width: 20px; height: 2px;
  background: currentColor; border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
nav:not(.scrolled) .nav-hamburger { color: rgba(255,255,255,0.9); }
nav.scrolled .nav-hamburger { color: var(--ink); }
.nav-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE MENU ── */
.mobile-menu {
  position: fixed; inset: 0; background: var(--ink);
  z-index: 300;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2.5rem;
  padding: 2rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.mobile-menu.open { opacity: 1; pointer-events: auto; }
.mobile-nav-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 1.75rem; }
.mobile-nav-links a {
  color: rgba(255,255,255,0.85); text-decoration: none;
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 500; letter-spacing: -0.01em;
  transition: color 0.15s;
}
.mobile-nav-links a:hover, .mobile-nav-links a:focus { color: var(--accent); }

/* ── HERO (compressed canonical values) ── */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(ellipse at top, var(--hero-from) 0%, var(--hero-via) 60%, var(--hero-to) 100%);
  color: #ffffff;
  padding: 5rem 2.5rem 2rem;
  min-height: 272px;
  display: flex; align-items: center;
}
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: url('/assets/berlin-network.jpg');
  background-size: cover; background-position: center;
  opacity: 0.18; mix-blend-mode: screen;
}
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to right, rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 0%, transparent 80%);
  opacity: 0.5;
}
.hero-inner {
  position: relative; z-index: 2;
  max-width: 1200px; margin: 0 auto; width: 100%;
}
.hero-tag {
  display: inline-block; font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 0.65rem;
}

.hero h1 {
  font-size: clamp(1.4rem, 2.6vw, 2.1rem);
  font-weight: 700; line-height: 1.1;
  color: #ffffff; margin-bottom: 1rem; max-width: 100%; text-wrap: balance;
  white-space: nowrap;
}
.hero h1 .accent { color: var(--accent); }
.hero p.lead, .hero .lead {
  font-size: 1rem; line-height: 1.6;
  color: rgba(255,255,255,0.78); max-width: 640px;
}

/* ── BODY SECTIONS (density pass) ── */
section.body {
  padding: 3rem 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
}
section.alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
section.alt > .inner {
  max-width: 1200px; margin: 0 auto;
  padding: 3rem 2.5rem;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem; letter-spacing: 0.14em;
  color: var(--accent-solid);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

h2.section-h, .section-h {
  font-size: clamp(1.85rem, 3.2vw, 2.6rem);
  line-height: 1.15;
  font-weight: 700;
  margin-bottom: 0.65rem;
  max-width: 820px; text-wrap: balance;
}
h2.section-h .accent { color: var(--accent); }
h2.section-h .ink   { color: var(--ink-soft); }

p.lead-fade, .lead-fade {
  font-size: 1.1rem; line-height: 1.6;
  color: var(--muted-fg);
  max-width: 680px;
  margin-bottom: 1.85rem;
}

/* ── CARD GRID ── */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.25s;
  will-change: transform;
}
section.alt .card { background: var(--haze); }
.card:hover { border-color: var(--ink-soft); transform: translateY(-3px); box-shadow: var(--shadow-soft); }
.card-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(14,164,114,0.1);
  color: var(--accent-solid);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.85rem;
}
.card-icon svg { width: 20px; height: 20px; }
.card h3 { font-size: 1.15rem; margin-bottom: 0.5rem; font-weight: 600; }
.card p  { font-size: 1rem; line-height: 1.6; color: var(--muted-fg); }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 2.5rem;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.82rem; color: var(--muted-fg);
  background: var(--surface);
  flex-wrap: wrap; gap: 0.75rem;
}
footer a { color: var(--ink); text-decoration: none; font-weight: 500; }
footer a:hover { text-decoration: underline; }

/* ── COOKIE BANNER ── */
#cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: #001a30; color: rgba(255,255,255,0.88);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; padding: 0.9rem 2rem;
  font-size: 0.84rem; line-height: 1.5; font-family: var(--font-body);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.28); transition: transform 0.3s ease;
}
#cookie-banner.dismissed { transform: translateY(110%); }
#cookie-banner p { max-width: 680px; margin: 0; }
.cookie-actions { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
#cookie-more { color: #7cc9b5; text-decoration: none; font-size: 0.82rem; white-space: nowrap; }
#cookie-more:hover { text-decoration: underline; }
#cookie-ok {
  background: #7cc9b5; color: #003154; border: none; border-radius: 999px;
  padding: 0.48rem 1.2rem; font-size: 0.82rem; font-weight: 700;
  cursor: pointer; font-family: var(--font-body); transition: background 0.15s; white-space: nowrap;
}
#cookie-ok:hover { background: #9dd8c5; }

/* ── RESPONSIVE ── */
@media (max-width: 800px) {
  nav { padding: 0.7rem 1.25rem; }
  .nav-logo img { height: 38px; }
  .nav-links { display: none; }
  .nav-right .btn-demo { display: none; }
  .mobile-menu .btn-demo { display: inline-block; }
  .nav-hamburger { display: flex; }
  footer { flex-direction: column; gap: 0.5rem; text-align: center; padding: 1.5rem 1.25rem; }
}
@media (max-width: 768px) {
  .hero { padding: 4.25rem 1.25rem 1.5rem; min-height: 224px; }
  .hero h1 { white-space: normal; font-size: clamp(1.25rem, 5.5vw, 1.65rem); margin-bottom: 0.65rem; }
  .hero p.lead, .hero .lead { font-size: 0.9rem; line-height: 1.5; }
  .hero-tag { font-size: 0.62rem; margin-bottom: 0.5rem; }
  section.body, section.alt > .inner { padding: 2.5rem 1.25rem; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 0.85rem; margin-top: 1rem; }
  .card { padding: 1.1rem; border-radius: 12px; }
  .card h3 { font-size: 1.05rem; }
  .card p { font-size: 0.92rem; }
  h2.section-h, .section-h { font-size: clamp(1.4rem, 5.5vw, 1.85rem); }
  p.lead-fade, .lead-fade { font-size: 0.95rem; margin-bottom: 1.25rem; }
}
@media (min-width: 769px) and (max-width: 1023px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  #cookie-banner { padding: 0.9rem 1.25rem; gap: 0.75rem; }
  .cookie-actions { width: 100%; justify-content: flex-end; }
}
