/* FAKE SCANNER — 基本スタイル（トークンは DESIGN.md が正） */

@font-face {
	font-family: "Oxanium";
	src: url("../fonts/oxanium-subset.woff2") format("woff2");
	font-weight: 400 800;
	font-display: swap;
}
@font-face {
	font-family: "Zen Kaku Gothic New";
	src: url("../fonts/zenkakugothicnew-400-subset.woff2") format("woff2");
	font-weight: 400;
	font-display: swap;
}
@font-face {
	font-family: "Zen Kaku Gothic New";
	src: url("../fonts/zenkakugothicnew-700-subset.woff2") format("woff2");
	font-weight: 700;
	font-display: swap;
}

:root {
	--bg: #05070a;
	--bg-2: #0c1118;
	--panel: rgba(12, 17, 24, 0.72);
	--blue: #3fd2ff;
	--blue-dim: #1b6f8c;
	--red: #ff2d4a;
	--caution: #ffd23f;
	--text: #e6edf3;
	--muted: #8b98a8;

	--font-display: "Oxanium", system-ui, sans-serif;
	--font-body:
		"Zen Kaku Gothic New", system-ui, "Hiragino Sans", "Noto Sans JP",
		sans-serif;

	--gutter: clamp(16px, 4vw, 48px);
	--ease: cubic-bezier(0.22, 1, 0.36, 1);
	--glow: var(--blue);
	color-scheme: dark;
}

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	color: var(--text);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.7;
	background-color: var(--bg);
	background-image:
		radial-gradient(
			ellipse 80% 60% at 75% 25%,
			color-mix(in srgb, var(--glow) 16%, transparent),
			transparent 60%
		),
		radial-gradient(
			ellipse 60% 50% at 5% 95%,
			rgba(63, 210, 255, 0.1),
			transparent 60%
		),
		repeating-linear-gradient(
			0deg,
			rgba(63, 210, 255, 0.05) 0 1px,
			transparent 1px 48px
		),
		repeating-linear-gradient(
			90deg,
			rgba(63, 210, 255, 0.05) 0 1px,
			transparent 1px 48px
		),
		linear-gradient(180deg, var(--bg-2), var(--bg));
	background-attachment: fixed;
}

body[data-state="result"] {
	--glow: var(--red);
}

h1,
h2,
p,
ol,
ul {
	margin: 0;
}

img,
video {
	display: block;
	max-width: 100%;
}

button,
input,
label {
	font: inherit;
}

:focus-visible {
	outline: 2px solid var(--blue);
	outline-offset: 3px;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

[hidden] {
	display: none;
}

/* ジョーク表示: 常に画面上端に固定 */
.joke-bar {
	position: sticky;
	top: 0;
	z-index: 10;
	display: block;
	padding: 8px var(--gutter);
	background: var(--caution);
	color: #111;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.5;
	text-align: center;
}
.joke-bar strong {
	margin-right: 10px;
	font-family: var(--font-display);
	font-weight: 800;
	letter-spacing: 0.12em;
}

.site-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	padding: 20px var(--gutter);
}

.logo {
	font-family: var(--font-display);
	font-weight: 800;
	font-size: 18px;
	letter-spacing: 0.18em;
	color: var(--text);
	text-decoration: none;
	white-space: nowrap;
}
.logo b {
	color: var(--blue);
}

.header-tools {
	display: flex;
	align-items: center;
	gap: 12px;
}

.tag {
	font-family: var(--font-display);
	font-size: 12px;
	letter-spacing: 0.2em;
	color: var(--muted);
	border: 1px solid var(--blue-dim);
	padding: 4px 10px;
	white-space: nowrap;
}

.sound-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid var(--blue-dim);
	background: transparent;
	color: var(--muted);
	font-family: var(--font-display);
	font-size: 12px;
	letter-spacing: 0.15em;
	cursor: pointer;
}
.sound-toggle__icon {
	width: 14px;
	height: 14px;
	border: 2px solid currentColor;
	border-radius: 50%;
}
.sound-toggle[aria-pressed="true"] {
	color: var(--blue);
	border-color: var(--blue);
}
.sound-toggle[aria-pressed="true"] .sound-toggle__icon {
	background: var(--blue);
	box-shadow: 0 0 10px var(--blue);
}

.eyebrow {
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 13px;
	letter-spacing: 0.3em;
	color: var(--blue);
}
.eyebrow--red {
	color: var(--red);
}

/* ボタン */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 24px;
	border: 1px solid var(--blue);
	font-family: var(--font-body);
	font-weight: 700;
	font-size: 15px;
	letter-spacing: 0.04em;
	cursor: pointer;
	user-select: none;
	transition:
		background-color 200ms var(--ease),
		box-shadow 200ms var(--ease),
		color 200ms var(--ease);
}
.btn--primary {
	background: var(--blue);
	color: var(--bg);
	box-shadow: 0 0 24px rgba(63, 210, 255, 0.4);
}
.btn--primary:hover:not(:disabled) {
	box-shadow: 0 0 36px rgba(63, 210, 255, 0.7);
}
.btn--ghost {
	background: transparent;
	color: var(--blue);
}
.btn--ghost:hover {
	background: rgba(63, 210, 255, 0.1);
}
.btn--text {
	border-color: transparent;
	background: transparent;
	color: var(--text);
	text-decoration: underline;
	text-underline-offset: 6px;
	padding: 0 12px;
}
.btn--text:hover {
	color: var(--blue);
}
.btn:disabled {
	border-color: var(--blue-dim);
	background: transparent;
	color: var(--muted);
	box-shadow: none;
	cursor: not-allowed;
}

/* ラベルで包んだファイル入力にもフォーカス表示を出す */
label.btn:has(+ input:focus-visible) {
	outline: 2px solid var(--blue);
	outline-offset: 3px;
}
label.btn:has(+ input:disabled) {
	opacity: 0.5;
	pointer-events: none;
}

.site-footer {
	margin-top: auto;
	padding: 24px var(--gutter) 32px;
	border-top: 1px solid rgba(63, 210, 255, 0.12);
	color: var(--muted);
	font-size: 13px;
}
