/* Hallmark · genre: atmospheric · macrostructure: Filmstrip · tone: ash-noir
 * theme: Noir · nav: N4 Split · footer: Ft3 Link columns
 * enrichment: real Steam app 1576240 screenshots · axes: dark / serif-display / oxide-red
 * pre-emit critique: P4 H4 E5 S5 R4 V5
 * Differs from Terminal/Bento/Brutal/Aurora/Midnight/Sport on: paper, accent, display, nav, footer, filmstrip
 */

@import url("./tokens.css");

html,
body {
  overflow-x: clip;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-ink);
  background:
    radial-gradient(ellipse 55% 42% at 0% 0%, oklch(28% 0.08 28 / 0.28), transparent 58%),
    radial-gradient(ellipse 40% 35% at 100% 20%, oklch(22% 0.04 70 / 0.2), transparent 55%),
    linear-gradient(180deg, var(--color-paper), oklch(10% 0.012 40));
  line-height: 1.7;
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  min-width: 0;
}
a {
  color: var(--color-accent);
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
.shell {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* N4 Split: brand left · links center · CTA right */
.site-nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  min-height: var(--nav-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-md);
  padding: 0 var(--space-lg);
  background: oklch(12% 0.015 40 / 0.92);
  border-bottom: var(--rule) solid var(--color-line);
  backdrop-filter: blur(10px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  justify-self: start;
}
.brand img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
}
.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  list-style: none;
  margin: 0;
  padding: 0;
  justify-self: center;
}
.nav-links a {
  color: var(--color-ink-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--color-accent);
}
.site-nav > .btn {
  justify-self: end;
}
.nav-toggle {
  display: none;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--color-line);
  background: transparent;
  color: var(--color-ink);
  cursor: pointer;
  font-family: var(--font-body);
  justify-self: end;
}
.nav-toggle:focus-visible,
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}
@media (max-width: 800px) {
  .site-nav {
    grid-template-columns: 1fr auto auto;
  }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
  }
  .site-nav > .btn {
    display: none;
  }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    background: var(--color-paper-2);
    border-bottom: 1px solid var(--color-line);
  }
  .nav-links.is-open {
    display: flex;
  }
  .nav-links a {
    padding: 12px var(--space-lg);
    border-top: 1px solid var(--color-line);
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.65rem 1.15rem;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform var(--dur-fast) var(--ease-out),
    background var(--dur-med) var(--ease-out),
    box-shadow var(--dur-med) var(--ease-out),
    border-color var(--dur-med) var(--ease-out);
}
.btn-primary {
  color: oklch(98% 0.01 80);
  background: var(--color-accent);
  box-shadow: 0 8px 24px oklch(40% 0.12 28 / 0.28);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px oklch(40% 0.14 28 / 0.38);
}
.btn-secondary {
  color: var(--color-ink);
  background: transparent;
  border-color: var(--color-line);
}
.btn-secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: oklch(22% 0.03 28 / 0.35);
}
.btn-ghost {
  border-color: transparent;
  color: var(--color-ink-muted);
  text-decoration: underline;
  font-weight: 500;
}

/* Filmstrip hero */
.film-hero {
  position: relative;
  min-height: min(92vh, 780px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: var(--nav-h);
  isolation: isolate;
}
.film-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.film-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.05);
}
.film-hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, oklch(12% 0.015 40 / 0.55) 0%, oklch(10% 0.015 40 / 0.35) 40%, oklch(10% 0.015 40 / 0.92) 100%),
    linear-gradient(90deg, oklch(10% 0.02 40 / 0.55), transparent 45%);
}
.film-hero-copy {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto var(--space-xl);
  max-width: 40rem;
  min-width: 0;
}
.film-hero .kicker {
  margin: 0 0 var(--space-sm);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent-2);
}
.film-hero h1 {
  margin: 0 0 var(--space-sm);
  font-size: var(--text-display);
  color: var(--color-ink);
}
.film-hero h1 span {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 1.1vw + 0.45rem, 1.15rem);
  font-weight: 500;
  color: var(--color-ink-muted);
  letter-spacing: 0;
}
.film-hero .lede {
  margin: 0 0 var(--space-lg);
  color: var(--color-ink-muted);
  max-width: 34rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.film-strip {
  display: flex;
  gap: var(--space-xs);
  overflow-x: auto;
  padding: var(--space-md) 0 var(--space-lg);
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  scrollbar-width: thin;
  border-top: 1px solid var(--color-line);
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 18px,
      oklch(30% 0.02 40 / 0.35) 18px,
      oklch(30% 0.02 40 / 0.35) 20px
    );
}
.film-strip button,
.film-strip .film-frame {
  flex: 0 0 auto;
  width: 132px;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 2px solid var(--color-line);
  background: var(--color-paper-3);
  cursor: pointer;
  overflow: hidden;
  border-radius: var(--radius-md);
  transition: transform var(--dur-med) var(--ease-out), border-color var(--dur-med) var(--ease-out);
}
.film-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-med) var(--ease-out);
}
.film-strip button:hover,
.film-strip .film-frame:hover {
  border-color: var(--color-accent);
  transform: translateY(-4px) scale(1.04);
  z-index: 1;
}
.film-strip button:hover img,
.film-strip .film-frame:hover img {
  transform: scale(1.06);
}

.kicker {
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 var(--space-sm);
}
.lede {
  color: var(--color-ink-muted);
  margin: 0 0 var(--space-lg);
}

/* Frame-border sections */
.section {
  padding: var(--space-3xl) 0;
}
.section .shell > .section-head,
.section .shell > .info-grid,
.section .shell > .feature-grid,
.section .shell > .gallery-grid,
.section .shell > .download-band,
.section .shell > .timeline,
.section .shell > .review-grid,
.section .shell > .faq-list,
.section .shell > .article-grid,
.section .shell > .platform-grid,
.section .shell > .steps,
.section .shell > .spec-compare,
.section .shell > .guide-grid {
  position: relative;
}
.section-frame {
  border: 1px solid var(--color-line);
  background: var(--color-paper-2);
  padding: var(--space-xl);
  box-shadow:
    inset 0 0 0 4px oklch(13% 0.015 40),
    0 0 0 1px oklch(30% 0.02 40 / 0.4);
}
.section-head {
  margin-bottom: var(--space-xl);
  max-width: 40rem;
  min-width: 0;
}
.section-head h2 {
  font-size: var(--text-display-s);
  margin: 0 0 var(--space-sm);
}
.section-head p {
  margin: 0;
  color: var(--color-ink-muted);
}
@media (max-width: 768px) {
  .section-head {
    max-width: none;
  }
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-sm);
}
.info-cell {
  background: var(--color-paper-3);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  min-width: 0;
}
.info-cell dt {
  margin: 0 0 4px;
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
}
.info-cell dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
@media (max-width: 900px) {
  .info-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 480px) {
  .info-grid {
    grid-template-columns: 1fr;
  }
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
}
.feature-card {
  background: var(--color-paper-3);
  border: 1px solid var(--color-line);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  min-width: 0;
}
.feature-card .mark {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: var(--color-accent);
  letter-spacing: 0.08em;
}
.feature-card h3 {
  margin: var(--space-sm) 0 var(--space-xs);
  font-size: var(--text-xl);
}
.feature-card p {
  margin: 0;
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
}
@media (max-width: 900px) {
  .feature-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
}
.gallery-item {
  aspect-ratio: 16 / 9;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-paper-3);
  cursor: pointer;
  min-width: 0;
  padding: 0;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-med) var(--ease-out);
}
.gallery-item:hover img {
  transform: scale(1.05);
}
@media (max-width: 800px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.download-band {
  margin: var(--space-xl) 0;
  padding: var(--space-2xl);
  text-align: center;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, oklch(24% 0.06 28 / 0.45), oklch(14% 0.02 40)),
    var(--color-paper-2);
}
.download-band h2 {
  margin: 0 0 var(--space-sm);
  font-size: var(--text-4xl);
}
.download-band p {
  margin: 0 0 var(--space-lg);
  color: var(--color-ink-muted);
}

.timeline {
  border-left: 1px solid var(--color-line);
}
.timeline-item {
  position: relative;
  padding: 0 0 var(--space-lg) var(--space-lg);
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 0.45rem;
  width: 7px;
  height: 7px;
  background: var(--color-accent);
  border-radius: 1px;
}
.timeline-item h3 {
  margin: 0 0 4px;
  font-size: var(--text-md);
}
.timeline-item p {
  margin: 0;
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
}
.review-card {
  background: var(--color-paper-3);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  min-width: 0;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}
.review-card.visible {
  opacity: 1;
  transform: none;
}
.review-card p {
  margin: 0 0 var(--space-md);
  color: var(--color-ink-muted);
}
.review-card cite {
  font-style: normal;
  font-size: var(--text-xs);
  color: var(--color-accent);
  letter-spacing: 0.04em;
}
@media (max-width: 800px) {
  .review-grid {
    grid-template-columns: 1fr;
  }
}

.faq-list {
  display: grid;
  gap: var(--space-sm);
}
.faq-item {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-paper-2);
  overflow: hidden;
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-md) var(--space-lg);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  align-items: center;
  min-height: 44px;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: "+";
  color: var(--color-accent);
  flex-shrink: 0;
}
.faq-item[open] summary::after {
  content: "-";
}
.faq-item .faq-body {
  padding: 0 var(--space-lg) var(--space-md);
  color: var(--color-ink-muted);
  overflow-wrap: anywhere;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
}
.article-link {
  display: block;
  padding: var(--space-md);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-paper-3);
  text-decoration: none;
  color: var(--color-ink);
  min-width: 0;
  transition: border-color var(--dur-med) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.article-link:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
}
.article-link span {
  display: block;
  margin-top: 4px;
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
}
@media (max-width: 800px) {
  .article-grid {
    grid-template-columns: 1fr;
  }
}

.final-cta {
  padding: var(--space-4xl) 0;
  text-align: center;
  border-top: 1px solid var(--color-line);
  background: linear-gradient(180deg, transparent, oklch(18% 0.03 28 / 0.25));
}
.final-cta h2 {
  margin: 0 0 var(--space-sm);
  font-size: var(--text-display-s);
}
.final-cta p {
  margin: 0 0 var(--space-lg);
  color: var(--color-ink-muted);
}
.final-cta .note {
  margin-top: var(--space-md);
  font-size: var(--text-sm);
  color: var(--color-ink-muted);
}

.page-hero {
  padding: calc(var(--nav-h) + var(--space-2xl)) 0 var(--space-xl);
}
.page-hero h1 {
  margin: 0 0 var(--space-sm);
  font-size: var(--text-display-s);
}
.page-hero p {
  margin: 0;
  color: var(--color-ink-muted);
  max-width: 40rem;
}
.crumbs {
  margin-bottom: var(--space-sm) !important;
  font-size: var(--text-sm);
}
.crumbs a {
  text-decoration: none;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}
.tab-btn {
  min-height: 40px;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--color-line);
  background: transparent;
  color: var(--color-ink-muted);
  cursor: pointer;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
}
.tab-btn.is-active,
.tab-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
}
.platform-card {
  background: var(--color-paper-2);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  min-width: 0;
}
.platform-card h2 {
  margin: 0 0 var(--space-sm);
  font-size: var(--text-xl);
}
.platform-card p {
  margin: 0 0 var(--space-md);
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
}
.badge {
  display: inline-block;
  margin-bottom: var(--space-sm);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
}
@media (max-width: 800px) {
  .platform-grid {
    grid-template-columns: 1fr;
  }
}

.steps {
  display: grid;
  gap: var(--space-sm);
  counter-reset: step;
}
.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-md);
  padding: var(--space-md);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-paper-2);
  min-width: 0;
}
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-display);
  color: var(--color-accent);
  font-weight: 600;
}
.step h3 {
  margin: 0 0 4px;
  font-size: var(--text-md);
}
.step p {
  margin: 0;
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
}

.spec-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}
.spec-box {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  background: var(--color-paper-2);
  min-width: 0;
}
.spec-box h3 {
  margin: 0 0 var(--space-md);
  font-size: var(--text-xl);
}
.spec-box table,
.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.spec-box th,
.spec-box td,
.article-body th,
.article-body td {
  border-bottom: 1px solid var(--color-line);
  padding: 0.55rem 0.4rem;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.spec-box th,
.article-body th {
  color: var(--color-ink-muted);
  font-weight: 500;
  width: 30%;
}
@media (max-width: 700px) {
  .spec-compare {
    grid-template-columns: 1fr;
  }
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
}
.guide-card {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  background: var(--color-paper-2);
  min-width: 0;
}
.guide-card h3 {
  margin: 0 0 var(--space-xs);
  font-size: var(--text-xl);
}
.guide-card p {
  margin: 0 0 var(--space-md);
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
}
@media (max-width: 800px) {
  .guide-grid {
    grid-template-columns: 1fr;
  }
}

.article-body {
  width: min(100% - 2rem, 46rem);
  margin: 0 auto var(--space-4xl);
  padding: var(--space-xl);
  border: 1px solid var(--color-line);
  background: var(--color-paper-2);
  box-shadow: inset 0 0 0 4px oklch(13% 0.015 40);
}
.article-body h2 {
  margin: var(--space-xl) 0 var(--space-sm);
  font-size: var(--text-4xl);
}
.article-body p,
.article-body li {
  color: var(--color-ink-muted);
}
.article-body ul.checklist {
  padding-left: 1.2rem;
}
.article-body a {
  overflow-wrap: anywhere;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: oklch(8% 0.02 40 / 0.92);
}
.lightbox.is-open {
  display: flex;
}
.lightbox img {
  max-height: min(70vh, 720px);
  max-width: min(92vw, 1100px);
  border: 1px solid var(--color-line);
}
.lightbox-ui {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: center;
}
.lightbox-close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
}

/* Ft3 multi-column footer */
.site-footer {
  border-top: 1px solid var(--color-line);
  padding: var(--space-3xl) 0 var(--space-xl);
  background: oklch(11% 0.012 40);
}
.footer-cols {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, minmax(0, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-width: 0;
}
.footer-brand img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border: 1px solid var(--color-line);
}
.footer-brand strong {
  font-family: var(--font-display);
  font-size: var(--text-md);
}
.footer-brand p {
  margin: 0;
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
}
.footer-col h3 {
  margin: 0 0 var(--space-sm);
  font-size: var(--text-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent-2);
}
.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.footer-col a {
  color: var(--color-ink-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  white-space: nowrap;
}
.footer-col a:hover {
  color: var(--color-accent);
}
.footer-legal {
  border-top: 1px solid var(--color-line);
  padding-top: var(--space-md);
  color: var(--color-ink-muted);
  font-size: var(--text-xs);
}
.footer-legal p {
  margin: 0 0 4px;
}
@media (max-width: 900px) {
  .footer-cols {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .footer-cols {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .btn,
  .film-strip button,
  .film-strip .film-frame,
  .film-strip img,
  .gallery-item img,
  .article-link,
  .review-card {
    transition: none !important;
  }
  .btn-primary:hover,
  .film-strip button:hover,
  .film-strip .film-frame:hover,
  .article-link:hover {
    transform: none;
  }
  .review-card {
    opacity: 1;
    transform: none;
  }
}
