/* Colors - edit here to change the theme */
:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #e2e2de;
  --accent: #0a8fc2;
  --accent-soft: #0a8fc21f;
  --green: #22a35a;
  --on-accent: #fff;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e1e20;
    --surface: #262629;
    --text: #ececec;
    --muted: #9b9ba0;
    --line: #36363a;
    --accent: #1cb8ec;
    --accent-soft: #1cb8ec26;
    --green: #3ccf7a;
    --on-accent: #0c1d24;
  }
}

/* Base - system fonts, so no font files must be loaded */
*, *::before, *::after { box-sizing: border-box; }

body {
  display: grid;
  grid-template-columns: 19rem 1fr;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

h1, h2, h3, p, ul, ol { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Sidebar - fixed next to the content, holds identity, menu and contact */
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100vh;
  padding: 3rem 1.5rem 1.5rem;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--line);
  text-align: center;
}

.portrait {
  width: 8rem;
  height: 8rem;
  margin-bottom: 1.25rem;
  border-radius: 50%;
  object-fit: cover;
  /* Draw the ring as a shadow. A rounded outline shows seams while it rotates. */
  box-shadow: 0 0 0 5px var(--surface), 0 0 0 7px var(--accent);
  transition: transform .4s ease;
}

.portrait:hover { transform: rotate(-6deg) scale(1.04); }

h1 { font-size: 1.4rem; line-height: 1.25; }
.role { color: var(--muted); font-size: .95rem; }

/* Freelance badge - the green dot pulses to show the status is current */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-top: .9rem;
  padding: .2rem .75rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: .8rem;
}

.badge::before {
  content: "";
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
  color: var(--green);
}

/* Location - small line with a pin icon below the role */
.location {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-top: .35rem;
  color: var(--muted);
  font-size: .85rem;
}

/* Contact - round icon buttons. The text stays in the HTML for screen readers. */
.contact {
  display: flex;
  gap: .6rem;
  margin-top: 1.1rem;
  padding: 0;
  list-style: none;
}

.contact a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 0;
  transition: transform .2s, background .2s, border-color .2s;
}

.contact a:hover { transform: translateY(-3px); background: var(--accent); border-color: var(--accent); }
.contact a:hover::before { background: var(--on-accent); }

/* Icons - each class i-* sets --icon. The icons are data URIs, so they also work when the page is opened from disk.
   Brand and menu icons: Font Awesome Free 5.12.1, CC BY 4.0, https://fontawesome.com/license/free */
.i-mail::before, .i-location::before, .i-github::before,
.i-linkedin::before, .i-home::before, .i-projects::before, .i-user::before {
  content: "";
  flex-shrink: 0;
  width: var(--size, 1rem);
  height: var(--size, 1rem);
  background: var(--accent);
  mask: var(--icon) center / contain no-repeat;
}

.i-mail { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath transform='matrix(1 0 0 -1 0 448)' d='M502.3 257.2C506.2 260.3 512 257.4 512 252.5V48C512 21.5 490.5 0 464 0H48C21.5 0 0 21.5 0 48V252.4C0 257.4 5.7 260.2000000000001 9.7 257.1C32.1 239.7 61.8 217.6 163.8 143.5C184.9 128.1 220.5 95.7 256 95.9C291.7 95.6 328 128.7 348.3 143.5C450.3 217.6 479.9 239.8 502.3 257.2zM256 128C279.2 127.6 312.6 157.2 329.4 169.4C462.1 265.7 472.2 274.1 502.8 298.1C508.6 302.6 511.9999999999999 309.6 511.9999999999999 317V336C511.9999999999999 362.5 490.4999999999999 384 463.9999999999999 384H48C21.5 384 0 362.5 0 336V317C0 309.6 3.4 302.7 9.2 298.1C39.8 274.2 49.9 265.7 182.6 169.4C199.4 157.2 232.8 127.6 256 128z'/%3E%3C/svg%3E"); }
.i-location { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath transform='matrix(1 0 0 -1 0 448)' d='M172.268 -53.67C26.97 156.969 0 178.587 0 256C0 362.039 85.961 448 192 448S384 362.039 384 256C384 178.587 357.03 156.969 211.732 -53.67C202.197 -67.444 181.802 -67.443 172.268 -53.67zM192 176C236.183 176 272 211.817 272 256S236.183 336 192 336S112 300.183 112 256S147.817 176 192 176z'/%3E%3C/svg%3E"); --size: .8rem; }
.i-github { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 496 512'%3E%3Cpath transform='matrix(1 0 0 -1 0 448)' d='M165.9 50.6C165.9 48.6 163.6 47 160.7 47C157.4 46.7 155.1 48.3 155.1 50.6C155.1 52.6 157.4 54.2 160.3 54.2C163.3 54.5000000000001 165.9 52.9 165.9 50.6zM134.8 55.1C134.1 53.1 136.1 50.8 139.1 50.2C141.7 49.2 144.7 50.2 145.3 52.2S144 56.5000000000001 141 57.4C138.4 58.1 135.5 57.1 134.8 55.1zM179 56.8C176.1 56.1 174.1 54.2 174.4 51.9C174.7 49.9 177.3 48.6 180.3 49.3C183.2 50 185.2 51.9 184.9 53.9C184.6 55.8 181.9 57.1 179 56.8zM244.8 440C106.1 440 0 334.7 0 196C0 85.1 69.8 -9.8 169.5 -43.2C182.3 -45.5 186.8 -37.6 186.8 -31.1C186.8 -24.9 186.5 9.3 186.5 30.3C186.5 30.3 116.5 15.3 101.8 60.1C101.8 60.1 90.4 89.2000000000001 74 96.7000000000001C74 96.7000000000001 51.1 112.4 75.6 112.1C75.6 112.1 100.5 110.1 114.2 86.3C136.1 47.7 172.8 58.8 187.1 65.4C189.4 81.4 195.9 92.5000000000001 203.1 99.1C147.2 105.3 90.8 113.4 90.8 209.6C90.8 237.1 98.4 250.9000000000001 114.4 268.5C111.8 275 103.3 301.8 117 336.4000000000001C137.9 342.9000000000001 186 309.4000000000001 186 309.4000000000001C206 315 227.5 317.9000000000001 248.8 317.9000000000001S291.6 315 311.6 309.4000000000001C311.6 309.4000000000001 359.7000000000001 343 380.6 336.4000000000001C394.3 301.7000000000001 385.8 275 383.2000000000001 268.5C399.2000000000001 250.8000000000001 409.0000000000001 237.0000000000001 409.0000000000001 209.6C409.0000000000001 113.1 350.1000000000001 105.4 294.2000000000001 99.1C303.4000000000001 91.2000000000001 311.2000000000001 76.2000000000001 311.2000000000001 52.7C311.2000000000001 19.0000000000001 310.9000000000001 -22.6999999999999 310.9000000000001 -30.9C310.9000000000001 -37.4 315.5000000000001 -45.3 328.2000000000001 -43C428.2 -9.8 496 85.1 496 196C496 334.7 383.5 440 244.8 440zM97.2 95.1C95.9 94.1 96.2 91.8 97.9 89.9C99.5 88.3 101.8 87.6 103.1 88.9C104.4 89.9 104.1 92.2000000000001 102.4 94.1C100.8 95.7000000000001 98.5 96.4 97.2 95.1zM86.4 103.2000000000001C85.7 101.9 86.7 100.3000000000001 88.7 99.3000000000001C90.3 98.3000000000001 92.3 98.6000000000001 93 100.0000000000001C93.7 101.3000000000001 92.7 102.9 90.7 103.9C88.7 104.5000000000001 87.1 104.2000000000001 86.4 103.2000000000001zM118.8 67.6C117.2 66.3 117.8 63.3 120.1 61.4C122.4 59.1 125.3 58.8 126.6 60.4C127.9 61.7000000000001 127.3 64.7000000000001 125.3 66.6C123.1 68.9 120.1 69.2000000000001 118.8 67.6zM107.4 82.3C105.8 81.3 105.8 78.7 107.4 76.4C109 74.1 111.7 73.1 113 74.1C114.6 75.4 114.6 78 113 80.3C111.6 82.6 109 83.6 107.4 82.3z'/%3E%3C/svg%3E"); }
.i-linkedin { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath transform='matrix(1 0 0 -1 0 448)' d='M100.3 -32H7.4V267.1H100.3V-32zM53.8 307.9C24.1 307.9 0 332.5 0 362.2C0 391.9 24.1 416 53.8 416C83.5 416 107.6 391.9 107.6 362.2C107.6 332.5 83.5 307.9 53.8 307.9zM448 -32H355.3V113.6C355.3 148.3 354.6 192.8 307 192.8C258.7 192.8 251.3 155.1 251.3 116.1V-32H158.5V267.1H247.6V226.3H248.9C261.3 249.8 291.6 274.6 336.8 274.6C430.8 274.6 448.1 212.7 448.1 132.3V-32z'/%3E%3C/svg%3E"); }
.i-home { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512'%3E%3Cpath transform='matrix(1 0 0 -1 0 448)' d='M488 135.3V-8C488 -21.3 477.3 -32 464 -32H348C341.4 -32 336 -26.6 336 -20V92C336 98.6 330.6 104 324 104H252C245.4 104 240 98.6 240 92V-20C240 -26.6 234.6 -32 228 -32H112C98.7 -32 88 -21.3 88 -8V135.3C88 138.9 89.6 142.3 92.4 144.6L280.4 299.4000000000001C284.8 303 291.2 303 295.7 299.4000000000001L483.7 144.6C486.4 142.3 488 138.9 488 135.3zM571.6 196.2L488 265.1V403.6C488 410.2 482.6 415.6 476 415.6H420C413.4 415.6 408 410.2 408 403.6V331L318.5 404.7C300.8 419.3 275.2 419.3 257.5 404.7L4.4 196.2C-0.7 192 -1.4 184.4 2.8 179.3L28.3 148.3C32.5 143.2 40.1 142.5 45.2 146.7L280.4 340.4C284.8 344 291.2 344 295.7 340.4L530.9 146.7C536 142.5 543.6 143.2 547.8 148.3L573.3 179.3C577.5 184.5 576.6999999999999 192 571.5999999999999 196.2z'/%3E%3C/svg%3E"); }
.i-user { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath transform='matrix(1 0 0 -1 0 448)' d='M224 192C294.7 192 352 249.3 352 320S294.7 448 224 448S96 390.7 96 320S153.3 192 224 192zM313.6 160H296.9000000000001C274.7000000000001 149.8 250.0000000000001 144 224 144S173.4 149.8 151.1 160H134.4C60.2 160 0 99.8 0 25.6V-16C0 -42.5 21.5 -64 48 -64H400C426.5 -64 448 -42.5 448 -16V25.6C448 99.8 387.8 160 313.6 160z'/%3E%3C/svg%3E"); }
.i-projects { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 512'%3E%3Cpath transform='matrix(1 0 0 -1 0 448)' d='M480 352H160C71.6 352 0 280.4 0 192S71.6 32 160 32C204.8 32 245.2 50.4 274.2 80H365.7C394.7 50.4 435.2 32 479.9 32C568.3 32 639.9 103.6 639.9 192S568.4 352 480 352zM256 172C256 165.4 250.6 160 244 160H192V108C192 101.4 186.6 96 180 96H140C133.4 96 128 101.4 128 108V160H76C69.4 160 64 165.4 64 172V212C64 218.6 69.4 224 76 224H128V276C128 282.6 133.4 288 140 288H180C186.6 288 192 282.6 192 276V224H244C250.6 224 256 218.6 256 212V172zM440 104C413.5 104 392 125.5 392 152S413.5 200 440 200S488 178.5 488 152S466.5 104 440 104zM520 184C493.5 184 472 205.5 472 232S493.5 280 520 280S568 258.5 568 232S546.5 184 520 184z'/%3E%3C/svg%3E"); }
.i-code { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m8 6-6 6 6 6M16 6l6 6-6 6M14 4l-4 16'/%3E%3C/svg%3E"); }
.i-bolt { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 2 4 14h7l-1 8 9-12h-7z'/%3E%3C/svg%3E"); }
.i-gamepad { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='6' width='20' height='12' rx='6'/%3E%3Cpath d='M6 12h4M8 10v4M15 11h.01M18 13h.01'/%3E%3C/svg%3E"); }
.i-chat { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a8 8 0 0 1-11.6 7.1L3 21l1.9-6.4A8 8 0 1 1 21 12z'/%3E%3Cpath d='M8 12h.01M12 12h.01M16 12h.01'/%3E%3C/svg%3E"); }
.i-tea { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9h13v5a5 5 0 0 1-5 5H9a5 5 0 0 1-5-5z'/%3E%3Cpath d='M17 11h1.5a2.5 2.5 0 0 1 0 5H17'/%3E%3Cpath d='M8 2.5c0 1.5 1 1.5 1 3M12 2.5c0 1.5 1 1.5 1 3'/%3E%3C/svg%3E"); }
.i-tv { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='7' width='20' height='14' rx='2'/%3E%3Cpath d='m7 2 5 5 5-5'/%3E%3C/svg%3E"); }

/* Menu - full-width rows with icon. An arrow slides in on hover. */
nav {
  display: grid;
  gap: .35rem;
  width: 100%;
  margin: 2.25rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

nav a {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .65rem 1rem;
  border-radius: .6rem;
  color: var(--text);
  font-weight: 500;
  transition: background .2s, color .2s;
}

/* Menu icons share one width, so the labels line up although the gamepad is wider */
nav a::before { width: 1.2rem; }

nav a::after {
  content: "→";
  margin-left: auto;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .2s, transform .2s;
}

nav a:hover { background: var(--accent-soft); text-decoration: none; }
nav a:hover::after { opacity: 1; transform: none; }

/* Mark the menu link of the visible page. Without a hash, the home page is visible. */
body:not(:has(.page:target, .page :target)) nav a[href="#home"],
body:has(#home:target) nav a[href="#home"],
body:has(#projects:target) nav a[href="#projects"],
body:has(#about:target) nav a[href="#about"] {
  background: var(--accent);
  color: var(--on-accent);
}

body:not(:has(.page:target, .page :target)) nav a[href="#home"]::before,
body:has(#home:target) nav a[href="#home"]::before,
body:has(#projects:target) nav a[href="#projects"]::before,
body:has(#about:target) nav a[href="#about"]::before { background: var(--on-accent); }

.sidebar footer {
  display: flex;
  gap: 1.25rem;
  margin-top: auto;
  padding-top: 2rem;
  font-size: .8rem;
}

.sidebar footer a { color: var(--muted); }

/* Content area */
main {
  width: 100%;
  max-width: 76rem;
  padding: 3.5rem 3rem;
}

/* Pages - show only the page in the URL hash, or one that contains the hash target.
   Without a hash, show the home page. The parts of a page fade in one after the other. */
.page { display: none; scroll-margin-top: 3.5rem; }
.page:target, .page:has(:target), main:not(:has(.page:target, .page :target)) #home { display: var(--display, block); }
.page > div { animation: rise .5s ease both; }
.page > div:nth-child(2) { animation-delay: .1s; }
.page > div:nth-child(3) { animation-delay: .2s; }

/* Section titles - a short gradient bar below the title */
h2 {
  margin-bottom: 1.75rem;
  font-size: 1.5rem;
  line-height: 1.3;
}

h2::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 3px;
  margin-top: .5rem;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--green));
}

/* Resume page - timeline left, skills right on wide screens */
.resume {
  --display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(16rem, 1fr);
  gap: 4rem;
  align-items: start;
}


/* Timeline - date and company left, a line with dots in the middle, details right */
.timeline { padding: 0; list-style: none; }

.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 9rem 1fr;
  column-gap: 3rem;
  padding-bottom: 2rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  top: .5rem;
  bottom: -.5rem;
  left: calc(9rem + 1.5rem);
  width: 1px;
  background: var(--line);
}

.timeline li:last-child::before { display: none; }

.timeline li::after {
  content: "";
  position: absolute;
  top: .35rem;
  left: calc(9rem + 1.5rem - .4rem);
  width: .8rem;
  height: .8rem;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
  transition: transform .2s;
}

.timeline li:hover::after { transform: scale(1.35); }

/* Active jobs - filled dot that pulses */
.timeline li.now::after {
  background: var(--accent);
  color: var(--accent);
  animation: pulse 2.4s infinite;
}

.when { text-align: right; font-size: .85rem; line-height: 1.5; }
.when time { display: block; font: 600 .85rem/1.6 var(--mono); }
.when span { color: var(--muted); }

.what h3 { font-size: 1.05rem; transition: color .2s; }
.timeline li:hover h3 { color: var(--accent); }
.what p { color: var(--muted); margin-top: .35rem; }
.what b { color: var(--text); }

/* Links in the resume - accent color, underline and an arrow, so it is clear they open another page.
   Company names are bold like the project names. */
.what a, .when a {
  border-radius: .25rem;
  text-decoration: underline 1px;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  text-underline-offset: 3px;
  transition: background .2s, text-decoration-color .2s;
}

.what a b { color: inherit; }
.when a { font-weight: 600; }
.what a::after, .when a::after { content: "↗"; display: inline-block; margin-left: .15rem; font-size: .8em; }
.what a:hover, .when a:hover { background: var(--accent-soft); text-decoration-color: var(--accent); }

.tag {
  display: inline-block;
  margin-left: .35rem;
  padding: 0 .55rem;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .72rem;
  font-weight: 500;
  vertical-align: .15em;
}

/* Skills - one block per group, the items are chips */
.skill-group + .skill-group { margin-top: 1.5rem; }

.skill-group h3 {
  margin-bottom: .6rem;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: .3rem .8rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  font-size: .875rem;
  transition: border-color .2s, color .2s, transform .2s;
}

.chips li:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* About page - intro panel with key facts, then cards */
.about { max-width: 62rem; }
.about > div + div { margin-top: 2.5rem; }

.intro {
  padding: 1.6rem 1.9rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background:
    radial-gradient(circle at 100% 0, var(--accent-soft), transparent 55%),
    var(--surface);
}

.lead { font-size: 1.15rem; line-height: 1.7; max-width: 44rem; }
.lead + .lead { margin-top: .75rem; color: var(--muted); font-size: 1rem; }

/* Key facts - large numbers in the accent color */
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 2.75rem;
  margin: 1.25rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.facts dt {
  background: linear-gradient(90deg, var(--accent), var(--green));
  background-clip: text;
  color: transparent;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.1;
}

.facts dd { margin: 0; color: var(--muted); font-size: .85rem; }

/* Cards - an icon tile at the top. The tile is ::before, the icon is ::after on top of it. */
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}

.cards article {
  position: relative;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}

.cards article::before {
  content: "";
  display: block;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: .75rem;
  border-radius: .75rem;
  background: var(--accent-soft);
  transition: transform .3s;
}

.cards article::after {
  content: "";
  position: absolute;
  top: calc(1.25rem + .625rem);
  left: calc(1.4rem + .625rem);
  width: 1.5rem;
  height: 1.5rem;
  background: var(--accent);
  mask: var(--icon) center / contain no-repeat;
}

.cards article:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 28px -16px var(--accent);
}

.cards article:hover::before { transform: rotate(-8deg) scale(1.08); }
.cards h3 { margin-bottom: .4rem; font-size: 1.1rem; }
.cards p { color: var(--muted); font-size: .95rem; }

/* Small cards - icon on the left, used for the interests */
.cards.small article { display: grid; grid-template-columns: auto 1fr; align-content: start; column-gap: 1rem; padding: 1.25rem; }
.cards.small article::before { grid-row: span 2; margin: 0; }
.cards.small article::after { top: calc(1.25rem + .625rem); left: calc(1.25rem + .625rem); }
.cards.small h3 { margin: 0; }

/* Projects page - one card per project: screenshots left, details right */
.projects { max-width: 70rem; }
.project-list { display: grid; gap: 1.5rem; }

.project {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 1.75rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
}

.project:hover { border-color: var(--accent); box-shadow: 0 16px 36px -24px var(--accent); }

/* Screenshots - a large main image and thumbnails below.
   Each thumbnail is the label of a hidden radio button. The checked radio button selects the main image. */
.shots {
  display: grid;
  gap: .5rem;
  align-content: start;
}

.shots input { position: absolute; opacity: 0; pointer-events: none; }

.shots img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--line);
}

.main a { display: none; overflow: hidden; border-radius: .6rem; animation: fade .35s ease; }
.main img { transition: transform .4s ease; }
.main a:hover img { transform: scale(1.03); }

.thumbs {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: .5rem;
}

.thumbs label {
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: .5rem;
  opacity: .6;
  cursor: pointer;
  transition: opacity .2s, border-color .2s;
}

.thumbs label:hover { opacity: 1; }
.shots:has(input:focus-visible) .thumbs { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: .5rem; }

/* Show the main image and mark the thumbnail of the checked radio button (up to 4 screenshots) */
.shots:has(input:nth-of-type(1):checked) .main a:nth-child(1),
.shots:has(input:nth-of-type(2):checked) .main a:nth-child(2),
.shots:has(input:nth-of-type(3):checked) .main a:nth-child(3),
.shots:has(input:nth-of-type(4):checked) .main a:nth-child(4) { display: block; }

.shots:has(input:nth-of-type(1):checked) .thumbs label:nth-child(1),
.shots:has(input:nth-of-type(2):checked) .thumbs label:nth-child(2),
.shots:has(input:nth-of-type(3):checked) .thumbs label:nth-child(3),
.shots:has(input:nth-of-type(4):checked) .thumbs label:nth-child(4) { border-color: var(--accent); opacity: 1; }

/* Details - title, tags, description, then role and work as label and value */
.info { display: flex; flex-direction: column; gap: .75rem; padding: .25rem 0; }
.info h3 { font-size: 1.5rem; line-height: 1.2; }
.info .tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.info .tag { margin: 0; }
.info p { color: var(--muted); }

.details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .5rem 1.25rem;
  margin: 0;
  padding-top: .85rem;
  border-top: 1px solid var(--line);
}

.details dt { color: var(--muted); font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding-top: .2rem; }
.details dd { margin: 0; }
.details ul { display: grid; gap: .3rem; margin: 0; padding: 0; list-style: none; }
.details li { position: relative; padding-left: 1rem; }
.details li::before { content: ""; position: absolute; left: 0; top: .65em; width: .4rem; height: .4rem; border-radius: 50%; background: var(--accent); }

.links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; padding-top: .5rem; }

.links a {
  padding: .4rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 99px;
  font-size: .875rem;
  font-weight: 600;
  transition: background .2s, color .2s;
}

.links a::after { content: " ↗"; }
.links a:hover { background: var(--accent); color: var(--on-accent); text-decoration: none; }

/* Legal page - plain long text */
.legal { max-width: 46rem; }
.legal > div + div { margin-top: 3.5rem; }
.legal h3 { margin: 1.75rem 0 .5rem; font-size: 1.05rem; }
.legal p, .legal ul { margin-bottom: .75rem; }
.legal ul { padding-left: 1.25rem; list-style: none; }

/* Animations - the pulse uses currentColor, so each element sets its own color */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 currentColor; }
  70%, 100% { box-shadow: 0 0 0 .5rem transparent; }
}

@keyframes fade {
  from { opacity: 0; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
}

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

/* Medium screens - skills move below the timeline */
@media (max-width: 75rem) {
  .resume { grid-template-columns: 1fr; gap: 2rem; }
  .project { grid-template-columns: 1fr; }
}

/* Small screens - the sidebar becomes a normal header above the content */
@media (max-width: 52rem) {
  body { display: block; }
  .sidebar { position: static; height: auto; padding: 2.5rem 1rem 1.5rem; border-right: 0; border-bottom: 1px solid var(--line); }
  nav { max-width: 24rem; }
  .sidebar footer { padding-top: 1.5rem; }
  main { padding: 2.5rem 1rem; }
  .intro { padding: 1.5rem; }
  .cards { grid-template-columns: 1fr; }
}

/* Very small screens - timeline date goes above the details */
@media (max-width: 34rem) {
  .timeline li { grid-template-columns: 1fr; padding-left: 1.75rem; }
  .timeline li::before { left: .4rem; }
  .timeline li::after { left: 0; }
  .when { text-align: left; margin-bottom: .25rem; }
  .when time { display: inline; margin-right: .5rem; }
}

/* Print - one column, black on white, without menu and animations */
@media print {
  :root { --bg: #fff; --surface: #fff; --text: #000; --muted: #444; }
  body { display: block; }
  .sidebar { position: static; height: auto; border: 0; }
  nav, .badge, .sidebar footer { display: none; }
  .resume { grid-template-columns: 1fr; }
  .timeline li { break-inside: avoid; }
}
