:root {
    --paper: #efeee4;
    --white: #fffdf6;
    --ink: #0a0a0a;
    --green: #19a35b;
    --yellow: #fcd116;
    --red: #e63946;
    --bronze: #d4905a;
    --silver: #cfd4da;
    --display: 'Anybody', 'Arial Black', 'Helvetica Neue', Arial, sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
    --b: 3px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 1rem; }

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--mono);
    font-size: 0.95rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

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

.skip {
    position: absolute; left: 1rem; top: -4rem; z-index: 100;
    background: var(--yellow); border: var(--b) solid var(--ink); padding: 0.5rem 0.9rem; font-weight: 600;
}
.skip:focus { top: 0.75rem; }

/* Frame: a black grid whose gaps draw the thick tile borders */
.page { max-width: 1180px; margin: 0 auto; padding: clamp(0.75rem, 3vw, 2.5rem) clamp(0.75rem, 3vw, 2rem) 3rem; }
.frame {
    display: grid; gap: var(--b);
    background: var(--ink); border: var(--b) solid var(--ink); box-shadow: 8px 8px 0 var(--ink);
}
.frame > *, .row > *, .col > * { min-width: 0; }
.row, .col, main { display: grid; gap: var(--b); background: var(--ink); }

.tile { background-color: var(--white); padding: clamp(1.25rem, 3vw, 2.25rem); }
.tile-label { display: flex; align-items: center; padding: 1.25rem; }
.tile-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.tile-title {
    font-family: var(--display); font-size: clamp(1.1rem, 2.4vw, 1.5rem); line-height: 1.1;
    font-weight: 900; text-transform: uppercase; letter-spacing: 0.01em;
    font-variation-settings: 'wdth' 120, 'wght' 900; overflow-wrap: anywhere;
}
.tile-label .tile-title { font-size: clamp(1rem, 1.8vw, 1.25rem); }

.bg-green { background-color: var(--green); }
.bg-yellow { background-color: var(--yellow); }
.bg-red { background-color: var(--red); }

/* Navigation row */
.row-nav { grid-template-columns: minmax(0, 1fr) auto; }
.nav-tile {
    display: flex; align-items: center; padding: 0.8rem 1rem;
    font-family: var(--display); font-weight: 800; font-size: 0.85rem; text-transform: uppercase;
    font-variation-settings: 'wdth' 110, 'wght' 800;
}
.nav-tile:focus-visible { outline-offset: -6px; }
.nav-logo { grid-column: 1; grid-row: 1; background-color: var(--yellow); }
.nav-contact { grid-column: 2; grid-row: 1; background-color: var(--green); transition: background-color 0.15s ease, color 0.15s ease; }
.nav-contact:hover { background-color: var(--ink); color: var(--yellow); }
.nav-links {
    grid-column: 1 / -1; grid-row: 2; flex-wrap: wrap; justify-content: center;
    gap: 0.25rem 1.25rem; background-color: var(--white);
}
.nav-links a { padding: 0.15rem 0.25rem; transition: background-color 0.15s ease; }
.nav-links a:hover { background-color: var(--yellow); }

@media (min-width: 900px) {
    .row-nav { grid-template-columns: auto minmax(0, 1fr) auto; }
    .nav-logo, .nav-contact, .nav-links { grid-column: auto; grid-row: auto; }
}

/* Buttons */
.btn-row { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    border: var(--b) solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
    padding: 0.6rem 1rem; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}
.btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }
.btn-green { background-color: var(--green); }
.btn-yellow { background-color: var(--yellow); }
.btn-white { background-color: var(--white); }
.btn-small { padding: 0.35rem 0.7rem; font-size: 0.75rem; box-shadow: 3px 3px 0 var(--ink); }

.sq-btn {
    width: 2.5rem; height: 2.5rem; background-color: var(--yellow);
    border: var(--b) solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
    font-weight: 700; font-size: 1rem; cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.sq-btn:hover { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.controls { display: flex; gap: 0.75rem; }

/* Hero */
.row-hero { grid-template-columns: minmax(0, 1fr); }
.hero-copy {
    display: flex; flex-direction: column; align-items: flex-start; gap: 1.5rem;
    background-image:
        linear-gradient(rgba(10, 10, 10, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(10, 10, 10, 0.1) 1px, transparent 1px);
    background-size: 24px 24px;
}
.badge {
    background: var(--ink); color: var(--yellow); padding: 0.2rem 0.7rem;
    font-weight: 600; font-size: 0.8rem;
}
.hero-name {
    font-family: var(--display); font-size: clamp(2.4rem, 10vw, 5.25rem);
    line-height: 0.95; font-weight: 900; text-transform: uppercase; letter-spacing: -0.01em;
    font-variation-settings: 'wdth' 125, 'wght' 900;
    animation: refine 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.hero-line { display: block; }

@keyframes refine {
    from { font-variation-settings: 'wdth' 50, 'wght' 150; opacity: 0.3; }
    to   { font-variation-settings: 'wdth' 125, 'wght' 900; opacity: 1; }
}

.hero-text { max-width: 30rem; }

.hero-visual { display: grid; place-items: center; padding: clamp(1.5rem, 4vw, 3rem) clamp(1.5rem, 4vw, 3rem) 3.25rem; }
.photo { position: relative; width: min(100%, 22rem); }
.photo::before {
    content: ""; position: absolute; inset: 0; background: var(--yellow);
    border: var(--b) solid var(--ink); transform: translate(-0.9rem, -0.9rem);
}
.photo img {
    position: relative; width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
    border: var(--b) solid var(--ink); box-shadow: 6px 6px 0 var(--ink);
}
.code-card {
    position: absolute; right: -0.75rem; bottom: -1.75rem; max-width: 100%;
    background: var(--ink); color: var(--white); border: var(--b) solid var(--ink);
    box-shadow: 5px 5px 0 var(--yellow); padding: 0.8rem 1rem;
    font-size: 0.72rem; line-height: 1.5; white-space: pre; overflow: hidden;
}
.code-key { color: var(--yellow); }
.code-val { color: #7ee787; }

@media (min-width: 900px) {
    .row-hero { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
}

/* Skills */
.row-skills { grid-template-columns: minmax(0, 1fr); }
.skill-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.5rem 2rem; }
.skill-name { font-weight: 600; font-size: 0.8rem; text-transform: uppercase; margin-bottom: 0.6rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chip {
    border: 2px solid var(--ink); background-color: var(--white); box-shadow: 2px 2px 0 var(--ink);
    padding: 0.1rem 0.6rem; font-weight: 600; font-size: 0.8rem;
}
.chip-hot { background-color: var(--yellow); }

@media (min-width: 900px) {
    .row-skills { grid-template-columns: 14rem minmax(0, 1fr); }
}

/* Projects carousel */
.row-main { grid-template-columns: minmax(0, 1fr); }
.slides {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; padding-right: 3px; }
.slide-media { border: var(--b) solid var(--ink); background-color: var(--red); padding: 0.75rem; }
.slide-frame { border: var(--b) solid var(--ink); aspect-ratio: 16 / 9; overflow: hidden; background-color: var(--white); }
.slide-frame img { width: 100%; height: 100%; object-fit: cover; }
.slide-body { padding-top: 1.1rem; }
.slide-title {
    font-family: var(--display); font-size: 1.3rem; line-height: 1.15; font-weight: 800; text-transform: uppercase;
    font-variation-settings: 'wdth' 110, 'wght' 800;
}
.slide-desc { margin-top: 0.5rem; max-width: 46rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.9rem 0 1.1rem; }
.tag { border: 2px solid var(--ink); background-color: var(--white); padding: 0 0.5rem; font-size: 0.75rem; font-weight: 600; }

.dots { display: flex; justify-content: center; gap: 0.7rem; margin-top: 1.5rem; }
.dot {
    position: relative; width: 0.9rem; height: 0.9rem; padding: 0; cursor: pointer;
    border: 2px solid var(--ink); border-radius: 50%; background-color: var(--white);
}
.dot::after { content: ""; position: absolute; inset: -0.6rem; }
.dot[aria-current="true"] { background-color: var(--ink); }

/* Covers for projects without a screenshot yet */
.cover { position: relative; width: 100%; height: 100%; }
.cover-water {
    background:
        repeating-radial-gradient(circle at 72% 125%, transparent 0 26px, rgba(255, 255, 255, 0.13) 26px 28px),
        linear-gradient(160deg, #08303a, #0f5566 60%, #1b8a9c);
}
.cover-play { background: linear-gradient(150deg, #1d1608, #3b2c0d 70%, #6b5116); }
.cover-play::before {
    content: ""; position: absolute; inset: 0; margin: auto;
    width: 5rem; height: 5rem; border-radius: 50%; background: #e8b923;
}
.cover-play::after {
    content: ""; position: absolute; inset: 0; margin: auto; width: 0; height: 0;
    border-style: solid; border-width: 0.85rem 0 0.85rem 1.4rem;
    border-color: transparent transparent transparent #1d1608;
    transform: translateX(0.2rem);
}

/* Education and Medallion tiles */
.col { grid-template-rows: auto 1fr; }
.edu-name { margin-top: 1rem; font-weight: 600; }
.edu-meta { margin-top: 0.15rem; }
.tiers { display: grid; gap: 0.6rem; margin-top: 1rem; }
.tier { border: var(--b) solid var(--ink); padding: 0.5rem 0.75rem; font-size: 0.8rem; line-height: 1.4; }
.tier b { display: block; font-family: var(--display); text-transform: uppercase; font-variation-settings: 'wdth' 110, 'wght' 800; }
.tier-bronze { background-color: var(--bronze); }
.tier-silver { background-color: var(--silver); }
.tier-gold { background-color: var(--yellow); }

@media (min-width: 900px) {
    .row-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
}

/* Experience and contact */
.row-bottom { grid-template-columns: minmax(0, 1fr); }
.timeline { display: grid; gap: 1.75rem; border-left: var(--b) solid var(--ink); margin-left: 0.5rem; }
.timeline li { position: relative; padding-left: 1.5rem; }
.timeline li::before {
    content: ""; position: absolute; left: -0.6rem; top: 0.4rem;
    width: 0.9rem; height: 0.9rem; border-radius: 50%; background: var(--ink);
}
.tl-name {
    font-family: var(--display); font-size: 1.05rem; line-height: 1.2; font-weight: 800; text-transform: uppercase;
    font-variation-settings: 'wdth' 110, 'wght' 800;
}
.tl-role { margin-top: 0.15rem; }
.tl-meta { opacity: 0.75; font-size: 0.85rem; }

.cta {
    display: flex; flex-direction: column; align-items: flex-start; gap: 1.1rem;
    background-image:
        linear-gradient(rgba(10, 10, 10, 0.16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(10, 10, 10, 0.16) 1px, transparent 1px);
    background-size: 22px 22px;
}
.cta-title {
    font-family: var(--display); font-size: clamp(1.4rem, 3vw, 1.9rem); line-height: 1.1; font-weight: 900; text-transform: uppercase;
    font-variation-settings: 'wdth' 115, 'wght' 900;
}
.cta-mail { font-weight: 600; font-size: 0.85rem; overflow-wrap: anywhere; text-decoration: underline; text-underline-offset: 0.2em; }

@media (min-width: 900px) {
    .row-bottom { grid-template-columns: 14rem minmax(0, 1fr); }
    .cta { grid-column: 1 / -1; }
}
@media (min-width: 1200px) {
    .row-bottom { grid-template-columns: 14rem minmax(0, 1fr) 20rem; }
    .cta { grid-column: auto; }
}

/* Footer */
.row-foot { grid-template-columns: minmax(0, 1fr); }
.foot-copy { display: flex; align-items: center; justify-content: center; text-align: center; padding: 0.8rem 1rem; font-size: 0.8rem; font-weight: 500; }
.foot-links { display: flex; align-items: center; justify-content: center; gap: 0.75rem; padding: 0.7rem 1rem; }
.row-foot .nav-logo { grid-column: auto; grid-row: auto; }

@media (min-width: 900px) {
    .row-foot { grid-template-columns: auto minmax(0, 1fr) auto; }
}

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