/* FILO v1.0 — Picto Show Records
   Colors come from the app's three themes (source/main.c). Default: ALAMBRE. */

:root, [data-theme="ALAMBRE"] {
  --bg: #000000; --fg: #ffffff; --grey: #aaaaaa; --dim: #6e6e6e; --faint: #3c3c3c;
  --glow: drop-shadow(0 0 3px rgba(255,255,255,.55)) drop-shadow(0 0 14px rgba(255,255,255,.18));
}
[data-theme="INGENUO"] {
  --bg: #eeeee8; --fg: #101010; --grey: #505048; --dim: #808078; --faint: #c4c4bc; --glow: none;
}
[data-theme="NARANJA"] {
  --bg: #ff6a00; --fg: #101010; --grey: #5a2200; --dim: #9a3a00; --faint: #d85800; --glow: none;
}
:root {
  --ease: cubic-bezier(.22, 1, .36, 1);
  --w: 720px;
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--grey);
  background: var(--bg);
  transition: background-color .4s, color .4s;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-size: 16px; line-height: 1.7; overflow-x: hidden; }
::selection { background: var(--fg); color: var(--bg); }
a { color: var(--fg); }
a.ul { text-decoration: underline 1px var(--dim); text-underline-offset: 7px; transition: text-underline-offset .1s, text-decoration-color .1s; }
a.ul:hover { text-decoration-color: var(--fg); text-underline-offset: 4px; }
p { margin: 0 0 1.2em; }
strong { color: var(--fg); font-weight: 500; }
.container { max-width: var(--w); margin: 0 auto; padding: 0 24px; }

/* ---------- bitmap text (Picto Rail / 5x7) ---------- */
.px { --px: 3px; display: inline-block; line-height: 0; color: var(--fg); vertical-align: middle; }
.px svg { display: block; fill: currentColor; max-width: 100%; height: auto; }
.px.anim rect { opacity: 0; }
.px.anim.in rect { animation: pixelIn .3s steps(2) forwards; animation-delay: var(--d); }
@keyframes pixelIn { to { opacity: 1; } }
.glow { filter: var(--glow); }

/* ---------- fixed controls ---------- */
.ctrl {
  position: fixed; top: 16px; z-index: 30; display: flex; gap: 8px;
}
.ctrl.l { left: 16px; } .ctrl.r { right: 16px; }
.ctrl button {
  background: var(--bg); border: 1px solid var(--dim); color: var(--fg);
  padding: 7px 10px; cursor: pointer; line-height: 0;
  transition: background-color .12s, border-color .12s;
}
.ctrl button .px { --px: 2px; }
.ctrl button:hover, .ctrl button:focus-visible { background: var(--fg); border-color: var(--fg); outline: none; }
.ctrl button:hover .px, .ctrl button:focus-visible .px { color: var(--bg); }

.mini-logo {
  position: fixed; top: 18px; left: 50%; z-index: 30; translate: -50% -14px; opacity: 0; pointer-events: none;
  display: flex; align-items: flex-end; gap: 6px; text-decoration: none;
  transition: opacity .4s var(--ease), translate .6s var(--ease);
}
.mini-logo .px.big { --px: 2px; }
.mini-logo .px.sm { --px: 1px; color: var(--grey); padding-bottom: 1px; }
body.scrolled .mini-logo { opacity: 1; translate: -50% 0; pointer-events: auto; }

/* ---------- hero ---------- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 540px; overflow: hidden; }
#floor {
  position: absolute; inset: 0; width: 100%; height: 100%;
  image-rendering: pixelated; image-rendering: crisp-edges;
}
.hero-inner {
  position: absolute; left: 0; right: 0; top: 30%; text-align: center; z-index: 1;
  will-change: transform, opacity;
}
.logo-box {
  display: inline-block; padding: 26px 34px 22px; border: 3px solid var(--fg);
  animation: boot 1.1s var(--ease) both .15s;
}
.logo-box .px { --px: 10px; }
@media (max-width: 599px) { .logo-box .px { --px: 6px; } .logo-box { padding: 16px 20px 14px; } }
@keyframes boot { 0% { opacity: 0; scale: .96; } 40% { opacity: 1; } 55% { opacity: .3; } 70% { opacity: 1; } 100% { scale: 1; } }
.hero .ver { display: block; margin: 18px auto 0; }
.hero .ver .px { --px: 2px; color: var(--grey); }
.hero .sub { margin-top: 10px; }
.hero .sub .px { --px: 2px; color: var(--dim); }
.scroll-hint { position: absolute; left: 50%; bottom: 96px; translate: -50% 0; z-index: 1; }
.scroll-hint .px { --px: 2px; color: var(--dim); animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- screens ---------- */
canvas[data-screen] { display: block; width: 100%; height: auto; image-rendering: pixelated; image-rendering: crisp-edges; }
@media (max-width: 820px) { canvas[data-screen] { image-rendering: auto; } }  /* below 1:1, smooth instead of dropping pixels */
.app-screen { max-width: 820px; margin: 40px auto 0; padding: 0 24px; }
.app-screen .frame { border: 1px solid var(--faint); padding: 10px; filter: var(--glow); }

/* ---------- sticky CTA (menu-item style) ---------- */
.cta-sticky { position: sticky; top: 52px; z-index: 5; display: flex; justify-content: center; padding-top: 24px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  min-width: 220px; height: 36px; padding: 0 24px;
  background: var(--bg); border: 1px solid var(--dim); color: var(--fg);
  transition: background-color .1s, border-color .1s;
}
.btn .px { --px: 2px; }
.btn:hover, .btn:focus-visible { background: var(--fg); border-color: var(--fg); outline: none; }
.btn:hover .px, .btn:focus-visible .px { color: var(--bg); }
.note { text-align: center; margin-top: 22px; color: var(--dim); font-size: 14px; }

/* ---------- headings ---------- */
.heading { display: flex; justify-content: center; margin: 120px 0 46px; }
.heading .px { --px: 3px; }
@media (max-width: 599px) { .heading .px { --px: 2px; } }
.heading.rule { position: relative; }
.heading.rule::after { content: ""; position: absolute; left: 0; right: 0; bottom: -18px; height: 1px; background: var(--faint); }
h3 { margin: 0 0 14px; line-height: 0; }
h3 .px { --px: 2px; }

/* ---------- audio players ---------- */
.players { display: grid; gap: 12px; margin: 40px 0 0; }
.player { display: flex; height: 40px; gap: 8px; }
.play-button { width: 40px; flex: none; position: relative; padding: 0; cursor: pointer; background: var(--bg); border: 1px solid var(--dim); transition: background-color .1s, border-color .1s; }
.play-button svg { position: absolute; width: 12px; height: 12px; top: 50%; left: 50%; translate: -50% -50%; fill: var(--fg); }
.play-button:hover:not(:disabled) { background: var(--fg); border-color: var(--fg); }
.play-button:hover:not(:disabled) svg { fill: var(--bg); }
.play-button:disabled { cursor: default; opacity: .45; }
.progress-box { flex: 1; position: relative; cursor: pointer; min-width: 0; border: 1px solid var(--faint); padding: 0 6px; }
.waveform { position: absolute; inset: 4px 6px; display: flex; align-items: center; gap: 2px; }
.waveform .bar { flex: 1 1 0; background: var(--faint); min-height: 1px; }
.waveform .bar.on { background: var(--fg); }
.progress-box:hover .bar:not(.on) { background: var(--dim); }
.player .ptitle { position: absolute; right: 6px; top: -1px; z-index: 1; background: var(--bg); padding: 0 0 4px 8px; line-height: 0; }
.player .ptitle .px { --px: 1px; color: var(--fg); }
.player .soon { position: absolute; left: 6px; bottom: -1px; z-index: 1; background: var(--bg); padding: 0 6px 2px 0; line-height: 0; }
.player .soon .px { --px: 1px; color: var(--dim); }

/* ---------- wireframe 3DS ---------- */
.device { --dw: min(760px, calc(100vw - 32px)); width: var(--dw); margin: 10px auto 40px; filter: var(--glow); }
.lid, .base { position: relative; border: 2px solid var(--grey); background: var(--bg); }
.lid { border-radius: 26px 26px 10px 10px; padding: 7% 15% 5.5%; }
.base { border-radius: 10px 10px 30px 30px; padding: 4.5% 22.5% 13%; }
.hinge { position: relative; height: calc(var(--dw) * .045); margin: 0 4%; border: 2px solid var(--dim); border-top: 0; border-bottom: 0; }
.hinge::before, .hinge::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: var(--dim); border-radius: 2px; }
.hinge::before { top: 22%; } .hinge::after { bottom: 22%; }
.screen { border: 1px solid var(--dim); padding: 2.2%; border-radius: 4px; }
.cam { position: absolute; top: 3%; left: 50%; width: 6px; height: 6px; border: 1px solid var(--dim); border-radius: 50%; translate: -50% 0; }
.speaker { position: absolute; top: 40%; width: 3.5%; height: 22%; background-image: radial-gradient(var(--dim) 30%, transparent 36%); background-size: 5px 5px; }
.speaker.l { left: 6.5%; } .speaker.r { right: 6.5%; }
.slider { position: absolute; right: 5%; top: 22%; width: 1.6%; height: 30%; border: 1px solid var(--dim); border-radius: 3px; }
.slider::after { content: ""; position: absolute; left: -2px; right: -2px; height: 18%; top: 30%; border: 1px solid var(--grey); background: var(--bg); }
.cpad { position: absolute; left: 6.5%; top: 9%; width: 12%; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--grey); }
.cpad::after { content: ""; position: absolute; inset: 18%; border-radius: 50%; border: 1px solid var(--dim); }
.dpad { position: absolute; left: 7.5%; top: 44%; width: 10%; aspect-ratio: 1; }
.dpad::before, .dpad::after { content: ""; position: absolute; border: 2px solid var(--grey); border-radius: 2px; }
.dpad::before { left: 33%; right: 33%; top: 0; bottom: 0; } .dpad::after { top: 33%; bottom: 33%; left: 0; right: 0; }
.abxy { position: absolute; right: 6.5%; top: 14%; width: 13%; aspect-ratio: 1; }
.abxy i { position: absolute; width: 32%; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--grey); }
.abxy i:nth-child(1) { left: 34%; top: 0; } .abxy i:nth-child(2) { left: 0; top: 34%; } .abxy i:nth-child(3) { right: 0; top: 34%; } .abxy i:nth-child(4) { left: 34%; bottom: 0; }
.small-btns { position: absolute; right: 8%; top: 52%; display: grid; gap: 7px; }
.small-btns i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--dim); }
.home-btn { position: absolute; left: 50%; bottom: 4.5%; width: 13%; height: 3.4%; translate: -50% 0; border: 2px solid var(--grey); border-radius: 99px; }
.power { position: absolute; right: 7%; bottom: 7%; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--grey); }

/* ---------- theme picker (app menu style) ---------- */
.themes { display: grid; gap: 8px; max-width: 420px; margin: 34px auto 0; }
.themes button {
  height: 32px; background: var(--bg); border: 1px solid var(--dim); cursor: pointer; line-height: 0;
  transition: background-color .1s, border-color .1s;
}
.themes button .px { --px: 2px; }
/* each button previews its own theme */
.themes .sw-INGENUO { background: #eeeee8; border-color: #808078; } .themes .sw-INGENUO .px { color: #101010; }
.themes .sw-ALAMBRE { background: #000; border-color: #6e6e6e; }    .themes .sw-ALAMBRE .px { color: #fff; }
.themes .sw-NARANJA { background: #ff6a00; border-color: #9a3a00; } .themes .sw-NARANJA .px { color: #101010; }
.themes button[aria-pressed="true"] { outline: 2px solid var(--fg); outline-offset: 4px; }
.themes button:hover { outline: 1px solid var(--dim); outline-offset: 4px; }

/* ---------- tables / features ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; font-size: 14px; line-height: 1.6; }
.feature-grid ul { list-style: none; margin: 0; padding: 0; }
.feature-grid li { padding: 1px 0 1px 14px; position: relative; color: var(--grey); }
.feature-grid li::before { content: ""; position: absolute; left: 0; top: .72em; width: 5px; height: 1px; background: var(--dim); }
@media (max-width: 640px) { .feature-grid { grid-template-columns: 1fr; } }

.keys { width: 100%; border-collapse: collapse; font-size: 15px; }
.keys td { padding: 10px 4px; border-bottom: 1px solid var(--faint); vertical-align: middle; }
.keys td:first-child { width: 170px; white-space: nowrap; }
kbd { display: inline-block; font: 600 11px/1 ui-monospace, Menlo, Consolas, monospace; color: var(--fg); border: 1px solid var(--dim); padding: 6px 7px; min-width: 24px; text-align: center; }
.path { font: 13px/1.4 ui-monospace, Menlo, Consolas, monospace; color: var(--fg); border: 1px solid var(--faint); padding: 12px 14px; overflow-x: auto; }

.credits { text-align: center; max-width: 580px; margin: 0 auto; }
.more { text-align: center; margin-top: 90px; }
.psr { text-align: center; margin-top: 110px; }
.psr .px.name { --px: 3px; }
.psr .px.tag { --px: 1px; color: var(--grey); margin-top: 12px; }
.foot { margin: 40px 0 0; padding-bottom: 130px; text-align: center; font-size: 12px; color: var(--dim); }
.foot p { margin: 0 0 6px; }

/* ---------- bottom nav: CHOP / FM tabs style ---------- */
nav.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; gap: 10px;
  background: var(--bg); padding: 14px 0 calc(22px + env(safe-area-inset-bottom)); border-top: 1px solid var(--faint);
}
nav.bottom a { display: inline-flex; align-items: center; justify-content: center; min-width: 74px; height: 26px; padding: 0 12px; border: 1px solid var(--dim); text-decoration: none; transition: background-color .1s, border-color .1s; }
nav.bottom .px { --px: 1px; }
nav.bottom a.active, nav.bottom a:hover { background: var(--fg); border-color: var(--fg); }
nav.bottom a.active .px, nav.bottom a:hover .px { color: var(--bg); }

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; translate: 0 22px; transition: opacity .9s var(--ease), translate .9s var(--ease); }
.reveal.in { opacity: 1; translate: 0 0; }
.heading.reveal { opacity: 1; translate: none; }

/* ---------- cursor trail ---------- */
.cursor-ghost { position: fixed; width: 4px; height: 4px; pointer-events: none; z-index: 40; background: var(--fg); opacity: .5; animation: ghost .9s steps(4) forwards; }
@keyframes ghost { to { opacity: 0; } }

.page-top { padding-top: 110px; }

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

@media (max-width: 520px) { .mini-logo { display: none; } .ctrl button .px { --px: 1.5px; } }

/* language switcher: active one filled, like the CHOP / FM tabs */
#langs { gap: 0; }
#langs button + button { border-left: 0; }
#langs button[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); }
#langs button[aria-pressed="true"] .px { color: var(--bg); }

/* system-font fallback for text the bitmap fonts don't cover (Japanese) */
.px.sys { line-height: 1.25; }
.px.sys .pxf { font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif; font-weight: 700; letter-spacing: .06em; color: currentColor; white-space: nowrap; }
.heading .px.sys .pxf { white-space: normal; }
.ctrl .px.sys .pxf, nav.bottom .px.sys .pxf { font-weight: 500; }
:lang(ja) body { line-break: strict; word-break: normal; }

/* page transitions with picto.show: the PSR logo morphs into the FILO box, the nav stays put */
@view-transition { navigation: auto; }
.logo-box { view-transition-name: psr-logo; }
nav.bottom { view-transition-name: bottom-nav; }
::view-transition-group(psr-logo) { animation-duration: .7s; animation-timing-function: cubic-bezier(.22,1,.36,1); }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
