@font-face {
  font-family: "DotGothic16";
  src: url("../fonts/dotgothic16-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DotGothic16";
  src: url("../fonts/dotgothic16-japanese.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+3000-30FF, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FF00-FFEF, U+20000-2FA1F;
}

:root {
  --paper: #f7f0df;
  --paper-2: #fffaf0;
  --paper-3: #efe3cd;
  --ink: #29231d;
  --ink-soft: #4e4439;
  --muted: #786b5a;
  --line: #c8b99f;
  --line-dark: #8d7c64;
  --red: #c73e36;
  --red-deep: #8f2722;
  --sky: #96c9dc;
  --sky-deep: #2f6f8d;
  --green: #6f8f57;
  --green-deep: #3e5b35;
  --gold: #d7a33f;
  --pink: #e8b2bd;
  --black: #171411;
  --white: #fffdf8;
  --shadow: 5px 5px 0 rgba(41, 35, 29, 0.14);
  --serif: "Yu Mincho", "Hiragino Mincho ProN", "MS PMincho", serif;
  --sans: "MS PGothic", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  --display: "DotGothic16", "MS PGothic", monospace;
  --max: 1160px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background-color: #81786b;
  background-image:
    linear-gradient(115deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 9px),
    url("../img/star-grid.svg");
  background-size: auto, 40px 40px;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.85;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2.2 7.8L22 12l-7.8 2.2L12 22l-2.2-7.8L2 12l7.8-2.2z' fill='%23c73e36' stroke='%23fffdf8' stroke-width='1.2'/%3E%3C/svg%3E") 12 12, auto;
}

::selection {
  color: var(--white);
  background: var(--red);
}

img {
  max-width: 100%;
  height: auto;
  border-style: none;
}

a {
  color: var(--sky-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--red);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px dotted var(--red);
  outline-offset: 3px;
}

button,
input,
select {
  font: inherit;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
blockquote,
dl,
dd {
  margin-top: 0;
}

ul,
ol {
  padding-left: 1.4em;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 8px 14px;
  color: var(--white);
  background: var(--red);
  border: 2px solid var(--white);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: none;
}

.page {
  width: min(var(--max), calc(100% - 34px));
  margin: 24px auto;
  background: var(--paper);
  border: 1px solid #221d18;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.32);
}

/* ---------- utility ---------- */
.muted {
  color: var(--muted);
}
.small {
  font-size: 11px;
  line-height: 1.7;
}
.tiny {
  font-size: 9px;
  line-height: 1.6;
}
.center {
  text-align: center;
}
.nowrap {
  white-space: nowrap;
}
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 29px;
  padding: 4px 18px;
  color: #e8dcc6;
  background: var(--black);
  border-bottom: 1px solid #4b4035;
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 1.4px;
}

.topbar p {
  margin: 0;
}

.topbar .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  background: var(--red);
  border-radius: 50%;
  animation: blink 1.3s steps(2, start) infinite;
}

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.topbar a {
  color: #e8dcc6;
  text-decoration: none;
}

.topbar a:hover {
  color: #fff;
  text-decoration: underline;
}

/* ---------- masthead ---------- */
.masthead {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 18px 24px 16px;
  background:
    radial-gradient(circle at 90% 20%, rgba(199, 62, 54, 0.08), transparent 24%),
    linear-gradient(180deg, var(--paper-2), var(--paper));
  border-bottom: 5px double var(--ink);
}

.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
  flex: 0 0 auto;
  color: var(--ink);
  text-decoration: none;
  transform: rotate(-0.7deg);
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  display: grid;
  grid-template-columns: 35px 35px 53px;
  grid-template-rows: 35px 35px;
  gap: 3px;
  filter: drop-shadow(3px 3px 0 rgba(199, 62, 54, 0.28));
}

.brand-cell {
  display: grid;
  place-items: center;
  color: var(--paper-2);
  background: var(--ink);
  font-family: var(--display);
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0;
}

.brand-cell.b1 { grid-area: 1 / 1; }
.brand-cell.b2 { grid-area: 1 / 2; }
.brand-cell.b3 { grid-area: 2 / 1; }
.brand-cell.b4 { grid-area: 2 / 2; }
.brand-cell.b5 {
  grid-area: 1 / 3 / 3 / 4;
  font-size: 32px;
  background: var(--red);
}

.brand-sub {
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 2.1px;
  text-align: center;
}

.masthead-copy {
  min-width: 0;
}

.archive-label {
  display: inline-block;
  margin-bottom: 4px;
  padding: 1px 7px;
  color: var(--red);
  border: 1px solid var(--red);
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 2px;
  transform: rotate(-1deg);
}

.masthead-copy h1,
.masthead-copy .site-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.35;
}

.masthead-copy p {
  margin: 2px 0 0;
  color: var(--muted);
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 1.7px;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 10px;
  margin-left: auto;
  max-width: 560px;
}

.main-nav a {
  position: relative;
  display: inline-block;
  padding: 4px 2px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 1px;
  text-decoration: none;
}

.main-nav a::before,
.main-nav a::after {
  color: var(--line-dark);
  opacity: 0;
  transition: opacity 0.15s;
}

.main-nav a::before { content: "【"; }
.main-nav a::after { content: "】"; }

.main-nav a:hover::before,
.main-nav a:hover::after,
.main-nav a[aria-current="page"]::before,
.main-nav a[aria-current="page"]::after {
  opacity: 1;
}

.main-nav a[aria-current="page"] {
  color: var(--red);
}

/* ---------- ticker ---------- */
.ticker {
  display: flex;
  align-items: center;
  height: 31px;
  overflow: hidden;
  color: var(--paper-2);
  background: var(--red-deep);
  border-bottom: 1px solid #61211e;
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 2px;
  white-space: nowrap;
}

.ticker-track {
  display: flex;
  flex: 0 0 auto;
  width: max-content;
  animation: ticker 36s linear infinite;
}

.ticker-track span {
  display: inline-block;
  padding-right: 3.2em;
}

.ticker b {
  color: #ffe5a7;
  font-weight: 400;
}

/* ---------- shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 194px minmax(0, 1fr) 182px;
  gap: 22px;
  padding: 22px;
  align-items: start;
}

.rail {
  min-width: 0;
  font-size: 12px;
  line-height: 1.7;
}

.rail-left {
  padding-right: 4px;
}

.rail-right {
  padding-left: 4px;
}

.rail-title {
  margin: 20px 0 9px;
  padding: 3px 2px;
  border-top: 4px double var(--ink);
  border-bottom: 4px double var(--ink);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 1.5px;
  text-align: center;
}

.rail-title:first-child {
  margin-top: 0;
}

.rail-title small {
  display: block;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.8px;
}

.menu-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu-list li {
  border-bottom: 1px dotted var(--line-dark);
}

.menu-list a {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 6px 2px;
  color: var(--ink);
  text-decoration: none;
}

.menu-list a::before {
  content: "■";
  color: var(--red);
  font-size: 7px;
  transform: translateY(-2px);
}

.menu-list a:hover {
  color: var(--red);
  background: rgba(255, 250, 240, 0.7);
}

.menu-list .en {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 0.5px;
}

.rail-worklist {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: railwork;
}

.rail-worklist li {
  counter-increment: railwork;
  border-bottom: 1px dotted var(--line);
}

.rail-worklist a {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 2px 5px;
  align-items: baseline;
  padding: 5px 1px;
  color: var(--ink);
  text-decoration: none;
}

.rail-worklist a::before {
  content: counter(railwork, decimal-leading-zero);
  color: var(--red);
  font-family: var(--display);
  font-size: 9px;
}

.rail-worklist a:hover {
  color: var(--red);
}

.rail-worklist .y {
  color: var(--muted);
  font-family: var(--display);
  font-size: 8px;
}

.rail-worklist .t {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-note {
  margin: 10px 0;
  padding: 8px 9px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  font-size: 10px;
  line-height: 1.7;
}

.rail-note p {
  margin: 0 0 4px;
}

.rail-note p:last-child {
  margin-bottom: 0;
}

.rail-note .label {
  color: var(--red);
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 1px;
}

.counter {
  margin: 10px 0 4px;
  padding: 8px 6px 6px;
  color: #ffd98a;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 3px),
    var(--black);
  border: 3px double #6e5b42;
  text-align: center;
}

.counter-label {
  color: #c8b99f;
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 1.6px;
}

.counter-digits {
  display: block;
  margin: 1px 0;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 3px;
  line-height: 1.4;
  text-shadow: 0 0 7px rgba(255, 198, 92, 0.7);
}

.counter-sub {
  color: #8f7d64;
  font-size: 8px;
  line-height: 1.5;
}

.banner-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}

.banner-stack a {
  display: block;
  line-height: 0;
  filter: saturate(0.92);
}

.banner-stack a:hover {
  filter: saturate(1.15) contrast(1.03);
}

.banner-stack img {
  display: block;
  width: auto;
  max-width: 100%;
  border: 1px solid #6e5b42;
}

.banner-stack .wide {
  flex: 1 1 100%;
}

.qr-figure {
  margin: 9px 0 5px;
  text-align: center;
}

.qr-figure img {
  width: 78px;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--line-dark);
  image-rendering: pixelated;
}

.qr-figure figcaption {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.riffle-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 6px 7px;
  color: var(--ink);
  background: #e5d6b9;
  border: 1px solid var(--line-dark);
  text-decoration: none;
  font-family: var(--display);
  font-size: 9px;
  line-height: 1.5;
}

.riffle-badge:hover {
  color: var(--ink);
  background: #f0e4cd;
}

.riffle-badge img {
  width: 24px;
  height: 24px;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(0, 0.97fr);
  margin-bottom: 30px;
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--ink);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 140px;
  height: 7px;
  background: repeating-linear-gradient(90deg, var(--red) 0 16px, var(--paper) 16px 22px);
}

.hero-copy {
  position: relative;
  z-index: 1;
  padding: 30px 28px 28px;
  background-image:
    linear-gradient(180deg, rgba(255, 250, 240, 0.82), rgba(247, 240, 223, 0.94)),
    url("../img/star-grid.svg");
  background-size: auto, 40px 40px;
}

.hero-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
}

.stamp {
  display: inline-block;
  padding: 1px 7px;
  color: var(--white);
  background: var(--red);
  border: 1px solid var(--red-deep);
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 1.2px;
  transform: rotate(-1.5deg);
}

.stamp.stamp-dark {
  color: var(--paper-2);
  background: var(--ink);
  border-color: var(--ink);
}

.stamp.stamp-sky {
  color: #102a36;
  background: var(--sky);
  border-color: var(--sky-deep);
}

.hero-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(44px, 5.7vw, 72px);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 0.98;
  text-shadow: 4px 4px 0 rgba(199, 62, 54, 0.16);
}

.hero-title .line {
  display: block;
}

.hero-title .step {
  color: var(--red);
  font-size: 0.92em;
  letter-spacing: 0.08em;
}

.hero-en {
  margin: 7px 0 12px;
  color: var(--sky-deep);
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 4px;
}

.hero-lead {
  max-width: 35em;
  margin-bottom: 18px;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 15px;
  color: var(--paper-2);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 0;
  box-shadow: 3px 3px 0 var(--red);
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 1px;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}

.btn:hover {
  color: var(--paper-2);
  background: var(--red-deep);
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--ink);
}

.btn.btn-red {
  color: var(--white);
  background: var(--red);
  border-color: var(--red-deep);
  box-shadow: 3px 3px 0 var(--ink);
}

.btn.btn-red:hover {
  background: var(--red-deep);
  color: var(--white);
}

.btn.btn-ghost {
  color: var(--ink);
  background: transparent;
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--line);
}

.btn.btn-ghost:hover {
  color: var(--red);
  background: var(--paper-2);
  border-color: var(--red);
}

.btn.btn-small {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 10px;
  box-shadow: 2px 2px 0 rgba(41, 35, 29, 0.2);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 13px;
  margin: 16px 0 0;
  padding: 0;
  color: var(--muted);
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 0.8px;
  list-style: none;
}

.hero-meta li::before {
  content: "●";
  margin-right: 5px;
  color: var(--red);
  font-size: 6px;
  vertical-align: 1px;
}

.hero-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 22px 22px 26px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(47, 111, 141, 0.92), rgba(38, 83, 105, 0.98)),
    var(--sky-deep);
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.2) 0 2px, transparent 2px),
    linear-gradient(45deg, transparent 47%, rgba(255, 255, 255, 0.09) 47% 53%, transparent 53%);
  background-size: 22px 22px, 26px 26px;
  opacity: 0.7;
}

.hero-photo {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 7px 7px 26px;
  background: var(--white);
  box-shadow: 7px 8px 0 rgba(0, 0, 0, 0.24);
  transform: rotate(1.2deg);
}

.hero-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid #c9baa3;
}

.hero-photo figcaption {
  position: absolute;
  right: 8px;
  bottom: 5px;
  left: 8px;
  color: var(--muted);
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 0.4px;
  line-height: 1.4;
  text-align: right;
}

.hero-photo::before,
.hero-photo::after {
  content: "";
  position: absolute;
  z-index: 2;
  width: 66px;
  height: 19px;
  background: rgba(233, 213, 174, 0.84);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.hero-photo::before {
  top: -9px;
  left: -20px;
  transform: rotate(-34deg);
}

.hero-photo::after {
  right: -20px;
  bottom: 15px;
  transform: rotate(-34deg);
}

.hero-sticker {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 11px;
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  color: var(--white);
  background: var(--red);
  border: 2px solid var(--paper-2);
  border-radius: 50%;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2);
  font-family: var(--display);
  font-size: 10px;
  line-height: 1.3;
  text-align: center;
  transform: rotate(9deg);
  animation: floaty 4s ease-in-out infinite;
}

.hero-sticker b {
  display: block;
  font-size: 18px;
  font-weight: 400;
}

.hero-visual .mini-train {
  position: absolute;
  z-index: 2;
  right: 10px;
  bottom: 4px;
  width: 96px;
  opacity: 0.9;
  animation: train-bob 3.2s ease-in-out infinite;
}

.hero-visual .visual-note {
  position: relative;
  z-index: 1;
  margin: 12px 0 0;
  color: #e5f3f8;
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 1.2px;
  text-align: center;
}

/* ---------- home intro strip ---------- */
.welcome {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  margin: 0 0 30px;
  padding: 13px 18px;
  background: var(--paper-2);
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
}

.welcome p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.8;
}

.welcome strong {
  color: var(--red);
}

.welcome .cat {
  width: 45px;
  height: 45px;
}

.home-profile {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 0 0 30px;
  padding: 10px 13px;
  background: var(--paper-2);
  border: 1px solid var(--line-dark);
  border-left: 6px solid var(--red);
}

.home-profile .mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--paper-2);
  background: var(--ink);
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1;
  transform: rotate(-2deg);
}

.home-profile p {
  margin: 0;
  font-size: 11px;
  line-height: 1.75;
}

.home-profile b {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.home-profile .alias {
  color: var(--muted);
  font-size: 9px;
}

.home-profile .more {
  color: var(--ink);
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 0.5px;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  white-space: nowrap;
}

.home-profile .more:hover {
  color: var(--red);
  border-color: var(--red);
}

/* ---------- sections ---------- */
.section {
  margin-top: 34px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--ink);
}

.section-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.35;
}

.section-head .en {
  display: block;
  margin-top: 1px;
  color: var(--red);
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 2.2px;
}

.section-head .more {
  flex: 0 0 auto;
  color: var(--ink);
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 1px;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
}

.section-head .more:hover {
  color: var(--red);
  border-color: var(--red);
}

/* ---------- work cards ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
}

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

.work-card {
  position: relative;
  min-width: 0;
  background: var(--paper-2);
  border: 1px solid var(--ink);
  box-shadow: 3px 3px 0 var(--line);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.work-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink-soft);
}

.work-card-link {
  display: block;
  height: 100%;
  color: var(--ink);
  text-decoration: none;
}

.work-card-link:hover {
  color: var(--ink);
}

.work-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--black);
  border-bottom: 1px solid var(--ink);
}

.work-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, filter 0.5s ease;
}

.work-card:hover .work-media img {
  transform: scale(1.035);
  filter: saturate(1.08);
}

.work-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(23, 20, 17, 0.46));
  pointer-events: none;
}

.work-year {
  position: absolute;
  z-index: 1;
  top: 7px;
  left: 7px;
  padding: 0 6px;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--ink);
  font-family: var(--display);
  font-size: 9px;
  line-height: 1.9;
}

.work-no {
  position: absolute;
  z-index: 1;
  right: 7px;
  bottom: 7px;
  color: var(--paper-2);
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 1px;
  text-shadow: 1px 1px 1px #000;
}

.work-play {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 47px;
  height: 47px;
  color: var(--white);
  background: rgba(199, 62, 54, 0.92);
  border: 2px solid var(--white);
  border-radius: 50%;
  font-size: 14px;
  transform: translate(-50%, -50%) scale(0.88);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
}

.work-card:hover .work-play,
.work-card:focus-within .work-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.work-body {
  padding: 11px 13px 12px;
}

.work-kicker {
  margin: 0 0 2px;
  color: var(--red);
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 1.4px;
}

.work-title {
  margin: 0;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.work-en {
  margin: 0 0 7px;
  color: var(--muted);
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 1.2px;
  line-height: 1.5;
}

.work-desc {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 9px;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag {
  display: inline-block;
  padding: 0 5px;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 8px;
  line-height: 1.8;
  white-space: nowrap;
}

.tag-red {
  color: var(--red);
  border-color: rgba(199, 62, 54, 0.45);
  background: #f9e7e3;
}

.work-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 7px;
  border-top: 1px dotted var(--line);
  color: var(--muted);
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 0.8px;
}

.work-foot .arrow {
  color: var(--red);
}

/* ---------- memo / updates ---------- */
.memo-grid {
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 17px;
  align-items: start;
}

.memo-box {
  padding: 13px 15px 14px;
  background: var(--paper-2);
  border: 1px solid var(--ink);
  box-shadow: 3px 3px 0 var(--line);
}

.memo-box h3 {
  margin: 0 0 6px;
  padding-bottom: 5px;
  border-bottom: 1px dotted var(--line-dark);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 1px;
}

.memo-box h3 small {
  float: right;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0;
}

.update-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.update-item {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 9px;
  padding: 7px 0;
  border-bottom: 1px dotted var(--line);
}

.update-item:last-child {
  border-bottom: 0;
}

.update-date {
  height: fit-content;
  padding: 0 3px;
  font-family: var(--display);
  font-size: 8px;
  line-height: 1.9;
  text-align: center;
  white-space: nowrap;
}

.date-spring { color: #9c2d5d; background: #fdcee7; border-left: 3px solid #d73780; }
.date-summer { color: #1e6d18; background: #d2f9b7; border-left: 3px solid #0b9100; }
.date-autumn { color: #8a3305; background: #f3c8b6; border-left: 3px solid #9e3903; }
.date-winter { color: #155f99; background: #b6e2fa; border-left: 3px solid #1e83d5; }

.update-text {
  margin: 0;
  font-size: 11px;
  line-height: 1.7;
}

.update-text b {
  color: var(--red);
  font-weight: 400;
}

.update-text a {
  text-decoration: none;
  border-bottom: 1px solid var(--sky);
}

.memo-note {
  font-size: 11px;
  line-height: 1.8;
}

.memo-note p {
  margin-bottom: 8px;
}

.memo-note .quote {
  margin: 10px 0;
  padding: 8px 10px;
  color: var(--ink-soft);
  background: var(--paper);
  border-left: 4px solid var(--red);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.8;
}

.mini-links {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 10px;
}

.mini-links li {
  padding: 3px 0;
  border-bottom: 1px dotted var(--line);
}

.mini-links a::before {
  content: "→";
  margin-right: 4px;
  color: var(--red);
}

/* ---------- page head ---------- */
.page-head {
  position: relative;
  margin-bottom: 22px;
  padding: 3px 0 14px;
  border-bottom: 4px double var(--ink);
}

.breadcrumb {
  margin: 0 0 8px;
  color: var(--muted);
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 1px;
  list-style: none;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb li + li::before {
  content: ">";
  margin-right: 4px;
  color: var(--line-dark);
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--red);
}

.page-head h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 400;
  letter-spacing: 0.07em;
  line-height: 1.35;
}

.page-head .page-en {
  margin: 1px 0 7px;
  color: var(--red);
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 3px;
}

.page-head .page-lead {
  max-width: 47em;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.9;
}

.page-head .head-deco {
  position: absolute;
  right: 2px;
  bottom: 12px;
  color: rgba(199, 62, 54, 0.18);
  font-family: var(--display);
  font-size: 38px;
  line-height: 1;
  pointer-events: none;
}

/* ---------- works index ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0 0 18px;
  padding: 8px 10px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}

.filter-bar .filter-label {
  margin-right: 4px;
  color: var(--muted);
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 1px;
}

.filter-btn {
  padding: 2px 9px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-dark);
  border-radius: 0;
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 0.5px;
  cursor: pointer;
}

.filter-btn:hover,
.filter-btn.is-active {
  color: var(--white);
  background: var(--red);
  border-color: var(--red-deep);
}

.filter-count {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--display);
  font-size: 8px;
}

.work-card[hidden] {
  display: none;
}

.archive-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper-2);
  font-size: 11px;
}

.archive-table caption {
  padding: 0 0 8px;
  color: var(--muted);
  font-size: 10px;
  text-align: left;
}

.archive-table th,
.archive-table td {
  padding: 7px 8px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.archive-table th {
  color: var(--paper-2);
  background: var(--ink);
  font-family: var(--display);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 1px;
  white-space: nowrap;
}

.archive-table tr:nth-child(even) td {
  background: #fbf3e4;
}

.archive-table .year {
  width: 56px;
  font-family: var(--display);
  white-space: nowrap;
}

.archive-table .status {
  width: 82px;
  color: var(--red);
  font-family: var(--display);
  font-size: 8px;
  white-space: nowrap;
}

/* ---------- generic panel / prose ---------- */
.panel {
  padding: 16px 18px;
  background: var(--paper-2);
  border: 1px solid var(--ink);
  box-shadow: 3px 3px 0 var(--line);
}

.panel-title {
  margin: 0 0 8px;
  padding-bottom: 5px;
  border-bottom: 1px dotted var(--line-dark);
  font-family: var(--display);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.prose {
  font-size: 13px;
  line-height: 2;
}

.prose h2 {
  margin: 27px 0 9px;
  padding: 3px 8px;
  color: var(--ink);
  background: linear-gradient(90deg, #eadbc0, transparent);
  border-left: 5px solid var(--red);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.05em;
  line-height: 1.55;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  margin: 20px 0 6px;
  color: var(--red-deep);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.prose p {
  margin-bottom: 13px;
}

.prose ul,
.prose ol {
  margin-bottom: 13px;
}

.prose li {
  margin-bottom: 3px;
}

.prose a {
  border-bottom: 1px solid var(--sky);
  text-decoration: none;
}

.prose a:hover {
  border-color: var(--red);
}

.prose blockquote {
  margin: 15px 0;
  padding: 10px 14px;
  color: var(--ink-soft);
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 5px solid var(--red);
  font-family: var(--serif);
  font-size: 13.5px;
}

.prose code {
  padding: 1px 4px;
  background: #eadfcb;
  border: 1px solid var(--line);
  font-family: Consolas, monospace;
  font-size: 0.9em;
}

.note {
  margin: 15px 0;
  padding: 10px 13px;
  color: var(--ink-soft);
  background: #f5ead5;
  border: 1px dashed var(--line-dark);
  font-size: 11px;
  line-height: 1.8;
}

.note strong {
  color: var(--red);
}

.spoiler {
  margin: 15px 0;
  background: #f2e6d2;
  border: 1px solid var(--line-dark);
}

.spoiler summary {
  padding: 7px 12px;
  color: var(--red-deep);
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.spoiler summary:hover {
  background: #ecdec4;
}

.spoiler .spoiler-body {
  padding: 0 13px 11px;
  font-size: 12px;
  line-height: 1.9;
}

.spoiler .spoiler-body p:last-child {
  margin-bottom: 0;
}

/* ---------- work detail ---------- */
.work-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--ink);
}

.work-hero .work-cn {
  margin: 2px 0 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.work-hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(28px, 4.2vw, 44px);
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.3;
}

.work-hero .work-en {
  margin: 0 0 7px;
  color: var(--red);
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 2.6px;
}

.work-hero-side {
  padding: 9px 11px;
  background: var(--paper-2);
  border: 1px solid var(--line-dark);
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 0.5px;
  line-height: 1.9;
}

.work-hero-side p {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  padding: 1px 0;
  border-bottom: 1px dotted var(--line);
}

.work-hero-side p:last-child {
  border-bottom: 0;
}

.work-hero-side dt,
.work-hero-side span {
  color: var(--muted);
}

.work-hero-side b {
  font-weight: 400;
}

.work-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 214px;
  gap: 18px;
  align-items: start;
}

.work-main {
  min-width: 0;
}

.work-aside {
  min-width: 0;
}

.work-aside .panel {
  margin-bottom: 14px;
  padding: 11px 12px;
  box-shadow: 2px 2px 0 var(--line);
}

.work-aside .panel-title {
  font-size: 12px;
}

.data-list {
  margin: 0;
  font-size: 10px;
  line-height: 1.7;
}

.data-list div {
  display: grid;
  grid-template-columns: 5.5em 1fr;
  gap: 5px;
  padding: 4px 0;
  border-bottom: 1px dotted var(--line);
}

.data-list div:last-child {
  border-bottom: 0;
}

.data-list dt {
  color: var(--muted);
}

.data-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.aside-links {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 10px;
}

.aside-links li {
  padding: 3px 0;
}

.aside-links a::before {
  content: "→";
  margin-right: 3px;
  color: var(--red);
}

.work-tags {
  margin-bottom: 16px;
}

.work-quick {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 17px;
}

.quick-item {
  padding: 8px 9px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}

.quick-item .k {
  display: block;
  color: var(--muted);
  font-family: var(--display);
  font-size: 7px;
  letter-spacing: 1px;
}

.quick-item .v {
  display: block;
  font-family: var(--display);
  font-size: 11px;
  line-height: 1.5;
}

/* ---------- flash player ---------- */
.player-panel {
  margin-bottom: 20px;
  color: #e8dcc6;
  background: #0f0d0b;
  border: 1px solid var(--ink);
  box-shadow: 5px 5px 0 rgba(41, 35, 29, 0.22);
}

.player-topbar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 9px;
  color: #c8b99f;
  background: #2a241e;
  border-bottom: 1px solid #4b4035;
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 1px;
}

.player-topbar .lights {
  display: inline-flex;
  gap: 4px;
}

.player-topbar .lights i {
  display: block;
  width: 7px;
  height: 7px;
  background: #6e5b42;
  border-radius: 50%;
}

.player-topbar .lights i:first-child { background: var(--red); }
.player-topbar .lights i:nth-child(2) { background: var(--gold); }
.player-topbar .lights i:nth-child(3) { background: var(--green); }

.player-topbar .file {
  margin-left: auto;
  overflow: hidden;
  color: #8f7d64;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flash-shell {
  background: #000;
}

.flash-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-height: 72vh;
  margin: 0 auto;
  overflow: hidden;
  background: #000;
  aspect-ratio: var(--w, 4) / var(--h, 3);
}

.flash-stage[data-portrait="true"] {
  max-width: calc(72vh * var(--w) / var(--h));
}

.flash-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  filter: brightness(0.82) saturate(0.95);
  transition: opacity 0.3s;
}

.flash-launch {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 14px 22px;
  color: var(--white);
  background: rgba(23, 20, 17, 0.82);
  border: 2px solid var(--paper-2);
  box-shadow: 4px 4px 0 var(--red);
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.flash-launch:hover {
  background: var(--red-deep);
  transform: translate(1px, 1px);
}

.flash-launch:disabled {
  cursor: wait;
  opacity: 0.8;
}

.flash-launch .icon {
  font-size: 24px;
  line-height: 1;
}

.flash-launch small {
  color: #c8b99f;
  font-size: 8px;
  letter-spacing: 0.7px;
}

.flash-stage.is-playing .flash-poster,
.flash-stage.is-playing .flash-launch {
  opacity: 0;
  pointer-events: none;
}

.flash-stage.is-playing .flash-poster {
  visibility: hidden;
}

.flash-stage ruffle-player {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  z-index: 1;
}

.flash-loading {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--paper-2);
  background: rgba(15, 13, 11, 0.8);
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 1px;
}

.flash-loading[hidden] {
  display: none;
}

.flash-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding: 7px 8px;
  background: #241f1a;
  border-top: 1px solid #4b4035;
}

.flash-controls[hidden] {
  display: none;
}

.ctrl {
  min-height: 27px;
  padding: 3px 8px;
  color: #e8dcc6;
  background: #373029;
  border: 1px solid #5d4e3f;
  border-radius: 0;
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 0.6px;
  cursor: pointer;
}

.ctrl:hover {
  color: var(--white);
  background: var(--red-deep);
  border-color: var(--red);
}

.ctrl[aria-pressed="true"] {
  color: var(--ink);
  background: var(--gold);
  border-color: #a87a21;
}

.flash-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  color: #a9967c;
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 0.5px;
}

.flash-status .led {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 4px var(--green);
}

.flash-status.is-paused .led {
  background: var(--gold);
  box-shadow: 0 0 4px var(--gold);
}

.flash-status.is-error .led {
  background: var(--red);
  box-shadow: 0 0 4px var(--red);
}

.flash-caption {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  justify-content: space-between;
  margin: 0;
  padding: 5px 8px;
  color: #8f7d64;
  background: #171411;
  font-family: var(--display);
  font-size: 7px;
  letter-spacing: 0.5px;
  line-height: 1.6;
}

.flash-fallback {
  margin: 0;
  padding: 9px 10px;
  color: #e8dcc6;
  background: #3a201d;
  border-top: 1px solid #6b3731;
  font-size: 10px;
  line-height: 1.7;
}

.flash-fallback[hidden] {
  display: none;
}

.flash-fallback a {
  color: #ffd98a;
}

.player-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.7;
}

/* ---------- about ---------- */
.profile-card {
  display: grid;
  grid-template-columns: 122px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 22px;
  padding: 16px;
  background: var(--paper-2);
  border: 1px solid var(--ink);
  box-shadow: var(--shadow);
}

.profile-mark {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  color: var(--paper-2);
  background: var(--ink);
  border: 5px solid var(--paper-2);
  outline: 1px solid var(--ink);
  font-family: var(--serif);
  font-size: 50px;
  line-height: 1;
  transform: rotate(-2deg);
}

.profile-card h2 {
  margin: 0 0 2px;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.03em;
}

.profile-card .reading {
  margin: 0 0 8px;
  color: var(--red);
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 2px;
}

.profile-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
  margin: 0;
  font-size: 11px;
  line-height: 1.8;
}

.profile-facts div {
  display: grid;
  grid-template-columns: 4.2em 1fr;
  gap: 4px;
  padding: 2px 0;
  border-bottom: 1px dotted var(--line);
}

.profile-facts dt {
  color: var(--muted);
}

.profile-facts dd {
  margin: 0;
}

.timeline {
  position: relative;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 63px;
  width: 2px;
  background: var(--line-dark);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 20px;
  padding: 0 0 17px;
}

.timeline-year {
  padding-top: 1px;
  color: var(--red);
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: 0.04em;
  text-align: right;
  line-height: 1.4;
}

.timeline-body {
  position: relative;
  padding: 0 0 0 2px;
}

.timeline-body::before {
  content: "";
  position: absolute;
  top: 7px;
  left: -24px;
  width: 8px;
  height: 8px;
  background: var(--paper);
  border: 2px solid var(--red);
  border-radius: 50%;
}

.timeline-body h3 {
  margin: 0 0 2px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.timeline-body p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.8;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 18px;
  align-items: start;
}

.about-grid .panel {
  margin-bottom: 0;
}

.work-log {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 11px;
}

.work-log li {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px dotted var(--line);
}

.work-log .y {
  color: var(--red);
  font-family: var(--display);
  font-size: 9px;
}

.quote-large {
  margin: 18px 0;
  padding: 17px 20px;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--ink);
  border-left: 8px solid var(--red);
  box-shadow: 4px 4px 0 var(--line);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.9;
}

.quote-large small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 1px;
}

/* ---------- links ---------- */
.banner-wall {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.banner-card {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 8px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}

.banner-card a {
  flex: 0 0 auto;
  line-height: 0;
}

.banner-card img {
  display: block;
  border: 1px solid var(--line-dark);
}

.banner-card p {
  margin: 0;
  font-size: 9px;
  line-height: 1.6;
}

.banner-card b {
  display: block;
  color: var(--ink);
  font-family: var(--display);
  font-size: 10px;
  font-weight: 400;
}

.banner-card span {
  color: var(--muted);
  font-size: 8px;
}

.source-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 11px;
}

.source-list li {
  padding: 7px 0;
  border-bottom: 1px dotted var(--line);
}

.source-list a {
  font-weight: 700;
}

.source-list .desc {
  display: block;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.7;
}

.copy-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  padding: 8px;
  background: #e9dcc5;
  border: 1px solid var(--line-dark);
}

.copy-box code {
  overflow: auto;
  padding: 3px 5px;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  font-family: Consolas, monospace;
  font-size: 9px;
  white-space: nowrap;
}

.copy-status {
  margin: 4px 0 0;
  color: var(--green-deep);
  font-family: var(--display);
  font-size: 9px;
}

/* ---------- footer ---------- */
.site-footer {
  position: relative;
  padding: 25px 24px 15px;
  color: #e9dcc5;
  background:
    linear-gradient(180deg, rgba(23, 20, 17, 0.96), rgba(23, 20, 17, 1)),
    var(--black);
  border-top: 6px double var(--red);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.85fr 1fr;
  gap: 24px;
  align-items: start;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--paper-2);
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: 2px;
  text-decoration: none;
}

.footer-brand:hover {
  color: #fff;
}

.footer-brand .mini-mark {
  display: grid;
  grid-template-columns: 13px 13px;
  grid-template-rows: 13px 13px;
  gap: 1px;
  font-family: var(--display);
  font-size: 9px;
  line-height: 1;
}

.footer-brand .mini-mark span {
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--paper-2);
}

.footer-brand .mini-mark span:last-child {
  background: var(--red);
  color: var(--white);
}

.footer-about {
  margin: 8px 0 0;
  color: #b6a68e;
  font-size: 10px;
  line-height: 1.8;
}

.footer-title {
  margin: 0 0 6px;
  color: var(--gold);
  font-family: var(--display);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 1.5px;
}

.footer-links {
  margin: 0;
  padding: 0;
  list-style: none;
  color: #d5c6ae;
  font-size: 10px;
  line-height: 1.9;
}

.footer-links a {
  color: #e9dcc5;
  text-decoration: none;
}

.footer-links a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-links li::before {
  content: "›";
  margin-right: 5px;
  color: var(--red);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: 20px;
  padding-top: 9px;
  color: #8f7d64;
  border-top: 1px dotted #57483a;
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 0.7px;
}

.footer-bottom p {
  margin: 0;
}

.footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin-top: 8px;
}

.footer-badges img {
  border: 1px solid #57483a;
}

/* ---------- supplementary work-page parts ---------- */
.work-media.is-contain {
  background:
    radial-gradient(circle at 50% 45%, #3b332b, #171411 72%);
}

.work-media.is-contain img {
  object-fit: contain;
  padding: 12px;
  image-rendering: pixelated;
}

.cn-box {
  margin: 17px 0;
  padding: 11px 14px;
  background: #f2e6d2;
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
  border-left: 5px solid var(--sky-deep);
  font-size: 11.5px;
  line-height: 1.85;
}

.cn-box p {
  margin: 0;
}

.cn-box p + p {
  margin-top: 5px;
}

.cn-label {
  color: var(--sky-deep) !important;
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 1.5px;
}

.episode-picker {
  padding: 9px 10px 10px;
  background: #241f1a;
  border-top: 1px solid #4b4035;
}

.episode-title {
  margin: 0 0 6px;
  color: #c8b99f;
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 1px;
}

.episode-title span {
  color: #7f6d56;
}

.episode-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.episode-btn {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 10px;
  color: #e8dcc6;
  background: #373029;
  border: 1px solid #5d4e3f;
  border-radius: 0;
  font-family: var(--display);
  font-size: 9px;
  cursor: pointer;
}

.episode-btn small {
  color: #9d896e;
  font-size: 7px;
}

.episode-btn:hover,
.episode-btn.is-active {
  color: var(--ink);
  background: var(--gold);
  border-color: #a87a21;
}

.episode-btn.is-active small {
  color: #5a451e;
}

.work-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 24px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line-dark);
}

.work-pager a {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 10px;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  text-decoration: none;
}

.work-pager a:hover {
  color: var(--red);
  border-color: var(--red);
}

.work-pager span {
  color: var(--muted);
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 1px;
}

.work-pager b {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
}

.work-pager .pager-next {
  text-align: right;
}

.about-screenshot {
  margin: 0;
  padding: 7px 7px 25px;
  background: var(--white);
  border: 1px solid var(--line-dark);
  box-shadow: 4px 4px 0 var(--line);
  transform: rotate(0.6deg);
}

.about-screenshot img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
}

.about-screenshot figcaption {
  margin-top: 7px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
  text-align: right;
}

.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--paper-2);
  background: var(--ink);
  border: 1px solid var(--paper);
  box-shadow: 2px 2px 0 var(--red);
  font-size: 11px;
  line-height: 1;
  text-decoration: none;
}

.to-top:hover {
  color: var(--white);
  background: var(--red-deep);
}

/* ---------- 404 ---------- */
.notfound {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 22px;
  align-items: center;
  min-height: 390px;
  padding: 20px 0;
}

.notfound .big {
  margin: 0;
  color: var(--red);
  font-family: var(--display);
  font-size: clamp(90px, 17vw, 190px);
  line-height: 0.8;
  text-shadow: 5px 5px 0 var(--ink);
}

.notfound h1 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 27px;
  font-weight: 400;
}

.notfound p {
  font-size: 12px;
}

.notfound .cat {
  width: 110px;
  margin-bottom: 8px;
}

/* ---------- animations ---------- */
@keyframes blink {
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0; }
}

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes floaty {
  0%, 100% { transform: rotate(9deg) translateY(0); }
  50% { transform: rotate(6deg) translateY(-4px); }
}

@keyframes train-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

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

/* ---------- responsive ---------- */
@media (max-width: 1040px) {
  .shell {
    grid-template-columns: 182px minmax(0, 1fr);
  }
  .rail-right {
    display: none;
  }
  .page {
    width: min(920px, calc(100% - 24px));
  }
}

@media (max-width: 820px) {
  .masthead {
    flex-wrap: wrap;
    gap: 12px 16px;
    padding: 15px 17px;
  }
  .main-nav {
    order: 3;
    width: 100%;
    max-width: none;
    justify-content: flex-start;
    padding-top: 7px;
    border-top: 1px dotted var(--line-dark);
  }
  .masthead-copy {
    flex: 1 1 260px;
  }
  .shell {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .rail-left {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
    padding: 0 0 8px;
    border-bottom: 1px solid var(--line-dark);
  }
  .rail-left .rail-title {
    margin-top: 0;
  }
  .rail-left .rail-note,
  .rail-left .qr-figure {
    display: none;
  }
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-copy {
    padding: 25px 22px 22px;
  }
  .hero-visual {
    min-height: 320px;
    padding: 22px 26px 28px;
  }
  .hero-photo {
    max-width: 430px;
    margin: 0 auto;
  }
  .hero-visual .visual-note {
    margin-top: 12px;
  }
  .work-grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .memo-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }
  .work-layout {
    grid-template-columns: 1fr;
  }
  .work-aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .work-aside .panel {
    margin-bottom: 0;
  }
  .work-hero {
    grid-template-columns: 1fr;
    gap: 9px;
  }
  .work-hero-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
  }
  .notfound {
    grid-template-columns: 1fr;
    gap: 10px;
    text-align: center;
  }
  .notfound .cat {
    margin: 0 auto 8px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-grid > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 14px;
    background-image: none;
    background-color: #6e675d;
    cursor: auto;
  }
  .page {
    width: 100%;
    margin: 0;
    border-right: 0;
    border-left: 0;
  }
  .topbar {
    padding: 4px 10px;
    font-size: 8px;
    letter-spacing: 0.7px;
  }
  .topbar nav {
    gap: 7px;
  }
  .masthead {
    padding: 13px 12px 11px;
  }
  .brand-mark {
    grid-template-columns: 29px 29px 42px;
    grid-template-rows: 29px 29px;
  }
  .brand-cell {
    font-size: 21px;
  }
  .brand-cell.b5 {
    font-size: 26px;
  }
  .masthead-copy h1 {
    font-size: 18px;
  }
  .masthead-copy p {
    font-size: 8px;
  }
  .archive-label {
    font-size: 7px;
    letter-spacing: 1px;
  }
  .main-nav {
    gap: 2px 7px;
  }
  .main-nav a {
    font-size: 10px;
    padding: 2px 0;
  }
  .ticker {
    height: 27px;
    font-size: 8px;
    letter-spacing: 1px;
  }
  .shell {
    padding: 12px;
    gap: 0;
  }
  .rail-left {
    display: block;
    padding-bottom: 5px;
  }
  .rail-left .rail-title:first-child {
    display: none;
  }
  .rail-left .rail-worklist {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 5px;
  }
  .rail-left .rail-worklist li {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    background: var(--paper-2);
  }
  .rail-left .rail-worklist a {
    display: block;
    padding: 3px 6px;
    font-size: 9px;
  }
  .rail-left .rail-worklist a::before,
  .rail-left .rail-worklist .y {
    display: none;
  }
  .rail-left .menu-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    padding: 5px 0;
    border-bottom: 1px dotted var(--line);
  }
  .rail-left .menu-list li {
    border: 0;
  }
  .rail-left .menu-list a {
    padding: 1px 0;
    font-size: 10px;
  }
  .rail-left .menu-list .en {
    display: none;
  }
  .hero {
    margin-bottom: 22px;
  }
  .hero-copy {
    padding: 21px 16px 18px;
  }
  .hero-title {
    font-size: clamp(40px, 13vw, 58px);
  }
  .hero-en {
    font-size: 9px;
    letter-spacing: 2.4px;
  }
  .hero-lead {
    font-size: 12px;
    line-height: 1.8;
  }
  .hero-actions {
    gap: 7px;
  }
  .btn {
    min-height: 34px;
    padding: 5px 11px;
    font-size: 10px;
  }
  .hero-visual {
    min-height: 270px;
    padding: 17px 19px 22px;
  }
  .hero-sticker {
    width: 58px;
    height: 58px;
    font-size: 8px;
  }
  .hero-sticker b {
    font-size: 15px;
  }
  .hero-visual .mini-train {
    width: 76px;
  }
  .welcome {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 10px 12px;
    margin-bottom: 22px;
  }
  .welcome .cat {
    display: none;
  }
  .home-profile {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 8px 10px;
    margin-bottom: 22px;
    padding: 9px 10px;
  }
  .home-profile .mark {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }
  .home-profile p {
    font-size: 10px;
  }
  .home-profile .more {
    grid-column: 2;
    justify-self: start;
  }
  .section {
    margin-top: 25px;
  }
  .section-head h2 {
    font-size: 18px;
  }
  .work-grid,
  .work-grid.three {
    grid-template-columns: 1fr;
    gap: 13px;
  }
  .work-media {
    aspect-ratio: 16 / 9;
  }
  .memo-grid,
  .about-grid {
    gap: 12px;
  }
  .update-item {
    grid-template-columns: 66px 1fr;
    gap: 7px;
  }
  .profile-card {
    grid-template-columns: 78px 1fr;
    gap: 12px;
    padding: 12px;
  }
  .profile-mark {
    font-size: 32px;
  }
  .profile-card h2 {
    font-size: 19px;
  }
  .profile-facts {
    grid-template-columns: 1fr;
  }
  .timeline::before {
    left: 42px;
  }
  .timeline-item {
    grid-template-columns: 43px minmax(0, 1fr);
    gap: 14px;
  }
  .timeline-year {
    font-size: 12px;
  }
  .timeline-body::before {
    left: -18px;
  }
  .work-hero h1 {
    font-size: 27px;
  }
  .work-hero-side {
    grid-template-columns: 1fr;
  }
  .work-aside {
    grid-template-columns: 1fr;
  }
  .work-quick {
    grid-template-columns: 1fr 1fr;
  }
  .flash-stage {
    max-height: 62vh;
  }
  .flash-controls {
    gap: 4px;
    padding: 6px;
  }
  .ctrl {
    padding: 3px 6px;
    font-size: 7px;
  }
  .flash-status {
    flex: 1 0 100%;
    margin-left: 0;
    padding-top: 2px;
  }
  .banner-wall {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .footer-grid > :first-child {
    grid-column: auto;
  }
  .footer-bottom {
    display: block;
  }
  .notfound {
    min-height: 0;
    padding: 25px 0;
  }
  .notfound h1 {
    font-size: 22px;
  }
  .page-head .head-deco {
    display: none;
  }
  .to-top {
    right: 10px;
    bottom: 10px;
    width: 30px;
    height: 30px;
  }
}
