/* Pi66. Cobalt, sky, cream and ink: a manga-panel look. All styling lives here. */

:root {
	--cream: #ece3b4;
	--paper: #f6f0d2;
	--ink: #0d0d14;
	--ink-light: #817e73;
	--cobalt: #1b2fd1;
	--sky: #2a95ec;
	--coral: #ff5a52;
	--coral: #ff5a52;
	--coral-dark: #a82926;
	--pink: #d98ee3;
	--bg: var(--cream);
	--fg: var(--ink);
	--card: var(--paper);
	--edge: var(--ink);
	--display: "Dela Gothic One", "Zen Maru Gothic", sans-serif;
	--body: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0e0f1d;
		--fg: #ece3b4;
		--card: #171936;
		--edge: #ece3b4;
		--cobalt: #6f7dff;
	}
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	background-color: var(--bg);
	/* halftone dots */
	background-image: radial-gradient(color-mix(in srgb, var(--fg) 14%, transparent) 1.2px, transparent 1.6px);
	background-size: 14px 14px;
	color: var(--fg);
	font: 500 1.05rem/1.75 var(--body);
}

a { color: var(--cobalt); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { color: var(--coral); }

main, .top, .foot {
	width: min(100% - 2rem, 46rem);
	margin-inline: auto;
}

main { padding: 1rem 0 3rem; }

/* Header */

.top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.25rem 0 0.5rem;
}

.logo {
	color: var(--fg);
	font: 1.7rem/1 var(--display);
	text-decoration: none;
	letter-spacing: 0.02em;
}

.top nav { display: flex; flex-wrap: wrap; gap: 0.25rem 0.4rem; }

.top nav a {
	padding: 0.15rem 0.7rem;
	border: 2px solid transparent;
	border-radius: 999px;
	color: var(--fg);
	font-weight: 700;
	text-decoration: none;
}

.top nav a:hover { border-color: var(--edge); }

.top nav a.on {
	background: var(--cobalt);
	border-color: var(--edge);
	color: #fff;
}

/* Type */

h1, h2 {
	margin: 0;
	font-family: var(--display);
	font-weight: 400;
	line-height: 1.1;
}

h1 { margin-bottom: 1rem; font-size: clamp(2.6rem, 9vw, 4.2rem); color: var(--cobalt); }

h2 {
	display: inline-block;
	margin: 2.6rem 0 1rem;
	padding: 0.2rem 0.8rem 0.1rem;
	border: 3px solid var(--edge);
	background: var(--sky);
	color: #fff;
	font-size: 1.3rem;
	box-shadow: 4px 4px 0 var(--edge);
	transform: rotate(-1.2deg);
}

p, ul, blockquote { margin: 0 0 1rem; }

li { margin: 0.35rem 0; }

.lead { font-size: 1.25rem; font-weight: 700; max-width: 26rem; }

blockquote {
	padding: 0.6rem 1.2rem;
	border: 3px solid var(--edge);
	background: var(--card);
	box-shadow: 5px 5px 0 var(--coral);
	font: 1.3rem/1.4 var(--display);
}

blockquote p { margin: 0; }

/* Panels: images and boxes framed like manga panels */

.panel {
	margin: 0;
	border: 3px solid var(--edge);
	background: var(--card);
	box-shadow: 7px 7px 0 var(--edge);
	overflow: hidden;
}

.panel img { display: block; width: 100%; height: auto; }

/* Hero: text on the left, image on the right.
   The two empty 1fr rows keep the text centered next to the image. */

.hero {
	display: grid;
	grid-template-columns: 1.1fr 1fr;
	grid-template-rows: 1fr auto auto auto 1fr;
	column-gap: 2rem;
	padding: 2rem 0 0.5rem;
}

.hero > * { grid-column: 1; }
.hero > h1 { grid-row: 2; }
.hero > .lead { grid-row: 3; }
.hero > .links { grid-row: 4; }
.hero > .hero-img { grid-column: 2; grid-row: 1 / -1; align-self: center; }

.hero-img { transform: rotate(2deg); box-shadow: 9px 9px 0 var(--cobalt); }

.links { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.btn {
	display: inline-block;
	padding: 0.4rem 1.2rem;
	border: 3px solid var(--edge);
	border-radius: 999px;
	background: var(--coral);
	color: #fff;
	font-weight: 700;
	text-decoration: none;
	box-shadow: 3px 3px 0 var(--edge);
	transition: transform 0.12s, box-shadow 0.12s;
}

.btn.alt { background: var(--card); color: var(--fg); }

.btn:hover {
	color: #fff;
	transform: translate(2px, 2px);
	box-shadow: 1px 1px 0 var(--edge);
}

.btn.alt:hover { color: var(--fg); }

/* Project cards */

.cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.1rem;
	margin-bottom: 1rem;
	padding: 0;
	list-style: none;
}

.cards li { display: flex; margin: 0; }

.cards a {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 0.4rem;
	padding: 1rem 1.1rem 1.1rem;
	border: 3px solid var(--edge);
	background: var(--card);
	color: var(--fg);
	font-size: 0.95rem;
	line-height: 1.45;
	text-decoration: none;
	box-shadow: 5px 5px 0 var(--edge);
	transition: transform 0.12s, box-shadow 0.12s;
}

.cards strong { font: 1.25rem/1.2 var(--display); }
.cards li:nth-child(3n+1) strong { color: var(--cobalt); }
.cards li:nth-child(3n+2) strong { color: var(--coral); }
.cards li:nth-child(3n) strong { color: var(--sky); }
.cards a:hover { color: var(--fg); transform: translate(-3px, -3px) rotate(-0.6deg); box-shadow: 8px 8px 0 var(--edge); }

/* Skill tags */

.tags { display: flex; flex-wrap: wrap; gap: 0.6rem; padding: 0; list-style: none; }

.tags li {
	margin: 0;
	padding: 0.1rem 0.9rem;
	border: 3px solid var(--edge);
	border-radius: 999px;
	background: var(--card);
	font-weight: 700;
}

.tags li:nth-child(4n+1) { background: var(--sky); color: #fff; }
.tags li:nth-child(4n+3) { background: var(--pink); color: var(--ink); }

.server {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 1rem;

    .panel {
		aspect-ratio: 1 !important;
        margin-top: 0 !important;
        display: flex;
        min-width: 0;
		max-width: 150px;
    }
}
/* Contact */
.contact {
	display: grid;
	grid-template-columns: 1fr 9rem;
	align-items: center;
	background: var(--coral-dark);
	color: var(--ink);
	strong {
		color: var(--paper);
	}
}

.contact ul { margin: 0; padding: 1rem 1.3rem; list-style: none; font-weight: 700; }
.contact a { color: var(--ink); }
.contact li strong { display: inline-block; min-width: 5.5rem; font: 0.9rem var(--display); }
.contact img { height: 100%; object-fit: cover; border-left: 3px solid var(--edge); }

/* About */

.intro {
	display: grid;
	grid-template-columns: 13rem 1fr;
	grid-template-rows: 1fr auto auto;
	column-gap: 2rem;
	padding-top: 1.5rem;
}

.intro > h1 { grid-area: 2 / 2; }
.intro > p { grid-area: 3 / 2; }
.intro > .tall { grid-area: 1 / 1 / -1 / 2; align-self: end; }
.intro .tall { transform: rotate(-2deg); box-shadow: 8px 8px 0 var(--cobalt); }
.wide { margin-top: 2.5rem; transform: rotate(0.8deg); box-shadow: 8px 8px 0 var(--pink); }
.wide img { max-height: 22rem; object-fit: cover; object-position: 50% 35%; }

/* 404: the page is marked by {.lost} on its title */

main:has(.lost) { padding-top: 3rem; text-align: center; }
h1.lost { font-size: clamp(5rem, 24vw, 9rem); margin-bottom: 0; }
main:has(.lost) .panel { max-width: 20rem; margin: 2.5rem auto 0; transform: rotate(-2deg); }

/* Footer */

.foot {
	padding: 1.5rem 0 2.5rem;
	border-top: 3px dashed var(--edge);
	font-size: 0.9rem;
}

.foot p { margin: 0; }

/* Phones */

@media (max-width: 640px) {
	.hero { grid-template-columns: 1fr; grid-template-rows: none; }
	.hero > * { grid-area: auto; }
	.hero > .hero-img { grid-area: 1 / 1; max-width: 17rem; justify-self: center; margin-bottom: 1.8rem; }
	.cards { grid-template-columns: 1fr; }
	.intro { grid-template-columns: 1fr; grid-template-rows: none; }
	.intro > h1, .intro > p { grid-area: auto; }
	.intro > .tall { grid-area: auto; max-width: 12rem; margin-bottom: 2rem; }
	.contact { grid-template-columns: 1fr 6rem; }
	.top { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; scroll-behavior: auto !important; }
}
