@charset "utf-8";

/* ===========================================================================
   hl.css — Half-Life Japan
   ---------------------------------------------------------------------------
   A single design system for every page under hl/. The visual language is
   taken from the game: Black Mesa concrete, HEV-suit orange, hazard stripes,
   the lambda, and HUD panels drawn with corner brackets rather than boxes.

   The two textures used as backgrounds (img/hl_wp001.jpg, img/hl_wp002.jpg)
   are the site's own 2001 wallpapers, reused rather than replaced.

   Layout is mobile-first; the breakpoints are 600 / 900 / 1120px.
   =========================================================================== */

/* ------------------------------------------------------------------ tokens */

:root {
  /* surfaces */
  --bg:        #08090b;
  --bg-panel:  #101317;
  --bg-panel-2:#161a1f;
  --bg-sunk:   #0b0d10;
  --line:      #252c33;
  --line-soft: #1b2127;

  /* ink */
  --ink:       #dfe4e9;
  --ink-2:     #a8b2bb;
  --ink-dim:   #78838d;

  /* signal colours — HEV suit orange is the primary */
  --hev:       #ff6a00;
  --hev-lit:   #ffa142;
  --hev-deep:  #b64500;
  --xen:       #3fe0c5;   /* Xen crystal / health charger */
  --hazard:    #ffc400;   /* hazard stripe yellow */
  --danger:    #e5383b;
  --gold:      #ffc75a;
  --silver:    #c9d1d9;

  /* type */
  --f-display: "Bahnschrift", "DIN Alternate", "Roboto Condensed",
               "Arial Narrow", "Helvetica Neue", "Yu Gothic UI", sans-serif;
  --f-mono:    ui-monospace, "Cascadia Mono", "Consolas", "SF Mono",
               "Menlo", monospace;
  --f-body:    "Meiryo UI", "メイリオ", "Meiryo", "Hiragino Sans",
               "Noto Sans JP", "Yu Gothic UI", system-ui, sans-serif;

  /* metrics */
  --wrap: 1180px;
  --pad: clamp(1rem, 4vw, 2rem);
  --r: 2px;               /* the facility has no rounded corners to speak of */
  --head-h: 60px;

  --shadow: 0 2px 4px rgb(0 0 0 / .5), 0 12px 32px rgb(0 0 0 / .45);
  --glow: 0 0 12px rgb(255 106 0 / .45);

  color-scheme: dark;
}

/* ------------------------------------------------- cross-document nav */

/* Same-origin navigations cross-fade instead of flashing. Browsers without
   support simply navigate as before; the reduced-motion block below turns the
   animation off for anyone who asks for that. */
@view-transition { navigation: auto; }

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: .22s;
  animation-timing-function: cubic-bezier(.4, 0, .2, 1);
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}

/* --------------------------------------------------------------- reset-ish */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-block-start: calc(var(--head-h) + 1rem);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--f-body);
  font-size: clamp(.94rem, .9rem + .2vw, 1rem);
  line-height: 1.85;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(120% 80% at 50% -10%, rgb(255 106 0 / .10), transparent 60%),
    linear-gradient(rgb(8 9 11 / .90), rgb(8 9 11 / .96)),
    url("../img/hl_wp002.jpg");
  background-repeat: no-repeat, no-repeat, repeat;
  background-attachment: fixed, fixed, fixed;
  background-size: auto, auto, 420px;
  min-height: 100vh;
  /* `clip` (unlike `hidden`) does not create a scroll container, so
     position: sticky on the masthead keeps working. */
  overflow-x: clip;
  overflow-wrap: anywhere;
  word-break: normal;
  line-break: strict;
}

/* CRT scanlines. Static, very low contrast — a texture, not an effect. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  background: repeating-linear-gradient(
    to bottom,
    rgb(255 255 255 / .020) 0 1px,
    transparent 1px 3px);
  mix-blend-mode: overlay;
}

img, video, svg { max-width: 100%; height: auto; border: 0; display: block; }

a { color: var(--hev-lit); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--hev); }
a:visited { color: #d79a6a; }
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--hev);
  outline-offset: 3px;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

hr {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  margin: 2rem 0;
}

::selection { background: var(--hev); color: #000; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.skip {
  position: absolute;
  inset-inline-start: -9999px;
  z-index: 200;
}
.skip:focus {
  inset-inline-start: 1rem;
  inset-block-start: 1rem;
  background: var(--hev);
  color: #000;
  padding: .6rem 1rem;
  font-weight: 700;
}

/* ------------------------------------------------------------------- type */

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  letter-spacing: .02em;
}

.eyebrow {
  font-family: var(--f-mono);
  font-size: .68rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--hev);
  margin: 0 0 .45rem;
  display: flex;
  align-items: center;
  gap: .55rem;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgb(255 106 0 / .55), transparent);
}

/* ------------------------------------------------------------ hazard tape */

.hazard {
  height: 6px;
  background: repeating-linear-gradient(
    -45deg,
    var(--hazard) 0 10px,
    #14151a 10px 20px);
  opacity: .85;
}

/* --------------------------------------------------------------- masthead */

.site-head {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgb(10 12 14 / .88);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}

.site-head__bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--head-h);
  /* The nav is a flex child here. Below 1120px it has to break to its own
     full-width row, or `display: block` leaves the open drawer sitting in the
     flex line beside the brand as a narrow floating column. */
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--ink);
  flex: 0 0 auto;
}
.brand:visited { color: var(--ink); }
.brand svg { width: 26px; height: 26px; flex: 0 0 auto; filter: drop-shadow(0 0 6px rgb(255 106 0 / .6)); }
.brand b {
  font-family: var(--f-display);
  font-size: 1.16rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  display: block;
  line-height: 1;
}
.brand i {
  font-family: var(--f-mono);
  font-style: normal;
  font-size: .6rem;
  letter-spacing: .34em;
  color: var(--hev);
  display: block;
  line-height: 1.4;
}
.brand:hover b { color: var(--hev-lit); }

.nav-toggle {
  margin-inline-start: auto;
  font: 700 .72rem/1 var(--f-mono);
  letter-spacing: .18em;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  padding: .6rem .8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .5rem;
  white-space: nowrap;
}
.nav-toggle:hover { border-color: var(--hev); color: var(--hev-lit); }
.nav-toggle .bars { display: grid; gap: 3px; }
.nav-toggle .bars span { display: block; width: 16px; height: 2px; background: currentColor; }
.nav-toggle[aria-expanded="true"] { border-color: var(--hev); color: var(--hev); }

/* nav — drawer on small screens, bar on large */
.site-nav {
  display: none;
  flex: 0 0 100%;
  padding-block: .5rem 1rem;
  border-top: 1px solid var(--line-soft);
}
.site-nav.is-open { display: block; }

.site-nav ul { list-style: none; margin: 0; padding: 0; }

.site-nav > ul > li > a,
.site-nav > ul > li > .grp-btn {
  display: block;
  width: 100%;
  text-align: start;
  font: 700 .82rem/1 var(--f-display);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  padding: .8rem .2rem;
  border-bottom: 1px solid var(--line-soft);
  background: none;
  border-inline: 0;
  border-top: 0;
  cursor: pointer;
}
.site-nav > ul > li > a:visited { color: var(--ink); }
.site-nav > ul > li > a:hover,
.site-nav > ul > li > .grp-btn:hover { color: var(--hev-lit); }
.site-nav a[aria-current="page"],
.site-nav > ul > li.is-here > a,
.site-nav > ul > li.is-here > .grp-btn { color: var(--hev); }

.grp-btn::after {
  content: "▾";
  float: inline-end;
  color: var(--hev);
  transition: transform .18s;
}
.grp-btn[aria-expanded="true"]::after { transform: rotate(180deg); }

.site-nav .sub { display: none; padding: .3rem 0 .7rem .9rem; }
.site-nav .sub.is-open { display: block; }
.site-nav .sub a {
  display: block;
  padding: .42rem 0;
  font-size: .88rem;
  color: var(--ink-2);
  text-decoration: none;
}
.site-nav .sub a:hover { color: var(--hev-lit); }
.site-nav .sub a[aria-current="page"] { color: var(--hev); }
.site-nav .sub a[aria-current="page"]::before { content: "▸ "; }

@media (min-width: 1120px) {
  .site-head__bar { flex-wrap: nowrap; }
  .nav-toggle { display: none; }
  .site-nav {
    display: block;
    flex: 0 1 auto;
    margin-inline-start: auto;
    padding: 0;
    border: 0;
  }
  /* The list is the positioning context for every dropdown, and it stretches
     to the full height of the bar. So `top: 100%` means "the bottom of the
     bar" (clear of the hazard tape) and `inset-inline-end: 0` means "the right
     end of the menu" — the same edge for all three panels, rather than each
     one hanging off its own button. Stretching the items also gives the
     pointer a larger target on the way down. */
  .site-nav { align-self: stretch; }
  .site-nav > ul { position: relative; display: flex; align-items: stretch; gap: .15rem; height: 100%; }
  .site-nav > ul > li { display: flex; align-items: center; }
  .site-nav > ul > li > a,
  .site-nav > ul > li > .grp-btn {
    width: auto;
    padding: .55rem .7rem;
    border: 0;
    font-size: .78rem;
    white-space: nowrap;
  }
  .grp-btn::after { float: none; margin-inline-start: .35rem; display: inline-block; }
  .site-nav .sub {
    display: block;
    position: absolute;
    top: 100%;
    /* clear the 6px hazard tape and the masthead's 1px bottom border, which
       would otherwise cut across the first entries of the panel */
    margin-block-start: 7px;
    /* .hazard carries opacity: .85, which makes it a stacking context painted
       at z-index 0 — and it comes later in the document, so without this it
       paints *over* the panel rather than under it. */
    z-index: 1;
    /* Flush with the right end of the menu — the same edge for Guide, Mods
       and BBS, so the panel appears in one fixed place whichever group the
       pointer is on. */
    inset-inline-end: 0;
    min-width: 15rem;
    background: rgb(13 16 19 / .98);
    backdrop-filter: blur(12px);
    border: 1px solid var(--line);
    border-top: 2px solid var(--hev);
    padding: .5rem;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .16s, transform .16s, visibility .16s;
  }
  .site-nav > ul > li:hover .sub,
  .site-nav .sub.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  /* The gap the panel was pushed down by is dead ground for the pointer: a
     hover-opened panel would close as the cursor crossed the tape. The panel
     reaches back up over it with a transparent bridge — inert while the panel
     is hidden, since `visibility: hidden` takes the pseudo-element with it.
     It is offset from the panel's *padding* box, so it has to span the 7px
     margin plus the 2px top border to reach the bottom of the bar. */
  .site-nav .sub::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    top: -9px;
    height: 9px;
  }

  .site-nav .sub a { padding: .45rem .6rem; }
  .site-nav .sub a:hover { background: rgb(255 106 0 / .12); }
}

/* ------------------------------------------------------------ breadcrumbs */

.crumbs {
  border-bottom: 1px solid var(--line-soft);
  background: rgb(8 9 11 / .6);
}
.crumbs ol {
  list-style: none;
  margin: 0;
  padding-block: .6rem;
  display: flex;
  flex-wrap: wrap;
  gap: .2rem .5rem;
  font-family: var(--f-mono);
  font-size: .7rem;
  letter-spacing: .06em;
  color: var(--ink-dim);
}
.crumbs li + li::before { content: "/"; color: var(--hev-deep); margin-inline-end: .5rem; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--hev-lit); }
.crumbs [aria-current="page"] { color: var(--hev); }

/* ------------------------------------------------------------------- main */

main { display: block; padding-block: clamp(1.5rem, 4vw, 3rem) clamp(2rem, 6vw, 4rem); }

/* ------------------------------------------------------------ HUD panels */

/* The house container. Corner brackets instead of a full border keeps the
   HUD read without boxing every block in a hard rectangle. */
.panel {
  position: relative;
  background:
    linear-gradient(180deg, rgb(22 26 31 / .92), rgb(14 17 20 / .92));
  border: 1px solid var(--line);
  padding: clamp(1.1rem, 3vw, 1.9rem);
  margin-block-end: 1.6rem;
}
.panel::before,
.panel::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid var(--hev);
  pointer-events: none;
}
.panel::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.panel::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.panel > :first-child { margin-block-start: 0; }
.panel > :last-child { margin-block-end: 0; }

/* Section heading used inside and above panels. */
.sec-head {
  display: flex;
  align-items: baseline;
  gap: .7rem;
  flex-wrap: wrap;
  margin-block: 0 1.1rem;
  padding-block-end: .55rem;
  border-bottom: 1px solid var(--line);
  font-size: clamp(1.05rem, .95rem + .5vw, 1.35rem);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.sec-head::before {
  content: "";
  width: 4px;
  align-self: stretch;
  background: var(--hev);
  box-shadow: var(--glow);
  flex: 0 0 auto;
}
.sec-head .jp { text-transform: none; letter-spacing: normal; font-family: var(--f-body); }

/* --------------------------------------------------------------- page head */

.page-head { margin-block-end: 2rem; }
.page-head h1 {
  font-size: clamp(1.6rem, 1.2rem + 2.4vw, 3rem);
  text-transform: uppercase;
  letter-spacing: .01em;
  text-shadow: 0 0 26px rgb(255 106 0 / .35);
}
.page-head h1 .jp {
  display: block;
  font-family: var(--f-body);
  font-size: clamp(.9rem, .8rem + .5vw, 1.15rem);
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink-2);
  margin-block-start: .5rem;
  text-shadow: none;
}
.page-head .lede {
  margin-block-start: 1rem;
  color: var(--ink-2);
  max-width: 68ch;
}

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

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgb(8 9 11 / .45), rgb(8 9 11 / .92)),
    url("../img/hl_wp001.jpg") center / cover no-repeat;
  padding: clamp(1.6rem, 5vw, 3.4rem) clamp(1.1rem, 4vw, 2.6rem);
  margin-block-end: 2rem;
}
.hero::after {
  content: "";
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  height: 6px;
  background: repeating-linear-gradient(-45deg, var(--hazard) 0 10px, #14151a 10px 20px);
  opacity: .8;
}
.hero__art {
  margin-inline: auto;
  margin-block-end: 1.4rem;
  box-shadow: var(--shadow);
  border: 1px solid rgb(255 106 0 / .35);
}
.hero h1 {
  font-size: clamp(1.8rem, 1.1rem + 3.6vw, 3.6rem);
  text-transform: uppercase;
  text-align: center;
  text-shadow: 0 0 30px rgb(255 106 0 / .45);
}
.hero .sub {
  text-align: center;
  color: var(--ink-2);
  margin-block-start: .7rem;
}

/* home hero puts the 2001 banner art front and centre */
.hero--home { display: grid; gap: 1.6rem; place-items: center; text-align: center; }
.hero--home .hero__art { max-width: 480px; width: 100%; }
.hero--home .counter { margin: 0; }

/* --------------------------------------------------------------- counter */

.counter {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--f-mono);
  font-size: .65rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-dim);
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  padding: .45rem .7rem;
}
.counter img { display: block; }
.counter::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--xen);
  box-shadow: 0 0 8px var(--xen);
  border-radius: 50%;
  flex: 0 0 auto;
}

/* ----------------------------------------------------------- card grids */

.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}
/* 題名が2行に折れるカードがあっても、全行を同じ高さに揃える（2列以上のとき） */
@media (min-width: 30rem) { .cards--even { grid-auto-rows: 1fr; } }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  background: linear-gradient(180deg, rgb(22 26 31 / .9), rgb(13 16 19 / .9));
  border: 1px solid var(--line);
  border-left: 3px solid var(--hev-deep);
  padding: .95rem 1rem;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .18s, transform .18s, background .18s;
}
.card:visited { color: var(--ink); }
.card:hover {
  border-color: var(--line);
  border-left-color: var(--hev);
  background: linear-gradient(180deg, rgb(30 34 40 / .95), rgb(16 19 23 / .95));
  transform: translateY(-2px);
}
.card .k {
  font-family: var(--f-mono);
  font-size: .62rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--hev);
}
.card .t {
  font-family: var(--f-display);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.card .d { font-size: .82rem; color: var(--ink-dim); line-height: 1.6; }
.card--ext .t::after { content: " ↗"; color: var(--hev); font-size: .8em; }

/* numbered chapter cards */
.card--num { padding-inline-start: 3.2rem; }
.card--num .n {
  position: absolute;
  inset-inline-start: .85rem;
  inset-block-start: .85rem;
  font-family: var(--f-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--hev-deep);
  line-height: 1;
}
.card:hover .n { color: var(--hev); }

/* --------------------------------------------------------- link clusters */

.linklist { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.linklist li { display: flex; gap: .6rem; align-items: baseline; }
.linklist li::before { content: "▸"; color: var(--hev); flex: 0 0 auto; }
.linklist .note { color: var(--ink-dim); font-size: .84rem; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--f-mono);
  font-size: .74rem;
  letter-spacing: .08em;
  text-decoration: none;
  color: var(--ink-2);
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  padding: .42rem .75rem;
  transition: .18s;
}
.chip:hover, .chip:visited:hover { color: #000; background: var(--hev); border-color: var(--hev); }
.chip:visited { color: var(--ink-2); }
.chip--ext::after { content: "↗"; color: var(--hev); }
.chip--ext:hover::after { color: #000; }

/* ------------------------------------------------- walkthrough step cards */

.steps { display: grid; gap: 1.4rem; }

.step {
  position: relative;
  background: linear-gradient(180deg, rgb(20 24 28 / .92), rgb(12 15 18 / .92));
  border: 1px solid var(--line);
  border-top: 2px solid var(--hev-deep);
  padding: clamp(1rem, 2.6vw, 1.6rem);
  transition: border-top-color .2s;
}
.step:hover { border-top-color: var(--hev); }

.step__head {
  display: flex;
  align-items: baseline;
  gap: .7rem;
  flex-wrap: wrap;
  margin-block-end: .9rem;
}
.step__code {
  font-family: var(--f-mono);
  font-size: .66rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #000;
  background: var(--hev);
  padding: .18rem .5rem;
  /* Some map codes are long enough (rebellion/pf.html) to push a 360px
     viewport sideways, so the badge wraps rather than holding its width. */
  flex: 0 1 auto;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.step__title {
  font-family: var(--f-display);
  font-size: clamp(1rem, .95rem + .35vw, 1.2rem);
  font-weight: 700;
  letter-spacing: .03em;
}
.step__grid { display: grid; gap: 1.1rem; }
.step__body > :last-child { margin-block-end: 0; }
.step__body p { text-indent: 0; }

@media (min-width: 900px) {
  .step__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); align-items: start; }
  .step--shot-left .step__grid { grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); }
  .step--shot-left .step__body { order: 2; }
  .step--shot-left .step__shot { order: 1; }
  .step__shot { position: sticky; top: calc(var(--head-h) + 1rem); }
}

/* ----------------------------------------------- walkthrough part heading */

/* rebellion/fc.html and tfc.html split their step list into named parts
   ("Partie 1/2", "攻略手順", "攻略に直接関係無い場所"). The 2001 markup drew these as a
   bare coloured <span> sitting between two <hr>s, which reads as a heading but
   was not one. This is that same divider as a real heading; it is a grid item
   of .steps, not a .step card. */
.step-part {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin: .6rem 0 0;
  font-family: var(--f-display);
  font-size: clamp(.95rem, .9rem + .3vw, 1.1rem);
  font-weight: 700;
  letter-spacing: .06em;
  color: #7aa7ff;          /* the blue these labels have carried since 2001 */
}
.step-part::before,
.step-part::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.step-part:first-child { margin-block-start: 0; }

/* ------------------------------------------------------------- shot / fig */

.shot {
  margin: 0;
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  padding: 6px;
}
.shot img {
  width: 100%;
  display: block;
  background: #000;
}
.shot figcaption {
  font-size: .8rem;
  line-height: 1.6;
  color: var(--ink-2);
  padding: .55rem .3rem .15rem;
}
.shot--link { display: block; text-decoration: none; color: inherit; transition: border-color .18s; }
.shot--link:hover { border-color: var(--hev); }
.shot--link:visited { color: inherit; }

/* zoomable image gets an affordance */
.zoom { position: relative; display: block; }
.zoom::after {
  content: "⤢";
  position: absolute;
  inset-block-end: 6px;
  inset-inline-end: 6px;
  font-size: .7rem;
  line-height: 1;
  color: #000;
  background: var(--hev);
  padding: .25rem .35rem;
  opacity: 0;
  transition: opacity .18s;
}
.shot--link:hover .zoom::after,
.zoom:hover::after { opacity: 1; }

/* gallery grid */
.shotgrid {
  display: grid;
  gap: .9rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}
.shotgrid--wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }

/* numbered screenshot guide (Hazard course / Uplink) */
.guide { display: grid; gap: 1.1rem; counter-reset: gstep; }
.guide__item {
  display: grid;
  gap: 1rem;
  align-items: center;
  background: linear-gradient(180deg, rgb(20 24 28 / .9), rgb(12 15 18 / .9));
  border: 1px solid var(--line);
  padding: clamp(.8rem, 2.4vw, 1.2rem);
}
.guide__item .shot { border-color: var(--line-soft); }
.guide__txt { position: relative; padding-inline-start: 2.6rem; }
.guide__txt::before {
  counter-increment: gstep;
  content: counter(gstep, decimal-leading-zero);
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: -.1rem;
  font-family: var(--f-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--hev-deep);
}
@media (min-width: 760px) {
  .guide__item { grid-template-columns: minmax(0, 17rem) minmax(0, 1fr); }
}

/* ------------------------------------------------------------- review score */

.score {
  display: grid;
  gap: 1rem;
  align-items: center;
  background: linear-gradient(120deg, rgb(255 106 0 / .10), rgb(13 16 19 / .9) 45%);
  border: 1px solid var(--line);
  border-left: 3px solid var(--hev);
  padding: clamp(1rem, 3vw, 1.5rem);
  margin-block-end: 1.6rem;
}
@media (min-width: 700px) { .score { grid-template-columns: auto 1fr auto; } }

/* All three parts are paragraphs; the grid does the spacing. */
.score__label,
.score__stars,
.score__num { margin: 0; }

.score__label {
  font-family: var(--f-mono);
  font-size: .68rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--hev);
}
.score__stars {
  font-size: clamp(1rem, .8rem + 1.1vw, 1.5rem);
  letter-spacing: .12em;
  color: var(--gold);
  line-height: 1.3;
  text-shadow: 0 0 14px rgb(255 199 90 / .35);
  overflow-wrap: normal;
}
.score__num {
  font-family: var(--f-display);
  font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.4rem);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .02em;
  white-space: nowrap;
}
.score__num small { color: var(--ink-dim); font-size: .5em; }
.score__by {
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .12em;
  color: var(--ink-dim);
}

/* --------------------------------------------------------- update history */

.history { list-style: none; margin: 0; padding: 0; display: grid; }
.history li {
  display: grid;
  gap: .1rem .9rem;
  grid-template-columns: auto 1fr;
  padding: .5rem 0 .5rem 1.15rem;
  border-bottom: 1px dashed var(--line-soft);
  position: relative;
}
.history li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 1.05em;
  width: 5px; height: 5px;
  background: var(--hev-deep);
  transform: rotate(45deg);
}
.history li:first-child::before { background: var(--hev); box-shadow: var(--glow); }
.history time {
  font-family: var(--f-mono);
  font-size: .74rem;
  letter-spacing: .06em;
  color: var(--hev);
  white-space: nowrap;
  padding-block-start: .25em;
}
.history span { font-size: .92rem; color: var(--ink-2); }
.history li:first-child span { color: var(--ink); }

@media (max-width: 560px) {
  .history li { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------- bbs posts */

.thread { display: grid; gap: 1.2rem; }
.post {
  background: linear-gradient(180deg, rgb(20 24 28 / .9), rgb(12 15 18 / .9));
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  padding: clamp(.9rem, 2.6vw, 1.4rem);
}
.post:target { border-left-color: var(--hev); }
.post__head {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .9rem;
  align-items: baseline;
  padding-block-end: .6rem;
  margin-block-end: .8rem;
  border-bottom: 1px solid var(--line-soft);
}
.post__no {
  font-family: var(--f-mono);
  font-size: .66rem;
  letter-spacing: .12em;
  color: #000;
  background: var(--hev);
  padding: .15rem .45rem;
}
.post__subject {
  font-family: var(--f-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.post__meta {
  font-family: var(--f-mono);
  font-size: .72rem;
  color: var(--ink-dim);
  letter-spacing: .04em;
  margin-inline-start: auto;
}
.post__meta a { color: var(--ink-2); }
.post__body { font-size: .94rem; }
.post__body a { overflow-wrap: anywhere; }

.thread-toc { list-style: none; margin: 0 0 1.6rem; padding: 0; display: grid; gap: .35rem; }
.thread-toc a {
  display: flex;
  flex: 1 1 auto;
  gap: .6rem;
  align-items: center;
  text-decoration: none;
  color: var(--ink-2);
  padding: .4rem .55rem;
  border: 1px solid transparent;
  border-left: 2px solid var(--line);
  font-size: .88rem;
}
.thread-toc a:hover { color: var(--hev-lit); border-left-color: var(--hev); background: rgb(255 106 0 / .06); }
.thread-toc .re { color: var(--ink-dim); font-family: var(--f-mono); font-size: .7rem; }
.thread-toc .depth { padding-inline-start: 1.6rem; }

/* --------------------------------------------------------------- section nav */

.secnav {
  border: 1px solid var(--line);
  background: rgb(11 13 16 / .8);
  padding: .75rem clamp(.8rem, 2.5vw, 1.1rem);
  margin-block-end: 1.8rem;
}
.secnav__label {
  font-family: var(--f-mono);
  font-size: .62rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-block-end: .55rem;
}
.secnav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.secnav a {
  display: block;
  font-family: var(--f-mono);
  font-size: .73rem;
  letter-spacing: .06em;
  text-decoration: none;
  color: var(--ink-2);
  border: 1px solid var(--line);
  padding: .35rem .65rem;
  transition: .16s;
}
.secnav a:visited { color: var(--ink-2); }
.secnav a:hover { border-color: var(--hev); color: var(--hev-lit); }
.secnav a[aria-current="page"] {
  background: var(--hev);
  border-color: var(--hev);
  color: #000;
  font-weight: 700;
}

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

.pager {
  display: grid;
  gap: .7rem;
  grid-template-columns: 1fr;
  margin-block-start: 2.2rem;
  padding-block-start: 1.4rem;
  border-top: 1px solid var(--line);
}
@media (min-width: 700px) { .pager { grid-template-columns: 1fr 1fr; } }
.pager a {
  display: grid;
  gap: .2rem;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: .8rem 1rem;
  transition: .18s;
}
.pager a:visited { color: var(--ink); }
.pager a:hover { border-color: var(--hev); background: rgb(255 106 0 / .07); }
.pager .dir { font-family: var(--f-mono); font-size: .64rem; letter-spacing: .18em; color: var(--hev); text-transform: uppercase; }
.pager .t { font-family: var(--f-display); font-weight: 700; letter-spacing: .03em; }
.pager .next { text-align: end; }
.pager .next:only-child { grid-column: 2; }

/* --------------------------------------------------------------- lightbox */

/* `display` must stay scoped to [open]: a bare `display: grid` here would beat
   the UA's `dialog:not([open]) { display: none }` and paint the overlay over
   every page. */
.lb:not([open]) { display: none; }

.lb[open] {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: clamp(.75rem, 4vw, 2.5rem);
  background: rgb(4 5 6 / .93);
  backdrop-filter: blur(6px);
  border: 0;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  overflow: auto;
}
.lb::backdrop { background: rgb(4 5 6 / .9); }
.lb__fig { margin: 0; display: grid; gap: .8rem; justify-items: center; }
.lb__fig img {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  border: 1px solid rgb(255 106 0 / .4);
  box-shadow: var(--shadow);
  background: #000;
}
.lb__cap { font-size: .85rem; color: var(--ink-2); text-align: center; max-width: 60ch; }
.lb__close {
  position: fixed;
  inset-block-start: clamp(.5rem, 2vw, 1.2rem);
  inset-inline-end: clamp(.5rem, 2vw, 1.2rem);
  font: 700 .78rem/1 var(--f-mono);
  letter-spacing: .12em;
  color: var(--ink);
  background: rgb(16 19 23 / .9);
  border: 1px solid var(--line);
  padding: .6rem .8rem;
  cursor: pointer;
}
.lb__close:hover { border-color: var(--hev); color: var(--hev); }

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

.site-foot {
  border-top: 1px solid var(--line);
  background: rgb(6 7 9 / .85);
  margin-block-start: auto;
}
.site-foot__grid {
  display: grid;
  gap: 1.6rem;
  padding-block: 2.2rem 1.4rem;
}
@media (min-width: 760px) {
  .site-foot__grid { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
}
.site-foot h2 {
  font-family: var(--f-mono);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--hev);
  margin-block-end: .7rem;
}
.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.site-foot a { color: var(--ink-2); text-decoration: none; font-size: .85rem; }
.site-foot a:visited { color: var(--ink-2); }
.site-foot a:hover { color: var(--hev-lit); }
/* The base row carries the rights notice, so it is a three-column grid
   (lambda | legal block | back-to-top) rather than a single wrapping line. */
.site-foot__base {
  border-top: 1px solid var(--line-soft);
  padding-block: 1.1rem 1.8rem;
  display: grid;
  gap: .5rem 1rem;
  grid-template-columns: auto 1fr;
  align-items: start;
  color: var(--ink-dim);
}
.site-foot__base .lam {
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--hev);
}

@media (min-width: 700px) {
  .site-foot__base { grid-template-columns: auto 1fr auto; }
}

.legal { min-width: 0; }
.legal p {
  margin: 0;
  font-size: .74rem;
  line-height: 1.85;
  color: var(--ink-dim);
  overflow-wrap: normal;
}
/* SHO's own copyright reads a shade brighter than the attributions.
   Keyed by class, not position: pages that carried their own (C)SHO have an
   extra paragraph above and nth-of-type would land on the wrong line. */
.legal .legal-copy { color: var(--ink-2); }
.legal .legal-en {
  font-family: var(--f-mono);
  font-size: .66rem;
  letter-spacing: .02em;
  margin-block-start: .45rem;
  padding-block-start: .45rem;
  border-top: 1px solid var(--line-soft);
  color: #5f6a73;
}
/* the per-page (C)SHO the original markup carried, when a page had one */
.legal .page-copy {
  font-family: var(--f-mono);
  font-size: .68rem;
  letter-spacing: .1em;
  margin-block-end: .4rem;
  color: #5f6a73;
}

.site-foot__base .to-top { grid-column: 2; justify-self: start; }
@media (min-width: 700px) {
  .site-foot__base .to-top { grid-column: 3; justify-self: end; align-self: center; }
}

.to-top {
  text-decoration: none;
  white-space: nowrap;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  padding: .35rem .6rem;
}
.to-top:hover { color: var(--hev); border-color: var(--hev); }

/* ------------------------------------------------------------- utilities */

.u-c-red    { color: var(--danger); }
.u-c-gold   { color: var(--gold); }
.u-c-silver { color: var(--silver); }
.u-c-white  { color: #fff; }
.u-c-green  { color: #5fd47a; }
.u-c-blue   { color: #7aa7ff; }
.u-c-orange { color: var(--hev-lit); }
.u-c-yellow { color: var(--hazard); }
.u-c-gray   { color: var(--ink-dim); }
.u-c-purple { color: #c08bff; }
.u-c-brown  { color: #c98d63; }
.u-c-black  { color: var(--ink); }   /* black-on-dark would vanish */
.u-c-snow   { color: #f2f6fa; }
.u-mark     { color: var(--hev); }

.u-ta-center { text-align: center; }
.u-ta-right  { text-align: right; }
.u-ta-left   { text-align: left; }
.u-nowrap    { white-space: nowrap; }
.u-mono      { font-family: var(--f-mono); }
.u-dim       { color: var(--ink-dim); }

.stack > * + * { margin-block-start: 1.1rem; }
.center-block { margin-inline: auto; }

pre {
  font-family: var(--f-mono);
  font-size: .78rem;
  line-height: 1.7;
  color: var(--ink-dim);
  background: var(--bg-sunk);
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--hev-deep);
  padding: .7rem .85rem;
  margin: 0 0 .9rem;
  overflow-x: auto;
  white-space: pre-wrap;
}

/* Any legacy fragment the converter could not classify keeps its own markup
   and simply pans inside its own box rather than breaking the page. */
.legacy { overflow-x: auto; margin-block-end: 1.4rem; }
.legacy table { border-collapse: collapse; }
.legacy td, .legacy th { padding: .35rem .5rem; vertical-align: top; }

/* --------------------------------------------------------------- printing */

@media print {
  body { background: #fff; color: #000; }
  body::after, .site-head, .crumbs, .secnav, .pager, .site-foot, .to-top { display: none !important; }
  .panel, .step, .card, .guide__item { border: 1px solid #999; background: none; }
  a { color: #000; }
}

/* ===========================================================================
   Components added for the converted pages.
   =========================================================================== */

.block { margin-block-end: clamp(1.8rem, 5vw, 3rem); }
.block:last-child { margin-block-end: 0; }

/* dropdown group label */
.sub-h {
  font-family: var(--f-mono);
  font-size: .58rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: .55rem .6rem .25rem;
  border-bottom: 1px solid var(--line-soft);
  margin-block-end: .2rem;
}
.site-nav > ul > li > .sub > .sub-h:first-child { padding-block-start: .2rem; }

/* ------------------------------------------------------------ home feature */

.feature {
  display: grid;
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
  background: linear-gradient(120deg, rgb(255 106 0 / .07), rgb(16 19 23 / .9) 55%);
  border: 1px solid var(--line);
  padding: clamp(1.1rem, 3vw, 2rem);
}
@media (min-width: 760px) { .feature { grid-template-columns: minmax(0, 24rem) minmax(0, 1fr); } }
.feature__art {
  display: block;
  border: 1px solid rgb(255 106 0 / .3);
  padding: 6px;
  background: var(--bg-sunk);
  transition: border-color .18s, transform .18s;
}
.feature__art:hover { border-color: var(--hev); transform: translateY(-2px); }
.feature__art img { width: 100%; }
.feature__h {
  font-size: clamp(1.2rem, 1rem + 1vw, 1.7rem);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-block-end: .7rem;
}
.feature__txt p:last-child { margin-block-end: 0; }

/* ---------------------------------------------------------- card variants */

.card--banner {
  align-items: center;
  gap: .7rem;
  border-left-color: var(--line);
  padding: 1rem;
}
.card--banner img { border: 1px solid var(--line); }
.card--review { border-left-color: var(--xen); }
.card--review:hover { border-left-color: var(--xen); }
.card--review .k { color: var(--xen); }
.card--page .d { color: var(--ink-2); }

/* --------------------------------------------------------- prose & panels */

.prose p:last-child { margin-block-end: 0; }
.prose hr { margin: 1.4rem 0; }
.lede { color: var(--ink-2); }
.lede p:last-child { margin-block-end: 0; }
main > .lede.panel { border-left: 3px solid var(--hev-deep); }

.page-copy {
  font-family: var(--f-mono);
  font-size: .68rem;
  letter-spacing: .1em;
  color: var(--ink-dim);
  margin: 0;
}

/* ------------------------------------------------------------- back links */

.backrow {
  margin-block-start: 2rem;
  font-family: var(--f-mono);
  font-size: .78rem;
  letter-spacing: .1em;
  color: var(--ink-dim);
  text-align: center;
}
.backlink {
  display: inline-block;
  text-decoration: none;
  color: var(--ink-2);
  border: 1px solid var(--line);
  padding: .5rem 1.1rem;
  margin-inline: .3rem;
  transition: .18s;
}
.backlink:visited { color: var(--ink-2); }
.backlink:hover { border-color: var(--hev); color: var(--hev); background: rgb(255 106 0 / .08); }

/* --------------------------------------------------------------- embeds */

.embed {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  max-width: 44rem;
  margin: 1.4rem auto;
  border: 1px solid var(--line);
  background: #000;
}
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* inline figure inside running prose */
.shot--inline {
  max-width: 32rem;
  margin: 1.2rem auto;
}

/* the ★ in a walkthrough title, and ■ markers in headings */
h1 .u-mark.star { color: var(--gold); text-shadow: 0 0 18px rgb(255 199 90 / .5); }
.sec-head .u-mark { font-size: .7em; }

.sec-head.movie {
  text-transform: none;
  letter-spacing: normal;
  font-family: var(--f-display);
}

/* ---------------------------------------------------------------- bbs bits */

.post__name { font-weight: 700; color: var(--ink); }
.post__pre { margin-block-end: .8rem; }
.post__body p:last-child { margin-block-end: 0; }

.thread-toc li { display: flex; align-items: center; }
.thread-toc .nr { display: inline-block; margin-inline-end: .4rem; flex: 0 0 auto; }
.thread-toc .sp { flex: 0 0 auto; opacity: 0; }
.thread-toc .sj { flex: 1 1 auto; }
.thread-toc a img { display: inline-block; }

.bbs-credit {
  margin-block-start: 2rem;
  font-size: .72rem;
  color: var(--ink-dim);
  text-align: end;
}
.bbs-credit a { color: var(--ink-dim); }

/* The Half-Life 2 gallery headings carry the (long dead) download link for
   each movie, so they need to read as links rather than as plain headings. */
.sec-head.movie a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dotted var(--hev-deep);
}
.sec-head.movie a:visited { color: var(--ink); }
.sec-head.movie a:hover { color: var(--hev-lit); border-bottom-color: var(--hev); }
.sec-head.movie a::after { content: " \2197"; font-size: .7em; color: var(--hev); }
.sec-head.movie b { font-weight: 700; }
.sec-head.movie span { font-weight: 400; color: var(--ink-dim); font-size: .8em; }

/* One-line spec entries (動作環境, マルチプレイヤーゲーム). */
.speclist { list-style: none; margin: 0; padding: 0; display: grid; }
.speclist li {
  padding: .5rem 0 .5rem 1.2rem;
  border-bottom: 1px dashed var(--line-soft);
  position: relative;
  line-height: 1.7;
}
.speclist li:last-child { border-bottom: 0; }
.speclist li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 1.05em;
  width: 5px; height: 5px;
  background: var(--hev-deep);
  transform: rotate(45deg);
}

.eyebrow--link a { color: var(--hev); text-decoration: none; }
.eyebrow--link a:visited { color: var(--hev); }
.eyebrow--link a:hover { color: var(--hev-lit); text-decoration: underline; }


/* 権利・削除依頼の注記（第三者が書いたページに置く） */
.rights-note {
  margin: 0 0 18px;
  padding: 10px 14px;
  border-left: 3px solid var(--hev, #ff6a00);
  background: rgba(128, 128, 128, 0.08);
  font-size: 13px;
  line-height: 1.85;
}
