/* =========================================================
   NyxYujin.com — shared stylesheet
   60% obsidian / 30% tactical slate / 10% mint emerald,
   with Claude's warm orange reserved for where Claude appears.
   Sections: tokens → reset → language → chrome → buttons →
   hero → shelf → game page → skills → team → channels →
   footer → motion → responsive
   ========================================================= */

/* ---------- Tokens ---------- */

:root {
  --bg: #101214;
  --bg-raised: #15181c;
  --surface: #1e2228;
  --surface-hover: #232930;
  --border: #2e343d;
  --text: #f0f4f8;
  --muted: #9aa5b1;
  --accent: #2ed8a1;
  --accent-hover: #4ce8b6;
  --ink: #07130f;

  /* Claude "Patchweaver" accent — use only where Claude appears. */
  --claude: #f08a3c;
  --claude-cream: #f6e7d3;

  /* Per-game glow; each game card / page overrides it inline. */
  --game: var(--accent);

  --font-sans: "Inter", "Segoe UI Variable Display", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Meiryo", "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --shell: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --topbar-h: 60px;
}

/* ---------- Reset ---------- */

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

html {
  color-scheme: dark;
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 16px);
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%),
    var(--bg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Faint tactical grid behind everything. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(color-mix(in srgb, var(--border) 36%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--border) 36%, transparent) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 10%, transparent 80%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 10%, transparent 80%);
}

::selection {
  color: var(--ink);
  background: var(--accent);
}

a {
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin: 0;
}

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

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 180ms var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.shell {
  width: 100%;
  max-width: calc(var(--shell) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main {
  flex: 1 0 auto;
}

/* ---------- Language ----------
   Every translatable string is written twice: data-l="en" and
   data-l="ja". The inactive one is hidden. The inline script in each
   page's <head> sets data-lang before first paint, so nothing flickers. */

:root:not([data-lang="ja"]) [data-l="ja"],
:root[data-lang="ja"] [data-l="en"] {
  display: none !important;
}

/* Wide tracking suits English uppercase labels, not kana and kanji. */
.eyebrow [data-l="ja"],
.topnav [data-l="ja"],
.card-meta [data-l="ja"],
.loop-bar [data-l="ja"],
.facts dt [data-l="ja"] {
  letter-spacing: 0.04em;
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  view-transition-name: topbar;
}

/* 3 equal-ish columns keep the menu truly centred. */
.topbar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: var(--topbar-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--accent);
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent) 30%, transparent));
}

.brand-slash {
  padding-inline: 2px;
  color: var(--accent);
}

.topnav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 28px);
  justify-self: center;
}

.topnav a {
  position: relative;
  padding: 8px 2px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 200ms var(--ease);
}

.topnav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms var(--ease);
}

.topnav a:hover,
.topnav a:focus-visible,
.topnav a[aria-current="page"] {
  color: var(--text);
}

.topnav a:hover::after,
.topnav a:focus-visible::after,
.topnav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.lang-switch {
  display: inline-flex;
  justify-self: end;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-raised);
}

.lang-switch button {
  min-width: 40px;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
  cursor: pointer;
  transition: color 200ms var(--ease), background-color 200ms var(--ease);
}

.lang-switch button:hover {
  color: var(--text);
}

.lang-switch button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--accent);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.005em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 200ms var(--ease),
    background-color 200ms var(--ease),
    border-color 200ms var(--ease),
    box-shadow 200ms var(--ease);
}

.btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.btn-primary {
  color: var(--ink);
  background: var(--accent);
  box-shadow: 0 10px 30px -14px color-mix(in srgb, var(--accent) 80%, transparent);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--accent-hover);
  box-shadow: 0 14px 36px -12px color-mix(in srgb, var(--accent) 90%, transparent);
  transform: translateY(-2px);
}

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: var(--surface-hover);
  transform: translateY(-2px);
}

/* ---------- Shared text pieces ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 22px;
}

.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 680;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.section-count {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  align-self: center;
  background: linear-gradient(90deg, var(--border), transparent);
}

.section {
  padding-block: clamp(48px, 8vw, 88px) 0;
}

/* ---------- Home hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(32px, 6vw, 72px);
  padding-top: clamp(36px, 7vw, 80px);
}

.hero-copy {
  display: grid;
  gap: 20px;
  justify-items: start;
}

.hero h1 {
  font-size: clamp(2.6rem, 6.2vw, 4.6rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  text-wrap: balance;
}

.hero h1 .hl {
  color: var(--accent);
}

.hero-lead {
  max-width: 34em;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

/* Featured poster with the orbit rings from the original site. */
.feature {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  padding-block: 24px;
  text-decoration: none;
}

.feature-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.feature-orbit--outer {
  width: min(115%, 500px);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.feature-orbit--inner {
  width: min(88%, 380px);
  border: 1px dashed color-mix(in srgb, var(--game) 30%, transparent);
}

.feature-glow {
  position: absolute;
  inset: 10% 15%;
  z-index: -2;
  border-radius: 50%;
  background: var(--game);
  opacity: 0.28;
  filter: blur(60px);
}

.feature-art {
  position: relative;
  width: min(100%, 300px);
  aspect-ratio: 471 / 836;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--game) 45%, var(--border));
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow:
    0 40px 80px -40px #000,
    0 0 0 6px color-mix(in srgb, var(--bg) 70%, transparent);
  transform: rotate(2deg);
  transition: transform 400ms var(--ease);
}

.feature:hover .feature-art,
.feature:focus-visible .feature-art {
  transform: rotate(0deg) translateY(-4px);
}

.feature-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feature-tag {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 999px;
  color: var(--accent);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateX(-50%);
}

.dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: signal 2.4s ease-in-out infinite;
}

/* ---------- Game shelf ---------- */

/* 190px minimum fits the four games plus the "next game" slot in one
   row on a full-width desktop shell. */
.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr));
  gap: clamp(14px, 2vw, 22px);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
  transition:
    transform 260ms var(--ease),
    border-color 260ms var(--ease),
    box-shadow 260ms var(--ease);
}

.card:hover,
.card:focus-visible {
  border-color: color-mix(in srgb, var(--game) 70%, transparent);
  box-shadow:
    0 24px 50px -28px color-mix(in srgb, var(--game) 70%, transparent),
    0 0 0 1px color-mix(in srgb, var(--game) 25%, transparent);
  transform: translateY(-4px);
}

.card-art {
  position: relative;
  aspect-ratio: 471 / 836;
  overflow: hidden;
  background: var(--bg-raised);
}

.card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms var(--ease);
}

.card:hover .card-art img,
.card:focus-visible .card-art img {
  transform: scale(1.04);
}

/* Fade the bottom of the art into the card body. */
.card-art::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 30%;
  background: linear-gradient(transparent, var(--surface));
  pointer-events: none;
}

.card-body {
  display: grid;
  gap: 6px;
  padding: 4px 16px 18px;
}

.card-meta {
  color: var(--game);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  filter: brightness(1.15);
}

.card-title {
  font-size: 1.08rem;
  font-weight: 680;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.card-hook {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* The "next game" slot. */
.card--next {
  justify-content: center;
  min-height: 100%;
  border-style: dashed;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in srgb, var(--border) 25%, transparent) 14px 15px),
    var(--bg-raised);
}

.card--next:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border);
}

.card--next .card-body {
  justify-items: center;
  padding: 32px 20px;
  text-align: center;
}

.next-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 8px;
  border: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent);
  border-radius: 50%;
  color: var(--accent);
}

.next-icon svg {
  width: 22px;
  height: 22px;
}

/* ---------- Game page ---------- */

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 28px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.crumbs a {
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--accent);
}

.game {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(28px, 6vw, 72px);
  padding-top: 28px;
}

.game::before {
  content: "";
  position: absolute;
  top: 0;
  left: -10%;
  z-index: -1;
  width: 60%;
  height: 80%;
  border-radius: 50%;
  background: var(--game);
  opacity: 0.16;
  filter: blur(90px);
  pointer-events: none;
}

.game-art {
  position: sticky;
  top: calc(var(--topbar-h) + 24px);
  aspect-ratio: 471 / 836;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--game) 45%, var(--border));
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 40px 80px -40px #000;
}

.game-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-info {
  display: grid;
  gap: 22px;
  justify-items: start;
  padding-top: 8px;
}

.game-info .eyebrow {
  color: var(--game);
  filter: brightness(1.15);
}

.game h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 720;
  letter-spacing: -0.04em;
  line-height: 1.02;
  text-wrap: balance;
}

.game-alt-title {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  font-weight: 500;
  letter-spacing: 0;
}

.game-pitch {
  max-width: 36em;
  font-size: clamp(1.02rem, 1.5vw, 1.15rem);
  text-wrap: pretty;
}

.loop {
  width: 100%;
  max-width: 560px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.loop-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  background: color-mix(in srgb, var(--bg) 40%, transparent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.loop-bar h2 {
  font: inherit;
}

.window-dots {
  display: flex;
  gap: 5px;
}

.window-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
}

.window-dots span:first-child {
  background: var(--accent);
}

.loop ol {
  margin: 0;
  padding: 6px 0;
  list-style: none;
  counter-reset: loop;
}

.loop li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 18px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.55;
  counter-increment: loop;
}

.loop li + li {
  border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
}

.loop li::before {
  content: counter(loop, decimal-leading-zero);
  color: var(--accent);
  font-size: 12px;
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  max-width: 560px;
  margin: 0;
  border-top: 1px solid var(--border);
}

.facts div {
  padding: 14px 14px 0 0;
}

.facts dt {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.facts dd {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 600;
}

.credit {
  color: var(--muted);
  font-size: 14px;
}

.credit strong {
  color: var(--text);
  font-weight: 600;
}

.credit .claude {
  color: var(--claude);
}

.shelf--more {
  grid-template-columns: repeat(3, minmax(0, 230px));
}

/* ---------- Agent skills ----------
   Home: one wide row per skill (thumbnail + copy + Download).
   Skill page: header, demo video, two step boxes, prompt, facts.
   Each skill sets its own --game colour inline, like the games. */

.section-lead {
  max-width: 40em;
  margin: -8px 0 22px;
  color: var(--muted);
  text-wrap: pretty;
}

.skills {
  display: grid;
  gap: 18px;
}

.skill-card {
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 4vw, 40px);
  padding: clamp(12px, 1.6vw, 16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse 40% 90% at 0% 50%, color-mix(in srgb, var(--game) 10%, transparent), transparent 70%),
    var(--surface);
  transition:
    border-color 260ms var(--ease),
    box-shadow 260ms var(--ease);
}

.skill-card:hover,
.skill-card:focus-within {
  border-color: color-mix(in srgb, var(--game) 60%, transparent);
  box-shadow: 0 24px 50px -30px color-mix(in srgb, var(--game) 70%, transparent);
}

.skill-thumb {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-raised);
}

.skill-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms var(--ease);
}

.skill-card:hover .skill-thumb img {
  transform: scale(1.03);
}

.skill-body {
  display: grid;
  gap: 10px;
  justify-items: start;
  padding-right: clamp(0px, 2vw, 16px);
}

.skill-body .card-title {
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
}

.skill-body .card-title a {
  text-decoration: none;
}

.skill-body .card-title a:hover {
  color: var(--accent);
}

.skill-body .card-hook {
  max-width: 34em;
  font-size: 0.95rem;
}

.skill-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-top: 8px;
}

.skill-actions .btn {
  min-height: 44px;
  padding: 0 18px;
  font-size: 14px;
}

.download-meta {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.skill {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: clamp(28px, 4vw, 40px);
  padding-top: 28px;
}

.skill::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  z-index: -1;
  width: 70%;
  height: 50%;
  border-radius: 50%;
  background: var(--game);
  opacity: 0.12;
  filter: blur(100px);
  pointer-events: none;
}

.skill-head {
  display: grid;
  gap: 20px;
  justify-items: start;
  max-width: 780px;
}

.skill-head .eyebrow {
  color: var(--game);
  filter: brightness(1.15);
}

.skill h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 720;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.skill-head .game-actions {
  align-items: center;
}

.skill-demo {
  display: grid;
  gap: 10px;
  margin: 0;
}

.skill-demo video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid color-mix(in srgb, var(--game) 40%, var(--border));
  border-radius: var(--radius-lg);
  background: #0c0c12;
  box-shadow: 0 40px 80px -40px #000;
}

.skill-demo figcaption {
  color: var(--muted);
  font-size: 13px;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 18px;
}

.skill-grid .loop {
  max-width: none;
}

.skill code {
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: var(--bg-raised);
  font-family: var(--font-mono);
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.prompt {
  display: grid;
  gap: 8px;
  max-width: 780px;
  padding: 16px 20px;
  border-left: 2px solid var(--game);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--surface);
}

.prompt-label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.prompt-label [data-l="ja"] {
  letter-spacing: 0.04em;
}

.prompt-text {
  font-size: 1.02rem;
  text-wrap: pretty;
}

.facts--wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: none;
}

.skill-notes {
  display: grid;
  gap: 10px;
  max-width: 780px;
}

/* ---------- The team (home): Nyx + Claude ----------
   Each card takes its colour from --who: mint for Nyx, orange for Claude.
   Claude's card is mirrored (portrait on the right) on wide screens. */

.duo {
  display: grid;
  gap: 18px;
}

.dev {
  --who: var(--accent);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 56px);
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse 50% 80% at 0% 50%, color-mix(in srgb, var(--who) 10%, transparent), transparent 70%),
    var(--surface);
}

.dev .eyebrow {
  color: var(--who);
}

.dev--claude {
  --who: var(--claude);
  grid-template-columns: minmax(0, 1fr) auto;
  background:
    radial-gradient(ellipse 50% 80% at 100% 50%, color-mix(in srgb, var(--who) 10%, transparent), transparent 70%),
    var(--surface);
}

.dev--claude .dev-portrait {
  order: 2;
}

/* Square illustrated portrait in a frame tinted with the card colour. */
.dev-portrait {
  width: clamp(150px, 20vw, 220px);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid color-mix(in srgb, var(--who) 45%, var(--border));
  border-radius: var(--radius-lg);
  box-shadow:
    0 24px 48px -24px #000,
    0 0 0 6px color-mix(in srgb, var(--bg) 60%, transparent),
    0 0 40px -10px color-mix(in srgb, var(--who) 45%, transparent);
}

.dev-copy {
  display: grid;
  gap: 14px;
  justify-items: start;
}

.dev-copy h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.dev-copy p {
  max-width: 38em;
  color: var(--muted);
}

.status-lines {
  display: grid;
  gap: 6px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 13px;
}

.status-lines li {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.status-emoji {
  flex: 0 0 auto;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}

/* ---------- Channels ---------- */

.channels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 12px;
}

.channel {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
  transition:
    transform 220ms var(--ease),
    border-color 220ms var(--ease),
    background-color 220ms var(--ease);
}

.channel:hover,
.channel:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.channel-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  background: var(--bg-raised);
  transition: color 220ms var(--ease), border-color 220ms var(--ease);
}

.channel:hover .channel-icon,
.channel:focus-visible .channel-icon {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  color: var(--accent);
}

.channel-icon svg {
  width: 18px;
  height: 18px;
}

.channel-copy {
  display: grid;
  min-width: 0;
}

.channel-name {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
}

.channel-handle {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.footer {
  margin-top: clamp(56px, 9vw, 96px);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding-block: 22px 28px;
}

.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
}

.footer-note {
  letter-spacing: 0.02em;
}

.footer-note .claude {
  color: var(--claude);
}

/* ---------- Motion ---------- */

@keyframes signal {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Smooth cross-page transitions (Chromium, Safari 18.2+). Box art
   carries a matching view-transition-name on the home shelf and on its
   game page, so the poster morphs between the two. */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 260ms;
  animation-timing-function: var(--ease);
}

::view-transition-group(*) {
  animation-duration: 420ms;
  animation-timing-function: var(--ease);
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > *,
  .feature,
  .game-info > *,
  .game-art,
  .skill-head > *,
  .skill-demo {
    animation: rise 700ms var(--ease) both;
  }

  .skill-head > :nth-child(2) {
    animation-delay: 60ms;
  }

  .skill-head > :nth-child(n + 3) {
    animation-delay: 120ms;
  }

  .skill-demo {
    animation-delay: 180ms;
  }

  .hero-copy > :nth-child(2),
  .game-info > :nth-child(2) {
    animation-delay: 60ms;
  }

  .hero-copy > :nth-child(3),
  .game-info > :nth-child(3) {
    animation-delay: 120ms;
  }

  .hero-copy > :nth-child(n + 4),
  .game-info > :nth-child(n + 4) {
    animation-delay: 180ms;
  }

  .feature {
    animation-delay: 140ms;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  /* The orbit rings are wider than a phone; clip them at the screen edge
     without creating a scroll container. */
  .hero {
    grid-template-columns: 1fr;
    overflow-x: clip;
    text-align: left;
  }

  .feature-art {
    width: min(70vw, 280px);
  }

  .game {
    grid-template-columns: 1fr;
  }

  .game-art {
    position: relative;
    top: 0;
    width: min(72vw, 320px);
    justify-self: center;
  }

  .game::before {
    left: 20%;
  }

  .skill-card,
  .skill-grid {
    grid-template-columns: 1fr;
  }

  .skill-body {
    padding: 0 4px 6px;
  }

  .facts--wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  :root {
    --topbar-h: 56px;
  }

  .brand-text {
    display: none;
  }

  .topnav a {
    font-size: 11px;
    letter-spacing: 0.1em;
  }

  .shelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .shelf--more {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .shelf--more .card-hook {
    display: none;
  }

  /* On phones the "next game" slot becomes a slim full-width row. */
  .card--next {
    grid-column: 1 / -1;
  }

  .card--next .card-body {
    grid-template-columns: auto 1fr;
    justify-items: start;
    align-items: center;
    column-gap: 14px;
    padding: 16px;
    text-align: left;
  }

  .card--next .next-icon {
    grid-row: span 2;
    margin: 0;
  }

  .lang-switch button {
    min-width: 36px;
    padding: 0 8px;
  }

  .card-body {
    padding: 2px 12px 14px;
  }

  .card-title {
    font-size: 0.98rem;
  }

  .card-hook {
    font-size: 0.82rem;
  }

  .dev,
  .dev--claude {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .dev-portrait,
  .dev--claude .dev-portrait {
    order: 0;
    width: 140px;
  }

  .facts {
    grid-template-columns: 1fr 1fr;
  }

  .game-actions,
  .hero-actions {
    width: 100%;
  }

  .game-actions .btn,
  .hero-actions .btn,
  .skill-actions .btn {
    flex: 1 1 auto;
  }

  .skill-actions,
  .skill-head .game-actions {
    width: 100%;
  }

  .download-meta {
    flex-basis: 100%;
    text-align: center;
  }
}

@media (max-width: 400px) {
  .shelf--more {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shelf--more .card:nth-child(3) {
    display: none;
  }
}

@media (hover: none) {
  .card:hover,
  .channel:hover,
  .btn:hover {
    transform: none;
  }
}
