/* ==========================================================================
   Portfolio styles
   Ported from the Claude Design project in design/ (Portfolio.html and
   components/*.jsx). Dark only, like the design. No inline styles anywhere:
   the CSP allows stylesheets from 'self' only, so per-item colours come from
   .tone-* classes (see lib/components/tone.dart).
   ========================================================================== */

@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/space-grotesk-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
  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: 'Space Grotesk';
  src: url('/fonts/space-grotesk-latin-ext.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, 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: 'JetBrains Mono';
  src: url('/fonts/jetbrains-mono-latin.woff2') format('woff2');
  font-weight: 400 600;
  font-display: swap;
  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: 'JetBrains Mono';
  src: url('/fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  font-weight: 400 600;
  font-display: swap;
  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;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: dark;

  --bg: #08080f;
  --app-bg: #07070f;
  --text: #f2f2f7;
  --text-2: rgb(255 255 255 / 0.7);
  --text-3: rgb(255 255 255 / 0.55);
  /* The faintest text allowed: small white text needs at least 46% opacity
     to reach WCAG AA (4.5:1) on the lightest part of the page background. */
  --text-4: rgb(255 255 255 / 0.5);
  --surface: rgb(255 255 255 / 0.04);
  --surface-2: rgb(255 255 255 / 0.07);
  --border: rgb(255 255 255 / 0.08);
  --border-soft: rgb(255 255 255 / 0.06);

  --accent-blue: oklch(0.68 0.15 230);
  --accent-teal: oklch(0.78 0.13 195);
  --accent-cyan: oklch(0.85 0.1 210);
  --accent-amber: oklch(0.82 0.16 75);
  --grad: linear-gradient(180deg, var(--accent-blue) 0%, var(--accent-teal) 70%, var(--accent-cyan) 100%);

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);

  --tone: var(--accent-blue);
}

.tone-blue {
  --tone: oklch(0.75 0.15 250);
}
.tone-indigo {
  --tone: oklch(0.7 0.17 255);
}
.tone-green {
  --tone: oklch(0.78 0.17 155);
}
.tone-rose {
  --tone: oklch(0.72 0.17 15);
}
.tone-amber {
  --tone: oklch(0.8 0.16 75);
}
.tone-cyan {
  --tone: oklch(0.82 0.12 205);
}
.tone-teal {
  --tone: oklch(0.78 0.13 195);
}
.tone-violet {
  --tone: oklch(0.8 0.12 280);
}
.tone-slate {
  --tone: oklch(0.4 0.04 280);
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 85% 35%, oklch(0.35 0.14 210 / 0.45), transparent 60%),
    radial-gradient(ellipse 70% 60% at 15% 70%, oklch(0.32 0.13 230 / 0.35), transparent 55%),
    radial-gradient(ellipse 50% 40% at 50% 0%, oklch(0.38 0.1 200 / 0.25), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-display);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Subtle noise over the whole page. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.5;
  mix-blend-mode: overlay;
  pointer-events: none;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

strong {
  color: #fff;
  font-weight: 600;
}

::selection {
  background: oklch(0.7 0.15 215 / 0.4);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background: rgb(255 255 255 / 0.15);
}

[hidden] {
  display: none !important;
}

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

.icon {
  display: inline-flex;
  flex-shrink: 0;
}

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 50;
  padding: 10px 16px;
  border-radius: 12px;
  background: #fff;
  color: var(--bg);
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* Small monospace caption, used for section labels. */
.label {
  margin-bottom: 10px;
  color: var(--text-4);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 14px;
  background: var(--surface);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  transition:
    transform 150ms ease,
    background-color 150ms ease;
}

.button:hover {
  background: var(--surface-2);
  transform: translateY(-1px);
}

/* The design's gradient (lightness 0.62 to 0.55) is too light for the white
   label; this one keeps 4.5:1 across the whole button, also on hover. */
.button--primary {
  border-color: transparent;
  background: linear-gradient(135deg, oklch(0.52 0.15 230), oklch(0.46 0.13 210));
  box-shadow:
    0 12px 30px -10px oklch(0.55 0.15 220 / 0.55),
    inset 0 1px 0 rgb(255 255 255 / 0.2);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.button--primary:hover {
  background: linear-gradient(135deg, oklch(0.54 0.15 230), oklch(0.49 0.13 210));
}

/* ---------- Layout ---------- */

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(24px, 6vw, 80px);
  max-width: 1440px;
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 72px) clamp(24px, 6vw, 80px);
}

.shell__phone {
  position: sticky;
  top: 40px;
  display: flex;
  justify-content: center;
  min-width: 0;
  /* Links to `#phone` keep the phone in view on narrow screens. Here it is
     beside the hero, so the margin clamps their scroll to the top. */
  scroll-margin-top: 100vh;
}

.shell__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  grid-column: 1 / -1;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-4);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.shell__footer a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Hero ---------- */

.hero {
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
  max-width: 540px;
}

.lang-switch {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 6px;
  color: var(--text-4);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lang-switch__current {
  color: var(--text);
}

.lang-switch__link {
  color: var(--text-4);
  transition: color 150ms ease;
}

.lang-switch__link:hover {
  color: var(--text-2);
}

.hero__status {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero__status-dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-amber);
  box-shadow: 0 0 10px var(--accent-amber);
}

.hero__name {
  font-size: clamp(56px, 8.5vw, 108px);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.hero__first,
.hero__last {
  display: block;
}

.hero__first {
  color: #fff;
}

/* Keeps descenders ("y") from being clipped by background-clip: text. */
.hero__last {
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.hero__tagline {
  max-width: 440px;
  color: var(--text-2);
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.55;
  text-wrap: pretty;
}

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

.hero__divider {
  width: 360px;
  max-width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgb(255 255 255 / 0.14), transparent);
}

.stack .label {
  margin-bottom: 14px;
  letter-spacing: 0.18em;
}

.stack__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stack__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 56px;
}

.stack__glyph {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--surface-2);
  border-radius: 10px;
  background: var(--surface);
}

.stack__glyph svg {
  display: block;
}

.stack__label {
  color: rgb(255 255 255 / 0.5);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.hero__hint {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-4);
  font-family: var(--font-mono);
  font-size: 11px;
}

.hero__hint-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-teal);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

/* ---------- Phone ---------- */

.phone {
  position: relative;
  width: 352px;
  max-width: 100%;
  height: 720px;
  padding: 10px;
  border-radius: 56px;
  background: linear-gradient(145deg, #1c1c24 0%, #0a0a10 55%, #14141c 100%);
  box-shadow:
    0 0 0 1.5px rgb(255 255 255 / 0.08) inset,
    0 0 0 2px #000,
    0 30px 80px -20px rgb(0 0 0 / 0.8),
    0 60px 120px -40px oklch(0.5 0.2 280 / 0.35),
    inset 0 0 60px rgb(120 100 200 / 0.04);
}

.phone__button {
  position: absolute;
  left: -2px;
  width: 3px;
  border-radius: 2px 0 0 2px;
  background: linear-gradient(90deg, #000, #2a2a34);
}

.phone__button--left-1 {
  top: 110px;
  height: 30px;
}

.phone__button--left-2 {
  top: 170px;
  height: 55px;
}

.phone__button--left-3 {
  top: 240px;
  height: 55px;
}

.phone__button--right {
  top: 190px;
  right: -2px;
  left: auto;
  height: 80px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(270deg, #000, #2a2a34);
}

.phone__display {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 46px;
  background: #000;
}

/* Sensor pill: slim, deliberately not the iOS shape. */
.phone__sensor {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 96px;
  height: 30px;
  padding-right: 10px;
  border-radius: 18px;
  background: #000;
  transform: translateX(-50%);
}

.phone__sensor span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #4a5a8a, #080818);
  box-shadow: 0 0 4px rgb(120 160 255 / 0.4);
}

.phone__status {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 6px 26px 0 28px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
  pointer-events: none;
}

.phone__status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
}

.phone__screen {
  position: absolute;
  inset: 44px 0 0;
  overflow: hidden;
}

/* A 32px tap area along the bottom edge with the bar drawn inside it. */
.phone__indicator {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 25;
  height: 32px;
}

span.phone__indicator {
  pointer-events: none;
}

.phone__indicator::after {
  content: '';
  position: absolute;
  bottom: 9px;
  left: 50%;
  width: 120px;
  height: 4px;
  border-radius: 3px;
  background: rgb(255 255 255 / 0.5);
  transform: translateX(-50%);
}

/* ---------- Home screen ---------- */

.home {
  position: relative;
  height: 100%;
  overflow: hidden;
  padding-top: 60px;
  background:
    radial-gradient(ellipse 60% 40% at 20% 15%, oklch(0.35 0.14 215 / 0.7), transparent 60%),
    radial-gradient(ellipse 70% 50% at 85% 80%, oklch(0.3 0.13 230 / 0.7), transparent 60%),
    radial-gradient(ellipse 50% 40% at 60% 45%, oklch(0.32 0.12 195 / 0.5), transparent 60%),
    linear-gradient(180deg, #0a1218 0%, #060e14 100%);
}

.home__waves {
  position: absolute;
  inset: 0;
  opacity: 0.18;
}

.home__waves svg {
  display: block;
}

.widget {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 20px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgb(255 255 255 / 0.06);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  animation: tile-in 600ms var(--ease-out) backwards;
}

.widget__main {
  min-width: 0;
}

.widget__caption {
  color: rgb(255 255 255 / 0.6);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.widget__title {
  margin-top: 2px;
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.widget__place {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 11px;
}

.widget__place .icon {
  color: oklch(0.72 0.17 15);
}

.widget__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  /* Never narrower than the label's longest word (e.g. "doświadczenia"). */
  min-width: min-content;
  max-width: 66px;
  text-align: right;
}

.widget__side .icon {
  color: var(--accent-amber);
}

.widget__value {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.widget__label {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.apps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  justify-items: center;
  row-gap: 22px;
  margin: 30px 22px 0;
}

.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  animation: tile-in 500ms var(--ease-out) backwards;
}

.app:nth-child(2) {
  animation-delay: 40ms;
}
.app:nth-child(3) {
  animation-delay: 80ms;
}
.app:nth-child(4) {
  animation-delay: 120ms;
}
.app:nth-child(5) {
  animation-delay: 160ms;
}
.app:nth-child(6) {
  animation-delay: 200ms;
}

.app__icon,
.dock__item {
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--from), var(--to));
  color: #fff;
  transition: transform 120ms;
}

.app__icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  box-shadow:
    0 8px 20px -6px var(--tint),
    inset 0 1px 0 rgb(255 255 255 / 0.15),
    inset 0 -1px 0 rgb(0 0 0 / 0.15);
}

.app:active .app__icon {
  transform: scale(0.92);
}

.app__label {
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 3px rgb(0 0 0 / 0.6);
}

.app--about {
  --from: #2a2a38;
  --to: #131320;
  --tint: rgb(100 120 200 / 0.3);
}
.app--projects {
  --from: oklch(0.68 0.15 230);
  --to: oklch(0.55 0.14 215);
  --tint: oklch(0.6 0.15 225 / 0.5);
}
.app--cv {
  --from: oklch(0.75 0.15 75);
  --to: oklch(0.6 0.2 40);
  --tint: oklch(0.65 0.2 55 / 0.5);
}
.app--contact {
  --from: oklch(0.78 0.17 155);
  --to: oklch(0.62 0.19 170);
  --tint: oklch(0.7 0.19 160 / 0.5);
}
.app--skills {
  --from: oklch(0.78 0.13 195);
  --to: oklch(0.58 0.13 210);
  --tint: oklch(0.65 0.14 200 / 0.5);
}
.app--github {
  --from: #2a2a38;
  --to: #0b0b14;
  --tint: rgb(255 255 255 / 0.1);
}

.dock {
  position: absolute;
  right: 16px;
  bottom: 28px;
  left: 16px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 76px;
  padding: 0 14px;
  border: 1px solid rgb(255 255 255 / 0.09);
  border-radius: 28px;
  background: rgb(255 255 255 / 0.08);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}

.dock__item {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  box-shadow:
    0 6px 16px -4px var(--tint),
    inset 0 1px 0 rgb(255 255 255 / 0.15);
}

.dock__item:active {
  transform: scale(0.9);
}

.dock__item--phone {
  --from: oklch(0.8 0.18 155);
  --to: oklch(0.6 0.2 160);
  --tint: oklch(0.7 0.2 160 / 0.4);
}
.dock__item--mail {
  --from: oklch(0.75 0.15 250);
  --to: oklch(0.55 0.22 260);
  --tint: oklch(0.6 0.2 255 / 0.4);
}
.dock__item--linkedin {
  --from: oklch(0.7 0.15 235);
  --to: oklch(0.48 0.18 245);
  --tint: oklch(0.55 0.18 240 / 0.4);
}
.dock__item--skills {
  --from: oklch(0.85 0.17 75);
  --to: oklch(0.65 0.2 55);
  --tint: oklch(0.75 0.2 65 / 0.4);
}

/* Entry animations replay on every document load, and the cross-document view
   transition below fades the new page in at the same time. Two nested opacity
   ramps multiply, which left the phone's screen all but empty for ~400ms in the
   middle of a navigation, so tile-in and app-in only move and scale: their
   content is painted at full opacity from the first frame. */
@keyframes tile-in {
  from {
    transform: translateY(12px) scale(0.9);
  }
}

/* ---------- App chrome ---------- */

.chrome {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--app-bg);
  animation: app-in 450ms var(--ease-out);
}

.chrome__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px 14px;
  border-bottom: 1px solid rgb(255 255 255 / 0.05);
}

.chrome__back {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 17px;
  background: rgb(255 255 255 / 0.08);
  transition: background-color 150ms;
}

.chrome__back:hover {
  background: rgb(255 255 255 / 0.14);
}

.chrome__titles {
  flex: 1;
  min-width: 0;
}

.chrome__subtitle {
  color: var(--tone);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.chrome__title {
  overflow: hidden;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Scroll padding keeps a focused item's ring in view and clear of the
   home-indicator bar when tabbing scrolls it into view. */
.chrome__body {
  flex: 1;
  overflow: hidden auto;
  overscroll-behavior: contain;
  padding: 18px 18px 44px;
  scroll-padding: 12px 0 40px;
}

/* The phone's screen clips anything outside the body, so the ring goes
   inside, following the display's rounded bottom corners. */
.chrome__body:focus-visible {
  outline-offset: -2px;
  border-radius: 0 0 46px 46px;
}

/* No opacity or blur here either, for the reason given above tile-in: both
   read as "the content has not loaded yet". */
@keyframes app-in {
  from {
    transform: scale(1.04);
  }
}

/* ---------- Shared app content ---------- */

.section {
  margin-top: 22px;
}

.prose {
  color: rgb(255 255 255 / 0.78);
  font-size: 13.5px;
  line-height: 1.6;
  text-wrap: pretty;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgb(255 255 255 / 0.06);
  font-family: var(--font-mono);
  font-size: 11px;
}

.actions {
  margin-top: 18px;
}

/* A faint link line closing a screen, e.g. Contact's link to the privacy
   policy. */
.screen-note {
  margin-top: 16px;
  color: var(--text-4);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.screen-note a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* 404: the same message once per language. */
.not-found + .not-found {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border-soft);
}

/* ---------- About ---------- */

.avatar {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 14px;
  border-radius: 20px;
  /* Dark enough for 3:1 behind the large initials. */
  background: linear-gradient(145deg, oklch(0.6 0.15 230), oklch(0.5 0.14 200));
  box-shadow: 0 10px 30px -10px oklch(0.55 0.22 285 / 0.6);
  font-size: 28px;
  font-weight: 700;
}

.profile__name {
  margin-bottom: 2px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.profile__role {
  margin-bottom: 18px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 13px;
}

.facts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.fact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgb(255 255 255 / 0.05);
  border-radius: 12px;
  background: var(--surface);
  font-size: 13px;
}

.fact .icon {
  color: var(--text-3);
}

.callout {
  margin-top: 20px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(135deg, oklch(0.3 0.13 215 / 0.4), oklch(0.25 0.12 200 / 0.25));
}

.callout__label {
  margin-bottom: 6px;
  color: oklch(0.78 0.12 290);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.callout__text {
  font-size: 14px;
  font-weight: 500;
}

.callout__text + .callout__text {
  margin-top: 6px;
}

.callout__accent {
  color: oklch(0.85 0.12 280);
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 24px;
}

.stat {
  display: flex;
  flex-direction: column;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: rgb(255 255 255 / 0.03);
}

.stat__value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.stat__label {
  margin-top: 2px;
  color: rgb(255 255 255 / 0.5);
  font-size: 11px;
  line-height: 1.35;
}

/* ---------- Projects ---------- */

.projects {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(150deg, color-mix(in oklch, var(--tone) 18%, transparent), rgb(255 255 255 / 0.02));
  scroll-margin-top: 12px;
  animation: app-in 400ms var(--ease-out) backwards;
}

.project:nth-child(2) {
  animation-delay: 40ms;
}
.project:nth-child(3) {
  animation-delay: 80ms;
}
.project:nth-child(4) {
  animation-delay: 120ms;
}
.project:nth-child(5) {
  animation-delay: 160ms;
}
.project:nth-child(n + 6) {
  animation-delay: 200ms;
}

.project__summary {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}

.project__summary::-webkit-details-marker {
  display: none;
}

.project__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--tone), color-mix(in oklch, var(--tone) 60%, transparent));
  box-shadow: 0 6px 16px -6px color-mix(in oklch, var(--tone) 50%, transparent);
  color: #fff;
}

.project__heading {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.project__client {
  color: var(--tone);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.project__name {
  margin-top: 1px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.project__period {
  margin-top: 2px;
  color: rgb(255 255 255 / 0.5);
  font-size: 11px;
}

.project__chevron {
  color: var(--text-4);
  transition: transform 200ms var(--ease-out);
}

.project[open] .project__chevron {
  transform: rotate(90deg);
}

.project__body {
  padding: 0 14px 16px;
  animation: slide-in 400ms var(--ease-out);
}

.project__body .label {
  margin-top: 16px;
}

.project__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.project__links li {
  display: flex;
  flex: 1;
}

.project__link {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--tone), color-mix(in oklch, var(--tone) 70%, transparent));
  box-shadow: 0 8px 18px -8px color-mix(in oklch, var(--tone) 60%, transparent);
  color: #0a0a10;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
}

/* ---------- CV ---------- */

.download {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(135deg, oklch(0.35 0.18 50 / 0.35), oklch(0.25 0.15 70 / 0.2));
}

.download__text {
  display: flex;
  flex-direction: column;
}

.download__title {
  font-size: 13px;
  font-weight: 600;
}

.download__meta {
  margin-top: 2px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
}

.download__button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 12px;
  background: oklch(0.8 0.16 75);
  color: #0a0a10;
  transition: transform 150ms;
}

.download:hover .download__button {
  transform: translateY(1px);
}

.download + .section {
  margin-top: 0;
}

.timeline__item {
  position: relative;
  padding: 0 0 18px 18px;
}

.timeline__item::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--tone);
  box-shadow: 0 0 12px var(--tone);
}

.timeline__item::after {
  content: '';
  position: absolute;
  top: 16px;
  bottom: 0;
  left: 4px;
  width: 1px;
  background: rgb(255 255 255 / 0.1);
}

.timeline__caption {
  color: var(--tone);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timeline__title {
  margin-top: 2px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.timeline__subtitle {
  margin-top: 1px;
  color: var(--text-3);
  font-size: 12px;
}

.timeline__highlights {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.timeline__highlights li {
  position: relative;
  padding-left: 12px;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.55;
  text-wrap: pretty;
}

.timeline__highlights li::before {
  content: '';
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.3);
}

.tiles {
  display: flex;
  gap: 10px;
}

.tile {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--surface);
}

.tile__title {
  font-size: 14px;
  font-weight: 600;
}

.tile__meta {
  margin-top: 2px;
  color: rgb(255 255 255 / 0.5);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* ---------- Contact ---------- */

.callout--intro {
  margin: 0 0 18px;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, oklch(0.35 0.18 160 / 0.35), oklch(0.25 0.15 180 / 0.15));
}

.callout__title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.callout__body {
  margin-top: 4px;
  color: rgb(255 255 255 / 0.65);
  font-size: 12.5px;
  line-height: 1.5;
}

.contacts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: var(--surface);
  transition: background-color 150ms;
}

a.contact:hover,
.contact:has(.reveal__button:hover, .reveal__link:hover) {
  background: var(--surface-2);
}

.contact__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--tone), color-mix(in oklch, var(--tone) 60%, transparent));
  color: #fff;
}

.contact__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.contact__label {
  color: rgb(255 255 255 / 0.45);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.contact__value {
  margin-top: 1px;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Phone and email reveal (lib/components/reveal.dart, web/reveal.js). The
   minimum height keeps the row from shifting when the script shows the
   button or swaps it for the link. A revealed value wraps rather than being
   cut off, since part of an address is no use. */
.reveal {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 22px;
}

.reveal__button {
  height: 22px;
  padding: 0 10px;
  border: 1px solid color-mix(in oklch, var(--tone) 45%, transparent);
  border-radius: 999px;
  background: color-mix(in oklch, var(--tone) 14%, transparent);
  color: #fff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.reveal__link {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* In a contact row the whole card is the target, like the linked rows. */
.contact--reveal .reveal__button::after,
.contact--reveal .reveal__link::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
}

/* So the focus ring goes around the card too. The value's overflow: hidden
   would clip a ring drawn around the button or link themselves. */
.contact--reveal:has(.reveal__button:focus-visible, .reveal__link:focus-visible) {
  outline: 2px solid var(--accent-teal);
  outline-offset: 3px;
}

.contact--reveal .reveal__button:focus-visible,
.contact--reveal .reveal__link:focus-visible {
  outline: none;
}

.copy {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: 0 -8px 0 -4px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--text-4);
  cursor: pointer;
  transition:
    color 150ms,
    background-color 150ms;
}

.copy:hover {
  background: var(--surface-2);
  color: var(--text-2);
}

.copy__done {
  display: none;
  color: oklch(0.78 0.17 155);
}

.copy[data-copied] .copy__idle {
  display: none;
}

.copy[data-copied] .copy__done {
  display: inline-flex;
}

/* ---------- Skills ---------- */

.skill-group + .skill-group {
  margin-top: 20px;
}

.skill-group__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--tone);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.skill-group__title::before {
  content: '';
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--tone);
  box-shadow: 0 0 8px var(--tone);
}

/* ---------- Document pages (lib/components/document_shell.dart) ---------- */

/* The privacy policy gets one readable column instead of the hero and phone.
   Doubling the class keeps these overrides ahead of the narrow-screen rules
   for `.shell` at the end of this file. */
.shell.shell--doc {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  align-items: start;
  gap: 0;
  max-width: 880px;
}

.doc__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.doc__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  transition: color 150ms;
}

.doc__back:hover {
  color: var(--text);
}

.doc {
  margin-top: clamp(32px, 6vw, 56px);
}

.doc__title {
  margin-top: 10px;
  font-size: clamp(30px, 5vw, 42px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.doc__updated {
  margin-top: 12px;
  color: var(--text-4);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

/* A measure of about 70 characters; the shell's max-width leaves room for it
   on wide screens. */
.doc__body {
  max-width: 68ch;
  margin-top: clamp(28px, 4vw, 40px);
  color: rgb(255 255 255 / 0.78);
  font-size: 15px;
  line-height: 1.7;
  text-wrap: pretty;
}

.doc__body h2 {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
  color: var(--text);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.doc__body > h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.doc__body h3 {
  margin-top: 26px;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.doc__body p,
.doc__body ul {
  margin-top: 14px;
}

.doc__body ul {
  padding-left: 18px;
  list-style: disc;
}

.doc__body li {
  margin-top: 8px;
}

.doc__body li::marker {
  color: var(--text-4);
}

.doc__body a {
  color: var(--accent-cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* The reveal button sits in the middle of a line here, not in a contact card
   (lib/components/reveal.dart). */
.doc__body .reveal {
  vertical-align: middle;
}

/* ---------- Page transitions ---------- */

/* Cross-document view transitions are off. With `navigation: auto` Chrome
   painted one fully white frame over the viewport at the start of every
   same-origin navigation on a 2x (Retina) display, then faded it out over the
   transition's 250ms: a hard white flash on a dark site. Measured 16/16
   navigations at deviceScaleFactor 2 and 0/16 at 1x, which is why it was easy
   to miss. Giving `::view-transition` an opaque background and dropping the
   UA's `plus-lighter` blending on the root snapshots both failed to fix it;
   turning the transition off fixed it every time. Without it the pages are
   already pre-rendered and cached, so a navigation just paints the next page. */
@view-transition {
  navigation: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after,
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Narrow screens: the phone stacks below the hero ---------- */

@media (max-width: 900px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }

  /* The phone keeps its place below the hero on every page; links into it
     go to `#phone`, so each app opens scrolled to the phone. */
  .shell__phone {
    position: static;
    scroll-margin-top: 24px;
  }

  .shell__footer {
    margin-top: 0;
  }

  .hero__hint .icon {
    transform: rotate(90deg);
  }
}
