/* Palette sampled from the two logos */
:root {
  --meritas-teal: #185353;
  --intellek-indigo: #3952B0;
  --intellek-sky: #45B6FF;
  --ink: #15302F;
  --ink-muted: #4A5F60;
  --line: #C9D6D6;
  --mist: #EEF3F3;
  --paper: #FFFFFF;
  --error: #B42318;

  --font: "Schibsted Grotesk", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --measure: 34rem;
  --page: 70rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

[hidden] { display: none !important; }

h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }

:focus-visible {
  outline: 3px solid var(--intellek-sky);
  outline-offset: 3px;
}

/* ---------- Brand bar: both logos, equal weight ---------- */
.brand-bar {
  background: var(--paper);
  padding: 1.25rem var(--gutter);
}

.brand-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.25rem, 4vw, 2.75rem);
}

.logo { width: auto; }
/* Heights tuned so both marks read at the same visual size */
.logo-meritas  { height: clamp(26px, 5vw, 36px); }
.logo-intellek { height: clamp(42px, 8vw, 60px); }

.brand-rule {
  width: 1.5px;
  align-self: stretch;
  min-height: 2.5rem;
  background: var(--line);
}

/* ---------- Hero: the two brand colours meet at the centre ---------- */
.hero {
  color: var(--paper);
  background: linear-gradient(90deg, var(--meritas-teal) 0 50%, var(--intellek-indigo) 50% 100%);
  padding: clamp(3rem, 8vw, 5.5rem) var(--gutter);
}

.hero-inner {
  max-width: var(--page);
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.1rem, 5.4vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  max-width: 20ch;
  margin: 0 auto;
  text-wrap: balance;
}

.hero-lede {
  font-size: clamp(1.0625rem, 1.8vw, 1.25rem);
  max-width: var(--measure);
  margin: 1.25rem auto 0;
  opacity: 0.92;
  text-wrap: pretty;
}

/* ---------- Main content ---------- */
.content {
  flex: 1;
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter);
}

h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.015em;
}

/* Access form */
.gate {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}

@media (min-width: 52rem) {
  .gate { grid-template-columns: 1fr minmax(20rem, 26rem); gap: 4rem; }
}

.gate-copy { max-width: var(--measure); }
.gate-copy p { margin-top: 0.875rem; color: var(--ink-muted); }
.gate-copy .gate-help { font-size: 0.9375rem; }

.gate-form {
  border-top: 4px solid var(--meritas-teal);
  border-image: linear-gradient(90deg, var(--meritas-teal) 0 50%, var(--intellek-indigo) 50% 100%) 1;
  background: var(--mist);
  padding: 1.75rem;
  display: grid;
  gap: 1.25rem;
}

.field { display: grid; gap: 0.375rem; }

label { font-weight: 600; font-size: 0.9375rem; }

input {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid #9DB2B2;
  border-radius: 6px;
  min-height: 3rem;
  padding: 0.625rem 0.875rem;
  width: 100%;
}

input:focus-visible { outline-offset: 1px; border-color: var(--intellek-indigo); }
input[aria-invalid="true"] { border-color: var(--error); }

.field-error, .form-error {
  color: var(--error);
  font-size: 0.875rem;
  font-weight: 500;
}
.field-error:empty, .form-error:empty { display: none; }

.btn {
  font: inherit;
  font-weight: 600;
  color: var(--paper);
  background: var(--intellek-indigo);
  border: 0;
  border-radius: 6px;
  min-height: 3.125rem;
  padding: 0 1.5rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.btn:hover { background: var(--meritas-teal); }
.btn[disabled] { cursor: progress; opacity: 0.75; }

/* Video library */
.library-head { max-width: var(--measure); margin-bottom: 2.25rem; }
.library-head p { margin-top: 0.625rem; color: var(--ink-muted); }
.library-head h2:focus { outline: none; }

.video-grid {
  display: grid;
  gap: 2.75rem 2rem;
}
@media (min-width: 48rem) {
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--ink);
  border-radius: 8px;
  overflow: hidden;
}

.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.video-missing {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.75rem;
  background: var(--mist);
  color: var(--ink-muted);
  font-weight: 500;
  text-align: center;
  padding: 1rem;
}
.video-missing[hidden] { display: none; }

.video-launch {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.625rem;
  padding: 1rem;
  background: linear-gradient(90deg, var(--meritas-teal) 0 50%, var(--intellek-indigo) 50% 100%);
}

.btn-launch {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
}
.btn-launch:hover { background: var(--mist); }

.launch-note {
  color: var(--paper);
  font-size: 0.875rem;
  opacity: 0.9;
}

.video-title {
  margin-top: 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.video-desc {
  margin-top: 0.375rem;
  color: var(--ink-muted);
  max-width: var(--measure);
}

/* Reveal after access is granted: one moment of motion */
.library.is-entering { animation: reveal 0.45s ease-out both; }
@keyframes reveal {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem var(--gutter);
  text-align: center;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

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