/* ==========================================================================
   Wiktor Oczkoś — personal site
   Contents: fonts, tokens, base, backdrop, glass, nav, buttons, hero bento,
   flow diagram, sections, experience, projects, services, toolkit, contact,
   footer, motion, responsive
   ========================================================================== */

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../fonts/bricolage-grotesque-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/instrument-sans-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;

  --r-tile: 28px;
  --r-inner: 16px;
  --gap: 14px;
  --pad: clamp(20px, 2.2vw, 30px);
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* Dark: a lake at night */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #04121a;
  --bg-hi: #0a2836;
  --ink: #eaf6f8;
  --ink-2: #b1cad1;
  --ink-3: #86a3ac;
  --teal: #45e0cf;
  --blue: #74bcff;
  --ice: #d7f6ff;
  --glass-a: rgba(196, 238, 255, .105);
  --glass-b: rgba(196, 238, 255, .035);
  --glass-solid: rgba(12, 38, 50, .92);
  --rim-a: rgba(255, 255, 255, .42);
  --rim-b: rgba(255, 255, 255, .05);
  --line: rgba(215, 246, 255, .2);
  --chip: rgba(215, 246, 255, .07);
  --shadow: 0 34px 60px -34px rgba(0, 6, 10, .9);
  --glow: rgba(69, 224, 207, .16);
  --btn-bg: linear-gradient(120deg, #45e0cf, #74bcff);
  --btn-ink: #04121a;
  --blob-a: rgba(41, 196, 190, .42);
  --blob-b: rgba(58, 132, 232, .40);
  --blob-c: rgba(160, 232, 255, .16);
  --contour: rgba(140, 224, 236, .16);
  --nav-bg: rgba(6, 28, 38, .74);
  --task: #12313d;
}

/* Light: the same lake under morning haze */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #dfecf0;
  --bg-hi: #f3f9fa;
  --ink: #06212b;
  --ink-2: #2f4d57;
  --ink-3: #48646d;
  --teal: #087a72;
  --blue: #1763bd;
  --ice: #0a4e63;
  --glass-a: rgba(255, 255, 255, .72);
  --glass-b: rgba(255, 255, 255, .36);
  --glass-solid: rgba(244, 250, 251, .95);
  --rim-a: rgba(255, 255, 255, 1);
  --rim-b: rgba(255, 255, 255, .35);
  --line: rgba(6, 33, 43, .18);
  --chip: rgba(6, 60, 76, .065);
  --shadow: 0 30px 50px -34px rgba(9, 62, 82, .55);
  --glow: rgba(23, 160, 190, .16);
  --btn-bg: linear-gradient(120deg, #087a72, #1763bd);
  --btn-ink: #ffffff;
  --blob-a: rgba(64, 205, 196, .55);
  --blob-b: rgba(96, 164, 240, .50);
  --blob-c: rgba(255, 255, 255, .8);
  --contour: rgba(9, 92, 112, .13);
  --nav-bg: rgba(238, 247, 249, .8);
  --task: #f1f8fa;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--teal); color: var(--btn-ink); }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 8px; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 12px;
  background: var(--glass-solid); color: var(--ink); text-decoration: none;
}
.skip:focus { top: 16px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

/* ---------- Backdrop ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% -10%, var(--bg-hi), transparent 60%),
    var(--bg);
}
.blob {
  position: absolute; border-radius: 50%;
  will-change: transform;
}
.blob-a {
  width: 62vmax; height: 62vmax; left: -18vmax; top: -22vmax;
  background: radial-gradient(closest-side, var(--blob-a), transparent);
  animation: drift-a 34s ease-in-out infinite alternate;
}
.blob-b {
  width: 56vmax; height: 56vmax; right: -16vmax; top: 18vh;
  background: radial-gradient(closest-side, var(--blob-b), transparent);
  animation: drift-b 42s ease-in-out infinite alternate;
}
.blob-c {
  width: 40vmax; height: 40vmax; left: 28vw; bottom: -20vmax;
  background: radial-gradient(closest-side, var(--blob-c), transparent);
  animation: drift-c 38s ease-in-out infinite alternate;
}
.contours {
  position: absolute; inset: 0;
  background: var(--contour);
  -webkit-mask: url("../img/contours.svg") center / cover no-repeat;
          mask: url("../img/contours.svg") center / cover no-repeat;
}
@keyframes drift-a { to { transform: translate(14vw, 12vh) scale(1.12); } }
@keyframes drift-b { to { transform: translate(-16vw, -10vh) scale(.9); } }
@keyframes drift-c { to { transform: translate(-10vw, -14vh) scale(1.2); } }

/* ---------- Glass ---------- */
.glass {
  position: relative; isolation: isolate;
  border-radius: var(--r-tile);
  background: linear-gradient(140deg, var(--glass-a), var(--glass-b));
  -webkit-backdrop-filter: blur(26px) saturate(170%);
          backdrop-filter: blur(26px) saturate(170%);
  box-shadow: var(--shadow), inset 0 1px 0 var(--rim-b);
}
/* rim light: a bright edge top-left that fades out, like a pane catching the sky */
.glass::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  border-radius: inherit; padding: 1px;
  background: linear-gradient(140deg, var(--rim-a), var(--rim-b) 38%, var(--rim-b) 62%, color-mix(in srgb, var(--rim-a) 55%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
/* pointer glow */
.glass[data-glow]::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 0%), var(--glow), transparent 65%);
  opacity: 0; transition: opacity .35s var(--ease);
}
.glass[data-glow]:hover::before { opacity: 1; }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--glass-solid); }
}

/* ---------- Nav ---------- */
.nav-wrap {
  position: sticky; top: 0; z-index: 50;
  padding: 14px var(--gutter) 0;
}
.nav {
  width: min(100%, var(--wrap)); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 8px 8px 10px;
  border-radius: 999px;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
          backdrop-filter: blur(30px) saturate(170%);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; letter-spacing: -.01em;
  text-decoration: none; padding-right: 8px; white-space: nowrap;
}
.brand img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.nav-links { display: flex; gap: 2px; }
.nav-links a {
  display: block; padding: 8px 14px; border-radius: 999px;
  font-size: .95rem; color: var(--ink-2); text-decoration: none;
  transition: color .2s, background-color .2s;
}
.nav-links a:hover, .nav-links a[aria-current="true"] { color: var(--ink); background: var(--chip); }
.nav-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: 50%; background: var(--chip); cursor: pointer;
  transition: background-color .2s, transform .2s var(--ease);
}
.icon-btn:hover { background: color-mix(in srgb, var(--chip), var(--ink) 8%); }
.icon-btn svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"] .i-moon, [data-theme="light"] .i-sun { display: none; }
.nav-menu { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px;
  border: 0; border-radius: 999px; cursor: pointer;
  font-weight: 600; font-size: .98rem; text-decoration: none; white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .2s, background-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: .92rem; }
.btn-primary {
  background: var(--btn-bg); color: var(--btn-ink);
  box-shadow: 0 10px 28px -12px var(--teal), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.btn-glass {
  background: var(--chip); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 var(--rim-b);
}
.btn-glass:hover { background: color-mix(in srgb, var(--chip), var(--ink) 7%); }
.btn-ghost { background: transparent; color: var(--ink-2); padding-inline: 14px; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 5px; }
.btn-ghost:hover { color: var(--ink); text-decoration-color: currentColor; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Shared tile pieces ---------- */
.tile { padding: var(--pad); overflow: hidden; display: flex; flex-direction: column; }
.tile-label, .tag { font-size: .88rem; color: var(--ink-3); font-weight: 500; }
.tile-title {
  font-family: var(--font-display); font-weight: 600; font-size: 1.22rem;
  line-height: 1.15; letter-spacing: -.02em;
}
.tile-note { font-size: .92rem; line-height: 1.45; color: var(--ink-2); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips li {
  padding: 5px 12px; border-radius: 999px;
  background: var(--chip); box-shadow: inset 0 0 0 1px var(--line);
  font-size: .86rem; color: var(--ink-2); white-space: nowrap;
}

/* ---------- Hero bento ---------- */
.hero { padding-top: clamp(18px, 3vw, 34px); }
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }

.t-intro { grid-column: 1 / 8; grid-row: 1 / 3; padding: clamp(24px, 3vw, 44px); justify-content: flex-end; min-height: 440px; }
.t-photo { grid-column: 8 / 11; grid-row: 1 / 3; padding: 0; }
.t-time  { grid-column: 11 / 13; grid-row: 1; }
.t-lang  { grid-column: 11 / 13; grid-row: 2; }
.t-flow  { grid-column: 1 / 8; grid-row: 3; }
.t-award { grid-column: 8 / 11; grid-row: 3; }
.t-study { grid-column: 11 / 13; grid-row: 3; }

.status {
  display: inline-flex; align-items: center; gap: 10px; align-self: flex-start;
  margin-bottom: auto;
  padding: 7px 14px 7px 12px; border-radius: 999px;
  background: var(--chip); box-shadow: inset 0 0 0 1px var(--line);
  font-size: .9rem; color: var(--ink-2);
}
.dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); flex: none; }
.dot::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 1px solid var(--teal); opacity: 0;
  animation: ping 2.6s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(.5); opacity: .8; } 80%, 100% { transform: scale(1.5); opacity: 0; } }

h1 {
  margin-top: 28px;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(3rem, 7.4vw, 6.1rem);
  line-height: .9; letter-spacing: -.045em;
  text-wrap: balance;
}
.lead {
  margin-top: 18px;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.2; letter-spacing: -.02em;
  color: var(--teal);
}
.intro-copy { margin-top: 14px; max-width: 58ch; color: var(--ink-2); }
.t-intro .actions { margin-top: 26px; }

.t-photo picture, .t-photo img { position: absolute; inset: 0; width: 100%; height: 100%; }
.t-photo img { object-fit: cover; object-position: 50% 22%; border-radius: inherit; }
/* a soft sheen so the photo sits under the same glass as the other tiles */
.t-photo::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit;
  background: linear-gradient(150deg, rgba(255, 255, 255, .16), transparent 32%), linear-gradient(to top, rgba(4, 18, 26, .45), transparent 40%);
}

.t-time { justify-content: space-between; gap: 10px; }
.clock {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.2rem, 3.4vw, 3rem); line-height: 1; letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}

.t-lang { gap: 14px; }
.langs { display: grid; gap: 11px; }
.langs li { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; row-gap: 5px; font-size: .92rem; }
.lvl { color: var(--ink-3); font-size: .86rem; }
/* six CEFR steps, A1 to C2; filled steps show the level */
.meter {
  grid-column: 1 / -1; height: 4px;
  background: linear-gradient(90deg, var(--teal) calc(var(--n) / 6 * 100%), var(--line) 0);
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 calc(100% / 6 - 3px), transparent calc(100% / 6 - 3px) calc(100% / 6));
          mask: repeating-linear-gradient(90deg, #000 0 calc(100% / 6 - 3px), transparent calc(100% / 6 - 3px) calc(100% / 6));
}

.t-flow { gap: 18px; justify-content: space-between; }
.t-award { gap: 10px; justify-content: flex-end; }
.award-mark { fill: none; stroke: var(--teal); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; margin-bottom: auto; }
.t-study { gap: 8px; justify-content: flex-end; }
.t-study .tile-label { margin-bottom: auto; }

/* ---------- Flow diagram ---------- */
.flow { width: 100%; height: auto; overflow: visible; }
.flow-tall { display: none; max-width: 300px; margin-inline: auto; }
.flow .links path { fill: none; stroke: var(--line); stroke-width: 1.5; }
.flow .links .loop { stroke-dasharray: 4 5; }
.flow .arrow { fill: var(--ink-3); }
.flow .task { fill: var(--task); stroke: var(--line); stroke-width: 1.2; }
.flow .gate { fill: color-mix(in srgb, var(--teal) 16%, transparent); stroke: var(--teal); stroke-width: 1.4; stroke-linejoin: round; }
.flow .ev { fill: none; stroke: var(--teal); stroke-width: 1.6; }
.flow .ev-end { stroke-width: 4; }
.flow text { fill: var(--ink); font-family: var(--font-body); font-size: 14.5px; font-weight: 500; }
.flow .notes text { fill: var(--ink-3); font-size: 13.5px; font-weight: 400; }
.flow .token { fill: var(--teal); filter: drop-shadow(0 0 6px var(--teal)); opacity: 0; }

/* ---------- Sections ---------- */
.section { padding-top: clamp(84px, 11vw, 150px); }
.section-head { max-width: 760px; margin-bottom: clamp(24px, 3.4vw, 44px); }
.section-head h2, .contact h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.1rem, 4.6vw, 3.6rem); line-height: 1; letter-spacing: -.04em;
  text-wrap: balance;
}
.section-head p { margin-top: 14px; color: var(--ink-2); font-size: 1.1rem; max-width: 56ch; }

.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.grid-12 h3, .services h3 {
  font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; line-height: 1.15; letter-spacing: -.02em;
}

/* ---------- Experience ---------- */
.xp-list { display: grid; gap: var(--gap); }
.xp {
  display: grid; grid-template-columns: minmax(170px, 230px) minmax(0, 1fr);
  gap: clamp(18px, 4vw, 60px);
  padding: clamp(22px, 3vw, 40px);
}
.xp-dates { font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; line-height: 1.2; letter-spacing: -.02em; }
.xp-place, .xp-sector { margin-top: 6px; font-size: .92rem; color: var(--ink-3); }
.xp-sector { color: var(--teal); }
.xp-body h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.4rem, 2.3vw, 1.9rem); line-height: 1.1; letter-spacing: -.03em;
}
.xp-body .at { color: var(--ink-3); font-weight: 500; }
.xp-lede { margin-top: 12px; font-size: 1.1rem; line-height: 1.45; max-width: 62ch; }
.xp-body > ul:not(.chips) { margin-top: 18px; display: grid; gap: 9px; max-width: 72ch; }
.xp-body > ul:not(.chips) li { position: relative; padding-left: 20px; color: var(--ink-2); font-size: 1rem; }
.xp-body > ul:not(.chips) li::before {
  content: ""; position: absolute; left: 2px; top: .66em; width: 7px; height: 1.5px; background: var(--teal);
}
.xp-body .chips { margin-top: 22px; }

/* ---------- Projects ---------- */
.p-lego  { grid-column: span 7; gap: 12px; align-items: flex-start; min-height: 320px; }
.p-stock { grid-column: span 5; gap: 12px; }
.p-name  { grid-column: span 3; gap: 6px; min-height: 190px; justify-content: flex-end; }
.p-lego h3, .p-stock h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); letter-spacing: -.03em; }
.p-lego p:not(.tag):not(.tile-note), .p-stock p:not(.tag) { color: var(--ink-2); max-width: 54ch; }
.p-lego .btn { margin-top: auto; }
.p-stock .chips { margin-top: auto; padding-top: 10px; }
.p-lego > *:not(.brick) { position: relative; z-index: 1; }
.brick {
  position: absolute; right: -34px; bottom: -30px; width: 250px; z-index: 0;
  transform: rotate(-12deg); opacity: .55;
}
.brick .body, .brick .studs rect { fill: color-mix(in srgb, var(--teal) 12%, transparent); stroke: var(--teal); stroke-width: 1.2; stroke-opacity: .6; }

.p-name .tag { margin-bottom: auto; }
.p-name h3 { font-size: 1.5rem; }
.p-name h3[data-letter]::before {
  content: attr(data-letter);
  position: absolute; right: 8px; top: -34px; z-index: -1;
  font-family: var(--font-display); font-weight: 700; font-size: 11rem; line-height: 1; letter-spacing: -.06em;
  color: transparent; -webkit-text-stroke: 1px var(--line);
  pointer-events: none;
}

/* ---------- Services ---------- */
.services { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--gap); align-items: stretch; }
.service-list { display: grid; gap: var(--gap); }
.service {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 8px 28px; align-items: baseline;
  padding: clamp(20px, 2.4vw, 30px);
}
.service p { color: var(--ink-2); }
.ai-tile { gap: 14px; padding: clamp(24px, 3vw, 40px); justify-content: flex-end; }
.ai-tile .tag { margin-bottom: auto; }
.ai-tile h3 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); letter-spacing: -.04em; line-height: 1; }
.ai-tile p:not(.tag) { color: var(--ink-2); }
.ai-tile .chips { padding-top: 8px; }

/* ---------- Toolkit ---------- */
.k-a { grid-column: span 5; } .k-b { grid-column: span 4; } .k-c { grid-column: span 3; }
.k-d { grid-column: span 4; } .k-e { grid-column: span 5; } .k-f { grid-column: span 3; }
#toolkit .tile { gap: 16px; }
.edu { display: grid; gap: 14px; }
.edu dt { font-weight: 600; }
.edu dd { color: var(--ink-2); font-size: .95rem; }

/* ---------- Contact ---------- */
.contact { padding: clamp(28px, 6vw, 80px); overflow: hidden; }
.contact h2 { max-width: 14ch; }
.contact > p { margin-top: 16px; color: var(--ink-2); font-size: 1.1rem; max-width: 46ch; }
.contact .actions { margin-top: 30px; }
.copy-status { min-height: 1.5em; margin-top: 12px; font-size: .92rem; color: var(--teal); }

/* ---------- Footer ---------- */
.footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding-block: 40px 44px; font-size: .92rem; color: var(--ink-3);
}
.footer a { color: var(--ink-2); text-underline-offset: 4px; }

/* ---------- Motion ---------- */
.tile, .xp, .service { transition: transform .35s var(--ease); }
@media (hover: hover) {
  .tile[data-glow]:hover, .service:hover { transform: translateY(-3px); }
}

@media (prefers-reduced-motion: no-preference) {
  /* page load: the hero tiles settle in once, then the diagram draws itself */
  .js .bento > * { opacity: 0; transform: translateY(18px) scale(.985); animation: settle .7s var(--ease) forwards; }
  .js .bento > :nth-child(1) { animation-delay: .05s; }
  .js .bento > :nth-child(2) { animation-delay: .12s; }
  .js .bento > :nth-child(3) { animation-delay: .19s; }
  .js .bento > :nth-child(4) { animation-delay: .26s; }
  .js .bento > :nth-child(5) { animation-delay: .33s; }
  .js .bento > :nth-child(6) { animation-delay: .40s; }
  .js .bento > :nth-child(7) { animation-delay: .47s; }
  @keyframes settle { to { opacity: 1; transform: none; } }

  .js .flow [style*="--i"] { opacity: 0; animation: appear .45s var(--ease) forwards; animation-delay: calc(.9s + var(--i) * .11s); }
  @keyframes appear { to { opacity: 1; } }

  .flow-wide .token { animation: run-x 9s linear 3s infinite; }
  .flow-tall .token { animation: run-y 9s linear 3s infinite; }
  @keyframes run-x { 0% { transform: translateX(0); opacity: 0; } 4% { opacity: 1; } 92% { opacity: 1; } 100% { transform: translateX(713px); opacity: 0; } }
  @keyframes run-y { 0% { transform: translateY(0); opacity: 0; } 4% { opacity: 1; } 92% { opacity: 1; } 100% { transform: translateY(418px); opacity: 0; } }

  .js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
  .js .reveal.in { opacity: 1; transform: none; }
  @media (hover: hover) { .js .reveal.in.tile[data-glow]:hover, .js .reveal.in.service:hover { transform: translateY(-3px); transition-duration: .35s; } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .blob, .dot::after { animation: none; }
  .btn:hover, .tile[data-glow]:hover, .service:hover { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .t-intro { grid-column: 1 / 8; }
  .t-photo { grid-column: 8 / 13; grid-row: 1 / 3; }
  .t-time  { grid-column: 1 / 5; grid-row: 3; }
  .t-lang  { grid-column: 5 / 9; grid-row: 3; }
  .t-study { grid-column: 9 / 13; grid-row: 3; }
  .t-flow  { grid-column: 1 / 9; grid-row: 4; }
  .t-award { grid-column: 9 / 13; grid-row: 4; }
  .p-name { grid-column: span 6; }
  .k-a, .k-b, .k-d, .k-e { grid-column: span 6; }
  .k-c, .k-f { grid-column: span 6; }
}

@media (max-width: 900px) {
  .nav-links {
    position: absolute; top: calc(100% + 10px); left: 0; right: 0;
    display: none; flex-direction: column; gap: 2px; padding: 10px;
    border-radius: 24px; background: var(--glass-solid);
    box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 16px; font-size: 1.05rem; }
  .nav-menu { display: grid; }

  .t-intro { grid-column: 1 / -1; grid-row: auto; min-height: 0; }
  .t-photo { grid-column: 1 / 7; grid-row: span 2; min-height: 380px; }
  .t-time  { grid-column: 7 / 13; grid-row: auto; }
  .t-lang  { grid-column: 7 / 13; grid-row: auto; }
  .t-flow  { grid-column: 1 / -1; grid-row: auto; }
  .t-award { grid-column: 1 / 7; grid-row: auto; }
  .t-study { grid-column: 7 / 13; grid-row: auto; }
  .status { margin-bottom: 0; }

  .xp { grid-template-columns: 1fr; }
  .xp-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; }
  .xp-place, .xp-sector { margin-top: 0; }

  .p-lego, .p-stock { grid-column: 1 / -1; }
  .services { grid-template-columns: 1fr; }
  .service { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root { --r-tile: 24px; --gap: 12px; }
  body { font-size: 1rem; }
  .nav-cv { display: none; }
  .brand span { font-size: .98rem; }

  .t-photo { grid-column: 1 / -1; grid-row: auto; min-height: 0; aspect-ratio: 1 / 1.08; }
  .t-time, .t-study { grid-column: span 6; }
  .t-lang, .t-award { grid-column: 1 / -1; }
  .t-time { order: 1; } .t-study { order: 1; } .t-lang { order: 2; } .t-flow { order: 3; } .t-award { order: 4; }
  .flow-wide { display: none; }
  .flow-tall { display: block; }
  .t-flow { gap: 22px; }

  .p-name { grid-column: span 6; min-height: 160px; }
  .p-name h3 { font-size: 1.25rem; }
  .p-name h3[data-letter]::before { font-size: 8rem; top: -18px; }
  .k-a, .k-b, .k-c, .k-d, .k-e, .k-f { grid-column: 1 / -1; }
  .brick { width: 190px; opacity: .35; }
  .actions .btn { flex: 1 1 auto; }
  .actions .btn-ghost { flex: 0 0 auto; }
  .status { border-radius: 18px; font-size: .86rem; }
}

@media print {
  .backdrop, .nav-wrap, .footer a { display: none; }
  body { background: #fff; color: #000; }
  .glass { box-shadow: none; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .js .reveal, .js .bento > *, .js .flow [style*="--i"] { opacity: 1 !important; transform: none !important; animation: none !important; }
}
