/* Tristan Santor — Dark Souls bonfire theme */

:root {
	--bg: #050403;
	--text: #ece6d8;
	--muted: #9a8e7b;
	--gold: #c9ab6c;
	--gold-dim: #6e5a3a;
	--line: rgba(140, 104, 66, .32);
	--panel: rgba(10, 8, 7, .9);
	--select: linear-gradient(90deg, rgba(158, 60, 22, .9), rgba(122, 42, 14, .78));
	--hp: #8e1c1c;
	--stam: #2e6a54;
	--serif: "EB Garamond", Garamond, "Times New Roman", serif;
	--display: "Cinzel", "Trajan Pro", Georgia, serif;
	--fx: 66%;          /* bonfire x position */
	--gutter: clamp(16px, 3vw, 48px);
	--noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

html, body { margin: 0; height: 100%; }

body {
	background: var(--bg);
	color: var(--text);
	font: 400 1.15rem/1.6 var(--serif);
	overflow: hidden;
	-webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--gold); }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }

#embers {
	position: fixed; inset: 0;
	pointer-events: none;
	z-index: 3;
	mix-blend-mode: screen;
}

/* ---------- Scene ---------- */

.scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; }

.wall {
	position: absolute; inset: 0;
	background:
		var(--noise),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='80'%3E%3Crect width='160' height='80' fill='%230d0a08'/%3E%3Cg fill='%231c1612'%3E%3Crect x='2' y='2' width='76' height='36'/%3E%3Crect x='82' y='2' width='76' height='36' fill='%23181310'/%3E%3Crect x='-38' y='42' width='76' height='36'/%3E%3Crect x='42' y='42' width='76' height='36' fill='%23201914'/%3E%3Crect x='122' y='42' width='76' height='36'/%3E%3C/g%3E%3C/svg%3E");
	background-size: 180px, 160px 80px;
	opacity: .9;
}

.glow {
	position: absolute; inset: 0;
	background: radial-gradient(circle at var(--fx) 88%, rgba(255, 128, 40, .42) 0, rgba(200, 70, 20, .16) 22%, transparent 48%);
	mix-blend-mode: screen;
	opacity: 0;
	transition: opacity 2.4s ease;
	animation: flicker 3.2s infinite;
}

.vignette {
	position: absolute; inset: 0;
	background: radial-gradient(circle at calc(var(--fx) + 6%) 88%, transparent 0, rgba(0, 0, 0, .5) 32%, rgba(0, 0, 0, .94) 66%);
	transition: background 2s ease;
}

.is-title .vignette { background: rgba(0, 0, 0, .9); }
body:not(.is-title) .glow { opacity: 1; }

@keyframes flicker {
	0%, 100% { filter: brightness(1); }
	20% { filter: brightness(.86); }
	45% { filter: brightness(1.08); }
	70% { filter: brightness(.93); }
}

/* Bonfire */

.bonfire {
	position: absolute;
	left: var(--fx); bottom: 3vh;
	width: 220px; height: 300px;
	transform: translateX(-50%);
	transition: opacity 1.6s ease;
}

.is-title .bonfire { opacity: 0; }

.sword {
	position: absolute;
	left: 50%; bottom: 34px;
	width: 46px;
	transform: translateX(-50%) rotate(-7deg);
	transform-origin: bottom center;
	filter: drop-shadow(0 0 6px rgba(255, 110, 30, .35));
}

.ash {
	position: absolute;
	left: 50%; bottom: 8px;
	width: 170px; height: 34px;
	transform: translateX(-50%);
	border-radius: 50% 50% 45% 45% / 80% 80% 20% 20%;
	background: radial-gradient(ellipse at 50% 15%, #ffd08a 0, #e2681f 14%, #7a3417 32%, #33261f 56%, #18120f 80%);
	box-shadow: 0 0 34px rgba(255, 120, 40, .22);
	filter: blur(1.2px);
}

.flames {
	position: absolute;
	left: 50%; bottom: 26px;
	width: 160px; height: 170px;
	transform: translateX(-50%);
	mix-blend-mode: screen;
	transition: transform 1.6s cubic-bezier(.2, .8, .2, 1);
}

.is-title .flames { transform: translateX(-50%) scale(.2); }

.flames i {
	position: absolute;
	bottom: 0; left: 50%;
	border-radius: 50% 50% 45% 45% / 62% 62% 38% 38%;
	background: radial-gradient(ellipse at 50% 82%, #fff4cf 0, #ffc164 18%, #ff7a18 42%, rgba(196, 44, 6, .55) 62%, transparent 74%);
	filter: blur(3px);
	transform-origin: 50% 100%;
	animation: burn 1.4s ease-in-out infinite;
}

.flames .f1 { width: 120px; height: 150px; margin-left: -60px; }
.flames .f2 { width: 80px;  height: 170px; margin-left: -54px; animation-duration: 1.1s; animation-delay: -.3s; }
.flames .f3 { width: 76px;  height: 160px; margin-left: -18px; animation-duration: 1.25s; animation-delay: -.7s; }
.flames .f4 { width: 54px;  height: 120px; margin-left: -66px; animation-duration: .9s;  animation-delay: -.2s; }
.flames .f5 { width: 50px;  height: 110px; margin-left: 14px;  animation-duration: 1s;   animation-delay: -.5s; }

@keyframes burn {
	0%, 100% { transform: scale(1, 1) translateX(0); opacity: .95; }
	25% { transform: scale(.9, 1.1) translateX(-3px); }
	50% { transform: scale(1.06, .92) translateX(2px); opacity: .8; }
	75% { transform: scale(.94, 1.06) translateX(-1px); }
}

/* Characters resting by the fire, rim-lit on the side facing it */

.knight {
	position: absolute;
	bottom: 3vh;
	height: min(42vh, 360px); width: auto;
	transition: opacity 1.6s ease;
}

.knight.is-left  { right: calc(100% - var(--fx) + 70px); }
.knight.is-right { left: calc(var(--fx) + 70px); }

.knight .rim { mix-blend-mode: screen; animation: rim 3.2s infinite; }

.is-title .knight { opacity: 0; }

@keyframes rim {
	0%, 100% { opacity: 1; }
	20% { opacity: .7; }
	45% { opacity: 1; }
	70% { opacity: .82; }
}

/* ---------- Title screen ---------- */

.title-screen {
	position: fixed; inset: 0;
	z-index: 10;
	display: flex; flex-direction: column;
	align-items: center; justify-content: center;
	padding: 0 var(--gutter);
	text-align: center;
	cursor: pointer;
	transition: opacity 1.2s ease, visibility 1.2s;
}

body:not(.is-title) .title-screen { opacity: 0; visibility: hidden; pointer-events: none; }

.title-name {
	margin: 0;
	font: 400 clamp(2.4rem, 8vw, 6.4rem)/1.05 var(--display);
	letter-spacing: .14em;
	text-transform: uppercase;
	color: #dcd5c6;
	text-shadow: 0 0 30px rgba(255, 255, 255, .08), 0 2px 0 #000;
	animation: rise 2.4s ease both;
}

.title-sub {
	margin: 1.4rem 0 0;
	font-family: var(--display);
	font-size: clamp(.75rem, 1.6vw, 1rem);
	letter-spacing: .32em;
	text-transform: uppercase;
	color: var(--muted);
	animation: rise 2.4s .4s ease both;
}

.press-any {
	margin-top: 18vh;
	font-family: var(--display);
	font-size: clamp(.85rem, 1.8vw, 1.1rem);
	letter-spacing: .3em;
	text-transform: uppercase;
	color: #cfc8b8;
	animation: pulse 2.6s 1.6s ease-in-out infinite both;
}

.title-foot {
	position: absolute; bottom: 3vh;
	margin: 0;
	font-size: .85rem;
	letter-spacing: .1em;
	color: #5d5447;
}

@keyframes rise { from { opacity: 0; transform: translateY(12px); filter: blur(4px); } }
@keyframes pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* ---------- Bonfire lit banner ---------- */

.banner {
	position: fixed; left: 0; right: 0; top: 50%;
	z-index: 20;
	transform: translateY(-50%);
	padding: 2.2rem 0;
	text-align: center;
	pointer-events: none;
	background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .78) 30%, rgba(0, 0, 0, .78) 70%, transparent);
	opacity: 0;
}

.banner span {
	display: inline-block;
	font: 400 clamp(2.2rem, 7vw, 5rem)/1 var(--display);
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #f2b35a;
	text-shadow: 0 0 24px rgba(255, 140, 40, .65), 0 0 2px #fff3d0;
}

.banner.is-on { animation: banner 3s ease forwards; }
.banner.is-on span { animation: bannerText 3s ease forwards; }

@keyframes banner { 0% { opacity: 0; } 15%, 70% { opacity: 1; } 100% { opacity: 0; } }
@keyframes bannerText { 0% { transform: scale(1.12); filter: blur(6px); } 22% { transform: scale(1); filter: blur(0); } 100% { transform: scale(.98); } }

/* ---------- HUD ---------- */

.hud {
	position: fixed;
	top: clamp(14px, 4vh, 40px); left: var(--gutter);
	z-index: 5;
	display: flex; align-items: center;
	width: min(980px, calc(100% - 2 * var(--gutter)));
	transition: opacity 1s ease;
}

.level {
	position: relative; z-index: 1;
	flex: none;
	display: grid; place-items: center;
	width: 70px; height: 70px;
	border-radius: 50%;
	background: radial-gradient(circle, #2a2622 0, #121010 66%);
	box-shadow: 0 0 0 3px #3b3530, 0 0 0 5px #0c0a09, 0 6px 16px #000;
	font: 600 2.1rem/1 var(--serif);
	color: #f1ece2;
	text-shadow: 0 0 2px #000, 0 0 8px rgba(0, 0, 0, .9);
}

.level.is-up { animation: levelUp .9s ease; }
@keyframes levelUp { 40% { box-shadow: 0 0 0 3px var(--gold), 0 0 26px 6px rgba(255, 190, 90, .55); } }

.bars { flex: 1; margin-left: -6px; display: grid; gap: 4px; }

.bar {
	height: 14px;
	background: #120c0b;
	border: 1px solid #3a302a;
	box-shadow: inset 0 1px 2px #000;
}

.bar i {
	display: block; height: 100%;
	background-image: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), rgba(0, 0, 0, .45) calc(10% - 2px) 10%);
	transition: width .35s ease;
}

.bar.hp i { width: 100%; background-color: var(--hp); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .08); }
.bar.stam { width: 58%; }
.bar.stam i { width: 100%; background-color: var(--stam); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .08); }

.is-title .hud, .is-title .hub,
.is-banner .hud, .is-banner .hub { opacity: 0; pointer-events: none; }

/* ---------- Panels ---------- */

.hub { transition: opacity 1s ease; }

.panel {
	position: fixed;
	z-index: 6;
	background: var(--noise), var(--panel);
	border: 1px solid #2c241d;
	box-shadow: 0 0 0 1px #000, 0 20px 60px rgba(0, 0, 0, .7), inset 0 0 60px rgba(0, 0, 0, .8);
}

/* ornamental corners */
.panel::before, .panel::after {
	content: "";
	position: absolute;
	width: 46px; height: 46px;
	pointer-events: none;
	border: 1px solid var(--gold-dim);
	opacity: .8;
}
.panel::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; border-radius: 14px 0 0 0; }
.panel::after { bottom: 8px; right: 8px; border-left: 0; border-top: 0; border-radius: 0 0 14px 0; }

/* Warp menu */

.menu {
	top: calc(clamp(14px, 4vh, 40px) + 100px);
	left: var(--gutter);
	width: min(600px, 52vw);
	padding: 28px 30px;
	transition: opacity .3s ease, transform .3s ease;
}

.is-window .menu { opacity: 0; transform: translateX(-12px); pointer-events: none; visibility: hidden; transition-property: opacity, transform, visibility; }
.is-window .controls { visibility: hidden; }

.menu .panel-inner {
	position: relative;
	padding: 10px 0;
	border: 1px solid var(--line);
	border-left-color: rgba(140, 104, 66, .5);
}

.caret {
	display: block;
	padding-left: 12px;
	font-size: .9rem; line-height: 1;
	color: #b8ad99;
}

#menu { list-style: none; margin: 4px 0; padding: 0 18px; }

#menu li { border-bottom: 1px solid var(--line); min-height: 2.8rem; }

#menu button {
	display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
	width: 100%;
	padding: .45rem .7rem;
	text-align: left;
	font-size: clamp(1.15rem, 2vw, 1.45rem);
	color: #e9e3d6;
	text-shadow: 0 1px 2px #000;
	transition: background .15s ease;
}

#menu button:focus-visible { outline: none; }
#menu button.is-selected { background: var(--select); box-shadow: inset 0 0 0 1px rgba(255, 150, 90, .15); }
#menu .tag {
	font-size: .78rem;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--muted);
}
#menu button.is-selected .tag { color: #f0c79a; }

.controls {
	position: fixed; z-index: 6;
	left: var(--gutter);
	bottom: calc(3vh + 64px);
	display: flex; gap: 1.6rem; flex-wrap: wrap;
	font-size: 1.15rem;
	text-shadow: 0 1px 3px #000;
}

.controls span { display: inline-flex; align-items: center; gap: .3rem; }

.btn {
	display: inline-grid; place-items: center;
	width: 1.3em; height: 1.3em;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, #4a4d58, #1a1b20);
	box-shadow: 0 0 0 1px #000;
	font-size: .9em; font-weight: 400;
}
.btn.cross { color: #7f9cff; }
.btn.circle::before { content: ""; width: .62em; height: .62em; border-radius: 50%; border: 2px solid #e2554f; }

.dpad {
	position: relative;
	display: inline-block;
	width: 1.1em; height: 1.1em;
	background:
		linear-gradient(#c8c2b4, #c8c2b4) center / 34% 100% no-repeat,
		linear-gradient(#c8c2b4, #c8c2b4) center / 100% 34% no-repeat;
}

.estus {
	position: fixed; z-index: 6;
	left: calc(var(--gutter) + 160px);
	bottom: 3vh;
	display: flex; align-items: baseline; gap: 1.4rem;
	font-size: 1.05rem;
	color: #d9d2c3;
	text-shadow: 0 1px 3px #000;
}
.estus .count {
	font-size: 1.5rem;
	padding: 0 .5rem;
	border-bottom: 1px solid #b7ae9c;
}
.estus.is-drinking { animation: drink .8s ease; }
@keyframes drink { 40% { color: #ffcf73; text-shadow: 0 0 14px rgba(255, 170, 60, .8); } }

.souls {
	position: fixed; z-index: 6;
	right: var(--gutter); bottom: 3vh;
	min-width: 170px;
	padding: .35rem 1.1rem .35rem 2.4rem;
	text-align: right;
	font-size: 1.1rem;
	color: var(--text);
	text-decoration: none;
	background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .75) 25%);
	border-bottom: 1px solid #6f6556;
	text-shadow: 0 1px 3px #000;
	transition: color .2s ease, border-color .2s ease;
}
.souls:hover { color: #f0c79a; border-bottom-color: var(--gold); }

/* ---------- Content windows ---------- */

.window {
	top: calc(clamp(14px, 4vh, 40px) + 100px);
	left: var(--gutter);
	width: min(1040px, calc(100% - 2 * var(--gutter)));
	max-height: calc(100% - clamp(14px, 4vh, 40px) - 180px);
	overflow-y: auto;
	padding: clamp(22px, 3vw, 40px);
	scrollbar-color: #4a3c2e transparent;
	animation: open .35s ease both;
}

@keyframes open { from { opacity: 0; transform: translateY(8px); } }

.window-head {
	display: flex; align-items: center; justify-content: space-between; gap: 1rem;
	margin-bottom: 1.4rem;
	padding-bottom: .8rem;
	border-bottom: 1px solid var(--line);
}

.window-head h2 {
	margin: 0;
	font: 400 clamp(1.4rem, 3vw, 2rem)/1.1 var(--display);
	letter-spacing: .1em;
	text-transform: uppercase;
	color: #e6dccb;
}

.close {
	display: inline-flex; align-items: center; gap: .45rem;
	font-size: 1.05rem;
	color: #cfc6b5;
}
.close:hover { color: #fff; }

.hint { margin: 0 0 1.4rem; font-style: italic; color: var(--muted); }

.sub {
	margin: 1.6rem 0 .6rem;
	font: 400 1rem var(--display);
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--gold);
}

/* About / status */

.status {
	display: grid;
	grid-template-columns: minmax(180px, 280px) 1fr;
	gap: clamp(20px, 3vw, 40px);
}

.portrait { margin: 0; }
.portrait img {
	width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
	border: 1px solid #3a2f25;
	box-shadow: 0 0 0 4px #0b0908, 0 0 0 5px #3a2f25;
	filter: sepia(.25) contrast(1.05) brightness(.92);
}
.portrait figcaption {
	margin-top: .9rem;
	text-align: center;
	font: 400 1.05rem var(--display);
	letter-spacing: .12em;
	color: #e2d8c6;
}

.stats { margin: 0; }
.stats div {
	display: flex; justify-content: space-between; gap: 1rem;
	padding: .45rem .2rem;
	border-bottom: 1px solid var(--line);
}
.stats dt { color: var(--muted); }
.stats dd { margin: 0; text-align: right; }

.runes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.runes li, .effects li {
	padding: .15rem .75rem;
	border: 1px solid var(--line);
	background: rgba(255, 255, 255, .02);
}
.runes small { color: var(--muted); }

.lore { margin-top: 1.8rem; padding-top: .4rem; border-top: 1px solid var(--line); color: #d6cfc1; }
.lore p { margin: .9rem 0; }

/* Projects / inventory */

.inventory {
	display: grid;
	grid-template-columns: minmax(150px, 230px) 1fr;
	gap: clamp(18px, 3vw, 36px);
}

.slots { display: grid; gap: .7rem; align-content: start; }

.slot {
	position: relative;
	display: block;
	border: 1px solid #2e261f;
	background: #0b0908;
	text-align: left;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.slot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; opacity: .6; transition: opacity .15s ease; }
.slot span { display: block; padding: .3rem .6rem; font-size: 1rem; color: #d6ceb9; }
.slot:hover img, .slot.is-selected img { opacity: 1; }
.slot.is-selected { border-color: #b4602a; box-shadow: 0 0 0 1px #b4602a, 0 0 18px rgba(214, 100, 40, .35); }

.item-detail h3 { margin: 0; font: 400 clamp(1.3rem, 2.6vw, 1.75rem)/1.2 var(--display); letter-spacing: .05em; }
.item-type { margin: .2rem 0 1rem; color: var(--gold); font-size: 1rem; }
.item-detail img { width: 100%; border: 1px solid #2e261f; }
.item-lore { color: #d6cfc1; }

/* Two screenshots side by side, columns sized to each image's aspect
   ratio so they line up at the same height. */
.shots { display: grid; grid-template-columns: .79fr 1.38fr; gap: .7rem; align-items: start; }
.effects { list-style: none; margin: 0 0 1.4rem; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; font-size: .95rem; }

.action {
	display: inline-block;
	padding: .55rem 1.3rem;
	border: 1px solid #8b5a2e;
	background: var(--select);
	color: #fbeee0;
	text-decoration: none;
	letter-spacing: .04em;
	transition: box-shadow .2s ease;
}
.action:hover { box-shadow: 0 0 18px rgba(214, 100, 40, .45); }

/* Links / summon signs */

.signs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.2rem; }

.sign {
	display: grid; justify-items: center; gap: .3rem;
	padding: 2rem 1rem 1.6rem;
	border: 1px solid var(--line);
	background: rgba(255, 255, 255, .015);
	text-align: center;
	text-decoration: none;
	color: var(--text);
	transition: border-color .2s ease, background .2s ease;
}

.sigil {
	width: 120px; height: 46px;
	margin-bottom: .8rem;
	border-radius: 50%;
	background: radial-gradient(ellipse, rgba(255, 238, 170, .95) 0, rgba(240, 190, 80, .7) 22%, rgba(200, 140, 40, .2) 52%, transparent 70%);
	filter: blur(1px);
	animation: sigil 2.8s ease-in-out infinite;
}
@keyframes sigil { 50% { opacity: .55; transform: scaleX(.92); } }

.sign-name { font: 400 1.4rem var(--display); letter-spacing: .1em; color: #f4e3b8; }
.sign-msg { font-style: italic; color: var(--muted); }
.sign:hover { border-color: #8a7240; background: rgba(240, 190, 80, .05); }
.sign:hover .sigil { animation-duration: 1s; }

/* Resume */

.scroll {
	display: block;
	width: 100%; height: 70vh;
	margin-top: 1.4rem;
	border: 1px solid #2e261f;
	background: #1a1612;
}

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
	:root { --fx: 50%; }
	body { font-size: 1.05rem; }

	.level { width: 54px; height: 54px; font-size: 1.6rem; }
	.bar { height: 11px; }

	.menu, .window { top: calc(clamp(14px, 4vh, 40px) + 76px); }
	.menu { width: calc(100% - 2 * var(--gutter)); padding: 16px; }
	#menu { padding: 0 8px; }
	#menu li.empty { display: none; }

	.window { max-height: calc(100% - clamp(14px, 4vh, 40px) - 140px); }

	.bonfire { transform: translateX(-50%) scale(.7); transform-origin: bottom center; }
	.knight { height: 30vh; }
	.knight.is-left  { right: calc(100% - var(--fx) + 40px); }
	.knight.is-right { left: calc(var(--fx) + 40px); }
	.controls { display: none; }
	.estus { left: var(--gutter); }
	.souls { min-width: 0; padding-left: 1.4rem; font-size: .9rem; bottom: calc(3vh + 2.8rem); }

	.status, .inventory { grid-template-columns: 1fr; }
	.portrait { max-width: 240px; }
	.slots { grid-template-columns: repeat(3, 1fr); }
	.slot span { font-size: .85rem; }
	.stats div { flex-direction: column; gap: 0; }
	.stats dd { text-align: left; }
	.scroll { height: 60vh; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
	.press-any { animation: none; }
}
