@font-face {
	font-family: Portfolio LCD;
	src: url("/fonts/DSEG7Classic-Bold.woff2") format("woff2");
	font-weight: 700;
	font-display: swap;
}

:root {
	color-scheme: only light;
	scrollbar-width: none;
	--paper: #fff;
	--ink: #171717;
	--muted: #555;
	--line: #bcbcbc;
	--line-soft: #dedede;
	--column: 30rem;
	--gutter: clamp(0.875rem, 4vw, 1.25rem);
	--tap: 2.75rem;
	scroll-padding-block-end: calc(var(--tap) + 0.75rem + env(safe-area-inset-bottom));
	background: var(--paper);
	color: var(--ink);
	font: 100% / 1.45 system-ui, sans-serif;
}

:root::-webkit-scrollbar { display: none; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, p, dl, dd, figure { margin: 0; }
a { color: inherit; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; }
button:not(:disabled), summary { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
::selection { background: #dce7db; color: var(--ink); }

.portfolio {
	width: 100%;
	max-width: var(--column);
	min-height: 100dvh;
	margin-inline: auto;
	border-inline: 1px solid var(--line);
	display: flex;
	flex-direction: column;
}

.masthead {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	column-gap: 0.75rem;
	row-gap: 0.25rem;
	padding: max(0.75rem, env(safe-area-inset-top)) var(--gutter) 0.75rem;
	border-bottom: 1px solid var(--line);
}

h1, .masthead-name {
	font-size: clamp(1.375rem, 5.75vw, 1.75rem);
	font-weight: 720;
	letter-spacing: -0.035em;
	line-height: 1.15;
}

.masthead-name { text-decoration: none; }

.clock {
	--clock-width: clamp(3.5rem, 16vw, 4rem);
	--clock-cut: 6px;
	position: relative;
	display: grid;
	flex: none;
	width: var(--clock-width);
	aspect-ratio: 16 / 7;
	padding: 0.75px;
	color: var(--ink);
	font: 700 calc(var(--clock-width) * 14 / 64) / 1 "Portfolio LCD", ui-monospace, monospace;
	user-select: none;
}

.clock::before, .clock-dial {
	clip-path: polygon(var(--clock-cut) 0, calc(100% - var(--clock-cut)) 0, 100% var(--clock-cut), 100% calc(100% - var(--clock-cut)), calc(100% - var(--clock-cut)) 100%, var(--clock-cut) 100%, 0 calc(100% - var(--clock-cut)), 0 var(--clock-cut));
}

.clock::before {
	content: "";
	position: absolute;
	inset: 0;
	background: #000;
}

.clock-dial {
	--clock-cut: 5.56px;
	display: grid;
	grid-template-columns: repeat(2, 9.5fr) 7fr repeat(2, 9.5fr);
	align-items: center;
	padding-inline: 0.38em;
	background: #dcdcdc;
	text-align: center;
}

.clock-dial [data-digit] { position: relative; }
.clock-dial [data-digit]::before { content: attr(data-ghost); position: absolute; inset: 0; opacity: 0.04; }
.clock-colon { opacity: 0.65; }

main { flex: 1; padding: 0 var(--gutter) 1rem; }
.intro { container-type: inline-size; padding-block: 0.75rem 0.25rem; }
.role { font-size: 0.9375rem; font-weight: 570; text-wrap: balance; }
.contact-links {
	display: flex;
	justify-content: flex-start;
	gap: clamp(0.625rem, calc((100cqi - 17.5rem) / 6), 0.95rem);
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.875rem;
	white-space: nowrap;
}

.contact-links a { display: inline-flex; align-items: center; min-height: var(--tap); }
.contact-links svg { display: none; }

@container (width < 21rem) {
	.contact-links {
		display: grid;
		grid-auto-flow: column;
		grid-auto-columns: minmax(0, 1fr);
		gap: 0;
	}
	.contact-links a { justify-content: center; width: 100%; }
	.contact-links span { display: none; }
	.contact-links svg { display: block; width: min(100%, 1.125rem); height: 1.125rem; }
}

.skills {
	padding-block: 0.65rem;
	border-block: 1px solid var(--line);
}

.skill-list { display: grid; gap: 0.48rem; font-size: 0.8125rem; }
.skill-list > div { display: grid; grid-template-columns: minmax(6rem, 27%) minmax(0, 1fr); gap: 0.55rem; }
.skill-list dt { font-weight: 680; }
.skill-list dt, .skill-list dd { overflow-wrap: anywhere; }
.more-skills { display: grid; }
.more-skills .skill-list { margin-block-start: 0.48rem; }
.more-skills summary {
	display: inline-flex;
	order: 1;
	justify-self: start;
	align-items: center;
	gap: 0.25rem;
	min-height: var(--tap);
	font-size: 0.8125rem;
	list-style: none;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}
.more-skills summary::-webkit-details-marker { display: none; }
.more-skills summary svg { width: 0.9rem; height: 0.9rem; }
.more-skills[open] summary svg { rotate: 180deg; }
.more-skills:not([open]) .skill-list { display: none; }
.more-skills:not([open]) .skills-collapse, .more-skills[open] .skills-expand { display: none; }

.deck { margin-block: 1rem; padding: 0.75rem 0.75rem 0; border: 1px solid var(--line); }
.deck-track { display: grid; grid-template-columns: minmax(0, 1fr); overflow: clip; overflow-clip-margin: 4px; touch-action: pan-y pinch-zoom; }
.deck-item { grid-area: 1 / 1; display: grid; grid-template-columns: minmax(0, 1fr); }
/* Inactive items still size the shared grid track at the current width. */
.deck-item[inert] { visibility: hidden; }
.deck-item[data-swipe-preview] { visibility: visible; }
.deck-item:is([data-project], [data-experience]) { grid-template-rows: auto auto 1fr; }
.deck-item[data-achievement] { grid-template-rows: auto 1fr; }
.deck-item[data-project] .demo-stage { align-self: center; }
.deck-heading { display: flex; flex-wrap: wrap; align-items: center; min-height: var(--tap); }
h2 { font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.deck-heading h2 { overflow-wrap: anywhere; }
.experience-proof { display: flex; flex-wrap: wrap; column-gap: 0.75rem; }
.experience-proof a, .repository-link { display: inline-flex; align-items: center; min-height: var(--tap); }
.experience-proof a { font-size: 0.8125rem; white-space: nowrap; }
.experience-proof a:last-child { margin-inline-start: auto; }
.repository-link { justify-content: center; min-width: var(--tap); }
.repository-link svg { width: 1.1rem; height: 1.1rem; }
.deck-pagination { display: grid; grid-template-columns: var(--tap) minmax(2.4rem, max-content) var(--tap); align-items: center; margin-inline-start: auto; text-align: center; }
.deck-pagination span { color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.deck button { border: 0; background: transparent; min-height: var(--tap); touch-action: manipulation; }
.deck button:hover { background: #f4f4f4; }
.deck button svg, .deck a svg { pointer-events: none; }
.deck-pagination button { display: grid; place-items: center; min-width: var(--tap); padding: 0; }
.deck-pagination svg, .bottom-bar svg { width: 1.15rem; height: 1.15rem; }
.deck-caption { color: var(--muted); font-size: 0.8125rem; margin: -0.15rem 0 0.65rem; }
.demo-stage { position: relative; width: 100%; min-height: 200px; aspect-ratio: 16 / 9; background: var(--ink); }
.demo-trigger, .demo-stage iframe { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; }
.demo-trigger:focus-visible { outline-offset: -3px; }
.demo-trigger img { display: block; width: 100%; height: 100%; object-fit: contain; }
.demo-play { position: absolute; inset: 50% auto auto 50%; translate: -50% -50%; display: grid; place-items: center; width: 3.25rem; height: 2.25rem; border-radius: 0.4rem; background: #d71d17; color: var(--paper); }
.demo-play svg { width: 1.45rem; height: 1.45rem; }
.experience-item { display: grid; align-self: center; gap: 0.45rem; padding-block: 0.4rem; font-size: 0.875rem; }
.experience-role { font-weight: 660; }
.experience-period { color: var(--muted); font-size: 0.8125rem; }
.deck-footer { display: flex; flex-wrap: wrap; align-items: center; column-gap: 0.5rem; margin-top: 0.35rem; }
.deck-categories {
	display: flex;
	flex: 1 0 min(100%, 11.5rem);
	min-inline-size: 0;
	max-inline-size: 12.5rem;
	gap: 0.65rem;
	overflow-x: auto;
	overscroll-behavior-inline: contain;
	scrollbar-width: none;
	user-select: none;
}
.deck-categories::-webkit-scrollbar { display: none; }
.deck-categories button { flex: none; padding-inline: 0.35rem; border-bottom: 2px solid transparent; font-size: 0.875rem; color: var(--muted); white-space: nowrap; }
.deck-categories button:focus-visible { outline-offset: -2px; }
.deck-categories[data-dragging] button { cursor: grabbing; }
.deck-categories [aria-pressed="true"] { border-bottom-color: var(--ink); color: var(--ink); font-weight: 690; }

.contributions { padding: 0.75rem; border: 1px solid var(--line); }
.contributions h2 { margin-bottom: 0.6rem; }
.graph-message { color: var(--muted); font-size: 0.8125rem; }
.graph-scroll { overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; }
.graph-scroll::-webkit-scrollbar { display: none; }
.graph-grid {
	--cell: clamp(0.56rem, 2.15vw, 0.75rem);
	display: grid;
	grid-auto-flow: column;
	grid-template-rows: repeat(7, var(--cell));
	grid-auto-columns: var(--cell);
	gap: 0.16rem;
	width: max-content;
}

.graph-grid [data-level] { border: 1px solid rgb(23 23 23 / 23%); }
.graph-grid [data-level="0"] { background: #e9e9e9; }
.graph-grid [data-level="1"] { background: #a8dca7; }
.graph-grid [data-level="2"] { background: #72bc76; }
.graph-grid [data-level="3"] { background: #36864a; }
.graph-grid [data-level="4"] { background: #216438; }

.bottom-bar {
	position: sticky;
	bottom: 0;
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	padding: 0.25rem 0 max(0.25rem, env(safe-area-inset-bottom));
	border-top: 1px solid var(--line);
	background: var(--paper);
}

.bottom-bar > * {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.2rem;
	min-height: var(--tap);
	padding: 0.2rem 0;
	border: 0;
	background: transparent;
	font-size: clamp(0.625rem, 2.6vw, 0.75rem);
	line-height: 1.15;
	overflow-wrap: anywhere;
}

.bottom-bar a { text-decoration: none; }
.bottom-bar a:hover, .detail-actions a:hover, .detail-text-link:hover { background: #f4f4f4; }
.bottom-current { font-weight: 700; box-shadow: inset 0 -2px var(--ink); }

.detail-page { padding-block: 1.25rem 1.5rem; }
.detail-page h1 { margin-bottom: 1rem; }
.detail-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.875rem; }
.detail-section { margin-block-start: 1.5rem; }
.detail-section > h2 { margin-bottom: 0.625rem; }
.detail-card {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.65rem;
	padding: clamp(0.75rem, 4vw, 1rem);
	border: 1px solid var(--line);
	font-size: 0.9375rem;
	overflow-wrap: anywhere;
}
.detail-card h3 { margin: 0; font-size: 1rem; line-height: 1.25; }
.detail-card-heading {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 0.625rem;
}
.detail-card-heading h1 { margin: 0; overflow-wrap: anywhere; }
.project-highlights { display: grid; gap: 0.55rem; margin: 0; padding-inline-start: 1.25rem; }
.detail-actions { display: flex; align-items: center; }
.detail-text-link { display: inline-flex; align-items: center; min-height: var(--tap); }
.detail-text-link { justify-self: start; font-size: 0.875rem; }
.detail-meta { display: grid; gap: 0.2rem; }
.achievement-photo { display: block; width: 100%; height: auto; }
.deck-achievement-photo { min-height: 200px; aspect-ratio: 16 / 9; align-self: center; object-fit: contain; }
.achievement-gallery { position: relative; aspect-ratio: 3 / 2; background: #f4f4f4; }
.gallery-track {
	display: flex;
	height: 100%;
	overflow-x: auto;
	overscroll-behavior-inline: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	cursor: grab;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track[data-dragging] { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.gallery-track img { flex: 0 0 100%; min-width: 0; height: 100%; object-fit: contain; scroll-snap-align: start; scroll-snap-stop: always; }
.gallery-dots {
	position: absolute;
	inset: auto auto 0.5rem 50%;
	translate: -50% 0;
	display: flex;
	gap: 0.25rem;
	padding: 0.28rem 0.4rem;
	border-radius: 999px;
	background: rgb(0 0 0 / 55%);
	pointer-events: none;
}
.gallery-dots span { width: 0.3rem; height: 0.3rem; border-radius: 50%; background: rgb(255 255 255 / 50%); }
.gallery-dots [data-current] { background: #fff; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 19rem) {
	.skill-list > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
