/* cinemaOS Learn: the hub generated by scripts/build-cinemaos-tutorials.mjs
   (search, tutorial cards grouped by track, Journal cards grouped by cluster).
   Standalone: does not load the landing CSS or tutorials.css, but shares their
   language (black, ivory, Space Grotesk, hairlines, sentence case). */

@font-face {
  font-family: "Space Grotesk";
  src: url("/cinemaos-release/assets/fonts/SpaceGrotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --t-font: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --t-bg: #000;
  --t-ivory: #f4f3ef;
  --t-text-soft: #b1b1b8;
  --t-muted: #85858d;
  --t-line: rgba(244, 243, 239, .09);
  --t-card-line: rgba(244, 243, 239, .14);
  --t-card-line-hover: rgba(244, 243, 239, .4);
  --t-line-strong: rgba(244, 243, 239, .2);
  --t-red: #cc0000;
  --t-green: #39e56a;
  --t-green-hot: #64f18a;
  --t-green-ink: #09140b;
  --t-gutter: clamp(16px, 4vw, 40px);
  --t-wide: 1180px;
  --t-ease: cubic-bezier(.22, 1, .36, 1);
  --t-open: .42s;
}

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

html {
  background: var(--t-bg);
  color: var(--t-ivory);
  font-family: var(--t-font);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: clip;
  background: var(--t-bg);
  color: var(--t-ivory);
  font-size: 16px;
  line-height: 1.6;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(244, 243, 239, .25); color: #fff; }

a { color: inherit; }
img, video { display: block; max-width: 100%; height: auto; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--t-ivory);
  outline-offset: 3px;
}

.t-skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--t-ivory);
  color: #000;
  font-weight: 600;
  text-decoration: none;
}
.t-skip:focus-visible { top: 12px; }

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

/* ---------------------------------------------------------------- rail */

.t-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--t-line);
  background: rgba(0, 0, 0, .82);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.t-header__inner {
  display: flex;
  align-items: center;
  gap: 8px 28px;
  max-width: var(--t-wide);
  min-height: 60px;
  margin: 0 auto;
  padding: 10px var(--t-gutter);
}

.t-wordmark {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1;
  text-decoration: none;
  color: #fff;
}
.t-wordmark span { color: var(--t-red); }

.t-header__nav {
  display: flex;
  gap: 22px;
}
.t-header__nav a {
  padding: 6px 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -.01em;
  text-decoration: none;
  color: var(--t-text-soft);
  transition: color .2s ease;
}
.t-header__nav a:hover { color: #fff; }
.t-header__nav a[aria-current="page"] { color: #fff; }

.t-header__cta {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid var(--t-line-strong);
  border-radius: 2px;
  color: var(--t-ivory);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: border-color .2s ease;
}
.t-header__cta:hover { border-color: var(--t-card-line-hover); color: #fff; }

/* Language switcher (same pattern as the Journal rail): native names, the current one underlined in red. */
.t-langs {
  flex: 1 1 260px;
  min-width: 0;
  margin-left: auto;
}
.t-langs ul {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  margin: 0;
  padding: 2px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.t-langs ul::-webkit-scrollbar { display: none; }
.t-langs a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-bottom: 1px solid transparent;
  font-size: 12.5px;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  color: var(--t-muted);
  transition: color .2s ease;
}
.t-langs a:hover { color: #fff; }
.t-langs a[aria-current="true"] { color: #fff; border-color: var(--t-red); }
.t-langs + .t-header__cta { margin-left: 0; }
@media (max-width: 640px) {
  .t-header__inner { flex-wrap: wrap; }
  .t-langs { order: 3; flex-basis: 100%; margin-left: 0; }
  .t-langs ul { justify-content: flex-start; padding-left: 0; }
  .t-langs li:first-child a { padding-left: 0; }
}

/* ---------------------------------------------------------------- layout */

.t-main {
  max-width: var(--t-wide);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 80px) var(--t-gutter) clamp(56px, 8vw, 96px);
}

h1, h2, h3, h4 { margin: 0; color: #fff; font-weight: 600; }

/* ---------------------------------------------------------------- head */

.l-head { max-width: 720px; }
.l-head h1 {
  font-size: clamp(36px, 4.6vw, 56px);
  line-height: 1.05;
  letter-spacing: -.045em;
  color: var(--t-ivory);
}
.l-head__lede {
  max-width: 52ch;
  margin: 14px 0 0;
  font-size: clamp(17px, 1.6vw, 19px);
  line-height: 1.5;
  color: var(--t-text-soft);
}

/* ---------------------------------------------------------------- search */

.l-find { margin: clamp(32px, 4vw, 48px) 0 0; }

.l-search { margin: 0; }
.l-search__input {
  display: block;
  width: 100%;
  margin: 0;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--t-line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--t-ivory);
  font-family: var(--t-font);
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1.3;
  caret-color: var(--t-ivory);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .2s ease;
}
.l-search__input::placeholder { color: var(--t-muted); opacity: 1; }
.l-search__input:focus,
.l-search__input:focus-visible { outline: none; border-bottom-color: var(--t-ivory); }
.l-search__input::-webkit-search-decoration,
.l-search__input::-webkit-search-cancel-button,
.l-search__input::-webkit-search-results-button,
.l-search__input::-webkit-search-results-decoration { -webkit-appearance: none; appearance: none; display: none; }

.l-results { margin-top: 8px; }
.l-results[hidden] { display: none; }
.l-results__group { margin-top: 24px; }
.l-results__group h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--t-muted);
}
.l-results__list { margin: 0; padding: 0; list-style: none; }
.l-results__list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--t-line);
  color: var(--t-ivory);
  text-decoration: none;
}
.l-results__list a:focus-visible { outline-offset: 2px; }
.l-results__title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.02em;
  color: #fff;
}
.l-results__list a:hover .l-results__title { text-decoration: underline; text-decoration-color: var(--t-line-strong); text-underline-offset: 4px; }
.l-results__meta {
  grid-column: 2;
  grid-row: 1;
  font-size: 14px;
  color: var(--t-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.l-results__desc {
  grid-column: 1 / -1;
  display: -webkit-box;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.5;
  color: var(--t-text-soft);
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.l-results__empty {
  margin: 20px 0 0;
  font-size: 17px;
  line-height: 1.5;
  color: var(--t-text-soft);
}
.l-results__empty b { color: #fff; font-weight: 600; }
.l-results mark {
  background: rgba(244, 243, 239, .14);
  color: #fff;
}

/* ---------------------------------------------------------------- blocks */

.l-block { margin-top: clamp(64px, 8vw, 112px); }
.l-block__head { max-width: 680px; margin-bottom: clamp(8px, 1vw, 16px); }
.l-block__head h2 {
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.1;
  letter-spacing: -.04em;
  color: var(--t-ivory);
}
.l-block__intro {
  margin: 12px 0 0;
  font-size: 17px;
  line-height: 1.55;
  color: var(--t-text-soft);
}
.l-block__intro a {
  color: var(--t-ivory);
  text-decoration: underline;
  text-decoration-color: var(--t-line-strong);
  text-underline-offset: 4px;
}
.l-block__intro a:hover { text-decoration-color: var(--t-ivory); }

.l-group { margin-top: clamp(36px, 4vw, 56px); }
.l-group__title {
  margin: 0 0 18px;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -.02em;
  color: var(--t-ivory);
}

/* ---------------------------------------------------------------- tutorial cards */

.l-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.l-card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--t-card-line);
  border-radius: 2px;
  background: #000;
  scroll-margin-top: 84px;
  transition: border-color .2s ease;
}
.l-card:hover, .l-card:focus-within { border-color: var(--t-card-line-hover); }

.l-card__summary { position: relative; }
.l-card__poster { display: block; }
.l-card__poster img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #050505;
  border-bottom: 1px solid var(--t-line);
}
/* No caption under the poster: the thumbnail carries the title. The heading stays
   for the outline and screen readers, and shows once the card is open. */
.l-card__title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -.025em;
  color: #fff;
}
.l-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--t-muted);
  font-variant-numeric: tabular-nums;
}

/* The cue and the toggle only exist once learn.js is running. */
.l-card__cue { display: none; color: var(--t-text-soft); transition: color .2s ease; }
.l-card__cue-close { display: none; }
.l-cards.is-ready .l-card__cue { display: inline; }
.l-card:hover .l-card__cue { color: #fff; }

.l-card__toggle {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.l-card__toggle[hidden] { display: none; }
.l-card__toggle:focus-visible { outline: 2px solid var(--t-ivory); outline-offset: -2px; }

/* Open: the card takes the whole row, the poster gives way to the player. */
.l-card.is-open { grid-column: 1 / -1; }
.l-card.is-open .l-card__poster { display: none; }
.l-card.is-open .l-card__title {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  padding: 22px 24px 20px;
  overflow: visible;
  clip: auto;
  white-space: normal;
  font-size: clamp(22px, 2.2vw, 28px);
  letter-spacing: -.035em;
}
.l-card.is-open .l-card__cue-open { display: none; }
.l-card.is-open .l-card__cue-close { display: inline; }

.l-card__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--t-open) var(--t-ease);
}
.l-card__panel[hidden] { display: none; }
.l-card.is-expanded .l-card__panel { grid-template-rows: 1fr; }
.l-card__panel-inner { min-height: 0; overflow: hidden; }
.l-card__panel-body {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 28px;
  padding: 0 24px 24px;
}

.l-card__player video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #050505;
  border: 1px solid var(--t-line);
}

.l-card__aside { display: flex; flex-direction: column; min-width: 0; }
.l-card__steps-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--t-muted);
}
.l-card__steps {
  margin: 0;
  padding-left: 1.25em;
  font-size: 15px;
  line-height: 1.55;
  color: var(--t-text-soft);
}
.l-card__steps li { margin: 0 0 .65em; padding-left: .2em; }
.l-card__steps li::marker { color: var(--t-muted); font-variant-numeric: tabular-nums; }
.l-card__steps strong { color: #fff; font-weight: 600; }
.l-card__steps a { color: var(--t-ivory); text-underline-offset: 3px; }
.l-card__more {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--t-ivory);
  text-decoration: underline;
  text-decoration-color: var(--t-line-strong);
  text-underline-offset: 4px;
}
.l-card__more:hover { text-decoration-color: var(--t-ivory); }

/* ---------------------------------------------------------------- journal cards */

.l-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.l-note { min-width: 0; }
.l-note a {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 18px 20px 18px;
  border: 1px solid var(--t-card-line);
  border-radius: 2px;
  color: inherit;
  text-decoration: none;
  transition: border-color .2s ease;
}
.l-note a:hover { border-color: var(--t-card-line-hover); }
.l-note__title {
  font-size: 16.5px;
  line-height: 1.3;
  letter-spacing: -.02em;
}
.l-note__desc {
  display: -webkit-box;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
  color: var(--t-text-soft);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.l-note__meta {
  margin-top: auto;
  padding-top: 4px;
  font-size: 13.5px;
  color: var(--t-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- cta */

.t-cta {
  margin-top: clamp(72px, 9vw, 120px);
  padding: clamp(28px, 4vw, 44px) 0 0;
  border-top: 1px solid var(--t-line);
}
.t-cta h2 {
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.1;
  letter-spacing: -.04em;
}
.t-cta p {
  max-width: 56ch;
  margin: 12px 0 24px;
  font-size: 17px;
  color: var(--t-text-soft);
}
.t-cta__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.t-cta__note { font-size: 14px; color: var(--t-muted); }

.t-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 56px;
  padding: 16px 28px;
  background: var(--t-green);
  color: var(--t-green-ink);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  transition: background .22s ease;
}
.t-download:hover { background: var(--t-green-hot); }
.t-download:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--t-green-ink); }

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

.t-footer { border-top: 1px solid var(--t-line); }
.t-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  max-width: var(--t-wide);
  margin: 0 auto;
  padding: 28px var(--t-gutter) 36px;
  font-size: 14px;
  color: var(--t-muted);
}
.t-footer p { margin: 0; }
.t-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.t-footer a { text-decoration: none; color: var(--t-text-soft); }
.t-footer a:hover { color: #fff; }

/* ---------------------------------------------------------------- smaller screens */

@media (max-width: 1000px) {
  .l-cards, .l-notes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .l-card__panel-body { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 640px) {
  .t-header__inner { gap: 8px 16px; }
  .t-header__nav { gap: 16px; }
  .t-header__nav a { font-size: 14.5px; }
  .t-header__cta { display: none; }
  .t-download { width: 100%; }
  .l-cards, .l-notes { grid-template-columns: 1fr; }
  .l-cards { gap: 20px; }
  .l-card.is-open .l-card__title { padding: 18px 16px 16px; }
  .l-card__panel-body { padding: 0 16px 18px; }
  .l-results__list a { grid-template-columns: 1fr; }
  .l-results__meta { grid-column: 1; grid-row: auto; }
}

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

@media (prefers-reduced-transparency: reduce) {
  .t-header { background: #000; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---------------------------------------------------------------- featured */

.l-featured {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(24px, 3.4vw, 48px);
  align-items: start;
  margin: clamp(40px, 5vw, 64px) 0 0;
  padding: clamp(20px, 2.4vw, 28px);
  border: 1px solid var(--t-line);
  border-radius: 2px;
  background: #070707;
}
.l-featured__player { position: relative; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--t-line); }
.l-featured__player video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.l-featured__label { margin: 0 0 10px; font-size: 14px; color: var(--t-text-soft); }
.l-featured h2 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.1; letter-spacing: -.035em; }
.l-featured h2 a { color: var(--t-ivory); text-decoration: none; }
.l-featured h2 a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.l-featured__desc { margin: 12px 0 0; font-size: 16px; line-height: 1.55; color: var(--t-text-soft); }
.l-featured__meta { margin: 10px 0 0; font-size: 14px; color: var(--t-text-soft); font-variant-numeric: tabular-nums; }
.l-featured__steps { margin: 20px 0 0; padding: 0 0 0 1.2em; display: grid; gap: 8px; font-size: 15px; line-height: 1.5; color: var(--t-ivory); }
.l-featured__steps li::marker { color: var(--t-text-soft); }
.l-featured__more { display: inline-block; margin-top: 22px; color: var(--t-ivory); font-size: 15px; text-underline-offset: 4px; }
@media (max-width: 900px) {
  .l-featured { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- compact pass
 * Title and one line per item, small posters, no boxes around cards, tight rhythm. */
.l-main { padding-top: clamp(28px, 3vw, 44px); }
.l-head h1 { font-size: clamp(30px, 3.2vw, 40px); }
.l-head__lede { margin-top: 8px; font-size: 16px; }
.l-find { margin-top: 20px; }
.l-search__input { padding: 10px 0; font-size: 17px; }

.l-featured { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: center; margin-top: 32px; padding: 0; border: 0; background: none; }
.l-featured__player { border: 0; border-radius: 4px; overflow: hidden; }
.l-featured__label { margin: 0 0 6px; font-size: 13px; }
.l-featured h2 { font-size: clamp(22px, 2.2vw, 28px); }
.l-featured__desc { margin-top: 8px; font-size: 15px; }
.l-featured__more { margin-top: 14px; font-size: 14px; }

.l-block { margin-top: 48px; }
.l-block__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; max-width: none; margin-bottom: 0; }
.l-block__head h2 { font-size: clamp(22px, 2vw, 26px); }
.l-block__link { margin: 0; font-size: 14px; }
.l-block__link a { color: var(--t-text-soft); text-underline-offset: 3px; }
.l-block__link a:hover { color: var(--t-ivory); }
.l-group { margin-top: 24px; }
.l-group__title { margin: 0 0 12px; font-size: 14px; font-weight: 500; color: var(--t-text-soft); letter-spacing: 0; }

.l-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 16px; }
.l-card { border: 0; background: none; }
.l-card:hover, .l-card:focus-within { border-color: transparent; }
.l-card__poster img { border: 0; border-radius: 4px; transition: opacity .2s ease; }
.l-card:hover .l-card__poster img { opacity: .82; }
.l-card.is-open .l-card__title { padding: 0 0 10px; }
.l-card.is-open { padding-top: 4px; border-top: 1px solid var(--t-line); }

.l-notes { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 24px; }
.l-note a { gap: 2px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--t-line); border-radius: 0; }
.l-note a:hover { border-color: var(--t-line-strong); }
.l-note__title { font-size: 15px; }
.l-note__desc { font-size: 13px; -webkit-line-clamp: 1; }

@media (max-width: 900px) { .l-featured { grid-template-columns: 1fr; } }
/* Tutorial grid: 3 per row on desktop, 2 on tablets, 1 on phones. */
@media (max-width: 1000px) { .l-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 519.98px) { .l-cards { grid-template-columns: 1fr; gap: 16px; } }
