/* Layout concept: a fixed "Flash stage" centered on a crosshair backdrop.
   Left column: big words sitting on white ribbon swooshes (the menu).
   Right: an Infront-style screen panel with a black header strip.
   Bottom-left: a broadcast slate with timecode + katakana, Pure Morning style.
   Every section repaints the stage in its own flat color. */

@font-face { font-family: "MPR"; src: url("../fonts/mplus-rounded-regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "MPR"; src: url("../fonts/mplus-rounded-bold.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "MPR"; src: url("../fonts/mplus-rounded-extrabold.woff") format("woff"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Dela"; src: url("../fonts/dela-gothic-one.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Pixel"; src: url("../fonts/silkscreen.woff") format("woff"); font-weight: 400; font-display: swap; }

:root {
  /* flat broadcast palette */
  --butter: #f4eda8;
  --mustard: #e9c744;
  --cyan: #56b7d3;
  --cobalt: #3d6fd8;
  --lavender: #c4c6ee;
  --salmon: #e98e86;
  --mint: #9fd8b9;
  --ink: #1c2150;
  --ink-2: #4a4f78;
  --paper: #ffffff;
  --line: #dcdcea;
  --signal: #e4532f;
  --back: #e8e8f0;

  --sec: var(--mustard);            /* current section color, set by JS */

  --f-round: "MPR", "Hiragino Maru Gothic ProN", "Arial Rounded MT Bold", "Segoe UI", system-ui, sans-serif;
  --f-kana: "Dela", "MPR", "Hiragino Sans", sans-serif;
  --f-px: "Pixel", ui-monospace, "Courier New", monospace;

  --menu-w: 330px;
  --r-stage: 30px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background-color: var(--back);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cpath d='M28 23v10M23 28h10' stroke='%23c4c4d6' stroke-width='1'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--f-round);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
[data-tc] { display: inline-block; white-space: nowrap; }
.screen-tc [data-tc], .loader-tc [data-tc] { width: 6.9em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.no-kana [data-kana] { display: none !important; }

.px { font-family: var(--f-px); font-size: 10px; line-height: 1; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Stage ---------- */
.wrap {
  height: 100%;
  display: grid; place-items: center;
  padding-block: 24px;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
}
.stage {
  position: relative;
  width: min(1240px, 100%);
  height: min(780px, 100%);
  border-radius: var(--r-stage);
  background: var(--sec);
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--menu-w) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-areas:
    "top top"
    "menu screen"
    "slate screen"
    "foot foot";
  column-gap: 28px;
  padding: 20px 28px 0 26px;
  transform-origin: 50% 50%;
}
.stage-art { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ---------- Top bar ---------- */
.topbar { grid-area: top; position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: block; color: var(--ink); }
.brand-mark svg { width: 100%; height: 100%; }
.brand-text { display: grid; line-height: 1.1; }
.brand-name { font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.brand-kana { font-family: var(--f-kana); font-size: 11px; letter-spacing: .06em; opacity: .75; }

.controls { display: flex; align-items: center; gap: 12px; }
.radio {
  display: flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 12px 0 4px; border-radius: 999px;
  background: var(--paper); color: var(--ink);
}
.radio-btn { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; flex: none; }
.radio-btn svg { width: 12px; height: 12px; }
.radio-meta { display: grid; gap: 3px; width: 112px; overflow: hidden; }
.radio-station { color: var(--signal); font-size: 9px; }
.radio-track { display: block; overflow: hidden; white-space: nowrap; font-size: 12px; font-weight: 700; line-height: 1.1; }
.radio-track span { display: inline-block; }
.radio.is-on .radio-track span { padding-left: 100%; animation: marquee 9s linear infinite; }
@keyframes marquee { to { transform: translateX(-100%); } }
.vol { width: 64px; height: 16px; margin: 0; accent-color: var(--ink); cursor: pointer; }
.eq { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.eq i { width: 3px; height: 4px; background: var(--ink); opacity: .35; }
.radio.is-on .eq i { opacity: 1; animation: eq .9s ease-in-out infinite alternate; }
.radio.is-on .eq i:nth-child(2) { animation-delay: -.3s; animation-duration: .7s; }
.radio.is-on .eq i:nth-child(3) { animation-delay: -.6s; animation-duration: 1.1s; }
.radio.is-on .eq i:nth-child(4) { animation-delay: -.15s; animation-duration: .8s; }
@keyframes eq { from { height: 3px; } to { height: 14px; } }

.px-btn {
  font-family: var(--f-px); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; line-height: 1;
  height: 36px; padding: 0 14px; border-radius: 999px; background: var(--paper); color: var(--ink);
  transition: background .15s, color .15s;
}
.px-btn:hover { background: var(--ink); color: var(--paper); }
.px-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.px-btn.dark { height: 22px; padding: 0 8px; background: transparent; color: var(--paper); border-radius: 4px; }
.px-btn.dark:hover { background: var(--paper); color: var(--ink); }
.px-btn.dark:disabled { opacity: .3; cursor: default; background: transparent; color: var(--paper); }

.switch { white-space: nowrap; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 6px 0 14px; border-radius: 999px; background: var(--paper); font-weight: 700; font-size: 13px; }
.switch-track { width: 42px; height: 24px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); transition: translate .25s var(--ease); }
.switch[aria-checked="true"] .switch-track { background: var(--signal); }
.switch[aria-checked="true"] .switch-knob { translate: 18px 0; background: var(--paper); }

/* ---------- Menu (ribbons) ---------- */
.menu { grid-area: menu; position: relative; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 0; }
.mi { position: relative; display: block; width: 100%; height: 78px; text-align: right; flex: none; }
.mi-word {
  position: absolute; right: 44px; bottom: 30px;
  font-weight: 800; font-size: 36px; line-height: 1; letter-spacing: -.02em; white-space: nowrap;
  color: var(--ink); opacity: .5; transition: opacity .2s, translate .3s var(--ease);
}
.mi-rib { position: absolute; left: 0; bottom: 0; width: 100%; height: 40px; overflow: visible; }
.mi-rib path { fill: var(--paper); opacity: .4; transition: opacity .2s; }
.mi-cap {
  position: absolute; bottom: 0; right: calc(45% + 18px); height: 22px; line-height: 22px;
  font-size: 12px; font-weight: 700; white-space: nowrap; color: var(--ink); opacity: .55; transition: opacity .2s;
}
.mi-btn {
  position: absolute; right: 0; bottom: 13px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--paper); color: var(--ink);
  box-shadow: 0 0 0 3px var(--sec);
  transition: background .2s, color .2s, rotate .4s cubic-bezier(.3, 1.6, .5, 1);
}
.mi-btn svg { width: 16px; height: 16px; }
.mi:hover .mi-word { opacity: .8; }
.mi:hover .mi-rib path { opacity: .7; }
.mi:hover .mi-btn { rotate: 90deg; }
.mi[aria-current="true"] .mi-word { opacity: 1; translate: -4px 0; }
.mi[aria-current="true"] .mi-rib path { opacity: 1; }
.mi[aria-current="true"] .mi-cap { opacity: 1; }
.mi[aria-current="true"] .mi-btn { background: var(--signal); color: var(--paper); rotate: 45deg; }
.mi:focus-visible { outline: none; }
.mi:focus-visible .mi-word { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; }

/* ---------- Slate ---------- */
.slate { grid-area: slate; position: relative; display: grid; grid-template-columns: auto auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: end; padding: 14px 0 16px; }
.slate-tc { width: 6.9em; font-size: 13px; color: var(--ink); align-self: center; }
.slate-kana { font-family: var(--f-kana); font-size: 22px; line-height: 1; white-space: nowrap; }
.slate-mark { width: 28px; height: 22px; display: block; }
.slate-mark svg { width: 100%; height: 100%; }
.slate-sub { grid-column: 2 / 4; font-size: 9px; margin-top: 4px; opacity: .8; }

/* ---------- Screen ---------- */
.screen {
  grid-area: screen; position: relative; align-self: stretch; min-height: 0; margin-bottom: 16px;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
  background: var(--paper); border-radius: 18px; overflow: hidden;
}
.screen-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 34px; padding: 0 10px 0 16px; background: var(--ink); color: var(--paper);
}
.screen-tc { display: flex; align-items: center; gap: 6px; opacity: .8; }
.rec-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); animation: blink 1.2s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
.pager { display: flex; align-items: center; gap: 4px; }
.pager[hidden] { display: none; }
#pagerCount { padding: 0 6px; font-variant-numeric: tabular-nums; }

.screen-body { min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding: 30px 34px 30px; scrollbar-width: thin; scrollbar-color: var(--ink) var(--line); }
.screen-body:focus { outline: none; }
.screen-index { display: flex; gap: 6px; padding: 10px 16px 12px; border-top: 1px solid var(--line); overflow-x: auto; }
.screen-index:empty { display: none; }
.ix {
  flex: none; min-width: 34px; height: 26px; padding: 0 8px; border-radius: 6px;
  font-family: var(--f-px); font-size: 10px; border: 1.5px solid var(--ink); color: var(--ink);
  transition: background .15s, color .15s;
}
.ix:hover { background: var(--line); }
.ix[aria-current="true"] { background: var(--ink); color: var(--paper); }

/* corner crosshairs on the screen, Infront style */
.screen::before, .screen::after {
  content: ""; position: absolute; width: 11px; height: 11px; pointer-events: none;
  background: linear-gradient(var(--paper), var(--paper)) 5px 0 / 1px 11px no-repeat, linear-gradient(var(--paper), var(--paper)) 0 5px / 11px 1px no-repeat;
  opacity: .6;
}
.screen::before { left: 6px; top: 42px; }
.screen::after { right: 6px; top: 42px; }

/* ---------- Views ---------- */
.view { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; max-width: 860px; }
.view.solo { grid-template-columns: minmax(0, 1fr); }
.v-main { display: grid; gap: 16px; min-width: 0; }
.v-label { color: var(--signal); }
.v-title { margin: 0; font-weight: 800; font-size: clamp(28px, 3.2vw, 40px); line-height: 1.05; letter-spacing: -.02em; text-wrap: balance; }
.v-title.sm { font-size: clamp(24px, 2.4vw, 31px); max-width: 24ch; }
.v-meta { margin: -8px 0 0; color: var(--ink-2); font-size: 15px; }
.v-text p { margin: 0 0 10px; max-width: 62ch; }
.v-text p:last-child { margin-bottom: 0; }
.v-h { margin: 6px 0 -4px; }

.plist { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; max-width: 64ch; }
.plist li { position: relative; padding-left: 22px; }
.plist li::before {
  content: ""; position: absolute; left: 2px; top: .5em; width: 11px; height: 11px;
  background: linear-gradient(var(--signal), var(--signal)) 4px 0 / 3px 11px no-repeat, linear-gradient(var(--signal), var(--signal)) 0 4px / 11px 3px no-repeat;
}

.chips { display: flex; flex-wrap: wrap; align-items: flex-start; align-content: flex-start; gap: 6px; }
.chip { padding: 3px 11px; border-radius: 999px; border: 1.5px solid var(--ink); font-size: 13px; font-weight: 700; line-height: 1.5; }

.rows { display: grid; max-width: 640px; }
.row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.row:first-child { border-top: 1px dashed var(--line); }
.row .px { padding-top: 5px; color: var(--ink-2); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; max-width: 560px; }
.stat { padding: 10px 14px; border-radius: 12px; background: var(--back); }
.stat b { display: block; font-weight: 800; font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--ink-2); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px;
  font-weight: 800; font-size: 14px; text-decoration: none; white-space: nowrap;
  background: var(--ink); color: var(--paper); transition: background .15s, translate .15s;
}
.btn:hover { background: var(--signal); translate: 0 -1px; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn svg { width: 16px; height: 16px; }

.email-box { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--back); max-width: 560px; }
.email-box code { font-family: var(--f-round); font-weight: 800; font-size: 20px; user-select: all; flex: 1 1 220px; overflow-wrap: anywhere; }

.skills { display: grid; gap: 0; max-width: 820px; }
.skill { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.skill b { display: block; font-weight: 800; font-size: 17px; }
.skill small { color: var(--ink-2); font-size: 13px; }

.courses { display: grid; max-width: 640px; }
.course { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.course span:last-child { color: var(--ink-2); text-align: right; font-size: 14px; }

/* ---------- Trading cards ---------- */
.card {
  --c: var(--cyan); --cd: #1d7fa6;
  position: relative; margin: 0; width: 100%; max-width: 100%; aspect-ratio: 3 / 4;
  border-radius: 16px; background: var(--c); color: var(--paper); overflow: hidden; container-type: inline-size;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; padding: 0;
}
.card-top, .card-lines, .card-foot { position: relative; z-index: 2; }
.card-top { display: flex; justify-content: flex-end; align-items: center; gap: 6px; padding: 9px 12px 8px; background: var(--cd); }
.card-flake { width: 22px; height: 22px; flex: none; color: var(--paper); }
.card-title {
  font-weight: 800; font-size: min(19px, calc(96cqi / var(--chars, 8))); line-height: .98; text-transform: uppercase; text-align: right; letter-spacing: -.01em;
  color: var(--paper);
  max-width: calc(100% - 30px); overflow-wrap: normal; word-break: normal; hyphens: none;
}
.card-art { z-index: 1; position: relative; display: grid; place-items: center; min-height: 0; padding: 8px 16px; overflow: hidden; }
.sticker {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; rotate: -4deg;
  display: grid; place-items: center; min-width: 58%; max-width: 92%; min-height: 64px; padding: 12px 12px;
  border-radius: 14px; background: var(--paper);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 55%, var(--ink)), 4px 5px 0 3px color-mix(in srgb, var(--c) 55%, var(--ink));
}
.sticker.dark { background: var(--ink); }
.sticker img { max-height: 54px; max-width: 100%; width: auto; object-fit: contain; }
.sticker-mark { font-weight: 800; font-size: 19px; line-height: 1.05; letter-spacing: -.01em; color: var(--ink); text-align: center; overflow-wrap: anywhere; }
.card-art svg { width: 100%; height: 100%; max-height: 100%; overflow: visible; }
.photo-stack { display: grid; width: 76%; place-items: center; }
.photo-stack > img { grid-area: 1 / 1; }
.card-photo.secret { opacity: 0; transition: opacity 1.2s ease; }
.card-photo.secret.is-on { opacity: 1; }
.card-photo { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; border-radius: 14px; border: 5px solid var(--paper); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 55%, var(--ink)); rotate: -3deg; }
.card-shot { width: 100%; border-radius: 10px; border: 4px solid var(--paper); }
.card-lines { height: 9px; border-top: 2px solid var(--cd); border-bottom: 2px solid var(--cd); margin: 0 0 4px; }
.card-foot { font-size: 10.5px; line-height: 1.3; font-weight: 700; color: var(--paper); padding: 7px 12px 9px; background: var(--cd); }
/* pastel card body (--c) with deeper title and caption bars (--cd) so white text reads cleanly */
.c-butter { --c: var(--butter); --cd: #8f7a14; } .c-mustard { --c: var(--mustard); --cd: #9a6d08; } .c-cyan { --c: var(--cyan); --cd: #1d7fa6; }
.c-cobalt { --c: var(--cobalt); --cd: #2a4ea8; } .c-lavender { --c: var(--lavender); --cd: #5f62bf; } .c-salmon { --c: var(--salmon); --cd: #c9493d; } .c-mint { --c: var(--mint); --cd: #1f8763; }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 40; display: grid; place-content: center; justify-items: center; gap: 22px;
  background: var(--butter); overflow: hidden;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.loader-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.loader-card { position: relative; display: grid; justify-items: center; gap: 14px; text-align: center; }
.loader-glyphs { display: flex; gap: 14px; }
.loader-glyphs svg { width: clamp(64px, 11vw, 104px); height: auto; overflow: visible; }
.loader-kana { margin: 6px 0 0; font-family: var(--f-kana); font-size: clamp(30px, 6vw, 52px); line-height: 1; letter-spacing: .02em; }
.loader-name { margin: 0; font-weight: 700; font-size: 15px; color: var(--ink-2); }
.meter { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.meter-bar { width: 180px; height: 12px; border: 1.5px solid var(--ink); border-radius: 3px; padding: 2px; display: block; }
.meter-bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--ink) 0 6px, transparent 6px 8px); }
#meterPct { width: 4ch; font-variant-numeric: tabular-nums; }
.enter { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }
.enter[hidden] { display: none; }
.enter-btn {
  display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 22px; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-weight: 800; font-size: 15px;
  transition: background .15s, translate .15s;
}
.enter-btn:hover { background: var(--signal); translate: 0 -2px; }
.enter-btn.ghost { background: var(--paper); color: var(--ink); }
.enter-btn.ghost:hover { background: var(--ink); color: var(--paper); }
.eb-ico svg { width: 18px; height: 18px; display: block; }
.loader-tc { position: absolute; left: max(24px, env(safe-area-inset-left, 0px)); top: max(24px, env(safe-area-inset-top, 0px)); margin: 0; font-size: 11px; }
.loader-tc b { font-weight: 400; color: var(--signal); }
.loader-skip { position: absolute; bottom: max(24px, env(safe-area-inset-bottom, 0px)); left: 50%; translate: -50% 0; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.loader-skip:hover { color: var(--ink); }
.loader.is-out { pointer-events: none; }

/* ---------- Footer ---------- */
.foot { grid-area: foot; position: relative; display: flex; justify-content: space-between; align-items: center; gap: 16px; height: 38px; margin: 0 -28px 0 -26px; padding: 0 28px 0 26px; background: color-mix(in srgb, var(--sec) 82%, var(--ink)); color: var(--ink); }
.hints { display: flex; gap: 22px; }
.foot-right { display: flex; align-items: center; gap: 18px; }
.cheat { display: inline-flex; align-items: center; gap: 3px; opacity: .6; transition: opacity .2s; }
.cheat:hover { opacity: 1; }
.cheat kbd { min-width: 16px; height: 16px; padding: 0 3px; }
.cheat-touch { display: none; }
.hints > span { display: inline-flex; align-items: center; gap: 4px; }
kbd { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 4px; background: var(--paper); font-family: var(--f-round); font-size: 9px; font-weight: 800; color: var(--ink); }

/* ---------- Easter egg ---------- */
.egg {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center;
  background: color-mix(in srgb, var(--ink) 55%, transparent);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.egg-win { width: min(440px, 100%); border-radius: 18px; overflow: hidden; background: var(--paper); box-shadow: 8px 10px 0 color-mix(in srgb, var(--ink) 35%, transparent); }
.egg-bar { display: flex; justify-content: space-between; align-items: center; height: 34px; padding: 0 8px 0 16px; background: var(--ink); color: var(--mustard); }
.egg-body { display: grid; gap: 12px; padding: 22px 24px 24px; background: var(--butter); }
.egg-body p { margin: 0; }
.egg-glyphs { display: flex; gap: 10px; }
.egg-glyphs svg { width: 48px; height: 48px; overflow: visible; }
.egg-title { margin: 0; font-weight: 800; font-size: 28px; line-height: 1.1; letter-spacing: -.01em; }
.egg-player iframe { display: block; width: 100%; height: 166px; border: 0; border-radius: 12px; background: var(--paper); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: max(28px, env(safe-area-inset-bottom, 0px)); z-index: 60;
  translate: -50% 16px; opacity: 0; pointer-events: none;
  padding: 10px 18px; border-radius: 999px; background: var(--ink); color: var(--paper);
  font-weight: 700; font-size: 14px; max-width: calc(100vw - 32px); transition: opacity .25s, translate .35s var(--ease);
}
.toast.is-on { opacity: 1; translate: -50% 0; }

/* ---------- Recruiter mode ---------- */
body.is-recruiter { overflow: auto; background: var(--paper); background-image: none; }
body.is-recruiter .wrap { display: none; }
.recruiter {
  max-width: 880px; margin: 0 auto; padding-block: max(28px, env(safe-area-inset-top, 0px)) 64px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.r-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.r-top .brand-mark { width: 30px; height: 30px; }
.r-top .switch { background: var(--back); }
.r-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center; margin-top: 44px; }
.r-head img { width: 108px; height: 108px; border-radius: 22px; object-fit: cover; object-position: 50% 30%; }
.r-head h1 { margin: 0; font-weight: 800; font-size: clamp(34px, 6vw, 50px); line-height: 1; letter-spacing: -.02em; }
.r-head p { margin: 8px 0 0; color: var(--ink-2); font-size: 16px; }
.r-summary { margin: 26px 0 0; font-size: 17px; line-height: 1.65; max-width: 66ch; }
.r-actions { margin-top: 22px; }
.r-email { margin-top: 12px; font-size: 14px; color: var(--ink-2); }
.r-email code { font-family: var(--f-round); font-weight: 700; color: var(--ink); user-select: all; }
.r-section { margin-top: 52px; }
.r-section > h2 { margin: 0 0 14px; font-weight: 800; font-size: 24px; letter-spacing: -.01em; }
.r-job { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 20px; padding: 18px 0; border-top: 1px solid var(--line); }
.r-job .when { color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.r-job h3 { margin: 0; font-weight: 800; font-size: 18px; }
.r-job h3 span { font-weight: 400; color: var(--ink-2); }
.r-job ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 5px; }
.r-stack { margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.r-work { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.r-proj { display: block; padding: 16px; border-radius: 14px; background: var(--back); text-decoration: none; border-left: 6px solid var(--c, var(--cyan)); }
a.r-proj:hover { background: var(--line); }
.r-proj h3 { margin: 0; font-weight: 800; font-size: 17px; }
.r-proj .kind { font-size: 13px; color: var(--ink-2); }
.r-proj p { margin: 8px 0 0; font-size: 14px; }
.r-skill { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 20px; padding: 8px 0; }
.r-skill b { font-weight: 800; }
.r-edu { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.r-edu h3 { margin: 0; font-weight: 800; font-size: 17px; }
.r-edu .school { color: var(--ink-2); }
.r-edu .when { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.r-foot { margin-top: 60px; color: var(--ink-2); font-size: 14px; }

/* ---------- Mid widths ---------- */
@media (max-width: 1180px) {
  :root { --menu-w: 290px; }
  .mi-word { font-size: 31px; }
  .view { grid-template-columns: 180px minmax(0, 1fr); gap: 24px; }
  .radio-meta { width: 84px; }
}

/* ---------- Flow layout: phones, tablets, short windows ---------- */
@media (max-width: 900px), (max-height: 600px) {
  body { overflow: auto; }
  .wrap { display: block; height: auto; padding: 0; }
  .stage {
    width: 100%; height: auto; min-height: 100vh; border-radius: 0;
    grid-template-columns: minmax(0, 1fr);
    min-height: 100dvh;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    grid-template-areas: "top" "menu" "slate" "screen" "foot";
    padding-block: max(14px, env(safe-area-inset-top, 0px)) 0;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .topbar { flex-wrap: wrap; row-gap: 10px; }
  .menu {
    position: sticky; top: 0; z-index: 5; flex-direction: row; justify-content: flex-start; gap: 6px;
    overflow-x: auto; margin: 0 -16px; padding: 8px 16px; background: color-mix(in srgb, var(--sec) 82%, var(--ink)); scrollbar-width: none;
  }
  .menu::-webkit-scrollbar { display: none; }
  .mi { width: auto; height: 38px; padding: 0 14px; border-radius: 999px; background: color-mix(in srgb, var(--paper) 45%, transparent); }
  .mi-word { position: static; font-size: 16px; opacity: 1; line-height: 38px; }
  .mi[aria-current="true"] { background: var(--paper); }
  .mi[aria-current="true"] .mi-word { translate: 0; }
  .mi-rib, .mi-cap, .mi-btn { display: none; }
  .slate { padding: 8px 0 12px; }
  .slate-kana { font-size: 18px; }
  .screen { margin-bottom: 16px; }
  .screen-body { overflow: visible; padding: 22px 18px 24px; }
  .screen-tc { display: none; }
  .foot { margin: 0 -16px; padding: 0 16px; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .hints { display: none; }
  .cheat-keys { display: none; }
  .cheat-touch { display: inline; }
  .foot-right { width: 100%; justify-content: space-between; }
}
@media (max-width: 640px) {
  .controls { width: 100%; justify-content: space-between; gap: 8px; }
  .radio-meta { width: 70px; }
  .eq, .vol { display: none; }
  .switch-label { font-size: 12px; }
  .px-btn { padding: 0 10px; }
  .view { grid-template-columns: minmax(0, 1fr); }
  .view .card { max-width: 240px; }
  .row, .skill, .r-job, .r-skill { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .r-head { grid-template-columns: minmax(0, 1fr); }
  .r-edu { grid-template-columns: minmax(0, 1fr); }
  .r-edu .when { text-align: left; }
  .loader-skip { white-space: normal; text-align: center; width: calc(100% - 32px); }
}
@media (hover: none) { .hints, .cheat-keys { display: none; } .cheat-touch { display: inline; } }

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