/*
 * 4U Italia Awareness Portal — public page
 *
 * Token system approved in WORKFLOW_STATE.md:
 *   navy  #124380  (brand, sampled from the real logo)
 *   red   #D8111E  (brand accent, sampled from the real logo)
 *   paper #FFFFFF / #F6F8FB, ink #1C2430, meta panel #EDF1F7
 *
 * Typography: Public Sans for titles/body, IBM Plex Mono only for the
 * technical metadata block. Both are self-hosted (see fonts.css) with a
 * system-font fallback stack; no external origin is ever contacted.
 */

@import url('/static/fonts.css');

:root {
  --navy: #124380;
  --navy-deep: #0d3263;
  --red: #d8111e;
  --paper: #ffffff;
  --paper-alt: #f6f8fb;
  --ink: #1c2430;
  --ink-soft: #4a5565;
  --meta: #edf1f7;
  --rule: #d4dde8;
  --grey: #8a95a5;

  --font-sans: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --measure: 720px;
  --step: 1.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-synthesis: none;
}

/* ---------- masthead ---------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--step);
  flex-wrap: wrap;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.75rem 1.5rem 1.25rem;
}

.masthead__logo {
  display: block;
  width: auto;
  height: 72px;
}

.masthead__context {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

/* ---------- sheet ---------- */

.sheet {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/*
 * The single bold move of the page: a two-line headline, first line navy,
 * second line red. Everything else stays typographically disciplined.
 */
.headline {
  margin: 0.5rem 0 2rem;
  font-size: clamp(1.875rem, 5.5vw, 2.875rem);
  line-height: 1.12;
  letter-spacing: -0.018em;
  font-weight: 700;
  text-wrap: balance;
}

.headline__line {
  display: block;
}

.headline__line--navy {
  color: var(--navy);
}

.headline__line--red {
  color: var(--red);
}

.prose p {
  margin: 0 0 1.15rem;
  max-width: 62ch;
}

.prose strong {
  font-weight: 650;
  color: var(--navy-deep);
}

/*
 * Security imperative, not a decorative eyebrow: left-aligned, lighter
 * weight than the headline, marked by a red rule rather than an icon.
 * Uppercase comes from the source text ("FERMATI. VERIFICA. SEGNALA.") and
 * is semantic here, so it is applied via text-transform while the DOM keeps
 * readable sentence case for screen readers.
 */
.imperative {
  margin: 2rem 0 2.75rem;
  padding-left: 1rem;
  border-left: 3px solid var(--red);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy-deep);
}

/*
 * Condensed restatement of the tracking disclosure, shown above the video
 * so it cannot be missed before playback starts. The full version (with
 * the privacy policy link and live session metadata) stays further down
 * in `.notice` — this is intentionally short and does not duplicate that
 * level of detail.
 */
.track-alert {
  margin: 0 0 2.25rem;
  padding: 1rem 1.25rem;
  background: var(--paper-alt);
  border-left: 3px solid var(--red);
  font-size: 0.9375rem;
  color: var(--ink);
}

.track-alert strong {
  font-weight: 650;
  color: var(--navy-deep);
}

/* ---------- player ---------- */

.player {
  margin: 0 0 2.5rem;
}

.player__heading {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.player__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--rule);
  overflow: hidden;
}

.player__video {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
}

.player__overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  border: 0;
  background: rgba(18, 67, 128, 0.42);
  cursor: pointer;
  transition: background 120ms ease;
}

.player__overlay:hover {
  background: rgba(18, 67, 128, 0.52);
}

.player__overlay[hidden] {
  display: none;
}

.player__overlay-icon {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 18px 0 18px 30px;
  border-color: transparent transparent transparent #fff;
}

.player__bar {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex-wrap: wrap;
  padding: 0.875rem 1rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 0;
}

.ctrl {
  flex: 0 0 auto;
  min-height: 2.25rem;
  padding: 0.375rem 0.875rem;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 550;
  color: var(--navy);
  background: var(--paper);
  border: 1px solid var(--navy);
  cursor: pointer;
}

.ctrl:hover:not(:disabled) {
  background: var(--meta);
}

.ctrl--primary {
  color: #fff;
  background: var(--navy);
}

.ctrl--primary:hover:not(:disabled) {
  background: var(--navy-deep);
}

.ctrl:disabled {
  color: var(--grey);
  border-color: var(--rule);
  background: var(--paper-alt);
  cursor: not-allowed;
}

.ctrl:focus-visible,
.volume__input:focus-visible,
.player__overlay:focus-visible,
a:focus-visible,
input:focus-visible,
button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* Read-only progress bar: no pointer affordance, it is not a slider. */
.progress {
  flex: 1 1 140px;
  min-width: 120px;
}

.progress__track {
  height: 6px;
  background: var(--rule);
  overflow: hidden;
}

.progress__fill {
  width: 0;
  height: 100%;
  background: var(--navy);
  transition: width 240ms linear;
}

.timecode {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.volume {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.volume__label {
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

.volume__input {
  width: 84px;
  accent-color: var(--navy);
}

.player__hint {
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.status {
  margin: 0.75rem 0 0;
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  background: var(--meta);
  border-left: 3px solid var(--navy);
}

.status[data-tone='done'] {
  border-left-color: #16794a;
}

.status[data-tone='warn'] {
  border-left-color: var(--red);
}

/* ---------- notice ---------- */

.notice {
  padding: 1.5rem;
  background: var(--paper);
  border: 1px solid var(--rule);
}

.notice__heading {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.notice p {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
}

.notice a {
  color: var(--navy);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* Technical metadata block: the only place IBM Plex Mono is used. */
.meta {
  margin: 1.25rem 0 0;
  padding: 1rem;
  background: var(--meta);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.meta__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0;
}

.meta dt {
  color: var(--ink-soft);
}

.meta dd {
  margin: 0;
  font-weight: 500;
  color: var(--navy-deep);
  font-variant-numeric: tabular-nums;
}

/* ---------- footer ---------- */

.footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
  color: var(--grey);
}

.footer p {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
  }
}
