/* ==========================================================================
   Adam Markocki — portfolio
   ========================================================================== */
:root {
  --ink: #ffffff;
  --ink-2: rgba(255, 255, 255, .82);
  --ink-3: rgba(255, 255, 255, .62);
  --panel: rgba(22, 44, 128, .58);
  --panel-hi: rgba(255, 255, 255, .16);
  --line: rgba(255, 255, 255, .22);
  --btn: #ffffff;
  --btn-ink: #1c3a9a;
  --gold: #f7c948;
  --gold-ink: #3a2a00;
  --sky-fallback: linear-gradient(180deg, #6e95ea, #3d6fe0 60%, #2855cc);
  --display: "Inter Tight", "Inter", system-ui, -apple-system, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pixel: "Silkscreen", ui-monospace, monospace;
  --n: 4px;              /* pixel notch size */
  --wrap: 1120px;
  --gutter: clamp(16px, 5vw, 48px);
  color-scheme: light;
}
:root[data-theme="night"] {
  --ink-2: rgba(226, 234, 255, .84);
  --ink-3: rgba(200, 214, 255, .6);
  --panel: rgba(8, 16, 44, .86);
  --panel-hi: rgba(160, 190, 255, .14);
  --line: rgba(170, 195, 255, .2);
  --btn: #e6edff;
  --btn-ink: #0e1940;
  --sky-fallback: linear-gradient(180deg, #182a62, #0e1940 60%, #080d23);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #3d6fe0 var(--sky-fallback) fixed;
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
:root[data-theme="night"] body { background-color: #0e1940; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.025em; line-height: 1.05; margin: 0; }
p { margin: 0; }
ul, ol { list-style: none; margin: 0; padding: 0; }
.px { font-family: var(--pixel); font-weight: 400; letter-spacing: .04em; text-transform: uppercase; font-size: 14px; line-height: 1.5; }
.muted { color: var(--ink-2); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: #fff; color: #000; padding: 8px 12px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* pixel notched corners — two-step "rounded" edge like a game UI */
.notch {
  clip-path: polygon(
    0 calc(var(--n) * 2), var(--n) calc(var(--n) * 2), var(--n) var(--n), calc(var(--n) * 2) var(--n), calc(var(--n) * 2) 0,
    calc(100% - var(--n) * 2) 0, calc(100% - var(--n) * 2) var(--n), calc(100% - var(--n)) var(--n), calc(100% - var(--n)) calc(var(--n) * 2), 100% calc(var(--n) * 2),
    100% calc(100% - var(--n) * 2), calc(100% - var(--n)) calc(100% - var(--n) * 2), calc(100% - var(--n)) calc(100% - var(--n)), calc(100% - var(--n) * 2) calc(100% - var(--n)), calc(100% - var(--n) * 2) 100%,
    calc(var(--n) * 2) 100%, calc(var(--n) * 2) calc(100% - var(--n)), var(--n) calc(100% - var(--n)), var(--n) calc(100% - var(--n) * 2), 0 calc(100% - var(--n) * 2));
}

/* ---------- sky ---------- */
#sky {
  position: fixed; inset: 0 auto auto 0; z-index: -1;
  image-rendering: pixelated; image-rendering: crisp-edges;
  pointer-events: none;
}
.no-webgl #sky { display: none; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px var(--gutter);
}
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 16px/1 var(--display); letter-spacing: -.01em; }
.controls { display: flex; align-items: center; gap: 8px; }
.lang { display: flex; background: var(--panel); padding: 3px; --n: 3px; }
.lang { clip-path: polygon(0 6px,3px 6px,3px 3px,6px 3px,6px 0,calc(100% - 6px) 0,calc(100% - 6px) 3px,calc(100% - 3px) 3px,calc(100% - 3px) 6px,100% 6px,100% calc(100% - 6px),calc(100% - 3px) calc(100% - 6px),calc(100% - 3px) calc(100% - 3px),calc(100% - 6px) calc(100% - 3px),calc(100% - 6px) 100%,6px 100%,6px calc(100% - 3px),3px calc(100% - 3px),3px calc(100% - 6px),0 calc(100% - 6px)); }
.lang button {
  font: 12px/1 var(--pixel); color: var(--ink-2); background: none; border: 0; padding: 8px 9px; cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer;
  background: var(--panel); border: 0; color: var(--ink);
  clip-path: polygon(0 6px,3px 6px,3px 3px,6px 3px,6px 0,calc(100% - 6px) 0,calc(100% - 6px) 3px,calc(100% - 3px) 3px,calc(100% - 3px) 6px,100% 6px,100% calc(100% - 6px),calc(100% - 3px) calc(100% - 6px),calc(100% - 3px) calc(100% - 3px),calc(100% - 6px) calc(100% - 3px),calc(100% - 6px) 100%,6px 100%,6px calc(100% - 3px),3px calc(100% - 3px),3px calc(100% - 6px),0 calc(100% - 6px));
}
.icon-btn svg { width: 16px; height: 16px; fill: currentColor; shape-rendering: crispEdges; }
#sound .on, #sound.is-on .off { display: none; }
#sound.is-on .on { display: block; }
#theme .moon, [data-theme="night"] #theme .sun { display: none; }
[data-theme="night"] #theme .moon { display: block; }
.lang button:hover, .icon-btn:hover { color: #fff; background-color: var(--panel-hi); }
.lang button[aria-pressed="true"]:hover { background: var(--btn); color: var(--btn-ink); }

/* ---------- layout ---------- */
main { position: relative; }
.section { max-width: var(--wrap); margin: 0 auto; padding: clamp(72px, 12vh, 140px) var(--gutter) 0; scroll-margin-top: 24px; }
.section-head { margin-bottom: 32px; }
.kicker { color: var(--ink); margin-bottom: 14px; }
[data-dim] { width: fit-content; max-width: 100%; }
.hero, .section-head, .contact { text-shadow: 0 1px 18px rgba(16, 36, 120, .45), 0 0 2px rgba(16, 36, 120, .25); }
[data-theme="night"] .hero, [data-theme="night"] .section-head, [data-theme="night"] .contact { text-shadow: 0 1px 18px rgba(4, 8, 30, .6); }
.btn, .badge { text-shadow: none; }
h2 { font-size: clamp(34px, 5vw, 56px); }
.panel {
  background: var(--panel);
  box-shadow: inset 0 2px 0 var(--panel-hi);
  --n: 6px;
}

/* ---------- hero ---------- */
.hero {
  min-height: 100svh; max-width: var(--wrap); margin: 0 auto;
  padding: 140px var(--gutter) 120px;
  display: flex; flex-direction: column; justify-content: center;
}
.hello { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.eyebrow { color: var(--ink); }
.hero-title { font-size: clamp(48px, 9.4vw, 128px); line-height: .96; letter-spacing: -.045em; max-width: 12ch; text-wrap: balance; }
.lede { font-size: clamp(18px, 2vw, 21px); color: rgba(255, 255, 255, .92); max-width: 36em; margin-top: 28px; line-height: 1.55; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.btn {
  --n: 4px; display: inline-flex; align-items: center; gap: 10px;
  font: 600 16px/1 var(--body); text-decoration: none; cursor: pointer; border: 0;
  padding: 16px 22px; transition: transform .15s steps(3), background-color .2s;
}
.btn [data-icon] { width: 16px; height: 16px; }
.btn-primary { background: var(--btn); color: var(--btn-ink); }
.btn-ghost { background: var(--panel); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn:hover { transform: translateY(-3px); }
.btn:active { transform: translateY(1px); }
.badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 44px; }
.badge {
  --n: 3px; display: inline-flex; align-items: center; gap: 10px;
  background: var(--panel); padding: 10px 14px 10px 12px; font-size: 14px; font-weight: 500; color: var(--ink-2);
}
.badge [data-icon] { width: 18px; height: 18px; flex: none; }
.badge.gold { background: var(--gold); color: var(--gold-ink); }
.badge.gold [data-icon] { background: #3a2a00; padding: 3px; width: 22px; height: 22px; }

/* ---------- projects ---------- */
.projects { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.project {
  --n: 6px; grid-column: span 2; position: relative; display: flex; flex-direction: column;
  background: var(--panel); box-shadow: inset 0 2px 0 var(--panel-hi), inset 0 0 0 1px color-mix(in srgb, var(--acc) 22%, transparent);
  transition: transform .25s steps(4), box-shadow .25s;
}
.project.featured { grid-column: span 4; flex-direction: row-reverse; }
.project:hover { transform: translateY(-5px); box-shadow: inset 0 2px 0 var(--panel-hi), inset 0 0 0 2px color-mix(in srgb, var(--acc) 70%, transparent); }

/* stage: the tinted top area with the icon, dithered like the sky */
.stage {
  position: relative; height: 200px; display: grid; place-items: center; padding-top: 22px; overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--acc) 55%, transparent), color-mix(in srgb, var(--acc) 12%, transparent) 70%);
}
.stage::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, .32) 1.2px, transparent 1.6px);
  background-size: 8px 8px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%); mask-image: linear-gradient(180deg, #000, transparent 85%);
  opacity: .55;
}
.stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: color-mix(in srgb, var(--acc) 60%, transparent); }
.featured .stage { height: auto; flex: 0 0 42%; padding-top: 0; }
.featured .stage::after { left: 0; top: 0; bottom: 0; right: auto; width: 2px; height: auto; }
.glow {
  position: absolute; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--acc) 85%, #fff 15%) 0%, transparent 65%);
  opacity: .55; filter: blur(6px); transition: opacity .3s, transform .4s;
}
.app-icon {
  position: relative; width: 96px; height: 96px; border-radius: 22px; flex: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .25), 0 14px 30px rgba(6, 14, 50, .45);
  transition: transform .3s steps(4);
}
.featured .app-icon { width: 132px; height: 132px; border-radius: 30px; }
.project:hover .app-icon { transform: translateY(-6px) rotate(-3deg); }
.project:hover .glow { opacity: .85; transform: scale(1.12); }
.kind {
  position: absolute; left: 14px; top: 14px; font-size: 11px; padding: 6px 8px;
  background: rgba(8, 16, 50, .55); color: #fff; letter-spacing: .06em;
}

.pbody { display: flex; flex-direction: column; gap: 10px; padding: 24px 26px 26px; flex: 1; }
.featured .pbody { padding: 34px 36px; justify-content: center; }
.project h3 { font-size: 28px; }
.featured h3 { font-size: clamp(34px, 4vw, 46px); }
.project p { color: var(--ink-2); flex: 1; }
.featured p { flex: 0; font-size: 18px; max-width: 30em; }

.pactions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pbtn {
  --n: 3px; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px;
  font: 600 14px/1 var(--body); text-decoration: none; white-space: nowrap;
  background: rgba(255, 255, 255, .1); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color .15s, transform .15s steps(2);
}
.pbtn.main { background: var(--btn); color: var(--btn-ink); box-shadow: none; }
.pbtn:hover { transform: translateY(-2px); background-color: rgba(255, 255, 255, .2); }
.pbtn.main:hover { background: #fff; }
.pbtn .arr { width: 10px; height: 10px; fill: currentColor; shape-rendering: crispEdges; }
.win { --n: 3px; align-self: flex-start; width: fit-content; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; background: var(--gold); color: var(--gold-ink); font-size: 13px; font-weight: 600; padding: 7px 11px; }
.win svg { width: 16px; height: 16px; background: #3a2a00; padding: 2px; }

@media (max-width: 980px) {
  .projects { grid-template-columns: repeat(2, 1fr); }
  .project, .project.featured { grid-column: span 1; }
  .project.featured { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .projects { grid-template-columns: 1fr; }
  .project.featured { flex-direction: column; }
  .featured .stage { height: 190px; flex: none; }
  .featured .stage::after { top: auto; right: 0; width: auto; height: 2px; }
  .featured .app-icon { width: 104px; height: 104px; border-radius: 24px; }
  .featured .pbody { padding: 24px; }
}
.tile { --n: 4px; width: 56px; height: 56px; padding: 12px; background: rgba(255, 255, 255, .14); flex: none; }
.project:hover .tile svg { animation: bob .6s steps(3) infinite alternate; }
@keyframes bob { to { transform: translateY(-3px); } }
.quest-img { width: 180px; height: 180px; object-fit: cover; margin-top: 14px; border-radius: 4px; box-shadow: 0 6px 18px rgba(8, 20, 70, .35); }
.cv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 14px; margin-top: 28px; }
.cv-card { padding: 24px; }
.cv-card.wide { grid-column: 1 / -1; }
.cv-card h3 { color: var(--ink-2); margin-bottom: 14px; font-size: 14px; }
.cv-rows li { display: flex; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); color: var(--ink-2); }
.cv-rows.stacked li { flex-direction: column; gap: 2px; }
.cv-rows li:first-child { border-top: 0; padding-top: 0; }
.cv-rows strong { color: var(--ink); font-weight: 600; }
.cv-rows .years { color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cv-card.wide .cv-list { columns: 2 280px; column-gap: 32px; }
.cv-list li { break-inside: avoid; padding: 7px 0 7px 18px; position: relative; color: var(--ink-2); }
.cv-list li::before { content: ""; position: absolute; left: 0; top: 16px; width: 6px; height: 6px; background: var(--ink); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.tags li { font: 12px/1 var(--pixel); text-transform: uppercase; padding: 6px 8px; background: rgba(255, 255, 255, .1); color: var(--ink-2); }
.link-arrow { font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--line); padding-bottom: 2px; white-space: nowrap; }
.link-arrow:hover { border-color: var(--ink); }

/* ---------- in collaboration with ---------- */
.collab { margin-top: clamp(56px, 8vw, 96px); }
.collab-head {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "crest title link" "crest text link";
  align-items: center; gap: 4px 20px; width: auto !important; margin-bottom: 24px;
}
.crest { grid-area: crest; width: 64px; height: 64px; filter: invert(1); opacity: .95; }
.collab-title { grid-area: title; }
.collab-title .kicker { margin-bottom: 6px; }
.collab-title h3 { font-size: clamp(28px, 3.6vw, 40px); }
.collab-text { grid-area: text; color: var(--ink-2); max-width: 44em; }
.collab-head > .pbtn { grid-area: link; align-self: center; }
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tool {
  --n: 5px; padding: 22px; display: flex; flex-direction: column; gap: 10px;
  transition: transform .2s steps(4), box-shadow .2s;
}
.tool:hover { transform: translateY(-4px); box-shadow: inset 0 2px 0 var(--panel-hi), inset 0 0 0 2px rgba(255, 255, 255, .35); }
.tool-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.tool-icon { --n: 3px; width: 44px; height: 44px; padding: 10px; background: rgba(255, 255, 255, .14); }
.tool:hover .tool-icon svg { animation: bob .5s steps(3) infinite alternate; }
.tool-kind { font-size: 11px; color: var(--ink-2); text-align: right; }
.tool h4 { font: 600 21px/1.2 var(--display); letter-spacing: -.015em; margin: 0; }
.tool p { color: var(--ink-2); font-size: 15.5px; flex: 1; }
.tool .pactions { margin-top: 6px; }

@media (max-width: 980px) {
  .tools { grid-template-columns: repeat(2, 1fr); }
  .collab-head { grid-template-columns: auto 1fr; grid-template-areas: "crest title" "text text" "link link"; }
  .collab-head > .pbtn { justify-self: start; margin-top: 8px; }
}
@media (max-width: 640px) {
  .tools { grid-template-columns: 1fr; }
  .crest { width: 52px; height: 52px; }
}

/* ---------- heatmap ---------- */
.heat-panel { padding: clamp(24px, 4vw, 40px); }
.heat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 28px; flex-wrap: wrap; }
.heat-head h2 { font-size: clamp(28px, 4vw, 44px); margin-bottom: 10px; }
.heat-scroll { overflow-x: auto; scrollbar-width: thin; padding-bottom: 6px; }
.heat { display: grid; grid-template-rows: repeat(7, auto); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; width: 100%; min-width: 640px; }
.heat i { display: block; aspect-ratio: 1; background: rgba(255, 255, 255, .09); opacity: 0; transform: translateY(-6px); }
.heat.placed i { opacity: 1; transform: none; transition: opacity .2s, transform .25s steps(3); transition-delay: calc(var(--c, 0) * 14ms); }
.heat i.pad { visibility: hidden; }
.heat .l1 { background: #5b86ea; }
.heat .l2 { background: #86a8f2; }
.heat .l3 { background: #bcd0f8; }
.heat .l4 { background: #ffffff; }
[data-theme="night"] .heat .l1 { background: #23408f; }
[data-theme="night"] .heat .l2 { background: #3a62c4; }
[data-theme="night"] .heat .l3 { background: #6f95ee; }
[data-theme="night"] .heat .l4 { background: #c9d8ff; }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 240px 1fr; gap: clamp(24px, 4vw, 48px); padding: clamp(24px, 4vw, 48px); align-items: start; }
.avatar { --n: 6px; width: 240px; height: 240px; background: rgba(255, 255, 255, .14); display: grid; place-items: center; overflow: hidden; }
.avatar > span { width: 72px; height: 72px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.about h2 { font-size: clamp(30px, 4.4vw, 48px); margin-bottom: 22px; }
.about-body p:not(.kicker):not(.heroes-label) { color: var(--ink-2); max-width: 38em; margin-bottom: 14px; }
.heroes-label { color: var(--ink-2); margin: 22px 0 12px !important; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { --n: 3px; background: rgba(255, 255, 255, .12); padding: 8px 14px; font-weight: 500; font-size: 15px; }

/* ---------- journey / advancements ---------- */
.quests { position: relative; display: grid; gap: 14px; padding-left: 0; }
.quests::before {
  content: ""; position: absolute; left: 27px; top: 28px; bottom: 28px; width: 4px;
  background: repeating-linear-gradient(to bottom, var(--line) 0 8px, transparent 8px 14px);
}
.quest { display: grid; grid-template-columns: 58px 1fr; gap: 18px; align-items: start; position: relative; }
.node {
  --n: 4px; width: 58px; height: 58px; padding: 13px; background: var(--btn); position: relative; z-index: 1;
  transform: scale(.6); opacity: .35; filter: grayscale(1);
}
.quest.in .node { transform: none; opacity: 1; filter: none; transition: transform .35s steps(4) .15s, opacity .2s .15s, filter .2s .15s; }
.quest-card { padding: 20px 24px; }
.quest .when { color: var(--ink-2); margin-bottom: 8px; }
.quest h3 { font-size: 22px; margin-bottom: 6px; letter-spacing: -.015em; }
.quest p:not(.when) { color: var(--ink-2); }
.quest .link-arrow { display: inline-block; margin-top: 12px; }
.quest.gold .node { background: var(--gold); }
.quest.gold .quest-card { box-shadow: inset 0 0 0 2px var(--gold); }
.quest.gold .when { color: var(--gold); }
.quest.next .node { background: var(--panel); }
.quest.next .quest-card { background: transparent; box-shadow: inset 0 0 0 2px var(--line); }
.quest.next h3::after { content: "▌"; animation: blink 1s steps(1) infinite; margin-left: 4px; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- the CV chest ---------- */
.chest {
  --n: 6px; width: 100%; margin-top: 18px; display: flex; align-items: center; gap: 22px;
  padding: 18px 24px 18px 18px; border: 0; cursor: pointer; text-align: left; color: var(--ink); font: inherit;
  transition: box-shadow .25s, background-color .25s;
}
.chest:hover { box-shadow: inset 0 2px 0 var(--panel-hi), inset 0 0 0 2px rgba(247, 201, 72, .55); }
.chest.open { box-shadow: inset 0 2px 0 var(--panel-hi), inset 0 0 0 2px var(--gold); }
.chest-art { position: relative; flex: none; width: 92px; height: 84px; display: grid; place-items: center; }
.chest-svg { width: 92px; height: 83px; overflow: visible; }
.chest:hover:not(.open) .chest-svg { animation: wiggle .5s steps(4) infinite; }
@keyframes wiggle { 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }
.chest-lid { transform-box: fill-box; transform-origin: 0% 100%; transition: transform .4s steps(5); }
.chest:hover:not(.open) .chest-lid { transform: translateY(-1px) rotate(-6deg); }
.chest.open .chest-lid { transform: translate(-1px, -3px) rotate(-28deg); }
.chest-glow { opacity: 0; transition: opacity .3s steps(3) .1s; }
.chest.open .chest-glow { opacity: 1; animation: flicker 1.6s steps(2) infinite .5s; }
@keyframes flicker { 50% { opacity: .7; } }
.loot { position: absolute; left: 50%; top: 40%; width: 0; height: 0; pointer-events: none; z-index: 2; }
.loot i {
  position: absolute; left: 0; top: 0; width: var(--s); height: var(--s); opacity: 0;
  animation: loot 1s steps(10) forwards;
}
@keyframes loot {
  0% { opacity: 1; transform: translate(0, 0); }
  55% { opacity: 1; transform: translate(var(--dx), var(--dy)); }
  100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 46px)); }
}
.chest-art::after {
  content: ""; position: absolute; right: 6px; top: 10px; width: 2px; height: 2px; background: #fff;
  box-shadow: 0 -3px #fff, 0 3px #fff, -3px 0 #fff, 3px 0 #fff, 0 0 0 1px #ffe27a;
  opacity: 0; animation: twinkle 3.2s steps(1) infinite;
}
.chest.open .chest-art::after { display: none; }
@keyframes twinkle { 0%, 70%, 100% { opacity: 0; } 74%, 82% { opacity: 1; } 78% { opacity: .4; } }
.chest-text { flex: 1; display: grid; gap: 4px; }
.chest-title { font: 600 clamp(20px, 2.4vw, 26px)/1.15 var(--display); letter-spacing: -.015em; }
.chest-hint { color: var(--ink-2); font-size: 15px; }
.chest-key {
  --n: 3px; flex: none; width: 38px; height: 38px; display: grid; place-items: center; font-size: 14px;
  background: rgba(255, 255, 255, .12); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25);
  clip-path: polygon(0 6px,3px 6px,3px 3px,6px 3px,6px 0,calc(100% - 6px) 0,calc(100% - 6px) 3px,calc(100% - 3px) 3px,calc(100% - 3px) 6px,100% 6px,100% calc(100% - 6px),calc(100% - 3px) calc(100% - 6px),calc(100% - 3px) calc(100% - 3px),calc(100% - 6px) calc(100% - 3px),calc(100% - 6px) 100%,6px 100%,6px calc(100% - 3px),3px calc(100% - 3px),3px calc(100% - 6px),0 calc(100% - 6px));
}
.chest:active .chest-key { box-shadow: inset 0 2px 0 rgba(0, 0, 0, .25); }

.cv-drawer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .7s cubic-bezier(.2, .8, .2, 1); }
.cv-drawer.open { grid-template-rows: 1fr; }
.cv-drawer-inner { overflow: hidden; min-height: 0; }
.cv-drawer .cv-grid { perspective: 900px; padding-bottom: 4px; }
.cv-drawer .cv-card {
  opacity: 0; transform: translateY(-34px) scale(.92) rotateX(-14deg); transform-origin: 50% 0;
  transition: opacity .25s, transform .3s ease-in;
}
.cv-drawer.open .cv-card {
  opacity: 1; transform: none;
  transition: opacity .4s, transform .65s cubic-bezier(.2, 1.5, .35, 1);
  transition-delay: calc(.18s + var(--k, 0) * .1s);
}

/* ---------- about socials ---------- */
.about-socials { display: flex; flex-wrap: wrap; gap: 8px; }
.sbtn {
  --n: 3px; display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px;
  font: 600 15px/1 var(--body); text-decoration: none; color: var(--ink);
  background: rgba(255, 255, 255, .12); transition: background-color .15s, transform .15s steps(2);
}
.sbtn svg { width: 18px; height: 18px; }
.sbtn:hover { background: rgba(255, 255, 255, .22); transform: translateY(-2px); }

/* ---------- contact ---------- */
.contact { text-align: center; padding-bottom: 40px; }
.contact .lede, .contact [data-dim] { margin-left: auto; margin-right: auto; }
.contact .cta { justify-content: center; }
.contact-title { font-size: clamp(44px, 8vw, 104px); letter-spacing: -.045em; line-height: .98; }
.socials { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px 28px; margin-top: 36px; }

/* ---------- ground ---------- */
.ground { position: relative; margin-top: 64px; }
#meadow { display: block; width: 100%; height: 150px; image-rendering: pixelated; image-rendering: crisp-edges; }
.foot-note { margin-left: auto !important; margin-right: auto !important; text-align: center; font-size: 14px; color: var(--ink-2); margin: 0 0 8px; padding: 0 16px; text-shadow: 0 1px 12px rgba(16, 36, 120, .5); }
.ground::after { content: ""; display: block; height: calc(76px + env(safe-area-inset-bottom)); background: #2f7a22; }
[data-theme="night"] .ground::after { background: #123020; }

/* ---------- hotbar ---------- */
.hotbar {
  position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30;
  display: flex; gap: 4px; padding: 4px; background: rgba(10, 18, 50, .72);
  clip-path: polygon(0 6px,3px 6px,3px 3px,6px 3px,6px 0,calc(100% - 6px) 0,calc(100% - 6px) 3px,calc(100% - 3px) 3px,calc(100% - 3px) 6px,100% 6px,100% calc(100% - 6px),calc(100% - 3px) calc(100% - 6px),calc(100% - 3px) calc(100% - 3px),calc(100% - 6px) calc(100% - 3px),calc(100% - 6px) 100%,6px 100%,6px calc(100% - 3px),3px calc(100% - 3px),3px calc(100% - 6px),0 calc(100% - 6px));
}
.hotbar a {
  position: relative; width: 48px; height: 48px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .1);
}
.hotbar a > [data-icon] { width: 24px; height: 24px; transition: transform .15s steps(2); }
.hotbar a:hover > [data-icon] { transform: translateY(-2px); }
.hotbar a.active { background: rgba(255, 255, 255, .2); box-shadow: inset 0 0 0 3px #fff; }
.hotbar kbd { position: absolute; right: 4px; bottom: 2px; font: 9px/1 var(--pixel); color: var(--ink-3); }
.hotbar .tip {
  position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%);
  font: 11px/1 var(--pixel); text-transform: uppercase; white-space: nowrap;
  background: rgba(10, 18, 50, .9); color: #fff; padding: 7px 9px; pointer-events: none;
  opacity: 0; transition: opacity .15s;
}
.hotbar a:hover .tip, .hotbar a:focus-visible .tip { opacity: 1; }

/* ---------- toasts ---------- */
.toasts { position: fixed; top: 76px; right: var(--gutter); z-index: 40; display: grid; gap: 10px; justify-items: end; }
.toast {
  --n: 4px; display: flex; align-items: center; gap: 14px; max-width: min(360px, calc(100vw - 32px));
  background: rgba(10, 18, 50, .88); color: #fff; padding: 14px 18px 14px 14px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .14);
  animation: toast-in .45s steps(6) both;
}
.toast.out { animation: toast-out .4s steps(5) both; }
.toast-icon { width: 40px; height: 40px; padding: 8px; background: rgba(255, 255, 255, .1); flex: none; }
.toast strong { display: block; color: var(--gold); font-size: 12px; margin-bottom: 3px; }
.toast span span { font-size: 14px; line-height: 1.35; }
@keyframes toast-in { from { transform: translateX(120%); } }
@keyframes toast-out { to { transform: translateX(120%); opacity: 0; } }

/* ---------- reveal ---------- */
.ready .reveal { opacity: 0; transform: translateY(18px); }
.ready .reveal.in { opacity: 1; transform: none; transition: opacity .5s ease, transform .5s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 70ms); }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .chest { gap: 14px; padding: 14px 16px 14px 12px; }
  .chest-art, .chest-svg { width: 68px; height: 62px; }
  .chest-key { display: none; }
  .chest-hint { font-size: 14px; }
  body { font-size: 16px; }
  .mark-name { font-size: 15px; }
  .lang button { padding: 8px 7px; }
  .hero { padding-top: 110px; padding-bottom: 110px; }
  .about { grid-template-columns: 1fr; }
  .avatar { width: 100%; height: auto; aspect-ratio: 1; max-width: 320px; }
  .avatar > span { width: 48px; height: 48px; }
  .hotbar a { width: 44px; height: 44px; }
  .hotbar kbd { display: none; }
  .toasts { top: auto; bottom: calc(80px + env(safe-area-inset-bottom)); left: 16px; right: 16px; justify-items: stretch; }
  .toast { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ready .reveal, .node, .heat i { opacity: 1 !important; transform: none !important; filter: none !important; }
}

/* =========================================================
   Style switching: PIXEL / ATLAS
   ========================================================= */
.skin-switch { display: flex; padding: 3px; background: var(--panel); clip-path: polygon(0 6px,3px 6px,3px 3px,6px 3px,6px 0,calc(100% - 6px) 0,calc(100% - 6px) 3px,calc(100% - 3px) 3px,calc(100% - 3px) 6px,100% 6px,100% calc(100% - 6px),calc(100% - 3px) calc(100% - 6px),calc(100% - 3px) calc(100% - 3px),calc(100% - 6px) calc(100% - 3px),calc(100% - 6px) 100%,6px 100%,6px calc(100% - 3px),3px calc(100% - 3px),3px calc(100% - 6px),0 calc(100% - 6px)); }
.skin-switch button { font: 12px/1 var(--pixel); color: var(--ink-2); background: none; border: 0; padding: 8px 9px; cursor: pointer; }
.skin-switch button[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); }
.skin-switch button:not([aria-pressed="true"]):hover { color: #fff; background: var(--panel-hi); }
@media (max-width: 720px) {
  #sound { display: none; }
  .controls { gap: 6px; }
  .skin-switch button[aria-pressed="true"] { display: none; }   /* phones: one tap target, "go to the other style" */
}

/* hide the pixel world while ATLAS is on */
[data-skin="atlas"] body { background: #0a0e13; }
[data-skin="atlas"] #sky, [data-skin="atlas"] body > main, [data-skin="atlas"] .ground,
[data-skin="atlas"] .hotbar, [data-skin="atlas"] .topbar, [data-skin="atlas"] .skip { display: none !important; }
[data-skin="pixel"] #atlas { display: none !important; }

/* boot sequence (into ATLAS) */
.boot {
  position: fixed; inset: 0; z-index: 90; display: none; padding: clamp(24px, 8vh, 80px) clamp(20px, 8vw, 96px);
  background: #0a0e13; color: #9fb3c8; font: 500 14px/1.9 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .02em;
}
.boot.on { display: block; }
.boot p { margin: 0; animation: bootline .18s steps(3) both; }
.boot p.ok { color: #3ecf8e; }
.boot.out { animation: bootout .45s ease forwards; }
@keyframes bootline { from { opacity: 0; transform: translateX(-6px); } }
@keyframes bootout { to { opacity: 0; clip-path: inset(0 0 100% 0); } }

/* pixel dissolve (back to PIXEL) */
.dissolve { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 90; display: none; image-rendering: pixelated; pointer-events: none; }
.dissolve.on { display: block; }

/* first-visit picker */
.picker {
  position: fixed; inset: 0; z-index: 80; overflow-y: auto; display: grid; grid-template-rows: auto 1fr;
  background: radial-gradient(120% 80% at 20% 0%, #1b2b55 0%, #0a0e13 60%);
  color: #e6edf6; opacity: 0; transition: opacity .35s ease;
}
.picker.on { opacity: 1; }
.picker-top { display: flex; justify-content: flex-end; padding: 16px var(--gutter); }
.picker .lang { background: rgba(255, 255, 255, .08); }
.picker-inner { align-self: center; width: min(980px, 100%); margin: 0 auto; padding: 8px var(--gutter) 48px; text-align: center; }
.picker-name { font: 500 13px/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .18em; text-transform: uppercase; color: #8fa3ba; margin-bottom: 18px; }
.picker h1 { font-size: clamp(34px, 6vw, 64px); letter-spacing: -.035em; margin-bottom: clamp(28px, 5vh, 48px); }
.picker-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; text-align: left; }
.pick {
  display: flex; flex-direction: column; gap: 10px; padding: 14px 14px 22px; cursor: pointer; color: inherit; font: inherit;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px;
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), border-color .2s, background-color .2s;
}
.pick:hover, .pick:focus-visible { transform: translateY(-4px); background: rgba(255, 255, 255, .07); outline: none; }
.pick-pixel:hover, .pick-pixel:focus-visible { border-color: #7fa6ff; }
.pick-atlas:hover, .pick-atlas:focus-visible { border-color: #4c9aff; }
.pick-art { position: relative; display: block; height: 170px; border-radius: 8px; overflow: hidden; margin-bottom: 6px; }
.pick-pixel .pick-art { background: #3d6fe0; image-rendering: pixelated; }
.pick-sky {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, .55) 1.3px, transparent 1.6px), radial-gradient(circle, rgba(255, 255, 255, .25) 1.3px, transparent 1.6px);
  background-size: 8px 8px, 8px 8px; background-position: 0 0, 4px 4px;
  -webkit-mask-image: radial-gradient(60% 50% at 30% 40%, #000 30%, transparent 70%), radial-gradient(50% 40% at 75% 65%, #000 30%, transparent 70%);
  mask-image: radial-gradient(60% 50% at 30% 40%, #000 30%, transparent 70%), radial-gradient(50% 40% at 75% 65%, #000 30%, transparent 70%);
  animation: drift 12s linear infinite;
}
@keyframes drift { to { background-position: 64px 0, 68px 4px; } }
.pick-sun { position: absolute; right: 18%; top: 18%; width: 28px; height: 28px; background: #fffbe8; clip-path: polygon(25% 0, 75% 0, 75% 12%, 88% 12%, 88% 25%, 100% 25%, 100% 75%, 88% 75%, 88% 88%, 75% 88%, 75% 100%, 25% 100%, 25% 88%, 12% 88%, 12% 75%, 0 75%, 0 25%, 12% 25%, 12% 12%, 25% 12%); }
.pick-grass { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; background: repeating-linear-gradient(90deg, #4fae3a 0 4px, #63c34a 4px 8px, #3c8f2b 8px 12px); clip-path: polygon(0 40%, 4% 0, 8% 45%, 13% 10%, 18% 50%, 24% 5%, 30% 40%, 36% 15%, 42% 50%, 49% 0, 55% 45%, 62% 10%, 68% 40%, 75% 5%, 82% 45%, 88% 15%, 94% 40%, 100% 10%, 100% 100%, 0 100%); }
.pick-atlas .pick-art { background: #0d131a; border: 1px solid #1e2731; }
.pick-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.pick-scan { position: absolute; top: 0; bottom: 0; width: 30%; background: linear-gradient(90deg, transparent, rgba(76, 154, 255, .22), transparent); animation: scan 3.2s ease-in-out infinite; }
@keyframes scan { from { left: -30%; } to { left: 100%; } }
.pick-name { font: 600 15px/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .16em; padding: 0 6px; }
.pick-pixel .pick-name { font-family: var(--pixel); letter-spacing: .08em; }
.pick-desc { color: #a8b6c6; font-size: 15px; line-height: 1.5; padding: 0 6px; }
.picker-hint { margin-top: 26px; color: #8fa3ba; font-size: 14px; }
@media (max-width: 640px) {
  .picker-cards { grid-template-columns: 1fr; }
  .pick-art { height: 120px; }
}
[data-picker] body { overflow: hidden; }

/* toasts in ATLAS */
[data-skin="atlas"] .toast {
  clip-path: none; border-radius: 6px; background: #121922; box-shadow: 0 0 0 1px #263241, 0 12px 30px rgba(0, 0, 0, .45);
  font-family: Inter, system-ui, sans-serif; animation: atlas-toast .3s cubic-bezier(.2, .8, .2, 1) both;
}
[data-skin="atlas"] .toast.out { animation: atlas-toast-out .3s ease both; }
[data-skin="atlas"] .toast strong { font: 600 11px/1.3 "JetBrains Mono", monospace; letter-spacing: .12em; color: #f5a524; }
[data-skin="atlas"] .toast-icon { background: rgba(245, 165, 36, .12); border-radius: 4px; }
[data-skin="atlas"] .toasts { top: 64px; bottom: auto; align-content: start; }
@media (max-width: 900px) {
  [data-skin="atlas"] .toasts { top: auto; bottom: calc(76px + env(safe-area-inset-bottom)); left: 12px; right: 12px; align-content: end; }
}
@keyframes atlas-toast { from { opacity: 0; transform: translateY(-8px); } }
@keyframes atlas-toast-out { to { opacity: 0; transform: translateY(-8px); } }


/* =========================================================
   Pixel-corner outlines: a ring that follows the stepped corners,
   so outlines no longer stop short of the corners.
   ========================================================= */
.project, .chest, .tool, .quest-card, .btn-ghost, .pbtn, .toast { position: relative; --rw: 0px; --ring: transparent; }
.project::after, .chest::after, .tool::after, .quest-card::after, .btn-ghost::after, .pbtn::after, .toast::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: var(--ring); transition: background-color .25s;
  clip-path: polygon(evenodd, calc(0px) calc(var(--n) * 2), calc(var(--n) * 1) calc(var(--n) * 2), calc(var(--n) * 1) calc(var(--n) * 1), calc(var(--n) * 2) calc(var(--n) * 1), calc(var(--n) * 2) calc(0px), calc(100% - (var(--n) * 2)) calc(0px), calc(100% - (var(--n) * 2)) calc(var(--n) * 1), calc(100% - (var(--n) * 1)) calc(var(--n) * 1), calc(100% - (var(--n) * 1)) calc(var(--n) * 2), calc(100% - (0px)) calc(var(--n) * 2), calc(100% - (0px)) calc(100% - (var(--n) * 2)), calc(100% - (var(--n) * 1)) calc(100% - (var(--n) * 2)), calc(100% - (var(--n) * 1)) calc(100% - (var(--n) * 1)), calc(100% - (var(--n) * 2)) calc(100% - (var(--n) * 1)), calc(100% - (var(--n) * 2)) calc(100% - (0px)), calc(var(--n) * 2) calc(100% - (0px)), calc(var(--n) * 2) calc(100% - (var(--n) * 1)), calc(var(--n) * 1) calc(100% - (var(--n) * 1)), calc(var(--n) * 1) calc(100% - (var(--n) * 2)), calc(0px) calc(100% - (var(--n) * 2)), calc(0px) calc(var(--n) * 2), calc(0px + var(--rw)) calc(var(--n) * 2 + var(--rw)), calc(var(--n) * 1 + var(--rw)) calc(var(--n) * 2 + var(--rw)), calc(var(--n) * 1 + var(--rw)) calc(var(--n) * 1 + var(--rw)), calc(var(--n) * 2 + var(--rw)) calc(var(--n) * 1 + var(--rw)), calc(var(--n) * 2 + var(--rw)) calc(0px + var(--rw)), calc(100% - (var(--n) * 2 + var(--rw))) calc(0px + var(--rw)), calc(100% - (var(--n) * 2 + var(--rw))) calc(var(--n) * 1 + var(--rw)), calc(100% - (var(--n) * 1 + var(--rw))) calc(var(--n) * 1 + var(--rw)), calc(100% - (var(--n) * 1 + var(--rw))) calc(var(--n) * 2 + var(--rw)), calc(100% - (0px + var(--rw))) calc(var(--n) * 2 + var(--rw)), calc(100% - (0px + var(--rw))) calc(100% - (var(--n) * 2 + var(--rw))), calc(100% - (var(--n) * 1 + var(--rw))) calc(100% - (var(--n) * 2 + var(--rw))), calc(100% - (var(--n) * 1 + var(--rw))) calc(100% - (var(--n) * 1 + var(--rw))), calc(100% - (var(--n) * 2 + var(--rw))) calc(100% - (var(--n) * 1 + var(--rw))), calc(100% - (var(--n) * 2 + var(--rw))) calc(100% - (0px + var(--rw))), calc(var(--n) * 2 + var(--rw)) calc(100% - (0px + var(--rw))), calc(var(--n) * 2 + var(--rw)) calc(100% - (var(--n) * 1 + var(--rw))), calc(var(--n) * 1 + var(--rw)) calc(100% - (var(--n) * 1 + var(--rw))), calc(var(--n) * 1 + var(--rw)) calc(100% - (var(--n) * 2 + var(--rw))), calc(0px + var(--rw)) calc(100% - (var(--n) * 2 + var(--rw))), calc(0px + var(--rw)) calc(var(--n) * 2 + var(--rw)));
}
.project { box-shadow: inset 0 2px 0 var(--panel-hi); --rw: 1px; --ring: color-mix(in srgb, var(--acc) 30%, transparent); }
.project:hover { box-shadow: inset 0 2px 0 var(--panel-hi); --rw: 2px; --ring: color-mix(in srgb, var(--acc) 80%, transparent); }
.tool:hover { box-shadow: inset 0 2px 0 var(--panel-hi); --rw: 2px; --ring: rgba(255, 255, 255, .4); }
.quest.gold .quest-card { box-shadow: none; --rw: 2px; --ring: var(--gold); }
.quest.next .quest-card { box-shadow: none; --rw: 2px; --ring: var(--line); }
.chest:hover { box-shadow: inset 0 2px 0 var(--panel-hi); --rw: 2px; --ring: rgba(247, 201, 72, .6); }
.chest.open { box-shadow: inset 0 2px 0 var(--panel-hi); --rw: 2px; --ring: var(--gold); }
.btn-ghost { box-shadow: none; --rw: 2px; --ring: var(--line); }
.pbtn { box-shadow: none; --rw: 1px; --ring: var(--line); }
.pbtn.main { --ring: transparent; }
.toast { box-shadow: none; --rw: 2px; --ring: rgba(255, 255, 255, .16); }
[data-skin="atlas"] .toast::after { display: none; }

/* longer headline words in Polish and French ("międzynarodowych", "internationales") */
:lang(pl) .hero-title, :lang(fr) .hero-title { font-size: clamp(30px, 8vw, 100px); max-width: 15ch; }
