/* Reset */
*,
*::before,
*::after {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

/* Local fonts */
@font-face {
	font-family: 'Concrete';
	src: url('/static/fonts/Concrete.ttf') format('truetype');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

html {
	scroll-behavior: smooth;
	overflow-x: hidden;
}

body {
	font-family: var(--font-body);
	background-color: var(--bg-main);
	color: var(--text-primary);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	min-height: 100vh;
	counter-reset: section-num;
	overflow-x: hidden;
	width: 100%;
}

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

a {
	color: inherit;
}

button {
	font: inherit;
	color: inherit;
	background: none;
	border: none;
	cursor: pointer;
}

ul,
ol {
	list-style: none;
}

/* Frame */
.frame {
	position: relative;
	z-index: 1;
	width: 100%;
	overflow-x: hidden;
}

.main-content {
	position: relative;
	z-index: 1;
	max-width: var(--content-max);
	margin: 0 auto;
	padding: 0 calc(var(--sidebar-w) + 2rem) 4rem calc(var(--sidebar-w) + 2rem);
	width: 100%;
}

.section {
	padding: clamp(3rem, 5vh, 5.5rem) 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	justify-content: center;
	border-bottom: 1px solid var(--card-border);
	scroll-margin-top: 1.5rem;
}

/* ── Section-based fullscreen navigation (Terminal screen swap) ── */
.section > * {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity 500ms ease, transform 500ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.section.is-active > * {
	opacity: 1;
	transform: translateY(0);
	animation: crt-boot 500ms ease-out both;
}

.section.is-leaving > * {
	opacity: 0;
	transform: translateY(-12px);
	transition: opacity 300ms ease, transform 300ms ease;
}

/* Sequential Stagger Delays (Waterfall system boot) */
.section.is-active > *:nth-child(1) { animation-delay: 100ms; }
.section.is-active > *:nth-child(2) { animation-delay: 250ms; }
.section.is-active > *:nth-child(3) { animation-delay: 400ms; }
.section.is-active > *:nth-child(4) { animation-delay: 550ms; }

/* Reverse stagger on leave */
.section.is-leaving > *:nth-child(1) { transition-delay: 0ms; }
.section.is-leaving > *:nth-child(2) { transition-delay: 50ms; }
.section.is-leaving > *:nth-child(3) { transition-delay: 100ms; }
.section.is-leaving > *:nth-child(4) { transition-delay: 150ms; }

@keyframes crt-boot {
	0% {
		opacity: 0;
		transform: translateY(14px);
		filter: brightness(2.2) contrast(1.6);
	}
	30% {
		opacity: 0.85;
		filter: brightness(0.7) contrast(1.1);
	}
	55% {
		opacity: 0.5;
		filter: brightness(1.6) contrast(1.3);
	}
	80% {
		opacity: 0.92;
		filter: brightness(1.05);
	}
	100% {
		opacity: 1;
		transform: translateY(0);
		filter: none;
	}
}

.section:not(.hero) {
	counter-increment: section-num;
}

.section:last-of-type {
	border-bottom: none;
}

.section__title {
	font-family: var(--font-display);
	font-size: 2.25rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	margin-bottom: 2.5rem;
	text-align: left;
}

.section:not(.hero) .section__title {
	text-align: center;
}

/* Buttons */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	font-family: var(--font-mono);
	font-size: 0.8rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
	padding: 12px 24px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background var(--transition), color var(--transition), transform var(--transition);
}

.btn--primary {
	background: var(--btn-bg);
	color: var(--btn-text);
	clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.btn--primary:hover:not(:disabled) {
	transform: translateY(-2px);
}

.btn--primary:focus-visible {
	outline: 2px solid var(--text-primary);
	outline-offset: 3px;
}

.btn--primary:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.btn--ghost {
	background: transparent;
	color: var(--text-secondary);
	border-color: var(--card-border);
}

.btn--ghost:hover:not(:disabled) {
	color: var(--text-primary);
	border-color: var(--text-secondary);
}

.btn--ghost:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.btn--repo {
	background: transparent;
	color: var(--text-secondary);
	border-color: var(--card-border);
}

.btn--repo:hover,
.btn--repo:focus-visible {
	color: var(--text-primary);
	border-color: var(--text-primary);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}

/* Responsive vertical scrolling adjustments */
@media (max-width: 900px) {
	.main-content {
		padding: 0 1.25rem 4rem 1.25rem;
		width: 100%;
	}
	.section {
		min-height: auto;
		padding: 3.5rem 0;
		justify-content: flex-start;
	}
}

@media (max-width: 640px) {
	.main-content {
		padding: 0 1rem 5rem 1rem;
		width: 100%;
	}
}

