/* Gilaki Dictionary v2 — design system. RTL first. Gilan green, light + dark. */

/* ---------------------------------------------------------------- tokens */
:root {
	--green-50: #eef7f1;
	--green-100: #d6ecdf;
	--green-200: #acd8be;
	--green-400: #4fa77a;
	--green-600: #1f6f4a;
	--green-700: #175a3b;
	--green-800: #11442d;
	--rice: #e9b949;
	--tea: #7a5a2f;

	--bg: #f6f8f5;
	--surface: #ffffff;
	--surface-2: #eef3ee;
	--text: #1b2620;
	--muted: #5d6b63;
	--border: #dbe4dd;
	--accent: var(--green-600);
	--accent-strong: var(--green-700);
	--accent-soft: var(--green-50);
	--accent-text: #ffffff;
	--warn-bg: #fff6e0;
	--warn-text: #7a5300;
	--ok-bg: #e6f4ec;
	--ok-text: #175a3b;
	--focus: #e9b949;

	--radius: 14px;
	--radius-sm: 9px;
	--shadow: 0 1px 2px rgba(17, 68, 45, .06), 0 6px 24px rgba(17, 68, 45, .07);
	--shadow-lg: 0 10px 40px rgba(17, 68, 45, .14);
	--max: 1180px;
	--font: 'Vazirmatn UI', Vazirmatn, Tahoma, 'Segoe UI', system-ui, sans-serif;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #0f1a15;
		--surface: #15231c;
		--surface-2: #1b2c23;
		--text: #e5eee8;
		--muted: #9fb2a6;
		--border: #27392f;
		--accent: #5cc08d;
		--accent-strong: #7ed3a6;
		--accent-soft: #1b3326;
		--accent-text: #0b1711;
		--warn-bg: #3a2f12;
		--warn-text: #f1d48a;
		--ok-bg: #173325;
		--ok-text: #9fe0bd;
		--shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 24px rgba(0, 0, 0, .25);
		--shadow-lg: 0 10px 40px rgba(0, 0, 0, .45);
		color-scheme: dark;
	}
}
:root[data-theme="dark"] {
	--bg: #0f1a15;
	--surface: #15231c;
	--surface-2: #1b2c23;
	--text: #e5eee8;
	--muted: #9fb2a6;
	--border: #27392f;
	--accent: #5cc08d;
	--accent-strong: #7ed3a6;
	--accent-soft: #1b3326;
	--accent-text: #0b1711;
	--warn-bg: #3a2f12;
	--warn-text: #f1d48a;
	--ok-bg: #173325;
	--ok-text: #9fe0bd;
	--shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 24px rgba(0, 0, 0, .25);
	--shadow-lg: 0 10px 40px rgba(0, 0, 0, .45);
	color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 1rem;
	line-height: 1.85;
	text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; }
main { flex: 1 0 auto; }
.grid > *, .word-layout > *, .search-layout > *, .content-layout > *, .footer-grid > * { min-width: 0; }
html, body { overflow-x: clip; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 4px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { line-height: 1.4; margin: 0 0 .6em; font-weight: 800; }
h1 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 2.3vw, 1.7rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.icon { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 1rem; top: -4rem; z-index: 100; background: var(--accent); color: var(--accent-text); padding: .5rem 1rem; border-radius: var(--radius-sm); }
.skip-link:focus { top: 1rem; }
.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: 16px; }
.section { padding-block: clamp(2rem, 5vw, 3.5rem); }
.stack > * + * { margin-top: 1rem; }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
[dir="ltr"], .ltr { direction: ltr; text-align: left; }

/* ---------------------------------------------------------------- buttons, forms */
.btn {
	display: inline-flex; align-items: center; gap: .45em; justify-content: center;
	border: 1px solid var(--border); background: var(--surface); color: var(--text);
	padding: .55em 1.1em; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer;
	transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-text); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { padding: .3em .8em; font-size: .9rem; }
input[type="text"], input[type="search"], input[type="email"], input[type="password"], select, textarea {
	width: 100%; font: inherit; color: var(--text); background: var(--surface);
	border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .6em .85em;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .95rem; }
.field { margin-bottom: 1rem; }
.field-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice { padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; }
.notice-ok { background: var(--ok-bg); color: var(--ok-text); }
.notice-warn { background: var(--warn-bg); color: var(--warn-text); }

/* ---------------------------------------------------------------- header */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: color-mix(in srgb, var(--surface) 88%, transparent);
	backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
	border-bottom: 1px solid var(--border);
}
.site-header .bar { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.brand { flex: none; display: flex; align-items: center; gap: .55rem; color: var(--text); font-weight: 800; font-size: 1.15rem; white-space: nowrap; }
.brand:hover { text-decoration: none; color: var(--accent); }
.brand img { width: 36px; height: 36px; border-radius: 10px; background: #fff; padding: 2px; }
.nav { display: flex; gap: .25rem; margin-inline-start: .5rem; }
.nav a { color: var(--text); padding: .4rem .75rem; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.header-tools { display: flex; align-items: center; gap: .5rem; margin-inline-start: auto; }
.account-links { display: flex; gap: .4rem; white-space: nowrap; }
.header-search { width: min(260px, 22vw); }
.dilami-date { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.dilami-date:hover { color: var(--accent); text-decoration: none; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme]) .theme-toggle .icon-sun { display: block; }
	:root:not([data-theme]) .theme-toggle .icon-moon { display: none; }
}
.menu-toggle { display: none; }
@media (max-width: 1500px) { .dilami-date.in-header { display: none; } }
@media (max-width: 1280px) { .header-search { display: none; } }
@media (max-width: 1100px) { .nav a { padding-inline: .5rem; } }
@media (max-width: 760px) {
	.menu-toggle { display: inline-grid; }
	.nav { display: none; position: absolute; inset-inline: 0; top: 64px; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--border); padding: .75rem 16px 1rem; box-shadow: var(--shadow); }
	.nav.open { display: flex; }
	.header-tools .account-links { display: none; }
	.nav .account-mobile { display: flex; gap: .5rem; margin-top: .5rem; }
}
.nav .account-mobile { display: none; }

/* ---------------------------------------------------------------- search + autocomplete */
.search-box { position: relative; }
.search-box form { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .25rem; box-shadow: var(--shadow); }
.search-box input[type="search"] { border: 0; background: transparent; box-shadow: none; padding: .55rem 1rem; }
.search-box input[type="search"]:focus { box-shadow: none; }
.search-box .btn { flex: none; }
.search-box.lg form { padding: .4rem; }
.search-box.lg input[type="search"] { font-size: 1.15rem; padding: .8rem 1.2rem; }
.search-box.sm form { box-shadow: none; }
.search-box.sm input[type="search"] { padding: .35rem .8rem; font-size: .95rem; }
.ac-list {
	position: absolute; inset-inline: 0; top: calc(100% + 6px); z-index: 60;
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
	list-style: none; margin: 0; padding: .35rem; max-height: 70vh; overflow-y: auto; text-align: start;
}
.ac-list[hidden] { display: none; }
.ac-group { padding: .35rem .7rem .15rem; font-size: .78rem; font-weight: 700; color: var(--muted); }
.ac-item a { display: flex; align-items: baseline; gap: .6rem; padding: .45rem .7rem; border-radius: var(--radius-sm); color: var(--text); }
.ac-item a:hover, .ac-item[aria-selected="true"] a { background: var(--accent-soft); text-decoration: none; }
.ac-item .ac-title { font-weight: 700; }
.ac-item .ac-hint { color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-item mark { background: transparent; color: var(--accent); }
.ac-empty, .ac-more a { display: block; padding: .5rem .7rem; color: var(--muted); }
.ac-more a { color: var(--accent); font-weight: 600; }

/* ---------------------------------------------------------------- hero */
.hero {
	position: relative; overflow: hidden; text-align: center;
	padding-block: clamp(3rem, 9vw, 6.5rem) clamp(2.5rem, 7vw, 5rem);
	background:
		radial-gradient(1200px 400px at 85% -10%, color-mix(in srgb, var(--rice) 22%, transparent), transparent 60%),
		radial-gradient(900px 500px at 0% 110%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
		linear-gradient(180deg, var(--accent-soft), var(--bg));
	border-bottom: 1px solid var(--border);
}
.hero::after { /* rice-terrace lines */
	content: ""; position: absolute; inset: auto 0 0 0; height: 90px; opacity: .35; pointer-events: none;
	background: repeating-radial-gradient(ellipse at 50% 220%, transparent 0 22px, color-mix(in srgb, var(--accent) 35%, transparent) 23px 24px);
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: .4rem; }
.hero .lead { color: var(--muted); font-size: clamp(1rem, 2vw, 1.2rem); max-width: 640px; margin: 0 auto 1.6rem; }
.hero .search-box { max-width: 680px; margin-inline: auto; }
.hero-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem 1.4rem; margin-top: 1.4rem; color: var(--muted); font-size: .95rem; }
.hero-meta strong { color: var(--text); }
.stat { display: inline-flex; align-items: center; gap: .35rem; }

/* ---------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1rem, 2.5vw, 1.5rem); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.card-head h2, .card-head h3 { margin: 0; }
.section-title { display: flex; align-items: center; gap: .5rem; }
.section-title .icon { color: var(--accent); }
.word-card { display: block; color: inherit; transition: transform .15s, box-shadow .15s, border-color .15s; }
.word-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--green-200); color: inherit; }
.word-card .w-title { font-size: 1.25rem; font-weight: 800; color: var(--text); margin: 0 0 .15rem; }
.word-card .w-meaning { color: var(--accent); font-weight: 600; margin: 0; }
.word-card .w-example { color: var(--muted); font-size: .93rem; margin: .4rem 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.word-list { list-style: none; margin: 0; padding: 0; }
.word-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem .2rem; border-bottom: 1px dashed var(--border); }
.word-list li:last-child { border-bottom: 0; }
.word-list .w { font-weight: 700; color: var(--text); }
.word-list .m { color: var(--muted); text-align: end; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }

.wotd { position: relative; overflow: hidden; background: linear-gradient(135deg, var(--green-700), var(--green-600) 55%, var(--green-400)); color: #fff; border: 0; }
.wotd::before { content: ""; position: absolute; inset-inline-end: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.wotd .label { display: inline-flex; gap: .35rem; align-items: center; font-size: .85rem; background: rgba(255, 255, 255, .16); padding: .2rem .7rem; border-radius: 999px; }
.wotd .w-title { font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 800; margin: .6rem 0 .1rem; color: #fff; }
.wotd .w-meaning { font-size: 1.15rem; color: #e8f6ee; }
.wotd blockquote { margin: 1rem 0 0; padding: .8rem 1rem; border-inline-start: 3px solid var(--rice); background: rgba(0, 0, 0, .12); border-radius: var(--radius-sm); }
.wotd blockquote p { margin: 0; }
.wotd blockquote .tr { color: #cfe9da; font-size: .93rem; }
.wotd a { color: #fff; }
.wotd .btn { background: #fff; color: var(--green-700); border-color: #fff; }
.wotd .btn:hover { background: var(--rice); border-color: var(--rice); color: #1b2620; }

.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; justify-content: space-between; background: var(--surface-2); }
.cta p { margin: 0; color: var(--muted); }

/* ---------------------------------------------------------------- chips */
.chips { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; margin: 0; padding: 0; }
.chips li > a, .chips li > span { display: inline-block; padding: .3rem .85rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; border: 1px solid transparent; }
.chips li > a:hover { border-color: var(--accent); text-decoration: none; }
.chips.neutral li > a, .chips.neutral li > span { background: var(--surface-2); color: var(--text); }
.letters { display: flex; flex-wrap: wrap; gap: .3rem; }
.letters a { display: inline-grid; place-items: center; min-width: 2.2rem; height: 2.2rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 700; }
.letters a:hover, .letters a.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); text-decoration: none; }

/* ---------------------------------------------------------------- word page */
.word-header { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-bottom: .4rem; }
.word-header h1 { margin: 0; font-size: clamp(2.2rem, 6vw, 3.4rem); }
.word-actions { display: flex; gap: .4rem; }
.word-sub { color: var(--muted); margin-bottom: 1.5rem; }
.word-layout { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
@media (max-width: 900px) { .word-layout { grid-template-columns: 1fr; } }
.meaning-block { display: grid; gap: 1.1rem; }
.meaning-row h2 { font-size: .95rem; color: var(--muted); font-weight: 700; margin-bottom: .45rem; }
.example { background: var(--surface-2); border-radius: var(--radius-sm); padding: .9rem 1.1rem; border-inline-start: 4px solid var(--accent); }
.example p { margin: 0; }
.example .glk { font-size: 1.15rem; font-weight: 600; }
.example .tr { color: var(--muted); margin-top: .35rem; }
.word-figure { margin: 0 0 1.25rem; }
.word-figure img { width: 100%; border-radius: var(--radius); object-fit: cover; max-height: 380px; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.facts h3 { font-size: .9rem; color: var(--muted); margin-bottom: .35rem; }
.untranslated-note { background: var(--warn-bg); color: var(--warn-text); border-radius: var(--radius-sm); padding: .8rem 1rem; }
.word-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; }

/* ---------------------------------------------------------------- breadcrumbs, pagination */
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .25rem; list-style: none; margin: 0 0 1rem; padding: 0; color: var(--muted); font-size: .9rem; }
.breadcrumbs li + li::before { content: "‹"; margin-inline: .35rem; color: var(--border); }
.breadcrumbs a { color: var(--muted); }
.pagination, .nav-links { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; margin-top: 2rem; }
.page-numbers { display: inline-grid; place-items: center; min-width: 2.5rem; height: 2.5rem; padding-inline: .6rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; }
.page-numbers.current { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
a.page-numbers:hover { border-color: var(--accent); text-decoration: none; }

/* ---------------------------------------------------------------- search page */
.search-layout { display: grid; gap: 1.5rem; grid-template-columns: 280px minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .search-layout { grid-template-columns: 1fr; } }
.filters { position: sticky; top: 84px; }
.filters fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
.filters legend { font-weight: 700; margin-bottom: .35rem; }
.seg { display: flex; flex-wrap: wrap; gap: .3rem; }
.seg label { margin: 0; font-weight: 500; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--border); cursor: pointer; font-size: .92rem; }
.seg input:checked + span { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); }
.result { display: flex; gap: 1rem; align-items: flex-start; }
.result + .result { margin-top: .9rem; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: .1rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); vertical-align: middle; }
.badge.glk { background: var(--accent-soft); color: var(--accent); }
.result h2 { font-size: 1.2rem; margin: 0 0 .2rem; }
.result h2 a { color: var(--text); }
.result p { margin: 0; color: var(--muted); }
.result-count { color: var(--muted); margin-bottom: 1rem; }

/* ---------------------------------------------------------------- contributors */
.rank-table { width: 100%; border-collapse: collapse; }
.rank-table th, .rank-table td { padding: .65rem .5rem; border-bottom: 1px solid var(--border); text-align: start; }
.rank-table th { color: var(--muted); font-size: .85rem; font-weight: 700; }
.rank-table td.num { font-variant-numeric: tabular-nums; }
.rank { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--surface-2); font-weight: 800; }
.rank-1 { background: #f3d36b; color: #4a3500; }
.rank-2 { background: #d7dde2; color: #2c3440; }
.rank-3 { background: #e6b58a; color: #4a2a10; }
.contributor { display: flex; align-items: center; gap: .6rem; }
.contributor img { border-radius: 50%; }
.level { font-size: .78rem; color: var(--accent); font-weight: 700; }
.top-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.top-list li { display: flex; align-items: center; gap: .7rem; }
.top-list .score { margin-inline-start: auto; color: var(--muted); font-size: .9rem; }

/* ---------------------------------------------------------------- untranslated page */
.untr-item { border-bottom: 1px solid var(--border); padding-block: 1rem; }
.untr-item:last-child { border-bottom: 0; }
.untr-item summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; list-style: none; }
.untr-item summary::-webkit-details-marker { display: none; }
.untr-item summary .w { font-size: 1.2rem; font-weight: 800; }
.untr-item[open] summary { margin-bottom: .8rem; }
.untr-item .suggest-form { background: var(--surface-2); border-radius: var(--radius-sm); padding: 1rem; }

/* ---------------------------------------------------------------- blog */
.post-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.post-card .thumb { aspect-ratio: 16 / 9; background: var(--surface-2); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card .body { padding: 1rem 1.2rem 1.2rem; }
.post-card h3 { margin-bottom: .35rem; }
.post-card h3 a { color: var(--text); }
.entry-content { font-size: 1.06rem; }
.entry-content img { border-radius: var(--radius-sm); }
.entry-content h2, .entry-content h3 { margin-top: 1.6em; }
.content-layout { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
@media (max-width: 900px) { .content-layout { grid-template-columns: 1fr; } }
.widget + .widget { margin-top: 1rem; }
.widget-title { font-size: 1rem; }
.widget ul { margin: 0; padding-inline-start: 1.1rem; }

/* ---------------------------------------------------------------- 404 */
.e404 { text-align: center; padding-block: clamp(3rem, 10vw, 6rem); }
.e404 .code { font-size: clamp(5rem, 18vw, 9rem); font-weight: 800; line-height: 1; letter-spacing: .05em; background: linear-gradient(135deg, var(--accent), var(--rice)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.e404 .search-box { max-width: 560px; margin: 1.5rem auto; }
.e404 .chips { justify-content: center; }

/* ---------------------------------------------------------------- footer */
.site-footer { margin-top: 3rem; background: var(--surface); border-top: 1px solid var(--border); padding-block: 2.5rem 1.5rem; font-size: .95rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 2fr repeat(3, 1fr); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h2 { font-size: 1rem; margin-bottom: .6rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; border-top: 1px solid var(--border); margin-top: 2rem; padding-top: 1.2rem; color: var(--muted); font-size: .88rem; }

/* ---------------------------------------------------------------- motion */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
	.site-header, .site-footer, .suggest, .search-box, .word-actions { display: none !important; }
	body { background: #fff; color: #000; }
}

/* suggestion form: extra fields */
.more-fields { margin: .5rem 0 1rem; border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: .6rem .9rem; }
.more-fields > summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.more-fields[open] > summary { margin-bottom: .8rem; }
.suggest-form fieldset { border: 0; padding: 0; }
.suggest-form legend { font-weight: 600; margin-bottom: .3rem; font-size: .95rem; }

/* word of the day picture */
.wotd-photo { display: block; margin: -1.5rem -1.5rem 1.1rem; aspect-ratio: 16 / 9; overflow: hidden; background: rgba(0, 0, 0, .15); }
.wotd-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 640px) { .wotd-photo { margin: -1rem -1rem 1rem; } }

.icon-btn.playing { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.suggest-form input[type="file"] { font: inherit; max-width: 100%; }
.suggest-form audio { vertical-align: middle; max-width: 100%; }
.comment-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.comment-list .comment { border-bottom: 1px solid var(--border); padding-block: .8rem; }
.comment-list .children { list-style: none; padding-inline-start: 1.5rem; }
.comment-author img { border-radius: 50%; vertical-align: middle; margin-inline-end: .4rem; }
.comment-form p { margin-bottom: .8rem; }
