/* ==========================================================================
   The Idea Factory — XIME External Programmes
   Static HTML/CSS/JS conversion of the TanStack Start landing page.
   Brand system: Raleway, XIME red (#E80000), black, white.
   Signature motif: thin black bar + thin red bar (see .bar-motif / .bar-rule).
   ========================================================================== */

:root {
  --background: #ffffff;
  --foreground: #111113;            /* oklch(0.18 0.004 285) */
  --muted: #f4f4f4;                 /* oklch(0.968 0 0) */
  --muted-foreground: #636365;      /* oklch(0.5 0.004 285) */
  --border: #dedede;                /* oklch(0.9 0 0) */
  --input: #dedede;
  --primary: #e80000;               /* XIME red */
  --primary-foreground: #ffffff;
  --radius: 2px;
  --font-sans: "Raleway", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

* {
  margin: 0;
  padding: 0;
  border-color: var(--border);
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

h1, h2, h3, h4 {
  letter-spacing: -0.02em;
  font-weight: 800;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

input,
textarea {
  font: inherit;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ------------------------------ Utilities ------------------------------- */
.container {
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* Signature motif: thin black bar + thin red bar on the left edge */
.bar-motif {
  position: relative;
  padding-left: 1.25rem;
}

.bar-motif::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 3px;
  background: var(--foreground);
}

.bar-motif::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 0.15em;
  bottom: 0.15em;
  width: 3px;
  background: var(--primary);
}

/* Thin-bar rule (horizontal pairs of bars) */
.bar-rule {
  display: flex;
  gap: 4px;
}

.bar {
  display: block;
  height: 3px;
}

.bar-black { background: var(--foreground); }
.bar-red   { background: var(--primary); }
.bar-white { background: #ffffff; }

.w-16 { width: 4rem; }
.w-12 { width: 3rem; }
.w-8  { width: 2rem; }
.w-7  { width: 1.75rem; }

.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary);
}

.eyebrow--muted {
  color: var(--muted-foreground);
}

/* Red eyebrows directly on the muted (light-grey) section background get a
   hair darker red so 12px uppercase text meets AA contrast (>= 4.5:1). */
.section--muted .eyebrow.bar-motif {
  color: #d20000;
}

/* ------------------------------- Sections ------------------------------- */
.section {
  padding-block: 4rem;
}

.section--muted {
  background: var(--muted);
}

@media (min-width: 640px) {
  .section {
    padding-block: 5rem;
  }
}

[id] {
  scroll-margin-top: 5.5rem;
}

.section-title {
  margin-top: 1.25rem;
  max-width: 48rem;
  font-size: 1.875rem;
  line-height: 1.1;
}

@media (min-width: 640px) {
  .section-title {
    font-size: 2.25rem;
  }
}

.section-lead {
  margin-top: 1.25rem;
  max-width: 42rem;
  font-size: 1.125rem;
  color: var(--muted-foreground);
}

.note {
  margin-top: 2rem;
  border-left: 2px solid var(--primary);
  padding-left: 1.25rem;
  font-size: 1rem;
  font-weight: 600;
}

/* -------------------------------- Buttons ------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: var(--primary-foreground);
  border: 0;
  font-size: 0.875rem;
  font-weight: 700;
  transition: opacity 0.15s ease;
}

.btn:hover {
  opacity: 0.9;
}

.btn svg {
  flex: none;
  width: 1rem;
  height: 1rem;
}

/* -------------------------------- Header -------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-bar {
  padding-inline: 1.25rem;
  padding-top: 0;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand-xime {
  height: 2.75rem;
  width: auto;
}

.brand-divider {
  flex: none;
  width: 1px;
  height: 2rem;
  background: var(--border);
}

.brand-if {
  height: 1.75rem;
  width: auto;
}

@media (min-width: 640px) {
  .brand {
    gap: 1rem;
  }

  .brand-xime {
    height: 3.5rem;
  }

  .brand-divider {
    height: 2.5rem;
  }

  .brand-if {
    height: 2.25rem;
  }
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .nav-desktop {
    display: flex;
  }
}

.nav-desktop > a:not(.btn) {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted-foreground);
  transition: color 0.15s ease;
}

.nav-desktop > a:not(.btn):hover {
  color: var(--primary);
}

.btn--nav {
  padding: 0.5rem 1rem;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
}

.nav-toggle svg {
  width: 1.5rem;
  height: 1.5rem;
}

@media (min-width: 1024px) {
  .nav-toggle {
    display: none;
  }
}

.nav-mobile {
  border-top: 1px solid var(--border);
  padding: 0.5rem 1.25rem 1.5rem;
}

.nav-mobile > a:not(.btn) {
  display: block;
  padding-block: 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  font-weight: 600;
}

.nav-mobile .btn {
  width: 100%;
  margin-top: 1rem;
  padding-block: 0.75rem;
}

/* ----------------------------- Hero switch ------------------------------ */
.hero-switch {
  border-bottom: 1px solid var(--border);
  background: #fbfbfb;
}

.hero-switch-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding-block: 0.5rem;
}

.hero-switch-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(17, 17, 19, 0.5);
}

.switch-group {
  display: flex;
  gap: 0.25rem;
}

.switch-btn {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(17, 17, 19, 0.6);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.switch-btn:hover {
  color: var(--foreground);
}

.switch-btn.is-active {
  background: var(--primary);
  color: var(--primary-foreground);
}

/* ------------------------------ Hero: road ------------------------------ */
.road-grid {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .road-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.road-panel {
  position: relative;
  aspect-ratio: 3 / 2;
}

@media (min-width: 640px) {
  .road-panel {
    aspect-ratio: 16 / 9;
  }
}

.road-panel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.road-caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
}

.road-caption--dark {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.62) 50%, rgba(0, 0, 0, 0.45));
}

.road-caption--light {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.58) 50%, rgba(0, 0, 0, 0.45));
}

@media (min-width: 640px) {
  .road-caption {
    padding: 2rem;
  }
}

@media (min-width: 1024px) {
  .road-caption {
    padding: 2.5rem;
  }
}

.road-caption .bar-rule {
  margin-bottom: 1rem;
}

.road-headline {
  max-width: 28rem;
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.15;
}

@media (min-width: 640px) {
  .road-headline {
    font-size: 1.875rem;
  }
}

@media (min-width: 1024px) {
  .road-headline {
    font-size: 2.25rem;
  }
}

.road-center {
  padding-block: 2.5rem;
  text-align: center;
}

@media (min-width: 640px) {
  .road-center {
    padding-block: 3rem;
  }
}

.road-logo {
  width: auto;
  height: 3.5rem;
  margin: 1rem auto 0;
}

@media (min-width: 640px) {
  .road-logo {
    height: 4rem;
  }
}

.road-tagline {
  max-width: 36rem;
  margin: 2rem auto 0;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.15;
}

@media (min-width: 640px) {
  .road-tagline {
    font-size: 1.25rem;
  }
}

.road-center .btn {
  margin-top: 1.5rem;
}

/* --------------------------- Hero: messages ----------------------------- */
.hero-msgs {
  display: grid;
  align-items: center;
  gap: 2.5rem;
  padding-block: 4rem;
}

@media (min-width: 1024px) {
  .hero-msgs {
    grid-template-columns: 1fr 1fr;
    gap: 3.5rem;
    padding-block: 5rem;
  }
}

.msgs {
  position: relative;
  min-height: 13rem;
}

@media (min-width: 640px) {
  .msgs {
    min-height: 15rem;
  }
}

.msg {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
}

.msg.is-active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
}

.msg h1 {
  max-width: 36rem;
  font-size: 1.875rem;
  line-height: 1.1;
}

@media (min-width: 640px) {
  .msg h1 {
    font-size: 3rem;
  }
}

.msg .punch {
  margin-top: 1.25rem;
  color: var(--primary);
  font-size: 1.875rem;
  font-weight: 800;
  line-height: 1.1;
}

@media (min-width: 640px) {
  .msg .punch {
    font-size: 3rem;
    white-space: nowrap;
  }
}

.hero-note {
  max-width: 36rem;
  margin-top: 2rem;
  font-size: 1.125rem;
  font-weight: 500;
  color: rgba(17, 17, 19, 0.8);
}

.hero-cta {
  margin-top: 2rem;
}

.dots {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.dot {
  width: 2.5rem;
  height: 4px;
  padding: 0;
  background: rgba(17, 17, 19, 0.2);
  transition: background-color 0.2s ease;
}

.dot.is-active {
  background: var(--primary);
}

.hero-fig {
  position: relative;
}

.hero-fig > .bar-rule {
  position: absolute;
  top: -1rem;
  left: 0;
  z-index: 10;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-left: 4px solid var(--primary);
}

/* ------------------------------- Programme ------------------------------ */
.prog-grid {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}

@media (min-width: 1024px) {
  .prog-grid {
    grid-template-columns: 1.4fr 1fr;
  }
}

.prog-copy {
  font-size: 1.125rem;
  line-height: 1.625;
  color: var(--muted-foreground);
}

.prog-copy p + p {
  margin-top: 1.5rem;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-self: start;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.fact-cell {
  background: var(--background);
  padding: 1.25rem;
}

.fact-cell dd {
  margin-top: 0.5rem;
  font-size: 1.125rem;
  font-weight: 800;
}

/* ------------------------- Hairline card grids -------------------------- */
.outcomes-grid,
.personas-grid,
.journey-grid {
  display: grid;
  gap: 1px;
  background: var(--border);
  margin-top: 2.5rem;
}

.cell {
  background: var(--background);
  padding: 1.75rem;
}

.cell h3 {
  font-size: 1.25rem;
  line-height: 1.3;
}

.cell p {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.625;
  color: var(--muted-foreground);
}

@media (min-width: 640px) {
  .outcomes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .outcomes-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .personas-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .journey-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .journey-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.persona-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.875rem;
  font-weight: 800;
}

.persona p {
  margin-top: 1.25rem;
  font-size: 1rem;
  line-height: 1.625;
}

.phase-top {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.phase-n {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--primary);
}

.journey-grid .cell h3 {
  margin-top: 1rem;
}

/* --------------------------------- Quote -------------------------------- */
.quote {
  max-width: 48rem;
  margin-top: 2rem;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.25;
}

@media (min-width: 640px) {
  .quote {
    font-size: 2.25rem;
  }
}

.quote-sub {
  max-width: 36rem;
  margin-top: 2rem;
  font-size: 1rem;
  line-height: 1.625;
  color: var(--muted-foreground);
}

.quote-bottom {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

@media (min-width: 768px) {
  .quote-bottom {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.quote-batch {
  font-size: 1.5rem;
  font-weight: 800;
}

@media (min-width: 640px) {
  .quote-batch {
    font-size: 1.875rem;
  }
}

.quote-batch-sub {
  max-width: 36rem;
  margin-top: 0.75rem;
  font-size: 1rem;
  color: var(--muted-foreground);
}

/* ------------------------------- Partners ------------------------------- */
.partners-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  margin-top: 2.5rem;
  border-block: 1px solid var(--border);
  padding-block: 2.5rem;
}

.partners-logos img {
  width: auto;
  height: 4rem;
}

@media (min-width: 640px) {
  .partners-logos img {
    height: 5rem;
  }
}

.partners-grid {
  display: grid;
  gap: 2.5rem;
  margin-top: 3rem;
}

@media (min-width: 1024px) {
  .partners-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.partners-grid h3 {
  font-size: 1.25rem;
  line-height: 1.3;
}

.partners-grid p {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.625;
  color: var(--muted-foreground);
}

.partners-grid .role {
  color: var(--primary);
}

.partners-note {
  margin-top: 3rem;
  border-left: 2px solid var(--primary);
  padding-left: 1.25rem;
  font-size: 1rem;
  line-height: 1.625;
}

/* ---------------------------------- FAQ --------------------------------- */
.acc {
  max-width: 48rem;
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.acc-item {
  border-bottom: 1px solid var(--border);
}

.acc-heading {
  margin: 0;
}

.acc-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding-block: 1.25rem;
  text-align: left;
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.acc-icon {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  transition: transform 0.3s ease;
}

.acc-item.open .acc-icon {
  transform: rotate(180deg);
}

.acc-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}

.acc-item.open .acc-panel {
  grid-template-rows: 1fr;
}

.acc-panel-inner {
  overflow: hidden;
  min-height: 0;
}

.acc-body {
  max-width: 44rem;
  padding-bottom: 1.25rem;
  font-size: 1rem;
  line-height: 1.625;
  color: var(--muted-foreground);
}

/* --------------------------------- Apply -------------------------------- */
.apply-grid {
  display: grid;
  gap: 3rem;
}

@media (min-width: 1024px) {
  .apply-grid {
    grid-template-columns: 1fr 1.15fr;
  }
}

.apply-contact {
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.apply-contact p + p {
  margin-top: 0.25rem;
}

.apply-contact-title {
  font-weight: 800;
  color: var(--foreground);
}

.apply-card {
  background: var(--background);
  padding: 2rem;
}

.apply-form {
  display: grid;
  gap: 1.25rem;
}

.apply-form-title,
.apply-success-title {
  font-size: 1.5rem;
  font-weight: 800;
}

.apply-success-body {
  margin-top: 1rem;
  font-size: 1rem;
  line-height: 1.625;
  color: var(--muted-foreground);
}

.form-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
}

.field-input {
  width: 100%;
  margin-top: 0.5rem;
  background: var(--background);
  border: 1px solid var(--input);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--foreground);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field-input::placeholder {
  color: var(--muted-foreground);
}

.field-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

textarea.field-input {
  resize: vertical;
  line-height: 1.5;
}

.btn--submit {
  width: 100%;
  padding-block: 0.75rem;
}

.fee-note {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* -------------------------------- Footer -------------------------------- */
.site-footer {
  background: var(--background);
  border-top: 1px solid var(--border);
}

.footer-top {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-block: 3rem;
}

@media (min-width: 640px) {
  .footer-top {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
}

.footer-logos {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-xime {
  width: auto;
  height: 3rem;
}

.footer-divider {
  width: 1px;
  height: 2rem;
  background: var(--border);
}

.footer-if {
  width: auto;
  height: 2rem;
}

.footer-blurb {
  max-width: 24rem;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 2.5rem;
  font-size: 0.875rem;
}

.footer-links a {
  color: var(--muted-foreground);
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
  padding-block: 1.5rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* --------------------------------- Toast -------------------------------- */
.toast-root {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  max-width: 22rem;
  padding: 0.75rem 1rem;
  background: #262626;
  color: #ededed;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  font-size: 0.875rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast svg {
  flex: none;
  width: 1rem;
  height: 1rem;
  margin-top: 0.125rem;
  color: #4ade80;
}

/* --------------------------- Reduced motion ----------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
