/* cinemaOS Journal: static article and hub pages generated by
   scripts/build-cinemaos-journal.mjs. Standalone: does not load the landing CSS. */

@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/SpaceGrotesk-Regular.otf") format("opentype");
  font-weight: 300 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/SpaceGrotesk-Bold.otf") format("opentype");
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --j-font: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --j-font-cjk: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Apple SD Gothic Neo", "Malgun Gothic", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --j-bg: #000;
  --j-text: #f4f3ef;
  --j-text-soft: #b1b1b8;
  --j-muted: #85858d;
  --j-line: rgba(255, 255, 255, .08);
  --j-line-strong: rgba(255, 255, 255, .16);
  --j-glass: rgba(255, 255, 255, .035);
  --j-glass-hover: rgba(255, 255, 255, .065);
  --j-red: #ff331a;
  --j-green: #39e56a;
  --j-green-hot: #64f18a;
  --j-green-ink: #09140b;
  --j-radius: 0;
  --j-gutter: clamp(16px, 4vw, 40px);
  --j-wide: 1180px;
  --j-measure: 68ch;
  --j-ease: cubic-bezier(.22, 1, .36, 1);
}

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

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

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

:lang(ja), :lang(ko), :lang(zh-Hans) { font-family: var(--j-font-cjk); }

::selection { background: rgba(255, 51, 26, .55); color: #fff; }

a { color: inherit; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--j-text);
  outline-offset: 3px;
  border-radius: 6px;
}

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

/* ---------------------------------------------------------------- header */

.j-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--j-line);
  background: rgba(0, 0, 0, .62);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  backdrop-filter: saturate(160%) blur(20px);
}

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

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

.j-header__sections { display: flex; gap: 18px; }
.j-header__section {
  position: relative;
  padding: 6px 0;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--j-text-soft);
}
.j-header__section:hover { color: #fff; }
.j-header__section[aria-current="page"] { color: #fff; }
.j-header__section[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--j-red);
}

.j-langs {
  flex: 1 1 260px;
  min-width: 0;
  margin-left: auto;
}
.j-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;
}
.j-langs ul::-webkit-scrollbar { display: none; }
.j-langs a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  font-size: 12.5px;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  color: var(--j-muted);
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}
.j-langs a:hover { color: #fff; }
.j-langs a[aria-current="true"] { color: #fff; border-color: var(--j-red); }

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

.j-main {
  max-width: var(--j-wide);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px) var(--j-gutter) clamp(56px, 8vw, 96px);
}

.j-crumbs { margin-bottom: clamp(20px, 4vw, 40px); }
.j-crumbs a, .j-text-link {
  font-size: 14px;
  text-decoration: none;
  color: var(--j-text-soft);
}
.j-crumbs a:hover, .j-text-link:hover { color: #fff; }

.j-eyebrow {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--j-text-soft);
}
.j-eyebrow a { text-decoration: none; }
.j-eyebrow a:hover { text-decoration: underline; text-underline-offset: 4px; }

h1, h2, h3 {
  font-weight: 500;
  letter-spacing: -.035em;
  overflow-wrap: break-word;
  text-wrap: balance;
}

/* ---------------------------------------------------------------- article */

.j-article { max-width: var(--j-measure); margin: 0 auto; }

.j-article__header { margin-bottom: clamp(32px, 6vw, 56px); }
.j-article__header h1 {
  margin: 0;
  font-size: clamp(34px, 5.4vw, 60px);
  line-height: 1.06;
  color: #fff;
}
.j-article__lede {
  margin: 22px 0 0;
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.55;
  color: var(--j-text-soft);
}
.j-article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--j-line);
  font-size: 13.5px;
  color: var(--j-muted);
}

.j-prose {
  font-size: 18px;
  line-height: 1.7;
  color: #dcdce0;
  overflow-wrap: break-word;
}
.j-prose > :first-child { margin-top: 0; }
.j-prose p, .j-prose ul, .j-prose ol, .j-prose blockquote { margin: 0 0 1.15em; }
.j-prose h2 {
  margin: 2.2em 0 .7em;
  font-size: clamp(25px, 3vw, 32px);
  line-height: 1.18;
  color: #fff;
  scroll-margin-top: 90px;
}
.j-prose h3 {
  margin: 1.8em 0 .5em;
  font-size: clamp(20px, 2.2vw, 23px);
  line-height: 1.3;
  color: #fff;
  scroll-margin-top: 90px;
}
.j-prose strong { font-weight: 700; color: #fff; }
.j-prose em { font-style: italic; }
.j-prose a {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 51, 26, .7);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  transition: text-decoration-color .2s ease;
}
.j-prose a:hover { text-decoration-color: var(--j-red); }
.j-prose ul, .j-prose ol { padding-left: 1.3em; }
.j-prose li { margin: .4em 0; padding-left: .2em; }
.j-prose li::marker { color: var(--j-muted); }
.j-prose ol li::marker { font-variant-numeric: tabular-nums; }
.j-prose blockquote {
  padding: 18px 22px;
  border: 1px solid var(--j-line);
  border-left: 2px solid var(--j-red);
  border-radius: 0;
  background: var(--j-glass);
  color: var(--j-text);
}
.j-prose blockquote p { margin: 0; }
.j-prose code {
  padding: .12em .4em;
  border: 1px solid var(--j-line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .06);
  font-family: inherit;
  font-size: .86em;
  overflow-wrap: anywhere;
}

/* CJK: no italics synthesis, taller lines, line breaking that respects words. */
:lang(ja) .j-prose, :lang(ko) .j-prose, :lang(zh-Hans) .j-prose {
  line-height: 1.9;
  letter-spacing: .01em;
}
:lang(ja) .j-prose em, :lang(zh-Hans) .j-prose em, :lang(ko) .j-prose em { font-style: normal; font-weight: 700; }
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3,
:lang(ko) h1, :lang(ko) h2, :lang(ko) h3,
:lang(zh-Hans) h1, :lang(zh-Hans) h2, :lang(zh-Hans) h3 { letter-spacing: 0; line-height: 1.35; }
:lang(ja), :lang(zh-Hans) { line-break: strict; }
:lang(ko) .j-prose, :lang(ko) h1, :lang(ko) h2, :lang(ko) h3 { word-break: keep-all; }

/* ---------------------------------------------------------------- CTA */

.j-cta {
  position: relative;
  max-width: var(--j-measure);
  margin: clamp(48px, 8vw, 80px) auto 0;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--j-line);
  border-radius: var(--j-radius);
  background: #0b0b0d;
}
.j-hub .j-cta { max-width: none; }
.j-cta h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.15;
  color: #fff;
}
.j-cta p { margin: 12px 0 0; color: var(--j-text-soft); }
.j-cta__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-top: 24px;
}
.j-cta__note { font-size: 13.5px; color: var(--j-muted); }

.j-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 56px;
  padding: 16px 28px;
  background: var(--j-green);
  color: var(--j-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, transform .3s var(--j-ease);
}
.j-download:hover { background: var(--j-green-hot); transform: translateY(-2px); }
.j-download:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--j-green-ink); }

/* ---------------------------------------------------------------- do this in cinemaOS
   The quiet box after an article's answer paragraph. */

.j-prose .j-doit {
  margin: 1.6em 0 1.9em;
  padding: 20px 22px 22px;
  border: 1px solid var(--j-line-strong);
  border-radius: 2px;
  background: var(--j-glass);
  font-size: 16px;
  line-height: 1.55;
}
.j-prose .j-doit p { margin: 0; }
.j-prose .j-doit .j-doit__title {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1.3;
  color: #fff;
}
.j-prose .j-doit .j-doit__line { margin-top: 6px; color: var(--j-text-soft); }
.j-prose .j-doit .j-doit__tutorial { margin-top: 10px; }
.j-prose .j-doit__tutorial a { overflow-wrap: anywhere; }
.j-doit__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 16px;
}
.j-prose .j-doit .j-download {
  color: var(--j-green-ink);
  text-decoration: none;
}
.j-download--compact {
  min-height: 46px;
  padding: 12px 22px;
  font-size: 16px;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.j-prose .j-doit .j-doit__more {
  color: var(--j-text-soft);
  font-size: 15px;
  text-decoration: none;
}
.j-prose .j-doit .j-doit__more:hover { color: #fff; }
:lang(ja) .j-doit, :lang(ko) .j-doit, :lang(zh-Hans) .j-doit { line-height: 1.75; }

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

.j-related { margin-top: clamp(56px, 8vw, 88px); }
.j-related > h2, .j-cluster > h2, .j-languages > h2 {
  margin: 0 0 20px;
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.2;
  color: #fff;
}

.j-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.j-card { min-width: 0; }
.j-card a {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 18px 0 20px;
  border: 0;
  border-top: 1px solid var(--j-line-strong);
  border-radius: 0;
  background: none;
  text-decoration: none;
  transition: border-color .25s ease;
}
.j-card a:hover { border-color: var(--j-red); }
.j-card a:hover .j-card__title { text-decoration: underline; text-decoration-color: var(--j-red); text-underline-offset: 4px; }
.j-card a:focus-visible { border-radius: var(--j-radius); }
.j-card__meta { font-size: 13px; color: var(--j-muted); }
.j-card__title {
  margin: 0;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -.02em;
  color: #fff;
}
.j-card__desc { font-size: 14.5px; line-height: 1.55; color: var(--j-text-soft); }

/* ---------------------------------------------------------------- hubs */

.j-hub__header { max-width: 820px; margin-bottom: clamp(40px, 7vw, 72px); }
.j-hub__header h1 {
  margin: 0;
  font-size: clamp(40px, 7vw, 84px);
  line-height: 1.02;
  letter-spacing: -.055em;
  color: #fff;
}
.j-hub__intro {
  margin: 22px 0 0;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.55;
  color: var(--j-text-soft);
}
.j-hub__count { margin: 14px 0 0; font-size: 15px; color: var(--j-muted); }

.j-cluster { margin-top: clamp(40px, 6vw, 64px); scroll-margin-top: 90px; }

.j-languages { margin-bottom: clamp(24px, 4vw, 40px); }
.j-language-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.j-language-grid a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--j-line);
  border-radius: 0;
  background: var(--j-glass);
  text-decoration: none;
  transition: background .25s ease, border-color .25s ease;
}
.j-language-grid a:hover { background: var(--j-glass-hover); border-color: var(--j-line-strong); }
.j-language-grid span { font-weight: 600; color: #fff; }
.j-language-grid small { font-size: 12.5px; color: var(--j-muted); }

.j-empty {
  max-width: var(--j-measure);
  padding: 24px;
  border: 1px solid var(--j-line);
  border-radius: var(--j-radius);
  background: var(--j-glass);
  color: var(--j-text-soft);
}
.j-empty p { margin: 0 0 12px; }
.j-empty p:last-child { margin: 0; }

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

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

/* ---------------------------------------------------------------- small screens */

@media (max-width: 640px) {
  .j-header__inner { min-height: 0; }
  .j-langs { flex-basis: 100%; margin-left: 0; }
  .j-langs ul { justify-content: flex-start; }
  .j-prose { font-size: 17px; }
  .j-card a { padding: 16px 0 18px; }
  .j-download { width: 100%; }
  .j-prose .j-doit { padding: 18px 16px 18px; }
  .j-doit__actions { justify-content: center; }
}

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

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