/* P5UI website (#1531). One stylesheet for every page, three looks: Original (follows the system light / dark),
   Persona 5 (red) and Ryuji Sakamoto (yellow), the same tokens as the design pages. Language: .en / .zh are hidden by
   html[data-lang]. No inline styles anywhere: the site's content security policy allows only this file. */
:root {
  --bg: #eef1f4; --surface: #ffffff; --surface2: #f4f6f8; --fg: #1b2430; --muted: #5b6776; --line: #d3dae2;
  --accent: #1d6a86; --accent-text: #1d6a86; --accent-fg: #ffffff; --glow: #e8a20c;
  --ok: #1f7a46; --warn: #b4531a; --code-bg: #e6ecf0; --hero: #dfe9ee;
  --clip: none; --radius: 8px; color-scheme: light;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-label: "Barlow Condensed", "Noto Sans SC", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-look]) {
    --bg: #11161c; --surface: #19202a; --surface2: #202936; --fg: #e8edf2; --muted: #9aa7b5; --line: #2c3641;
    --accent: #4aa3c2; --accent-text: #6fc0dc; --accent-fg: #0b1a22; --glow: #ffc247;
    --ok: #55c58a; --warn: #ff9a5c; --code-bg: #232c36; --hero: #16202a; color-scheme: dark;
  }
}
:root[data-look="p5"] {
  --bg: #0a0a0b; --surface: #151518; --surface2: #1d1d22; --fg: #f4f4f4; --muted: #b3b3ba; --line: #4a0c12;
  --accent: #e60012; --accent-text: #ff4a58; --accent-fg: #ffffff; --glow: #ff2b3a;
  --ok: #55e08a; --warn: #ffb04d; --code-bg: #26161a; --hero: #1a0b0e;
  --clip: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); --radius: 0px; color-scheme: dark;
}
:root[data-look="ryuji"] {
  --bg: #0c0c0a; --surface: #171713; --surface2: #201f18; --fg: #f7f3df; --muted: #c0bb9b; --line: #4a4515;
  --accent: #ffd400; --accent-text: #ffd400; --accent-fg: #14140f; --glow: #ffd400;
  --ok: #8fe08a; --warn: #ffa64d; --code-bg: #262418; --hero: #1b1a10;
  --clip: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); --radius: 0px; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html[data-lang="zh"] .en { display: none !important; }
html[data-lang="en"] .zh { display: none !important; }
body { background: var(--bg); color: var(--fg); font-family: var(--font-body); line-height: 1.7; font-size: 16px; margin: 0; }
a { color: var(--accent-text); }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
code { font-family: var(--font-mono); font-size: .88em; background: var(--code-bg); padding: 1px 5px; border-radius: 3px; overflow-wrap: anywhere; }
img { max-width: 100%; height: auto; }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 16px; }
main.wrap { padding-block: 8px 72px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1120px; margin: 0 auto; padding: 8px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.logo { font-family: var(--font-label); font-weight: 800; font-size: 26px; letter-spacing: .06em; text-decoration: none; color: var(--accent-fg); background: var(--accent); padding: 0 16px 0 12px; clip-path: var(--clip); border-radius: var(--radius); line-height: 1.35; }
.nav { display: flex; flex-wrap: wrap; gap: 2px 14px; flex: 1; }
.nav a { text-decoration: none; color: var(--muted); font-size: 15px; padding: 2px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--fg); }
.nav a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--accent); }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 2px 10px; font-family: var(--font-label); font-weight: 600; font-size: 15px; letter-spacing: .03em; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); }

/* headings */
h1 { font-size: clamp(30px, 6vw, 46px); line-height: 1.15; margin: 0 0 12px; text-wrap: balance; }
h2 { font-size: 20px; line-height: 1.3; margin: 40px 0 10px; display: inline-block; padding: 4px 18px 4px 14px; background: var(--accent); color: var(--accent-fg); clip-path: var(--clip); border-radius: var(--radius); scroll-margin-top: 70px; }
h3 { font-family: var(--font-label); letter-spacing: .08em; font-size: 16px; color: var(--accent-text); margin: 22px 0 6px; }
.eyebrow { font-family: var(--font-label); font-weight: 800; letter-spacing: .14em; font-size: 14px; color: var(--accent-text); text-transform: uppercase; }
.lede { color: var(--muted); font-size: 18px; max-width: 70ch; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* home */
.hero { background: var(--hero); border-bottom: 1px solid var(--line); }
.hero-in { max-width: 1120px; margin: 0 auto; padding: 36px 16px 32px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 28px; align-items: center; }
@media (max-width: 860px) { .hero-in { grid-template-columns: minmax(0, 1fr); } }
.hero img { border: 1px solid var(--line); border-radius: var(--radius); display: block; width: 100%; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn { display: inline-block; text-decoration: none; padding: 7px 20px 7px 16px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-family: var(--font-label); font-weight: 600; font-size: 18px; letter-spacing: .04em; clip-path: var(--clip); border-radius: var(--radius); }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn:hover { filter: brightness(1.08); }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.card h3 { margin-top: 0; }
.card p { margin: 6px 0; }
.card ul { margin: 6px 0 0; padding-left: 1.2em; }
a.card { display: block; text-decoration: none; color: var(--fg); }
a.card:hover { border-color: var(--accent); }
a.card .more { color: var(--accent-text); font-size: 14px; }
.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rules li { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: var(--radius); padding: 10px 14px; }

/* features */
.cols { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 860px) { .cols { grid-template-columns: minmax(0, 1fr); gap: 8px; } }
.toc { position: sticky; top: 64px; font-size: 15px; max-height: calc(100vh - 80px); overflow: auto; padding-top: 18px; }
@media (max-width: 860px) {
  .toc { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 14px; }
  .toc .grp, .toc p { width: 100%; margin: 0; }
  .toc a { border: 1px solid var(--line); border-left-width: 1px; border-radius: var(--radius); padding: 1px 10px; background: var(--surface); }
}
.toc a { display: block; text-decoration: none; color: var(--muted); padding: 3px 0 3px 10px; border-left: 3px solid var(--line); }
.toc a:hover { color: var(--fg); border-left-color: var(--accent); }
.toc .grp { font-family: var(--font-label); letter-spacing: .08em; color: var(--accent-text); margin: 0 0 6px; }
.feat { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.feat p { max-width: 74ch; }
.feat ul { padding-left: 1.3em; max-width: 78ch; }
.feat li { margin: 5px 0; }
.feat .one { color: var(--muted); font-size: 17px; margin: 0 0 8px; }
.shot { margin: 14px 0; }
.shot img { border: 1px solid var(--line); border-radius: var(--radius); }
.shot figcaption { color: var(--muted); font-size: 14px; }
.pagegrid { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 8px 18px; }
.pagegrid li a { font-weight: 600; }
.pagegrid li span.d { display: block; color: var(--muted); font-size: 14px; line-height: 1.4; }

/* changelog */
.ver { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 12px; }
.ver > summary, .ver > header { padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; list-style: none; cursor: pointer; }
.ver > summary::-webkit-details-marker { display: none; }
.ver .vn { font-family: var(--font-label); font-size: 26px; font-weight: 800; color: var(--accent-text); letter-spacing: .04em; }
.ver .vd { color: var(--muted); font-size: 14px; }
.ver .vb { padding: 0 16px 12px; }
.ver h4 { margin: 12px 0 2px; font-family: var(--font-label); letter-spacing: .08em; color: var(--accent-text); font-size: 15px; }
.ver ul { margin: 2px 0 0; padding-left: 1.3em; }
.ver li { margin: 4px 0; }
.jump { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 10px 0 16px; font-size: 14px; }

/* gallery, design, commands, description */
.shots { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.shots figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.shots figure img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--code-bg); }
.shots figcaption { padding: 6px 10px; font-size: 14px; color: var(--muted); }
table.cmds { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); }
table.cmds td, table.cmds th { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--line); }
table.cmds td:first-child { white-space: nowrap; }
@media (max-width: 700px) { table.cmds td:first-child { white-space: normal; } }
.tablewrap { overflow-x: auto; }
.doc { max-width: 84ch; }
.doc h2 { display: block; background: none; color: var(--fg); clip-path: none; padding: 0; border-bottom: 2px solid var(--accent); border-radius: 0; margin-top: 36px; }
.doc h3 { font-family: var(--font-body); letter-spacing: 0; color: var(--fg); font-size: 18px; }
.doc img { border: 1px solid var(--line); border-radius: var(--radius); display: block; margin: 10px 0; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; color: var(--muted); font-size: 15px; margin: 12px 0; }
.support { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: center; }
@media (max-width: 760px) { .support { grid-template-columns: minmax(0, 1fr); } }
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
footer .wrap { padding-block: 18px 40px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
