/* ============================================================
   宵妃那 ／ YoiHina — shared stylesheet
   Showa-era retrofuturism · paper-beige base · skeuomorphic
   ============================================================ */

:root {
  --paper:        #ECE1CB;
  --paper-shadow: #D6C8A8;
  --paper-deep:   #B9A982;
  --ink:          #1A1613;
  --ink-soft:     #3A322B;

  --vermilion:        #B83227;
  --vermilion-dark:   #6B1A10;
  --vermilion-deeper: #4A0F08;
  --vermilion-light:  #D8472F;

  --indigo:        #16345E;
  --indigo-dark:   #0A1D3D;
  --indigo-deeper: #050D1F;
  --indigo-light:  #2A4D7E;

  --mustard:        #D4A02C;
  --mustard-dark:   #8A6314;
  --mustard-deeper: #4A3508;
  --mustard-light:  #ECBB47;

  --moss:           #4A6041;
  --moss-dark:      #2A3825;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Shippori Mincho B1', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2' seed='5'/><feColorMatrix values='0 0 0 0 0.10  0 0 0 0 0.07  0 0 0 0 0.04  0 0 0 0.20 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
  opacity: 0.5;
}

/* CRT scan lines — slowly drift downward (vertical-hold misalignment) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    repeating-linear-gradient(
      to bottom,
      rgba(26, 22, 19, 0.055) 0,
      rgba(26, 22, 19, 0.055) 1px,
      transparent 1px,
      transparent 3px
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(184, 50, 39, 0.025) 0,
      rgba(184, 50, 39, 0.025) 1px,
      transparent 1px,
      transparent 9px
    );
  mix-blend-mode: multiply;
  animation: scan-drift 3s linear infinite;
  will-change: background-position;
}
@keyframes scan-drift {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 0 9px, 0 9px; }
}

/* CRT vertical-retrace beam — slow warm sweep top→bottom */
.crt-beam {
  position: fixed;
  left: 0; right: 0;
  top: 0;
  height: 22vh;
  pointer-events: none;
  z-index: 1;
  transform: translateY(-100%);
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(255, 245, 220, 0.06) 22%,
    rgba(255, 232, 198, 0.14) 45%,
    rgba(255, 220, 180, 0.20) 50%,
    rgba(255, 232, 198, 0.14) 55%,
    rgba(255, 245, 220, 0.06) 78%,
    transparent 100%
  );
  animation: crt-beam 9s linear infinite;
  will-change: transform;
}
@keyframes crt-beam {
  from { transform: translateY(-100%); }
  to   { transform: translateY(100vh); }
}

/* corner registration marks */
.reg {
  position: fixed;
  width: 26px;
  height: 26px;
  color: var(--ink);
  opacity: 0.5;
  z-index: 3;
}
.reg--tl { top: 16px; left: 16px; }
.reg--tr { top: 16px; right: 16px; }
.reg--bl { bottom: 16px; left: 16px; }
.reg--br { bottom: 16px; right: 16px; }

/* watermark numeral */
.watermark {
  position: fixed;
  right: clamp(20px, 5vw, 80px);
  bottom: clamp(50px, 8vw, 130px);
  font-family: 'VT323', monospace;
  font-size: clamp(140px, 22vw, 320px);
  color: var(--mustard);
  opacity: 0.16;
  pointer-events: none;
  line-height: 0.85;
  letter-spacing: -0.06em;
  z-index: 0;
  user-select: none;
}

/* CRT scanline transition element */
.crt-line {
  position: fixed;
  left: 0; right: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-50%) scaleX(0);
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.85) 25%,
    #fff 50%,
    rgba(255,255,255,0.85) 75%,
    transparent 100%);
  box-shadow:
    0 0 12px rgba(255,255,255,0.95),
    0 0 30px rgba(255,255,255,0.7),
    0 0 80px rgba(184, 50, 39, 0.45);
  opacity: 0;
  pointer-events: none;
  z-index: 60;
  will-change: transform, opacity;
}

/* frame */
.frame {
  position: relative;
  min-height: 100vh;
  padding: clamp(28px, 4.5vw, 56px) clamp(24px, 5vw, 64px);
  z-index: 2;
  display: flex;
  flex-direction: column;
  transform-origin: center center;
  will-change: transform, opacity, filter;
}

/* manual header */
.manual-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  padding: 9px 14px;
  margin-bottom: clamp(36px, 6vw, 72px);
  font-family: 'DotGothic16', monospace;
  font-size: clamp(10px, 1.05vw, 13px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background:
    linear-gradient(to right,
      transparent 0,
      transparent calc(50% - 1px),
      var(--ink) calc(50% - 1px),
      var(--ink) calc(50% + 1px),
      transparent calc(50% + 1px));
  background-size: 1px 100%;
  background-position: 50% 0;
  background-repeat: no-repeat;
}
.manual-bar > span { white-space: nowrap; }
.manual-bar .center {
  text-align: center;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* hero (home) */
.hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) 1.15fr;
  gap: clamp(28px, 5vw, 80px);
  align-items: start;
}

.brand-mark {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
}
.kanji-tate {
  writing-mode: vertical-rl;
  font-family: 'Shippori Mincho B1', serif;
  font-weight: 800;
  font-size: clamp(110px, 17vw, 230px);
  line-height: 0.94;
  color: var(--ink);
  letter-spacing: -0.05em;
  text-shadow: 6px 6px 0 var(--vermilion);
}
.kanji-side {
  writing-mode: vertical-rl;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
  padding-left: 8px;
  border-left: 1px dashed var(--ink-soft);
  font-family: 'DotGothic16', monospace;
  font-size: clamp(10px, 1.05vw, 12px);
  letter-spacing: 0.32em;
  color: var(--ink-soft);
}

.info {
  display: flex;
  flex-direction: column;
  gap: clamp(22px, 3vw, 36px);
}

.latin-mark {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.latin-mark h1 {
  margin: 0;
  font-family: 'Shippori Mincho B1', serif;
  font-weight: 700;
  font-size: clamp(40px, 5.6vw, 76px);
  letter-spacing: 0.005em;
  line-height: 1;
}
.latin-mark .slash {
  color: var(--vermilion);
  font-size: clamp(28px, 4vw, 50px);
  font-weight: 800;
}
.latin-mark .ver {
  font-family: 'VT323', monospace;
  font-size: clamp(15px, 1.5vw, 19px);
  color: var(--ink-soft);
  align-self: flex-end;
  margin-bottom: 8px;
  letter-spacing: 0.08em;
}

.title-strip {
  align-self: flex-start;
  background: var(--vermilion);
  color: var(--paper);
  padding: 7px 18px 8px;
  font-family: 'DotGothic16', monospace;
  font-size: clamp(13px, 1.5vw, 16px);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  box-shadow: 5px 5px 0 var(--ink);
}
.title-strip--blue  { background: var(--indigo); }
.title-strip--mustard { background: var(--mustard); color: var(--ink); }

.tagline {
  margin: 0;
  font-family: 'Shippori Mincho B1', serif;
  font-weight: 500;
  font-size: clamp(15px, 1.6vw, 20px);
  line-height: 1.75;
  max-width: 38ch;
  color: var(--ink-soft);
}
.tagline em {
  font-style: normal;
  background: linear-gradient(transparent 62%, rgba(212, 160, 44, 0.55) 62%);
  padding: 0 3px;
  color: var(--ink);
  font-weight: 700;
}

/* console */
.console {
  position: relative;
  background: linear-gradient(180deg, var(--paper-shadow) 0%, var(--paper-deep) 100%);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: clamp(22px, 2.6vw, 32px) clamp(18px, 2.4vw, 28px) clamp(20px, 2.4vw, 26px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.45),
    inset 0 -2px 0 rgba(0,0,0,0.22),
    7px 7px 0 var(--ink);
}
.console-label {
  position: absolute;
  top: -13px;
  left: 18px;
  background: var(--paper);
  padding: 1px 11px 2px;
  font-family: 'DotGothic16', monospace;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  border: 2px solid var(--ink);
  color: var(--ink);
}
.console-serial {
  position: absolute;
  top: -13px;
  right: 18px;
  background: var(--paper);
  padding: 1px 9px 2px;
  font-family: 'VT323', monospace;
  font-size: 14px;
  letter-spacing: 0.1em;
  border: 2px solid var(--ink);
  color: var(--ink-soft);
}

.buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 1.8vw, 22px);
  margin-bottom: 22px;
}

/* ============================================================
   skeuomorphic button
   ============================================================ */
.skeuo {
  appearance: none;
  border: none;
  cursor: pointer;
  position: relative;
  display: block;
  padding: clamp(20px, 2.6vw, 28px) 8px clamp(22px, 2.6vw, 28px);
  border-radius: 11px;
  color: var(--paper);
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  transform: translateY(0);
  transition:
    transform 90ms cubic-bezier(.2,.7,.3,1),
    box-shadow 90ms ease,
    filter 220ms ease;
  isolation: isolate;
  will-change: transform;
}
.skeuo::before {
  content: "";
  position: absolute;
  inset: 4px 6px auto 6px;
  height: 42%;
  border-radius: 8px 8px 36% 36% / 8px 8px 100% 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.04) 100%);
  pointer-events: none;
  z-index: 1;
}
.skeuo::after {
  content: "";
  position: absolute;
  inset: auto 4px 4px 4px;
  height: 32%;
  border-radius: 36% 36% 8px 8px / 100% 100% 8px 8px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.30) 100%);
  pointer-events: none;
  z-index: 1;
}
.skeuo > * { position: relative; z-index: 2; }

.skeuo--red {
  background: linear-gradient(180deg, var(--vermilion-light) 0%, var(--vermilion) 55%, #8a2418 100%);
  box-shadow:
    inset 0 0 0 2px var(--vermilion-dark),
    0 6px 0 var(--vermilion-dark),
    0 9px 0 var(--vermilion-deeper),
    0 13px 18px rgba(0,0,0,0.32);
}
.skeuo--blue {
  background: linear-gradient(180deg, var(--indigo-light) 0%, var(--indigo) 55%, #08152e 100%);
  box-shadow:
    inset 0 0 0 2px var(--indigo-dark),
    0 6px 0 var(--indigo-dark),
    0 9px 0 var(--indigo-deeper),
    0 13px 18px rgba(0,0,0,0.32);
}
.skeuo--mustard {
  background: linear-gradient(180deg, var(--mustard-light) 0%, var(--mustard) 55%, #7a560f 100%);
  color: var(--ink);
  box-shadow:
    inset 0 0 0 2px var(--mustard-dark),
    0 6px 0 var(--mustard-dark),
    0 9px 0 var(--mustard-deeper),
    0 13px 18px rgba(0,0,0,0.32);
}

.skeuo:hover { filter: brightness(1.05) saturate(1.06); transform: translateY(-1px); }
.skeuo:focus-visible { outline: 2px dashed var(--ink); outline-offset: 6px; }
.skeuo:active { transform: translateY(7px); }
.skeuo--red:active {
  box-shadow:
    inset 0 0 0 2px var(--vermilion-dark),
    0 1px 0 var(--vermilion-dark),
    0 2px 0 var(--vermilion-deeper),
    0 3px 7px rgba(0,0,0,0.4);
}
.skeuo--blue:active {
  box-shadow:
    inset 0 0 0 2px var(--indigo-dark),
    0 1px 0 var(--indigo-dark),
    0 2px 0 var(--indigo-deeper),
    0 3px 7px rgba(0,0,0,0.4);
}
.skeuo--mustard:active {
  box-shadow:
    inset 0 0 0 2px var(--mustard-dark),
    0 1px 0 var(--mustard-dark),
    0 2px 0 var(--mustard-deeper),
    0 3px 7px rgba(0,0,0,0.4);
}

.skeuo-cap {
  display: block;
  font-family: 'Shippori Mincho B1', serif;
  font-weight: 800;
  font-size: clamp(24px, 2.8vw, 34px);
  line-height: 1;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 0 rgba(0,0,0,0.25);
}
.skeuo--mustard .skeuo-cap { text-shadow: 0 1px 0 rgba(255,255,255,0.35); }
.skeuo-sub {
  display: block;
  margin-top: 7px;
  font-family: 'DotGothic16', monospace;
  font-size: clamp(10px, 1.1vw, 12px);
  letter-spacing: 0.34em;
  opacity: 0.88;
}

/* small skeuomorphic button (return etc) */
.skeuo--small {
  padding: 10px 22px 12px;
  border-radius: 8px;
  display: inline-block;
}
.skeuo--small .skeuo-cap { font-size: 18px; }
.skeuo--small .skeuo-sub { font-size: 10px; margin-top: 4px; letter-spacing: 0.28em; }

/* readout */
.readout {
  border-top: 1px dashed var(--ink-soft);
  padding-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: space-between;
  gap: 6px 18px;
  font-family: 'VT323', monospace;
  font-size: clamp(15px, 1.55vw, 19px);
  color: var(--ink);
  line-height: 1.4;
}
.readout span { white-space: nowrap; }
.readout .ok { color: var(--vermilion); font-weight: 700; }
.readout .blink { animation: blink 1.2s steps(1) infinite; }

/* scope — scrolling oscilloscope */
.scope {
  margin-top: 16px;
  height: 56px;
  background: linear-gradient(180deg, #F1E7D2 0%, #DCCAA2 100%);
  border: 2px solid var(--ink);
  border-radius: 4px;
  padding: 4px 8px;
  overflow: hidden;
  position: relative;
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.30),
    inset 0 -1px 0 rgba(255,255,255,0.4);
}
.scope::before {
  content: "";
  position: absolute;
  inset: 4px 8px;
  background-image:
    linear-gradient(to right, rgba(26,22,19,0.10) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(26,22,19,0.10) 1px, transparent 1px);
  background-size: 25px 12px;
  pointer-events: none;
  z-index: 2;
}
.scope::after {
  /* leading-edge phosphor brighten */
  content: "";
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: 24%;
  background: linear-gradient(to left, rgba(241,231,210,0.85) 0%, rgba(241,231,210,0) 100%);
  pointer-events: none;
  z-index: 3;
}
.scope svg {
  width: 200%;
  height: 100%;
  display: block;
  position: relative;
  z-index: 1;
  animation: scope-scroll 7s linear infinite;
  will-change: transform;
}
.scope path {
  stroke: var(--vermilion);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 1px rgba(184, 50, 39, 0.6));
}
@keyframes scope-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============================================================
   subpage layout (enter / signal / record)
   ============================================================ */
.page {
  flex: 1;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}
.page-mark {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.page-mark .kanji-tate {
  font-size: clamp(170px, 28vw, 380px);
}

.page-body {
  display: flex;
  flex-direction: column;
  gap: clamp(22px, 3vw, 36px);
}

.page-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.page-title h2 {
  margin: 0;
  font-family: 'Shippori Mincho B1', serif;
  font-weight: 700;
  font-size: clamp(36px, 4.6vw, 60px);
  letter-spacing: 0.005em;
  line-height: 1;
}
.page-title .slash { color: var(--vermilion); font-size: clamp(24px, 3.4vw, 42px); font-weight: 800; }
.page-title .label {
  font-family: 'VT323', monospace;
  font-size: clamp(14px, 1.4vw, 18px);
  color: var(--ink-soft);
  letter-spacing: 0.08em;
  align-self: flex-end;
  margin-bottom: 6px;
}

.panel {
  position: relative;
  background: linear-gradient(180deg, var(--paper-shadow) 0%, var(--paper-deep) 100%);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: clamp(22px, 2.6vw, 32px) clamp(18px, 2.4vw, 28px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.45),
    inset 0 -2px 0 rgba(0,0,0,0.22),
    7px 7px 0 var(--ink);
}
.panel-label {
  position: absolute;
  top: -13px;
  left: 18px;
  background: var(--paper);
  padding: 1px 11px 2px;
  font-family: 'DotGothic16', monospace;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  border: 2px solid var(--ink);
  color: var(--ink);
}
.panel-serial {
  position: absolute;
  top: -13px;
  right: 18px;
  background: var(--paper);
  padding: 1px 9px 2px;
  font-family: 'VT323', monospace;
  font-size: 14px;
  letter-spacing: 0.1em;
  border: 2px solid var(--ink);
  color: var(--ink-soft);
}

/* terminal-like text block (inside panel) */
.term {
  font-family: 'VT323', monospace;
  font-size: clamp(15px, 1.55vw, 19px);
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
}
.term .accent { color: var(--vermilion); font-weight: 700; }
.term .dim { color: var(--ink-soft); }
.term .blink::after { content: "▌"; animation: blink 1s steps(1) infinite; margin-left: 2px; }

/* meta grid */
.meta-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
  font-family: 'VT323', monospace;
  font-size: clamp(15px, 1.5vw, 18px);
  margin-top: 12px;
}
.meta-grid dt { color: var(--ink-soft); letter-spacing: 0.08em; }
.meta-grid dd { margin: 0; color: var(--ink); }

/* progress (loading) */
.progress {
  margin-top: 16px;
  border: 2px solid var(--ink);
  background: var(--paper);
  height: 22px;
  position: relative;
  overflow: hidden;
}
.progress-bar {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 0%;
  background:
    repeating-linear-gradient(
      45deg,
      var(--vermilion) 0,
      var(--vermilion) 8px,
      var(--vermilion-dark) 8px,
      var(--vermilion-dark) 16px);
  animation: prog 5.5s cubic-bezier(.2,.6,.4,1) infinite;
}
.progress-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: 'DotGothic16', monospace;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--ink);
  mix-blend-mode: difference;
  filter: invert(1);
  text-transform: uppercase;
}
@keyframes prog {
  0%   { width: 0%; }
  60%  { width: 78%; }
  90%  { width: 78%; }
  100% { width: 100%; }
}

/* archive list (record) */
.archive {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  font-family: 'Shippori Mincho B1', serif;
}
.archive li {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 16px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px dashed var(--ink-soft);
  font-size: clamp(14px, 1.4vw, 17px);
}
.archive .num {
  font-family: 'VT323', monospace;
  color: var(--vermilion);
  font-size: clamp(15px, 1.5vw, 19px);
  letter-spacing: 0.05em;
}
.archive .blank { color: var(--ink-soft); font-style: italic; opacity: 0.6; }
.archive .stamp {
  font-family: 'DotGothic16', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

/* page footer with return */
.return-row {
  margin-top: clamp(28px, 4vw, 48px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}
.return-row .hint {
  font-family: 'DotGothic16', monospace;
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

/* ============================================================
   stamp / footer
   ============================================================ */
.stamp-bar {
  margin-top: clamp(40px, 6vw, 80px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  border-top: 4px double var(--ink);
  padding-top: 16px;
  font-family: 'DotGothic16', monospace;
  font-size: clamp(10px, 1.1vw, 13px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.stamp-bar > :first-child { text-align: left; }
.stamp-bar > :last-child  { text-align: right; }

.seal {
  position: relative;
  width: 64px;
  height: 64px;
  background: var(--vermilion);
  color: var(--paper);
  border-radius: 5px;
  transform: rotate(-7deg) translateY(-2px);
  display: inline-grid;
  place-items: center;
  box-shadow:
    inset 0 0 0 2px var(--paper),
    inset 0 0 0 4px var(--vermilion),
    1px 2px 0 rgba(0,0,0,0.18);
  background-image:
    radial-gradient(ellipse 70% 80% at 22% 18%, rgba(255,255,255,0.22), transparent 55%),
    radial-gradient(ellipse 80% 60% at 80% 88%, rgba(0,0,0,0.30), transparent 55%);
}
.seal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  font-family: 'Shippori Mincho B1', serif;
  font-weight: 800;
  font-size: 17px;
  line-height: 1;
  letter-spacing: -0.02em;
  text-align: center;
  padding: 6px 4px;
  width: 100%;
}
.seal-grid span { padding: 1px 0; }

/* ============================================================
   responsive
   ============================================================ */
@media (max-width: 820px) {
  .manual-bar { grid-template-columns: 1fr 1fr; background: none; }
  .manual-bar .center { display: none; }

  .hero, .page { grid-template-columns: 1fr; gap: 40px; }

  .kanji-tate {
    writing-mode: horizontal-tb;
    font-size: clamp(70px, 22vw, 150px);
    text-shadow: 4px 4px 0 var(--vermilion);
    line-height: 1;
  }
  .page-mark .kanji-tate {
    font-size: clamp(110px, 36vw, 220px);
  }

  .kanji-side {
    writing-mode: horizontal-tb;
    flex-direction: row;
    flex-wrap: wrap;
    border-left: none;
    border-top: 1px dashed var(--ink-soft);
    padding: 6px 0 0;
    margin: 8px 0 0;
    gap: 14px;
  }
  .brand-mark, .page-mark { flex-direction: column; align-items: flex-start; gap: 2px; }

  .buttons { grid-template-columns: 1fr; }
  .readout { grid-template-columns: 1fr; justify-content: start; }
  .stamp-bar { grid-template-columns: 1fr auto; }
  .stamp-bar > :last-child { grid-column: 1 / -1; text-align: left; }

  .archive li { grid-template-columns: 60px 1fr; }
  .archive .stamp { grid-column: 2; }
}

/* ============================================================
   entrance reveals
   ============================================================ */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.manual-bar { animation: rise 600ms ease 0ms both; }
.brand-mark, .page-mark { animation: rise 700ms ease 80ms both; }
.info > *, .page-body > * { animation: rise 700ms ease both; }
.info > *:nth-child(1), .page-body > *:nth-child(1) { animation-delay: 200ms; }
.info > *:nth-child(2), .page-body > *:nth-child(2) { animation-delay: 280ms; }
.info > *:nth-child(3), .page-body > *:nth-child(3) { animation-delay: 360ms; }
.info > *:nth-child(4), .page-body > *:nth-child(4) { animation-delay: 440ms; }
.info > *:nth-child(5), .page-body > *:nth-child(5) { animation-delay: 520ms; }
.stamp-bar { animation: rise 700ms ease 600ms both; }

@keyframes blink { 50% { opacity: 0; } }

/* ============================================================
   CRT page transitions — leave / arrive
   ============================================================ */
@keyframes crt-leave {
  0%   { transform: scaleY(1) scaleX(1); opacity: 1; filter: brightness(1) saturate(1); }
  18%  { transform: scaleY(1.02) scaleX(1); opacity: 1; filter: brightness(1.5) saturate(1.4); }
  55%  { transform: scaleY(0.018) scaleX(1); opacity: 1; filter: brightness(2.2) saturate(0); }
  82%  { transform: scaleY(0.018) scaleX(1); opacity: 1; filter: brightness(2.4); }
  100% { transform: scaleY(0.018) scaleX(0); opacity: 0; filter: brightness(2.6); }
}
@keyframes crt-arrive {
  0%   { transform: scaleY(0.018) scaleX(0); opacity: 0; filter: brightness(2.4); }
  16%  { transform: scaleY(0.018) scaleX(1); opacity: 1; filter: brightness(2); }
  46%  { transform: scaleY(0.018) scaleX(1); opacity: 1; filter: brightness(1.6); }
  78%  { transform: scaleY(1) scaleX(1); opacity: 1; filter: brightness(1.2) saturate(1.2); }
  100% { transform: scaleY(1) scaleX(1); opacity: 1; filter: brightness(1) saturate(1); }
}
@keyframes crt-line-leave {
  0%, 35% { transform: translateY(-50%) scaleX(0); opacity: 0; }
  50%     { transform: translateY(-50%) scaleX(1.04); opacity: 1; }
  82%     { transform: translateY(-50%) scaleX(1.04); opacity: 1; }
  100%    { transform: translateY(-50%) scaleX(0); opacity: 0; }
}
@keyframes crt-line-arrive {
  0%      { transform: translateY(-50%) scaleX(0); opacity: 0; }
  10%     { transform: translateY(-50%) scaleX(1.04); opacity: 1; }
  46%     { transform: translateY(-50%) scaleX(1.04); opacity: 1; }
  62%     { transform: translateY(-50%) scaleX(0); opacity: 0; }
  100%    { transform: translateY(-50%) scaleX(0); opacity: 0; }
}

body.is-leaving .frame { animation: crt-leave 620ms cubic-bezier(.7,0,.84,0) forwards; }
body.is-leaving .crt-line { animation: crt-line-leave 620ms forwards; }
body.is-leaving .reg, body.is-leaving .watermark { transition: opacity 200ms ease; opacity: 0 !important; }

body.is-arriving .frame { animation: crt-arrive 720ms cubic-bezier(.16,1,.3,1) backwards; }
body.is-arriving .crt-line { animation: crt-line-arrive 720ms forwards; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  body.is-leaving .frame, body.is-arriving .frame { animation: none !important; opacity: 1; transform: none; }
  .crt-beam { display: none; }
  .scope svg { animation: none !important; }
}

/* ============================================================
   works list (作品)
   ============================================================ */
.works-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 8px;
}
.work {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 18px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px dashed var(--ink-soft);
}
.work:last-child { border-bottom: none; }
.work-num {
  font-family: 'VT323', monospace;
  color: var(--vermilion);
  font-size: clamp(15px, 1.5vw, 19px);
  letter-spacing: 0.05em;
  font-weight: 700;
}
.work-title {
  margin: 0;
  font-family: 'Shippori Mincho B1', serif;
  font-weight: 700;
  font-size: clamp(17px, 1.75vw, 23px);
  letter-spacing: 0.005em;
  line-height: 1.2;
}
.work-tag {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 8px 3px;
  font-family: 'DotGothic16', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  background: var(--ink);
  color: var(--paper);
  text-transform: uppercase;
  vertical-align: middle;
}
.work-tag--wip { background: var(--mustard-dark); }
.work-sub {
  font-family: 'DotGothic16', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  margin: 6px 0 0;
  text-transform: uppercase;
}
.work-meta p {
  margin: 6px 0 0;
  font-family: 'Shippori Mincho B1', serif;
  font-size: clamp(13px, 1.35vw, 16px);
  color: var(--ink-soft);
  line-height: 1.7;
  max-width: 52ch;
}
.work-link {
  font-family: 'DotGothic16', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--ink);
  text-transform: uppercase;
  padding: 6px 12px 7px;
  border: 2px solid var(--ink);
  text-decoration: none;
  white-space: nowrap;
  transition: background 150ms ease, color 150ms ease;
  align-self: center;
}
.work-link:hover { background: var(--ink); color: var(--paper); }
.work-link.is-disabled { opacity: 0.35; pointer-events: none; }

@media (max-width: 820px) {
  .work {
    grid-template-columns: 64px 1fr;
    gap: 12px;
  }
  .work-link { grid-column: 2; justify-self: start; margin-top: 6px; }
}

/* ============================================================
   journal entries (後日談)
   ============================================================ */
.entry {
  padding: 18px 0;
  border-bottom: 1px dashed var(--ink-soft);
}
.entry:last-child { border-bottom: none; }
.entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 10px;
}
.entry-date {
  font-family: 'VT323', monospace;
  font-size: clamp(14px, 1.4vw, 17px);
  color: var(--vermilion);
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.entry-title {
  margin: 0;
  font-family: 'Shippori Mincho B1', serif;
  font-weight: 700;
  font-size: clamp(18px, 1.95vw, 25px);
  letter-spacing: 0.005em;
  line-height: 1.25;
}
.entry-body {
  margin: 0;
  font-family: 'Shippori Mincho B1', serif;
  font-size: clamp(14px, 1.4vw, 17px);
  line-height: 1.78;
  color: var(--ink-soft);
  max-width: 60ch;
}
.entry-body em {
  font-style: normal;
  background: linear-gradient(transparent 62%, rgba(212, 160, 44, 0.45) 62%);
  padding: 0 3px;
  color: var(--ink);
  font-weight: 700;
}
.entry--blank .entry-body { opacity: 0.5; font-style: italic; }
.entry--blank .entry-title { color: var(--ink-soft); }
