/* Communardo demo site - Communardo Corporate Brand (Brand Book 2.0 "Smarter Together").
   One colour system, Arial (bundled TTFs as fallback for the licensed brand typeface), official gradient artwork.
   Light theme only. */

/* Prefer the system Arial (no download); the bundled TTFs are only fetched where Arial is missing (Linux, Android). */
@font-face {
  font-family: "Arial Brand"; font-weight: 400; font-style: normal; font-display: swap;
  src: local("Arial"), local("ArialMT"), url("../fonts/Arial-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Arial Brand"; font-weight: 700; font-style: normal; font-display: swap;
  src: local("Arial Bold"), local("Arial-BoldMT"), url("../fonts/Arial-Bold.ttf") format("truetype");
}
@font-face {
  font-family: "Arial Brand"; font-weight: 900; font-style: normal; font-display: swap;
  src: local("Arial Black"), local("Arial-Black"), url("../fonts/Arial-Black.ttf") format("truetype");
}

:root {
  /* official HEX values, see frame.md */
  --midnight: #040040;
  --royal: #0000DD;
  --orange: #FE6B00;
  --lightblue: #D5EDFF;
  --white: #FFFFFF;
  --lightgrey: #E3E3E3;

  /* derived text / line colours that keep AA contrast (darkgrey #9D9D9C is too light for text) */
  --text: var(--midnight);
  --muted: rgba(4, 0, 64, .74);            /* ~8:1 on white, ~7:1 on lightblue */
  --line: rgba(4, 0, 64, .10);              /* card hairlines */
  --control-line: rgba(4, 0, 64, .45);      /* >= 3:1 against white for control borders */

  --font: "Arial Brand", Arial, "Helvetica Neue", Helvetica, sans-serif;
  --gutter: clamp(16px, 5vw, 48px);
  --radius: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  color: var(--text);
  background: var(--lightblue);
  overflow-x: hidden;           /* belt and braces: nothing may scroll sideways */
  overflow-wrap: break-word;
}
img, video { max-width: 100%; }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }

.wrap { width: min(1200px, 100% - 2 * var(--gutter)); margin-inline: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 12px; top: 12px; z-index: 20;
  padding: 12px 20px; border-radius: 999px;
  background: var(--white); color: var(--midnight); font-weight: 700; text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

:focus-visible { outline: 3px solid var(--royal); outline-offset: 3px; }
.hero :focus-visible, .footer :focus-visible { outline-color: var(--white); }

/* ---------- hero: official gradient artwork, white logo, white type ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--white);
  background: var(--midnight);
}
/* gradient.png has a 1px black column on its left edge: overshoot by 4px so it is cropped away */
.hero-bg {
  position: absolute; top: 0; bottom: 0; left: -4px; right: -4px; z-index: -1;
  background: var(--midnight) url("../brand/gradient.png") 18% 35% / cover no-repeat;
}
@media (prefers-reduced-motion: no-preference) {
  .hero-bg { transform-origin: 20% 40%; animation: gradient-drift 30s ease-in-out infinite alternate; }
}
@keyframes gradient-drift { from { transform: scale(1); } to { transform: scale(1.06); } }

.hero-inner { padding-top: clamp(24px, 4vw, 48px); padding-bottom: clamp(96px, 11vw, 136px); }

/* The logo PNG has transparent padding (visible mark = 1384x105 of 1600x363): crop it so the mark aligns to the text edge.
   Image width stays >= 354px (brand minimum) because the container is >= 306px wide on every viewport >= 340px. */
.logo {
  width: min(100%, clamp(306px, 26vw, 380px));
  aspect-ratio: 1384 / 105;
  position: relative;
  overflow: hidden;
}
.logo img {
  position: absolute; display: block; height: auto; max-width: none;
  width: calc(1600 / 1384 * 100%);
  left: calc(-108 / 1384 * 100%);
  top: -143.81%;
}

.hero-title { margin-top: clamp(32px, 5vw, 64px); line-height: 1; }
.h1-main {
  display: block;
  font-weight: 900; letter-spacing: -.035em; line-height: 1;
  font-size: clamp(48px, 8.5vw, 112px);
}
.h1-claim {
  display: block; margin-top: .22em;
  font-weight: 700; letter-spacing: -.025em; line-height: 1.05;
  font-size: clamp(24px, 3.8vw, 48px);
}
.hero-lead {
  margin-top: clamp(14px, 2vw, 24px);
  max-width: 34ch;
  font-size: clamp(17px, 1.9vw, 24px); line-height: 1.3; letter-spacing: -.005em;
}

/* ---------- main: demo card overlaps the hero band ---------- */
.main {
  position: relative;
  margin-top: clamp(-96px, -7vw, -56px);
  padding-bottom: clamp(48px, 7vw, 96px);
  flex: 1 0 auto;
}
.main > #demos { display: grid; gap: clamp(24px, 4vw, 48px); }

.demo {
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(4, 0, 64, .18), 0 4px 14px rgba(4, 0, 64, .10);
}
/* 6px strip of the official gradient artwork */
.demo::before {
  content: ""; display: block; height: 6px;
  background: var(--midnight) url("../brand/gradient.png") 50% 18% / cover no-repeat;
}
.demo-body { padding: clamp(20px, 3.5vw, 40px); }

.eyebrow {
  display: inline-block;
  padding: 8px 16px; border-radius: 999px;
  background: var(--lightblue); color: var(--midnight);
  font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; line-height: 1.2;
}
.demo-title { margin-top: 14px; }
.product {
  display: block;
  font-weight: 900; letter-spacing: -.035em; line-height: 1.02;
  font-size: clamp(32px, 4.6vw, 56px);
}
.claim {
  display: block; margin-top: .4em;
  font-weight: 700; letter-spacing: -.02em; line-height: 1.15;
  font-size: clamp(19px, 2.4vw, 28px);
  color: var(--royal);
}
.demo-lead { margin-top: 16px; max-width: 62ch; color: var(--muted); font-size: clamp(16px, 1.6vw, 20px); line-height: 1.4; }

/* ---------- controls: language pills + subtitles switch ---------- */
.controls {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 28px;
  margin: clamp(20px, 2.6vw, 28px) 0 14px;
}
.lang { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lang-label {
  margin-right: 6px;
  font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.pill {
  appearance: none; -webkit-appearance: none;
  min-width: 56px; min-height: 44px; padding: 0 20px;
  border: 1px solid var(--control-line); border-radius: 999px;
  background: var(--white); color: var(--midnight);
  font: 700 15px/1 var(--font); letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.pill:hover { border-color: var(--midnight); background: var(--lightblue); }
.pill[aria-pressed="true"] {
  background: var(--midnight); border-color: var(--midnight); color: var(--white);
  box-shadow: inset 0 -3px 0 var(--orange);
  cursor: default;
}

.switch {
  appearance: none; -webkit-appearance: none;
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 0 6px 0 0;
  border: 0; border-radius: 999px; background: none; color: var(--midnight);
  font: 700 15px/1 var(--font); letter-spacing: .02em;
  cursor: pointer;
}
.switch-track {
  position: relative; flex: none;
  width: 44px; height: 24px;
  border: 2px solid var(--midnight); border-radius: 999px; background: var(--white);
  transition: background-color .15s ease;
}
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%; background: var(--midnight);
  transition: transform .15s ease, background-color .15s ease;
}
.switch[aria-checked="true"] .switch-track { background: var(--midnight); }
.switch[aria-checked="true"] .switch-track::after { transform: translateX(20px); background: var(--white); }
.switch-state { min-width: 3ch; font-weight: 400; color: var(--muted); }

/* ---------- player ---------- */
.player {
  position: relative;
  isolation: isolate;                 /* keeps video + blurred overlay inside the rounded corners */
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--midnight);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.player video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block; object-fit: contain;
  background: var(--midnight);
  border-radius: inherit;
}
video::cue {
  font-family: var(--font);
  color: #fff;
  background: rgba(4, 0, 64, .86);
}

/* graceful "video coming soon" state (source 404) */
.soon {
  position: absolute; inset: 0;
  display: grid; place-content: center; justify-items: center; gap: clamp(10px, 2vw, 20px);
  padding: 24px; text-align: center;
  border-radius: inherit;
  color: var(--white);
  background: rgba(4, 0, 64, .72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.soon-label {
  display: inline-block;
  padding: clamp(8px, 1.2vw, 12px) clamp(16px, 2vw, 26px); border-radius: 999px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .28);
  font-size: clamp(12px, 1.6vw, 20px); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; line-height: 1.2;
}
.soon-text { max-width: 30ch; font-size: clamp(15px, 2.1vw, 26px); line-height: 1.3; }
@media (prefers-reduced-motion: no-preference) {
  .soon { animation: soon-in .25s ease both; }
}
@keyframes soon-in { from { opacity: 0; } to { opacity: 1; } }

.noscript { padding: 24px; background: var(--white); border-radius: var(--radius); }

/* ---------- footer ---------- */
.footer {
  background: var(--midnight); color: var(--white);
  padding: 28px 0;
  font-size: 15px; letter-spacing: .02em;
}

@media (max-width: 560px) {
  .controls { gap: 4px 16px; }
  .lang { width: 100%; }
  .lang-label { width: 100%; margin: 0 0 2px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
