/*
  Contraflow Games – site styles (v1).
  Every colour, font and size comes from brand/tokens.css, loaded before
  this file. The lane motif appears once, in the home page's road band.
*/

/* ---- Fonts: Barlow and Barlow Condensed, served from this site ---------
   The Latin files Google Fonts served before (2026-10-04), so the pages look
   the same and nothing loads from Google. SIL Open Font License 1.1: see
   assets/fonts/OFL.txt. */

@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/assets/fonts/Barlow-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap;
  src: url(/assets/fonts/Barlow-500.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap;
  src: url(/assets/fonts/Barlow-600.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 300; font-display: swap;
  src: url(/assets/fonts/BarlowCondensed-300.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap;
  src: url(/assets/fonts/BarlowCondensed-600.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap;
  src: url(/assets/fonts/BarlowCondensed-700.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 800; font-display: swap;
  src: url(/assets/fonts/BarlowCondensed-800.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--step-0)/1.6 var(--font-body);
}

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

a { color: var(--text); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: var(--space-2); top: -4rem;
  background: var(--accent); color: var(--on-accent);
  padding: var(--space-1) var(--space-2); font-weight: 600; z-index: 10;
}
.skip:focus { top: var(--space-2); }
/* Read by screen readers and search engines, not drawn: the home page's h1. */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: var(--space-3); }

/* ---- Header ---------------------------------------------------------- */

.site-header { border-bottom: 1px solid var(--border); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-2) var(--space-3); padding-block: var(--space-2);
}
.brand { display: inline-flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.brand img { width: 48px; height: 48px; }

/* The wordmark, live text (BRAND.md). */
.wordmark { display: inline-flex; flex-direction: column; line-height: 1; font-family: var(--font-display); text-transform: uppercase; }
.wordmark .name { font-weight: 700; letter-spacing: 0.05em; color: var(--text); font-size: 1.75rem; }
.wordmark .kind { font-weight: 600; letter-spacing: 0.5em; color: var(--accent); font-size: 0.6rem; margin-top: 0.3em; }

.site-nav ul { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); list-style: none; margin: 0; padding: 0; }
.site-nav a { font-weight: 500; text-decoration: none; color: var(--text-muted); padding-block: 0.25rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); text-decoration: underline; text-decoration-thickness: 2px; }

/* ---- The road: the one memorable idea -------------------------------- */

.hero { padding-block: var(--space-5) 0; }
.hero-wordmark { margin: 0 0 var(--space-3); }
.hero-wordmark .name { font-size: var(--step-4); }
.hero-wordmark .kind { font-size: calc(var(--step-4) / 3); }
.hero h1 {
  font: 800 var(--step-3)/1.02 var(--font-display);
  margin: 0 0 var(--space-2);
  text-wrap: balance;
}
.hero .subline {
  font: 300 var(--step-2)/1.2 var(--font-display);
  color: var(--text-muted);
  margin: 0 0 var(--space-4);
  max-width: var(--measure);
}

/* Two lanes, opposing chevrons, a dashed centre line: the logo's road
   turned on its side and run the width of the page. On the home page it
   divides the first game from the rest. */
.road {
  background: var(--cf-ink);
  border-block: 1px solid var(--border);
  padding-block: 0.9rem;
  display: grid; gap: 0.9rem;
}
.lane {
  height: 32px;
  background-color: var(--text-muted);
  -webkit-mask-repeat: repeat-x; mask-repeat: repeat-x;
  -webkit-mask-size: 64px 32px; mask-size: 64px 32px;
}
.lane.east { -webkit-mask-image: url("/assets/chevron-right.svg"); mask-image: url("/assets/chevron-right.svg"); }
.lane.west { -webkit-mask-image: url("/assets/chevron-left.svg"); mask-image: url("/assets/chevron-left.svg"); }
.centre-line {
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--text) 0 32px, transparent 32px 64px);
  opacity: 0.8;
}
/* The page's one moment: each lane glides in from its own direction, once. */
@media (prefers-reduced-motion: no-preference) {
  .lane.east { animation: east 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .lane.west { animation: west 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  @keyframes east { from { -webkit-mask-position: -256px 0; mask-position: -256px 0; opacity: 0; } to { -webkit-mask-position: 0 0; mask-position: 0 0; opacity: 1; } }
  @keyframes west { from { -webkit-mask-position: 256px 0; mask-position: 256px 0; opacity: 0; } to { -webkit-mask-position: 0 0; mask-position: 0 0; opacity: 1; } }
}

/* ---- Buttons: amber is for the one action ----------------------------- */

.button {
  display: inline-block;
  background: var(--accent); color: var(--on-accent);
  font: 600 var(--step-0)/1 var(--font-body);
  padding: 0.95rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
}
.button:hover { text-decoration: underline; text-decoration-thickness: 2px; }

/* ---- Sections --------------------------------------------------------- */

main { display: block; }
.section { padding-block: var(--space-5); }
.section + .section { border-top: 1px solid var(--border); }
.section h2 { font: 700 var(--step-2)/1.1 var(--font-display); margin: 0 0 var(--space-4); }
.page-head { padding-block: var(--space-5) var(--space-3); }
.page-head h1 { font: 800 var(--step-3)/1.05 var(--font-display); margin: 0; }
.prose { max-width: var(--measure); }
.prose p { margin: 0 0 var(--space-2); }
/* The privacy policy: a long page of short sections, so smaller section
   heads than the home page's, lists, and file paths that may wrap. */
.policy h2 { font: 700 var(--step-1)/1.15 var(--font-display); margin: var(--space-4) 0 var(--space-1); }
.policy ul { margin: 0 0 var(--space-2); padding-left: 1.2em; display: grid; gap: var(--space-1); }
.policy code { font-size: 0.92em; overflow-wrap: anywhere; color: var(--text); }
.muted { color: var(--text-muted); }

/* ---- Games ------------------------------------------------------------ */
/* One layout for every game, on the home page and the games page: the head
   (name, labels, one line) comes first in the page, so on a phone the name
   is read before the pictures; from 761 px the pictures sit beside it. */

:root {
  --name-h: 4.5rem;          /* every game name sits in a box this tall */
  --necity-night: #140C2E;   /* the featured game's panel (see below) */
}

.game { display: grid; gap: var(--space-3) var(--space-4); align-items: start; }
.game + .game { margin-top: var(--space-5); padding-top: var(--space-5); border-top: 2px dashed var(--border); }
.game-head > :last-child { margin-bottom: 0; }
.game-line { margin: 0 0 var(--space-2); color: var(--text-muted); max-width: var(--measure); }
/* Alpha++'s family: text only, a line each, quieter than the game it belongs to. */
.family { margin-top: var(--space-3); padding-top: var(--space-2); border-top: 2px dashed var(--border); }
.family h3 { font: 700 var(--step-1)/1.15 var(--font-display); margin: 0 0 var(--space-1); }
.family dl { margin: 0; display: grid; gap: var(--space-2); }
.family dt { font: 700 var(--step-0)/1.2 var(--font-display); letter-spacing: 0.01em; }
.family dd { margin: 0.2rem 0 0; color: var(--text-muted); max-width: var(--measure); }
.family-line { margin: 0; color: var(--text-muted); font-size: var(--step--1); max-width: var(--measure); }

@media (min-width: 761px) {
  .game { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  .game.featured { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; }
  .game.featured .gallery { display: contents; }
  .game.featured .shots { grid-column: 1 / -1; }
  /* Lo-Fi's seven store shots, four to a row. */
  .shots.wide-first { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* The name: one box height for every game, so no name shouts over another.
   A game's logo is its own artwork and keeps its own colours. */
.game .game-name, .card .game-name {
  display: flex; align-items: center;
  height: var(--name-h); margin: 0 0 var(--space-2);
  line-height: 1;
}
.game-name img.game-wordmark { height: 100%; width: auto; max-width: 100%; object-fit: contain; object-position: left center; }
/* Alpha++'s lockup is a solid sign, heavier than the neon wordmarks at the same height. */
.game-name img.game-wordmark.sign { height: 78%; }
/* The family's lockups are half Alpha++'s width, so they get a taller box to read (the owner's pick, 2026-11-05). */
.alphapp-family .game-name { height: calc(var(--name-h) * 1.3); }
/* A game without a wordmark yet: its name in the display face, mixed case, sized to sit with the logos. */
.game .game-name.text-mark, .card .game-name.text-mark {
  height: auto; min-height: var(--name-h);
  font: 700 clamp(1.6rem, 1.3rem + 0.6vw, 2rem)/1.05 var(--font-display);
  letter-spacing: 0.01em;
}
/* The featured game's name is the one larger name on a page. */
.game .game-name.lead-name { height: calc(var(--name-h) * 1.9); }

/* Labels: three kinds, three looks. A status is a filled chip in capitals,
   a date is the square sign plate, a platform is plain text. */
.labels { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) 0.75rem; margin: 0 0 var(--space-2); padding: 0; list-style: none; }
.status {
  font: 700 var(--step--1)/1 var(--font-display);
  letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  padding: 0.5rem 0.65rem 0.45rem;
}
.status.first { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.plate {
  font: 600 var(--step-0)/1 var(--font-display);
  letter-spacing: 0.02em;
  border: 2px solid var(--text);
  padding: 0.35rem 0.6rem 0.3rem;
}
.platform { font: 500 var(--step--1)/1 var(--font-body); color: var(--text-muted); }

/* The store buttons: placeholders until the store pages exist. Dashed like
   roadworks and not links, so nobody mistakes them for broken buttons. */
.stores { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: var(--space-3) 0 0; padding: 0; list-style: none; }
.store {
  font: 700 var(--step-0)/1.2 var(--font-display); letter-spacing: 0.02em;
  border: 2px dashed var(--text-muted); border-radius: 4px;
  padding: 0.8rem 1rem;
}
.store-when { display: block; margin-top: 0.3rem; font: 500 var(--step--1)/1 var(--font-body); letter-spacing: 0; color: var(--text-muted); }

/* ---- Pictures ---------------------------------------------------------- */

.gallery { display: grid; gap: var(--space-2); margin: 0; }
.gallery figure, .shots figure, .card figure { margin: 0; }
.gallery figcaption, .shots figcaption, .pair figcaption { font-size: var(--step--1); color: var(--text-muted); margin-top: 0.4rem; }
.gallery img, .shots img, .pair img, .card figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--border); }
.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.pair { display: grid; gap: var(--space-2); margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pair figcaption { grid-column: 1 / -1; margin-top: 0; }
.gallery-note { font-size: var(--step--1); color: var(--text-muted); margin: 0; }
.pic, .shots figure, .card figure { position: relative; }

/* The trailer: a poster and a play button until pressed (assets/trailer.js),
   then the YouTube player in the same 16:9 box. */
.trailer-frame { position: relative; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--border); }
.trailer-frame img { display: block; width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; border: 0; }
.trailer-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.trailer-play {
  position: absolute; inset: 50% auto auto 50%; translate: -50% -50%;
  width: clamp(3.5rem, 12%, 6rem); aspect-ratio: 1; padding: 0; cursor: pointer;
  border: 3px solid var(--text); border-radius: 50%;
  background: color-mix(in srgb, var(--cf-ink) 70%, transparent);
}
/* The triangle, drawn with a clip so it follows the button's size. */
.trailer-play::before {
  content: ""; position: absolute; inset: 30% 26% 30% 36%;
  background: var(--text); clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.trailer-play:hover, .trailer-play:focus-visible { border-color: var(--accent); }
.trailer-play:hover::before, .trailer-play:focus-visible::before { background: var(--accent); }
.trailer-link { color: var(--text); white-space: nowrap; }
/* On a device: the poster is Apple's bezel with the frame on its screen, shown whole on the section's own
   background. Its screen is centred in the image, so the centred play button lands on the picture. Once
   playing, the box goes back to the plain 16:9 player. */
.trailer-frame.device { aspect-ratio: 1600 / 1054; background: none; border: 0; }
.trailer-frame.device img { object-fit: contain; }
.trailer-frame.device:has(iframe) { aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--border); }

/* Alpha++: the exit-tab sign stands in front of its city, like a real sign. */
.pic { overflow: hidden; }
.gallery .pic img.road-sign {
  position: absolute; right: 4%; bottom: 6%; width: 44%; height: auto;
  aspect-ratio: auto; border: 0; object-fit: contain;
  filter: drop-shadow(0 0.4rem 0.8rem rgb(0 0 0 / 0.45));
}

/* ---- The featured game ------------------------------------------------- */
/* NeCity Lo-Fi, the first game out. Its panel is the neon night sky, the one
   place the site steps outside the studio palette, and only behind the
   featured game. The other neon game, NeCity, sits on the studio navy, so the
   two families' logos never share a panel. */

.lead-game { padding-block: var(--space-4) var(--space-5); }
.game.featured { background: var(--necity-night); padding: var(--space-4); border: 1px solid var(--border); }
.game.featured + .game { border-top: 0; }
.game.featured .game-line { color: var(--cf-mist); font-size: var(--step-1); line-height: 1.4; max-width: 32ch; }

/* ---- Home: "Also on the way" -------------------------------------------- */

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4) var(--space-3); }
.cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { display: flex; flex-direction: column; }
.card figure { margin-bottom: var(--space-2); }
/* A card's logo or name is its link to the game's section on the games page:
   an arrow says so at rest, and it turns amber with an underline on hover and focus. */
.name-link { display: inline-flex; align-items: center; gap: 0.6rem; height: 100%; max-width: 100%; color: var(--text); text-decoration: none; border-bottom: 2px solid transparent; padding-bottom: 2px; }
.name-link::after { content: "\2192" / ""; font: 600 var(--step-1)/1 var(--font-body); color: var(--text-muted); flex: none; }
.name-link:hover, .name-link:focus-visible { border-bottom-color: var(--accent); }
.name-link:hover::after, .name-link:focus-visible::after { color: var(--accent); }
.name-link img.game-wordmark { height: 100%; min-width: 0; }
.name-link img.game-wordmark.sign { height: 78%; }
@media (min-width: 761px) {
  /* Beside each other, the cards line up picture-first; on a phone the name leads. */
  .card figure { order: -1; }
}

@media (max-width: 760px) {
  :root { --name-h: 3.5rem; }
  .game.featured { padding: var(--space-2); }
  .pair { grid-template-columns: 1fr; }
  /* On a phone, the whole-city view leads full width and the other six pair up. */
  .shots.wide-first li:last-child:nth-child(odd) { grid-column: auto; }
  .shots.wide-first li:first-child { grid-column: 1 / -1; }
  .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shots li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  /* The home page's three screenshots: a sideways swipe row. */
  .lead-game .shots { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--space-1); }
  .lead-game .shots li { flex: 0 0 80%; scroll-snap-align: start; }
  .lead-game { padding-block: var(--space-2) var(--space-4); }
  .cards, .cards.two { grid-template-columns: 1fr; }
  .card + .card { border-top: 2px dashed var(--border); padding-top: var(--space-4); }
}

/* ---- Placeholders: roadworks, visibly unfinished ------------------------ */

.ph {
  display: inline-block;
  font-family: var(--font-display); font-weight: 600;
  color: var(--text);
  border: 2px dashed var(--text-muted);
  background: repeating-linear-gradient(135deg, var(--surface) 0 8px, transparent 8px 16px);
  padding: 0.1rem 0.45rem;
}

/* ---- About and contact on the home page --------------------------------- */

.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--space-5); }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.contact-list dt, .label { font-weight: 600; }
.contact-list dd { margin: 0.25rem 0 0; }

/* ---- Footer ------------------------------------------------------------- */

.site-footer { border-top: 1px solid var(--border); padding-block: var(--space-4); color: var(--text-muted); font-size: var(--step--1); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); justify-content: space-between; align-items: center; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: var(--space-3); list-style: none; margin: 0; padding: 0; }
.site-footer a { color: var(--text-muted); }
.site-footer .credit-line { flex-basis: 100%; margin: 0; font-size: var(--step--2, 0.75rem); }

/* ---- 404 ----------------------------------------------------------------- */

.closed { padding-block: var(--space-6); }
.closed h1 { font: 800 var(--step-4)/1 var(--font-display); margin: 0 0 var(--space-2); }

/* ---- Narrow ------------------------------------------------------------- */

@media (max-width: 760px) {
  .split { grid-template-columns: 1fr; gap: var(--space-3); }
  .shots { gap: var(--space-1); }
  .hero { padding-block: var(--space-4) 0; }
}
@media (max-width: 400px) {
  .wrap { padding-inline: var(--space-2); }
}

/* Game pictures open full size (/assets/zoom.js; without it, the link opens the file). */
a.zoom { display: block; cursor: zoom-in; }
a.zoom:hover img { border-color: var(--accent); }
.viewer { border: 0; padding: 0; margin: 0; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; background: transparent; color: var(--text); }
.viewer::backdrop { background: rgba(8, 14, 22, 0.97); }
.viewer figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); padding: 3.5rem 1rem 2rem; box-sizing: border-box; }
.viewer figure img { max-width: 100%; max-height: calc(100% - 3rem); width: auto; height: auto; border: 1px solid var(--border); }
.viewer figcaption { font-size: var(--step--1); color: var(--text-muted); text-align: center; max-width: 60ch; }
.viewer button { position: absolute; background: var(--bg); color: var(--text); border: 1px solid var(--border); font: inherit; cursor: pointer; min-width: 44px; min-height: 44px; display: grid; place-items: center; }
.viewer button:hover, .viewer button:focus-visible { border-color: var(--accent); }
.viewer-close { top: 0.75rem; right: 0.75rem; padding: 0 1rem; }
.viewer-prev, .viewer-next { top: 50%; transform: translateY(-50%); padding: 0; }
.viewer-prev { left: 0.75rem; } .viewer-next { right: 0.75rem; }
.viewer-prev svg, .viewer-next svg { display: block; }
@media (max-width: 760px) { .viewer-prev, .viewer-next { top: auto; bottom: 0.75rem; transform: none; } }
