/* cinemaOS Tutorials: the tutorial pages generated by
   scripts/build-cinemaos-tutorials.mjs. Standalone: does not load the landing CSS,
   but follows its visual 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-measure: 68ch;
}

*, *::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; }

/* ---------------------------------------------------------------- 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(24px, 5vw, 56px) var(--t-gutter) clamp(56px, 8vw, 96px);
}

.t-crumbs {
  display: flex;
  gap: 10px;
  margin-bottom: clamp(24px, 4vw, 44px);
  font-size: 14.5px;
  color: var(--t-muted);
}
.t-crumbs a {
  text-decoration: none;
  color: var(--t-text-soft);
}
.t-crumbs a:hover { color: #fff; }

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

/* ---------------------------------------------------------------- tutorial page */

.t-tutorial__header { max-width: 820px; }
.t-tutorial__header h1 {
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.08;
  letter-spacing: -.045em;
}
.t-tutorial__lede {
  max-width: 64ch;
  margin: 16px 0 0;
  font-size: clamp(17px, 1.8vw, 19px);
  line-height: 1.55;
  color: var(--t-text-soft);
}
.t-tutorial__meta {
  margin: 10px 0 0;
  font-size: 15px;
  color: var(--t-muted);
  font-variant-numeric: tabular-nums;
}

.t-player { margin: clamp(28px, 4vw, 44px) 0 0; }
.t-player video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #050505;
  border: 1px solid var(--t-line);
  border-radius: 2px;
}
.t-player video p { padding: 16px; }
.t-player__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 12px 0 0;
  font-size: 14px;
}
.t-player__links a {
  text-decoration: none;
  color: var(--t-text-soft);
}
.t-player__links a:hover { color: #fff; }

.t-path { margin-top: clamp(32px, 5vw, 48px); }
.t-path h2, .t-prose h2, .t-related > h2 {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.025em;
  color: var(--t-ivory);
}
.t-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 0;
  margin: 0;
  padding: 14px 0;
  list-style: none;
  border-top: 1px solid var(--t-line);
  border-bottom: 1px solid var(--t-line);
}
.t-chips li {
  font-size: 15.5px;
  font-weight: 500;
  letter-spacing: -.01em;
  color: #fff;
}
.t-chips li + li::before {
  content: "\203A";
  margin: 0 12px;
  color: var(--t-muted);
}

.t-prose {
  max-width: var(--t-measure);
  margin-top: clamp(32px, 5vw, 48px);
  font-size: 17px;
  line-height: 1.65;
  color: var(--t-ivory);
}
.t-prose p { margin: 0 0 1.1em; }
.t-prose h2 { margin-top: 2em; }
.t-prose h3 {
  margin: 1.6em 0 .5em;
  font-size: 19px;
  letter-spacing: -.02em;
}
.t-prose ol, .t-prose ul { margin: 0 0 1.2em; padding-left: 1.3em; }
.t-prose li { margin: 0 0 .7em; padding-left: .25em; }
.t-prose ol li::marker { color: var(--t-muted); font-variant-numeric: tabular-nums; }
.t-prose ul li::marker { color: var(--t-muted); }
.t-prose strong { color: #fff; font-weight: 600; }
.t-prose a { color: #fff; text-decoration: underline; text-decoration-color: var(--t-line-strong); text-underline-offset: 3px; }
.t-prose a:hover { text-decoration-color: #fff; }
.t-prose code {
  padding: .1em .35em;
  background: rgba(255, 255, 255, .07);
  border-radius: 2px;
  font-family: inherit;
  font-size: .95em;
}
.t-prose blockquote {
  margin: 1.4em 0;
  padding: 0 0 0 18px;
  border-left: 1px solid var(--t-line-strong);
  color: var(--t-text-soft);
}

.t-credit {
  max-width: var(--t-measure);
  margin: 1.5em 0 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--t-muted);
}
.t-credit a { color: var(--t-text-soft); text-decoration: none; }
.t-credit a:hover { color: #fff; }

/* ---------------------------------------------------------------- pager */

.t-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: clamp(40px, 6vw, 64px);
}
.t-pager__link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 20px;
  border: 1px solid var(--t-card-line);
  border-radius: 2px;
  text-decoration: none;
  transition: border-color .2s ease;
}
.t-pager__link:hover { border-color: var(--t-card-line-hover); }
.t-pager__link small {
  font-size: 14px;
  color: var(--t-muted);
}
.t-pager__link span { font-size: 17px; font-weight: 600; letter-spacing: -.02em; color: #fff; }
.t-pager__next { text-align: right; }

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

.t-cta {
  margin-top: clamp(56px, 8vw, 96px);
  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); }

/* ---------------------------------------------------------------- more tutorials */

.t-related { margin-top: clamp(56px, 8vw, 96px); }
.t-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.t-card { min-width: 0; }
.t-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--t-card-line);
  border-radius: 2px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: border-color .2s ease;
}
.t-card a:hover { border-color: var(--t-card-line-hover); }
.t-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #050505;
  border-bottom: 1px solid var(--t-line);
}
.t-card__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px 20px;
}
.t-card__title {
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -.025em;
}
.t-card__desc {
  display: -webkit-box;
  overflow: hidden;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--t-text-soft);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.t-card__meta {
  margin-top: auto;
  padding-top: 4px;
  font-size: 14px;
  color: var(--t-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- 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) {
  .t-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .t-cards .t-card:nth-child(3) { display: none; }
}

@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-prose { font-size: 16.5px; }
  .t-pager { grid-template-columns: 1fr; }
  .t-pager__next { text-align: left; }
  .t-download { width: 100%; }
  .t-cards { grid-template-columns: 1fr; }
  .t-cards .t-card:nth-child(3) { display: block; }
}

@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; }
}
