/* Grimdraw site: the game's ink palette and fonts, served from this site (no third-party requests). */
@font-face { font-family: "Barlow Condensed"; src: url("/fonts/BarlowCondensed-ExtraBold.ttf"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/fonts/Barlow-Medium.ttf"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/fonts/Barlow-SemiBold.ttf"); font-weight: 600; font-display: swap; }

:root {
	--ink: #0b0908;
	--panel: #17110f;
	--panel-edge: #2c221d;
	--bone: #ece0c4;
	--parchment: #c7b690;
	--amber: #e8a33c;
	--ember: #ff7a2a;
	--blood: #b02a2c;
	--teal: #45aaa5;
	--grey: #8a8079;
	--heading: 800 1rem/1 "Barlow Condensed", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* The section glows spill past the edges on purpose; never let them make the page scroll sideways. */
html, body { overflow-x: clip; }

body {
	margin: 0;
	background: var(--ink);
	color: var(--bone);
	font: 500 18px/1.6 "Barlow", system-ui, sans-serif;
	-webkit-font-smoothing: antialiased;
}

a { color: var(--amber); }
img { display: block; max-width: 100%; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

h1, h2, h3, .eyebrow { font-family: "Barlow Condensed", sans-serif; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }

/* ---------- top bar ---------- */
header.top {
	position: fixed; inset: 0 0 auto 0; z-index: 50;
	display: flex; align-items: center; justify-content: space-between;
	padding: 16px max(16px, calc((100vw - 1080px) / 2 + 16px)); max-width: none;
	transition: background 0.3s, padding 0.3s, box-shadow 0.3s;
}
header.top.stuck {
	background: rgba(11, 9, 8, 0.78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
	padding-top: 10px; padding-bottom: 10px; box-shadow: 0 1px 0 var(--panel-edge);
}
header.top a.brand {
	display: flex; align-items: center; gap: 10px; text-decoration: none;
	font: var(--heading); font-size: 26px; letter-spacing: 0.05em; color: var(--amber);
}
header.top a.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 0 0 1px var(--panel-edge); }
header.top nav a { color: var(--parchment); text-decoration: none; margin-left: 20px; font-weight: 600; }
header.top nav a:hover { color: var(--amber); }
.solid header.top { position: static; }

/* ---------- hero ---------- */
.hero {
	position: relative; overflow: hidden; min-height: 100svh;
	display: flex; align-items: center;
	background: var(--ink) url("/img/bg_act3.jpg") center 30% / cover;
}
.hero::before {
	/* Darkens the painting toward the edges and the bottom so the text and the hero read. */
	content: ""; position: absolute; inset: 0;
	background:
		radial-gradient(ellipse at 70% 45%, rgba(11,9,8,0.1), rgba(11,9,8,0.85) 70%),
		linear-gradient(180deg, rgba(11,9,8,0.55), rgba(11,9,8,0.25) 40%, var(--ink) 96%);
}
.hero .fog {
	position: absolute; inset: auto -20% -10% -20%; height: 45%;
	background: radial-gradient(ellipse at center, rgba(199,182,144,0.12), transparent 70%);
	filter: blur(30px); animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: translateX(-6%); } to { transform: translateX(6%); } }

.embers { position: absolute; inset: 0; pointer-events: none; }
.embers i {
	position: absolute; bottom: -10px; width: 4px; height: 4px; border-radius: 50%;
	background: var(--ember); box-shadow: 0 0 10px 2px rgba(255, 122, 42, 0.7);
	animation: rise linear infinite; opacity: 0;
}
@keyframes rise {
	0% { transform: translate(0, 0); opacity: 0; }
	10% { opacity: 0.9; }
	100% { transform: translate(var(--sway, 30px), -105vh); opacity: 0; }
}

.hero .inner { position: relative; display: grid; grid-template-columns: 1.15fr 0.85fr; align-items: center; gap: 24px; padding-top: 90px; padding-bottom: 60px; }
.eyebrow { color: var(--teal); font-size: 18px; letter-spacing: 0.18em; margin: 0 0 10px; }
.hero h1 {
	margin: 0; font-size: clamp(72px, 13vw, 148px); line-height: 0.88; color: var(--amber);
	text-shadow: 0 5px 0 #000, 0 0 50px rgba(232, 163, 60, 0.45);
	animation: glow 4s ease-in-out infinite;
}
@keyframes glow { 50% { text-shadow: 0 5px 0 #000, 0 0 70px rgba(232, 163, 60, 0.7); } }
.brush { width: min(460px, 90%); height: 18px; margin: 14px 0 0; }
.brush path { stroke-dasharray: 600; stroke-dashoffset: 600; animation: ink 1.4s 0.4s ease-out forwards; }
@keyframes ink { to { stroke-dashoffset: 0; } }
.hero p.tag { font-size: 22px; color: var(--parchment); margin: 22px 0 30px; max-width: 520px; }
.hero .figure { justify-self: center; position: relative; width: min(480px, 100%); aspect-ratio: 1 / 1.05; }
.hero .figure .phone.tilt { position: absolute; right: 0; top: 2%; width: 52%; transform: rotate(7deg); opacity: 0.9; border-radius: 26px; }
.hero .figure .delver { position: absolute; left: -4%; bottom: 0; width: 82%; filter: drop-shadow(0 30px 40px rgba(0,0,0,0.85)); animation: breathe 5s ease-in-out infinite; transform-origin: 50% 100%; }
.hero .figure::after {
	/* The lantern's warm light pooled behind the hero. */
	content: ""; position: absolute; inset: 15% 10% 5%; z-index: -1;
	background: radial-gradient(circle, rgba(232,163,60,0.35), transparent 65%);
	animation: flicker 3s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.012, 1.02); } }
@keyframes flicker { 0%, 100% { opacity: 0.8; } 40% { opacity: 1; } 60% { opacity: 0.65; } }

.ctas { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.badge {
	display: inline-flex; align-items: center; gap: 10px; padding: 15px 26px; border-radius: 14px;
	background: var(--amber); color: #1a1310; text-decoration: none;
	font: var(--heading); font-size: 22px; letter-spacing: 0.06em; text-transform: uppercase;
	box-shadow: 0 5px 0 #6b4a17, 0 10px 30px rgba(232,163,60,0.25);
}
.badge.soon { background: rgba(23,17,15,0.85); color: var(--bone); box-shadow: 0 5px 0 #000; border: 1px solid var(--panel-edge); }
.badge.ghost { background: transparent; color: var(--parchment); box-shadow: none; border: 1px solid var(--panel-edge); }
.badge.ghost:hover { color: var(--amber); border-color: var(--amber); }
.small { font-size: 15px; color: var(--grey); margin-top: 14px; }

/* ---------- sections ---------- */
/* section.wrap, so this beats .wrap's zero top and bottom padding. */
section.wrap { padding: 104px 16px; position: relative; text-align: center; }
section.wrap + section.wrap { padding-top: 40px; }
section::before {
	/* A soft coloured glow behind each section, so the page doesn't read as one long black sheet. */
	content: ""; position: absolute; inset: 10% -10%; z-index: -1; pointer-events: none;
	background: radial-gradient(ellipse at 50% 40%, var(--tint, rgba(232,163,60,0.06)), transparent 65%);
}
section.heroes { --tint: rgba(69,170,165,0.08); }
section.bossing { --tint: rgba(176,42,44,0.12); }
section.cards { --tint: rgba(232,163,60,0.07); }
section h2 { font-size: clamp(40px, 6vw, 60px); line-height: 1; color: var(--amber); margin: 0 0 14px; }
section .lead { color: var(--parchment); font-size: 20px; max-width: 620px; margin: 0 auto 44px; text-wrap: balance; }

/* heroes */
.roster { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.hero-card {
	position: relative; background: linear-gradient(180deg, #1f1714, var(--panel)); border: 1px solid var(--panel-edge);
	border-radius: 18px; padding: 14px 14px 18px; text-align: center; overflow: hidden; cursor: pointer;
	transition: transform 0.25s, border-color 0.25s;
}
.hero-card:hover, .hero-card.lit { transform: translateY(-6px); border-color: var(--hue, var(--amber)); }
.hero-card .pose { position: relative; aspect-ratio: 1; }
.hero-card .pose img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity 0.2s; filter: drop-shadow(0 12px 14px rgba(0,0,0,0.7)); }
.hero-card .pose img.attack { opacity: 0; }
.hero-card:hover .pose img.attack, .hero-card.lit .pose img.attack { opacity: 1; }
.hero-card:hover .pose img.idle, .hero-card.lit .pose img.idle { opacity: 0; }
.hero-card .pose::before { content: ""; position: absolute; inset: 20% 10% 0; background: radial-gradient(circle, var(--glow, rgba(232,163,60,0.22)), transparent 70%); }
.hero-card h3 { margin: 8px 0 6px; font-size: 28px; line-height: 1; color: var(--bone); }
.hero-card h3 small { display: block; font-size: 14px; letter-spacing: 0.2em; color: var(--grey); margin-bottom: 2px; }
.hero-card p { margin: 0; color: var(--parchment); font-size: 15px; line-height: 1.45; }
.hero-card .unlock { display: block; margin-top: 10px; font-size: 13px; color: var(--grey); letter-spacing: 0.04em; }

/* cards: real card renders, fanned like a hand */
.fan { display: flex; justify-content: center; padding: 20px 0 64px; }
.fan .card {
	width: 190px; margin: 0 -14px; transform: rotate(var(--r)) translateY(var(--y, 0));
	filter: drop-shadow(0 18px 22px rgba(0,0,0,0.65)); transition: transform 0.25s; position: relative;
}
.fan .card:hover { transform: rotate(0) translateY(-26px) scale(1.08); z-index: 2; }

/* how a run works */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; text-align: left; }
.steps li { position: relative; background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 18px; overflow: hidden; padding-bottom: 18px; }
.steps li > img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-bottom: 1px solid var(--panel-edge); }
.steps li > img.relic { object-fit: contain; padding: 18px; background: radial-gradient(circle, rgba(232,163,60,0.22), transparent 70%), #0e0a09; }
.steps li span {
	position: absolute; top: 12px; left: 12px; width: 40px; height: 40px; border-radius: 50%;
	display: grid; place-items: center; background: var(--amber); color: #1a1310;
	font: var(--heading); font-size: 22px; box-shadow: 0 4px 0 #6b4a17;
}
.steps li h3 { margin: 16px 20px 6px; font-size: 26px; color: var(--bone); }
.steps li p { margin: 0 20px; color: var(--parchment); font-size: 16px; line-height: 1.5; }

/* bosses */
.bosses { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.boss {
	position: relative; border-radius: 18px; overflow: hidden; border: 1px solid var(--panel-edge);
	background: radial-gradient(ellipse at 50% 70%, rgba(176,42,44,0.28), transparent 70%), var(--panel);
	padding: 18px 12px 16px; text-align: center;
}
.boss img { width: 100%; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 16px 18px rgba(0,0,0,0.8)); transition: transform 0.3s; }
.boss:hover img { transform: scale(1.05); }
.boss h3 { margin: 6px 0 0; font-size: 24px; color: var(--bone); }
.boss span { color: var(--grey); font-size: 14px; }

/* screenshots */
/* Five phones in one even row that always fits; on narrow screens it scrolls sideways instead. */
.shots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; align-items: start; padding: 10px 0 26px; }
.phone {
	padding: 7px; border-radius: 30px;
	background: linear-gradient(160deg, #3a302b, #121010); box-shadow: 0 25px 40px rgba(0,0,0,0.6), inset 0 0 0 1px #4a3e37;
}
.phone img { width: 100%; border-radius: 24px; aspect-ratio: 660 / 1434; object-fit: cover; }

/* features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 18px; padding: 20px 22px; display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; text-align: left; transition: border-color 0.25s, transform 0.25s; }
.feature:hover { border-color: rgba(232,163,60,0.45); transform: translateY(-3px); }
.feature img { width: 64px; height: 64px; object-fit: contain; }
.feature h3 { margin: 0 0 4px; font-size: 22px; color: var(--bone); }
.feature p { margin: 0; color: var(--parchment); font-size: 16px; line-height: 1.45; }

/* ---------- content pages ---------- */
.page { padding-top: 32px; padding-bottom: 56px; max-width: 720px; }
.page h1 { font-size: 52px; line-height: 1; color: var(--amber); margin: 10px 0 8px; }
.page .muted { color: var(--grey); }
.page h2 { font-size: 26px; line-height: 1.2; color: var(--bone); margin: 0 0 6px; }
.page ul { padding-left: 20px; }
.page li { margin: 6px 0; }
.page .card { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 14px; padding: 18px 20px; margin: 18px 0; }

footer { border-top: 1px solid var(--panel-edge); padding: 32px 16px 48px; color: var(--grey); font-size: 15px; text-align: center; }
footer a { color: var(--parchment); margin-right: 18px; text-decoration: none; }
footer a:hover { color: var(--amber); }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s, transform 0.7s; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 900px) {
	.shots { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding: 10px 16px 26px; margin: 0 -16px; scrollbar-width: none; }
	.shots::-webkit-scrollbar { display: none; }
	.shots .phone { flex: none; width: 200px; scroll-snap-align: center; }
}
@media (max-width: 900px) {
	.roster { grid-template-columns: repeat(3, 1fr); }
	.steps { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; }
	.bosses { grid-template-columns: repeat(2, 1fr); }
	.features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
	.hero .inner { grid-template-columns: 1fr; text-align: center; padding-top: 80px; }
	.hero .figure { grid-row: 1; }
	.hero .figure { width: 300px; }
	.hero p.tag { margin-left: auto; margin-right: auto; }
	.brush { margin: 10px auto 0; }
	.ctas { justify-content: center; }
	.roster { grid-template-columns: repeat(2, 1fr); }
	.roster .hero-card:last-child { grid-column: span 2; max-width: 50%; justify-self: center; }
	.features { grid-template-columns: 1fr; }
	/* Four cards fit a phone without hiding each other's text. */
	.fan .card { width: 104px; margin: 0 -8px; }
	.fan .card:nth-child(2), .fan .card:nth-child(5) { display: none; }
	.eyebrow { font-size: 14px; letter-spacing: 0.12em; }
	.badge { font-size: 18px; padding: 14px 20px; }
	header.top nav a:first-child { display: none; }
	.hero-card h3, .boss h3 { font-size: 21px; }
	section.wrap { padding: 72px 16px; }
	section.wrap + section.wrap { padding-top: 24px; }
	header.top nav a { margin-left: 14px; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
	.reveal { opacity: 1; transform: none; }
	.brush path { stroke-dashoffset: 0; }
}
