/* Charterwake: Tidebound website. Plain CSS, no build step, no external resources (CSP default-src 'self').
   Colours and type follow the in-game HUD (docs/gdd/ui-ux.md "Design system"). */

@font-face { font-family: "Alegreya SC"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/AlegreyaSC-Medium.woff2") format("woff2"); }
@font-face { font-family: "Alegreya SC"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/AlegreyaSC-Bold.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/AlegreyaSans-Regular.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/AlegreyaSans-Medium.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/AlegreyaSans-Bold.woff2") format("woff2"); }

:root {
	color-scheme: dark;
	--night-0: #0d0c1f;
	--night-1: #131230;
	--panel: rgba(32, 31, 60, 0.95);
	--header: #3b3a6b;
	--well: #23223f;
	--rim: rgba(255, 201, 74, 0.32);
	--hairline: rgba(255, 201, 74, 0.22);
	--line: rgba(255, 255, 255, 0.1);
	--gold: #ffc94a;
	--gold-hover: #ffd76f;
	--text: #ecebfa;
	--text-dim: #c3c1dd;
	--muted: #a9a7c9;
	--faint: #8d8bb0;
	--violet: #a66bff;
	--cyan: #7fe3ff;
	--radius: 12px;
	--shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
	--font-display: "Alegreya SC", "Palatino Linotype", Palatino, Georgia, serif;
	--font-body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
	--measure: 46rem;
	--gutter: clamp(1rem, 4vw, 2rem);
}

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

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

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background:
		radial-gradient(1100px 600px at 110% -10%, rgba(166, 107, 255, 0.12), transparent 60%),
		radial-gradient(900px 500px at -10% 110%, rgba(46, 230, 214, 0.06), transparent 60%),
		var(--night-0);
	color: var(--text);
	font: 400 1.0625rem/1.6 var(--font-body);
	overflow-wrap: break-word;
}

main { flex: 1; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--gold); text-decoration-color: rgba(255, 201, 74, 0.45); text-underline-offset: 0.18em; }
a:hover { color: var(--gold-hover); text-decoration-color: currentColor; }
a:focus-visible, .button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; letter-spacing: 0.02em; margin: 0 0 0.6em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.6rem); }
h3 { font-size: 1.15rem; color: var(--gold); margin-top: 1.8em; }
p, ul, ol, dl, address { margin: 0 0 1em; }
address { font-style: normal; }
ul, ol { padding-left: 1.3em; }
li + li { margin-top: 0.3em; }
strong { font-weight: 700; color: #fff; }

.skip {
	position: absolute; left: 1rem; top: -4rem; z-index: 10;
	background: var(--gold); color: var(--well); padding: 0.5rem 1rem; border-radius: 8px; font-weight: 700;
}
.skip:focus { top: 1rem; }

/* ---------- Top bar ---------- */
.topbar {
	position: sticky; top: 0; z-index: 5;
	background: rgba(13, 12, 31, 0.86);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--hairline);
}
.topbar-inner {
	max-width: 72rem; margin: 0 auto; padding: 0.6rem var(--gutter);
	display: flex; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text); text-decoration: none; }
.brand img { width: 36px; height: 36px; }
.brand span { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: 0.06em; }
.brand:hover { color: var(--gold-hover); }
.nav { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
.nav li + li { margin: 0; }
.nav a {
	display: block; padding: 0.35rem 0.75rem; border-radius: 8px;
	color: var(--text-dim); text-decoration: none; font-weight: 500;
}
.nav a:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.nav a[aria-current="page"] { background: rgba(166, 107, 255, 0.22); box-shadow: inset 0 0 0 1px var(--rim); color: var(--gold); }

/* ---------- Panels ---------- */
.panel {
	background: var(--panel);
	border: 1px solid var(--rim);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}
.panel-head {
	background: linear-gradient(90deg, var(--header), rgba(59, 58, 107, 0.4));
	border-bottom: 1px solid var(--hairline);
	border-radius: var(--radius) var(--radius) 0 0;
	padding: 1rem 1.25rem;
}
.panel-head h2 { margin: 0; }
.panel-body { padding: 1.25rem; }

.chip {
	display: inline-block; padding: 0.15rem 0.6rem; border-radius: 6px;
	font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
	background: rgba(166, 107, 255, 0.2); color: var(--text-dim); box-shadow: inset 0 0 0 1px var(--line);
}

.button {
	display: inline-block; padding: 0.6rem 1.2rem; border-radius: 8px;
	background: var(--gold); color: var(--well); font-weight: 700; text-decoration: none;
	box-shadow: 0 6px 20px rgba(255, 201, 74, 0.22);
}
.button:hover { background: var(--gold-hover); color: var(--well); }
.button.secondary { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.button.secondary:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }

/* ---------- Landing ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; border-bottom: 1px solid var(--hairline); }
.hero-art { position: absolute; inset: 0; z-index: -2; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.hero::after {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background:
		linear-gradient(180deg, rgba(13, 12, 31, 0.25) 0%, rgba(13, 12, 31, 0.15) 35%, rgba(13, 12, 31, 0.85) 75%, var(--night-0) 100%);
}
.hero-inner {
	max-width: 72rem; margin: 0 auto; padding: clamp(12rem, 26vw, 18rem) var(--gutter) clamp(2rem, 5vw, 3.5rem);
	display: grid; gap: 1.25rem; justify-items: start;
}
.hero h1 { margin: 0; width: min(100%, 36rem); filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.5)); }
.hero-pitch { max-width: 44rem; padding: 1.1rem 1.25rem; font-size: 1.125rem; }
.hero-pitch p:last-child { margin-bottom: 0; }
.tagline { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.15rem, 2.6vw, 1.45rem); color: var(--gold); margin: 0; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 2px 12px rgba(0, 0, 0, 0.8); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

.section { max-width: 72rem; margin: 0 auto; padding: clamp(2rem, 5vw, 3.5rem) var(--gutter) 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-bottom: 1px solid var(--hairline); margin-bottom: 1.25rem; }
.section-title h2 { color: var(--gold); margin-bottom: 0.4rem; }
.section-title p { color: var(--muted); margin: 0 0 0.5rem; font-size: 0.95rem; }

.pillars { display: grid; grid-template-columns: 1fr; gap: 1rem; list-style: none; padding: 0; margin: 0; }
@media (min-width: 36rem) {
	.pillars { grid-template-columns: repeat(2, 1fr); }
	.pillars li:last-child { grid-column: 1 / -1; }
}
/* Five pillars: three over two on wide screens. */
@media (min-width: 60rem) {
	.pillars { grid-template-columns: repeat(6, 1fr); }
	.pillars li { grid-column: span 2; }
	.pillars li:nth-child(n + 4), .pillars li:last-child { grid-column: span 3; }
}
.pillars li { margin: 0; padding: 1.1rem 1.2rem; }
.pillars h3 { margin: 0 0 0.35rem; font-size: 1.15rem; }
.pillars p { margin: 0; color: var(--text-dim); }

.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; margin: 0; }
.gallery figure { margin: 0; overflow: hidden; }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 1px solid var(--hairline); }
.gallery figcaption { padding: 0.7rem 1rem; color: var(--text-dim); font-size: 0.95rem; }
.note { color: var(--muted); font-size: 0.95rem; margin-top: 0.9rem; }

/* ---------- Legal pages ---------- */
.legal { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: clamp(1.5rem, 4vw, 3rem) var(--gutter) 0; }
.legal > header { margin-bottom: 1.5rem; }
.legal > header p { color: var(--text-dim); }
.lang-switch { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.lang-switch li + li { margin: 0; }
.lang-switch a { display: inline-block; padding: 0.3rem 0.8rem; border-radius: 8px; text-decoration: none; color: var(--text-dim); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.lang-switch a:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.legal article { margin-bottom: 2rem; scroll-margin-top: 5rem; }
.legal article .panel-body > :last-child { margin-bottom: 0; }
.legal h3:first-child { margin-top: 0; }
.legal dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; }
.legal dt { color: var(--muted); }
.legal dd { margin: 0; }
.legal .meta { color: var(--muted); font-size: 0.95rem; }
.table-wrap { overflow-x: auto; margin: 0 0 1em; }
.legal table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); }
.legal th { font-weight: 700; color: var(--text-dim); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }
.back-top { font-size: 0.95rem; }

/* ---------- 404 ---------- */
.notfound { max-width: 40rem; margin: 0 auto; padding: clamp(3rem, 10vw, 6rem) var(--gutter) 0; text-align: center; }
.notfound img { width: 96px; height: 96px; margin: 0 auto 1.5rem; }

/* ---------- Footer ---------- */
.footer { margin-top: clamp(2.5rem, 6vw, 4rem); border-top: 1px solid var(--hairline); background: rgba(13, 12, 31, 0.7); }
.footer-inner {
	max-width: 72rem; margin: 0 auto; padding: 1.5rem var(--gutter) 2rem;
	display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; justify-content: space-between; color: var(--muted); font-size: 0.95rem;
}
.footer p { margin: 0; }
.footer ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.footer li + li { margin: 0; }
.footer a { color: var(--text-dim); }
.footer a:hover { color: var(--gold-hover); }

@media (max-width: 34rem) {
	body { font-size: 1rem; }
	.topbar { position: static; }
	.brand span { font-size: 1.15rem; }
	.nav a { padding: 0.3rem 0.55rem; }
	.legal dl { grid-template-columns: 1fr; gap: 0.1rem; }
	.legal dd { margin-bottom: 0.5rem; }
	.panel-body, .panel-head { padding-left: 1rem; padding-right: 1rem; }
}

@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
}

@media print {
	body { background: #fff; color: #000; }
	.topbar, .footer, .skip, .lang-switch, .back-top { display: none; }
	.panel { box-shadow: none; border-color: #999; background: #fff; }
	.panel-head { background: none; }
	h3, a, strong { color: #000; }
}
