/* ==========================================================================
   Tokens
   Breakpoints (literals in @media — keep in sync with site.js):
     900px  tablet: hamburger, timeline stack, hobby 1-col, tech gutter off
     720px  phone:  hero / footer stack
   ========================================================================== */

:root {
  /* Shared (theme-agnostic) */
  --radius: 14px;
  --font-display: "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
  --btn-pad-y: 0.45rem;
  --btn-pad-x: 0.95rem;
  --btn-font: 0.9rem;
  --tl-gap: 2.5rem;
  --tl-col-gap: 6.75rem;
  --tl-card-max: 26.5rem;
  --tl-rail: 5.4rem;

  /* Dark — EVE-ish deep space (Caldari slate + Gallente sage) */
  --bg: #0a0c10;
  --bg-elev: #12151a;
  --bg-card: #12151a;
  --ink: #e6e8ec;
  --muted: #8a8f9a;
  --accent: #576b66;
  --accent-deep: #3d4f4a;
  --accent-hot: #5a8aa3;
  --line: rgba(138, 143, 154, 0.18);
  --danger: #8c5055;
  --ok: #9eae95;
  --top-bg: rgba(10, 12, 16, 0.92);
  --input-bg: rgba(255, 255, 255, 0.03);
  --cookie-bg: #12151a;
  --btn-from: #3c5f73;
  --btn-to: #2a4555;
  --btn-fg: #f3f7fc;
  --btn-shadow: 0 4px 16px rgba(60, 95, 115, 0.35);
  --dot-ring: #0a0c10;
  --hero-glow-a: transparent;
  --hero-glow-b: transparent;
  --icon-well: rgba(0, 0, 0, 0.35);
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  --dock-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4);
}

/* Light — overrides only; dark lives on :root (and when data-theme="dark") */
[data-theme="light"] {
  --bg: #e9eef5;
  --bg-elev: #f7f9fc;
  --bg-card: linear-gradient(160deg, #fbfcfe 0%, #eef3f8 100%);
  --ink: #1b2733;
  --muted: #556677;
  --accent: #3f7a58;
  --accent-deep: #326348;
  --accent-hot: #2a6f9c;
  --line: rgba(21, 32, 43, 0.14);
  --danger: #b03d3d;
  --ok: #3d7a4e;
  --top-bg: rgba(233, 238, 245, 0.92);
  --input-bg: #ffffff;
  --cookie-bg: #f7f9fc;
  --btn-from: #4580b4;
  --btn-to: #2f6494;
  --btn-fg: #f7fafc;
  --btn-shadow: 0 4px 14px rgba(45, 95, 150, 0.3);
  --dot-ring: #e9eef5;
  --hero-glow-a: rgba(42, 111, 156, 0.14);
  --hero-glow-b: rgba(63, 122, 88, 0.12);
  --icon-well: rgba(21, 32, 43, 0.04);
  --shadow: 0 14px 36px rgba(21, 32, 43, 0.11);
  --dock-shadow: 0 -6px 20px rgba(21, 32, 43, 0.1);
}

/* ==========================================================================
   Base
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  /* soft copy deterrent — forms stay selectable below */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

input,
textarea,
select,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

[data-theme="light"] body {
  background:
    radial-gradient(1200px 600px at 10% -10%, var(--hero-glow-a), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, var(--hero-glow-b), transparent 50%),
    linear-gradient(180deg, #f2f6fb 0%, var(--bg) 42%, #e2e9f2 100%);
}

a {
  color: var(--accent-hot);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Chrome — shell, header, nav (desktop default)
   ========================================================================== */

.shell {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}

.shell:not(.top-inner):not(.dock-foot-inner) {
  padding-bottom: 6.5rem;
}

main {
  --hero-gap: 0.55rem;
  padding-left: var(--hero-gap);
}

.top {
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  background: var(--top-bg);
}

.top-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.1rem;
  padding: 1.05rem 0;
}

.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

.nav-burger {
  display: none;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: var(--bg-elev);
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
  flex: 0 0 auto;
}

.nav-burger .ico {
  font-size: 1.35rem;
  line-height: 1;
  width: 1.35rem;
  height: 1.35rem;
}

.nav-burger .nav-burger-close {
  display: none;
}

.nav-burger-open {
  display: inline-block;
}

.nav-toggle:checked ~ .nav-burger .nav-burger-open {
  display: none;
}

.nav-toggle:checked ~ .nav-burger .nav-burger-close {
  display: inline-block;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.45rem;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.05rem;
  align-items: center;
  justify-content: flex-end;
}

.nav a {
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
}

.nav a:hover {
  color: var(--ink);
}

.nav-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.icon-btn,
.flag-btn {
  width: 2.35rem;
  height: 2.35rem;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: var(--bg-elev);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
  flex: 0 0 auto;
}

.icon-btn:hover,
.flag-btn:hover {
  border-color: color-mix(in srgb, var(--accent-hot) 40%, var(--line));
  color: var(--accent-hot);
  text-decoration: none;
}

.icon-btn .ico {
  font-size: 1.25rem;
  line-height: 1;
  width: 1.25rem;
  height: 1.25rem;
}

/* Material SVGs via mask — color from currentColor */
.ico {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
  vertical-align: middle;
  background-color: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat;
  mask: var(--ico) center / contain no-repeat;
}

.ico-menu { --ico: url("/icons/menu.svg"); }
.ico-light { --ico: url("/icons/light.svg"); }
.ico-night { --ico: url("/icons/night.svg"); }
.ico-up { --ico: url("/icons/up.svg"); }
.ico-bike { --ico: url("/icons/bike.svg"); }
.ico-drill { --ico: url("/icons/drill.svg"); }
.ico-memory { --ico: url("/icons/memory.svg"); }
.ico-thai { --ico: url("/icons/thai.svg"); }
.ico-pets { --ico: url("/icons/pets.svg"); }
.ico-linkedin { --ico: url("/icons/linkedin.svg"); }
.ico-github { --ico: url("/icons/github.svg"); }
.ico-mail { --ico: url("/icons/mail.svg"); }
.ico-close { --ico: url("/icons/close.svg"); }
.ico-chevron-down { --ico: url("/icons/chevron-down.svg"); }
.ico-chevron-left { --ico: url("/icons/chevron-left.svg"); }
.ico-chevron-right { --ico: url("/icons/chevron-right.svg"); }

.flag {
  width: 1.35rem;
  height: 1rem;
  border-radius: 2px;
  display: block;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

/* Poland */
.flag-pl {
  background: linear-gradient(to bottom, #fff 50%, #dc143c 50%);
}

/* United States (simplified) */
.flag-us {
  background:
    linear-gradient(#fff, #fff) 0 16.66% / 100% 8.33%,
    linear-gradient(#fff, #fff) 0 33.33% / 100% 8.33%,
    linear-gradient(#fff, #fff) 0 50% / 100% 8.33%,
    linear-gradient(#fff, #fff) 0 66.66% / 100% 8.33%,
    linear-gradient(#fff, #fff) 0 83.33% / 100% 8.33%,
    linear-gradient(#b22234, #b22234);
  background-repeat: no-repeat;
  position: relative;
  overflow: hidden;
}

.flag-us::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 42%;
  height: 54%;
  background: #3c3b6e;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  min-height: 2.15rem;
  background: linear-gradient(135deg, var(--btn-from), var(--btn-to));
  color: var(--btn-fg);
  font-weight: 700;
  font-size: var(--btn-font);
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    text-shadow 0.15s ease;
  box-shadow: var(--btn-shadow);
}

.btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
  filter: brightness(1.12);
  box-shadow:
    0 0 14px rgba(74, 132, 196, 0.45),
    0 0 28px rgba(44, 86, 140, 0.3),
    var(--btn-shadow);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn-ghost:hover {
  color: var(--accent-hot);
  border-color: var(--accent-hot);
  filter: brightness(1.15);
  text-shadow: 0 0 10px rgba(143, 180, 212, 0.45), 0 0 20px rgba(74, 132, 196, 0.25);
  box-shadow: 0 0 16px rgba(74, 132, 196, 0.22);
}

.btn-linkedin .ico {
  width: 1.15em;
  height: 1.15em;
}

.btn-linkedin:hover {
  color: #0a66c2;
  border-color: #0a66c2;
  text-decoration: none;
  filter: brightness(1.2);
  text-shadow: 0 0 10px rgba(10, 102, 194, 0.65), 0 0 22px rgba(10, 102, 194, 0.35);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.75rem;
  padding: 2.25rem 0 2.75rem;
  min-height: 0;
  animation: rise 0.8s ease both;
  overflow: hidden;
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 0.65rem;
  max-width: 42rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.35rem, 5.5vw, 3.75rem);
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--ink);
  width: fit-content;
  max-width: 100%;
}

/* FocusOnNavigate focuses h1 — skip the full-bleed focus ring */
.hero h1:focus {
  outline: none;
}

.hero .tagline {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 40rem;
  margin: 0;
}

.hero-lead {
  margin: 0;
  max-width: 40rem;
  color: var(--ink);
  font-size: 1.05rem;
  opacity: 0.92;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--hero-gap);
  margin-top: 0.4rem;
}

/* ==========================================================================
   Sections / cards / skills
   ========================================================================== */

.section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--line);
  animation: rise 0.7s ease both;
}

.section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0 0 1rem;
  color: var(--ink);
}

.prose {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.08rem;
  user-select: none;
  white-space: pre-line;
}

.prose-wide {
  max-width: 70ch;
}

/* one-pager style: three plain columns, no cards / floating chips */
.skills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.75rem 2.5rem;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.skills-col h3 {
  margin: 0 0 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}

.skills-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  display: grid;
  gap: 0.5rem;
  font-size: 0.98rem;
  line-height: 1.4;
}

/* ==========================================================================
   Career timeline — NilsWe experiment: free flags, caret to rail, no card chrome
   ========================================================================== */

.career-timeline {
  --tl-flag-bg: color-mix(in srgb, var(--bg-elev) 88%, var(--ink));
  list-style: none;
  margin: 2.75rem auto 0;
  padding: 0.5rem 0 1.5rem;
  position: relative;
  display: grid;
  gap: 2.25rem;
  max-width: 48rem;
}

.career-timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 6px;
  margin-left: -3px;
  background: linear-gradient(
    180deg,
    transparent,
    color-mix(in srgb, var(--ink) 22%, transparent) 6%,
    color-mix(in srgb, var(--ink) 22%, transparent) 94%,
    transparent
  );
  z-index: 0;
}

.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 3.25rem;
  align-items: start;
  z-index: 1;
}

.tl-marker {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.tl-dot {
  position: absolute;
  left: 50%;
  top: 1.05rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  border: 4px solid var(--accent-hot);
  box-sizing: border-box;
}

.tl-soft .tl-dot {
  border-color: color-mix(in srgb, var(--muted) 80%, var(--line));
  border-width: 3px;
}

.tl-now .tl-dot {
  background: var(--accent-hot);
  border-color: color-mix(in srgb, var(--accent-hot) 55%, var(--ink));
}

/* borderless shell — flag is the only “chip” */
.tl-card {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  user-select: none;
}

.tl-soft .tl-card {
  opacity: 0.78;
}

.tl-left .tl-card {
  grid-column: 1;
  justify-self: end;
  width: min(100%, var(--tl-card-max));
  text-align: right;
}

.tl-right .tl-card {
  grid-column: 2;
  justify-self: start;
  width: min(100%, var(--tl-card-max));
}

.tl-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  list-style: none;
}

.tl-head::-webkit-details-marker,
.tl-head::marker {
  display: none;
  content: "";
}

.tl-head-main {
  min-width: 0;
  flex: 1 1 auto;
}

.tl-left .tl-head {
  flex-direction: row-reverse;
}

.tl-flag-wrap {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  max-width: 100%;
}

.tl-left .tl-flag-wrap {
  float: right;
}

.tl-right .tl-flag-wrap {
  float: left;
}

.tl-flag {
  position: relative;
  margin: 0;
  display: inline-block;
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink);
  background: var(--tl-flag-bg);
  padding: 0.4rem 0.7rem;
  border-radius: 5px;
  box-shadow: 1px 1px 0 color-mix(in srgb, var(--ink) 14%, transparent);
}

/* caret toward the rail */
.tl-left .tl-flag::after,
.tl-right .tl-flag::after {
  content: "";
  position: absolute;
  top: 50%;
  margin-top: -8px;
  border: 8px solid transparent;
}

.tl-left .tl-flag::after {
  left: 100%;
  border-left-color: var(--tl-flag-bg);
}

.tl-right .tl-flag::after {
  right: 100%;
  border-right-color: var(--tl-flag-bg);
}

.tl-time {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: var(--accent-hot);
  background: color-mix(in srgb, var(--accent-hot) 14%, var(--bg));
  padding: 0.32rem 0.48rem;
  border-radius: 3px;
  white-space: nowrap;
  vertical-align: middle;
}

.tl-now .tl-time {
  color: #f4f8fc;
  background: var(--accent-hot);
}

.tl-soft .tl-time {
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 14%, var(--bg));
}

.tl-soft .tl-flag {
  color: var(--muted);
  font-weight: 600;
  box-shadow: none;
}

.tl-chevron {
  display: none;
  flex: 0 0 auto;
  margin-top: 0.2rem;
  width: 1.1rem;
  height: 1.1rem;
  color: var(--accent-hot);
  transition: transform 0.2s ease;
}

.tl-card[open] .tl-chevron {
  transform: rotate(180deg);
}

.tl-company {
  display: block;
  clear: both;
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 1.02rem;
}

.tl-soft .tl-company {
  font-weight: 500;
}

.tl-mode {
  display: block;
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  font-style: italic;
  text-transform: lowercase;
  opacity: 0.9;
}

.tl-body {
  clear: both;
  margin-top: 0.55rem;
  padding: 0.65rem 0.75rem;
  background: color-mix(in srgb, var(--bg-elev) 55%, transparent);
  border-radius: 4px;
  text-align: left;
}

.tl-card:not([open]) .tl-body {
  display: none;
}

.tl-points {
  margin: 0;
  padding-left: 1.05rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
  display: grid;
  gap: 0.28rem;
}

.tl-aside {
  margin-top: 0.75rem;
  padding: 0.55rem 0 0.05rem 0.7rem;
  border-left: 2px solid var(--accent);
  text-align: left;
  font-style: normal;
}

.tl-soft .tl-aside {
  border-color: color-mix(in srgb, var(--muted) 55%, transparent);
}

.tl-aside strong {
  display: block;
  font-size: 0.96rem;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.tl-soft .tl-aside strong {
  color: var(--muted);
  font-weight: 500;
}

.tl-aside ul {
  margin: 0;
  padding-left: 1rem;
  color: var(--muted);
  font-size: 0.96rem;
  display: grid;
  gap: 0.2rem;
}

/* ==========================================================================
   Hobbies
   ========================================================================== */

.hobby-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem 2.5rem;
  margin-top: 1.75rem;
}

.hobby-card {
  position: relative;
  padding: 0.35rem 0 1.15rem;
  background: none;
  border: 0;
  box-shadow: none;
  user-select: none;
  min-height: 0;
}

.hobby-bike {
  grid-column: 1 / -1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 1.5rem;
  margin-bottom: 0.5rem;
}

.hobby-icon {
  width: 1.75rem;
  height: 1.75rem;
  margin-bottom: 0.55rem;
  border: 0;
  background: none;
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  color: var(--accent-hot);
}

.hobby-icon .ico {
  width: 1.5rem;
  height: 1.5rem;
}

.hobby-card h3 {
  position: relative;
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--ink);
}

.hobby-card p {
  position: relative;
  margin: 0;
  color: var(--muted);
  max-width: 48ch;
}

.hobby-bike p {
  max-width: 62ch;
}

/* Fluid justified photo grid — centered, works without JS */
.photogallery {
  --row-h: 14rem;
  --gap: 0.4rem;
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gap);
  width: min(100%, 52rem);
  margin: 1.35rem auto 0;
  padding: 0;
  list-style: none;
}

/* shortcut: sizes used by the gallery; add a rule when a photo gets a new W×H */
.slot-900-2000 { --w: 900; --h: 2000; }
.slot-900-1200 { --w: 900; --h: 1200; }

.hobby-slot {
  --grow: calc(var(--w) / var(--h));
  flex: calc(var(--grow) * 100) 1 calc(var(--grow) * var(--row-h));
  height: var(--row-h);
  max-width: 100%;
  min-width: 0;
}

.hobby-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 2px;
  padding: 0;
  margin: 0;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg-elev) 70%, #000);
  cursor: zoom-in;
  position: relative;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.hobby-thumb:hover,
.hobby-thumb:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  outline: none;
}

.hobby-thumb:focus-visible {
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 0 4px color-mix(in srgb, var(--accent-hot) 70%, transparent),
    0 12px 28px rgba(0, 0, 0, 0.35);
}

/* only thumbs fade — never the lightbox <img class="hobby-photo"> */
.hobby-thumb .hobby-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  opacity: 1;
  transform: scale(1);
  transition: transform 0.35s ease, filter 0.35s ease;
}

.hobby-thumb:hover .hobby-photo,
.hobby-thumb:focus-visible .hobby-photo {
  transform: scale(1.05);
  filter: saturate(1.05) brightness(1.04);
}

.hobby-lightbox {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  max-width: min(96vw, 56rem);
  width: 100%;
  box-shadow: none;
}

.hobby-lightbox::backdrop {
  background: rgba(4, 6, 10, 0.88);
  backdrop-filter: blur(6px);
}

.hobby-lightbox-close-wrap {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 0.5rem;
}

.hobby-lightbox-close {
  appearance: none;
  border: 0;
  background: color-mix(in srgb, var(--bg-elev) 55%, transparent);
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.55rem;
  border-radius: 2px;
}

.hobby-lightbox-close:hover {
  color: var(--accent-hot);
}

.hobby-lightbox-stage {
  position: relative;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: #000;
  max-height: min(82vh, 48rem);
}

.hobby-lightbox-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(82vh, 48rem);
  object-fit: contain;
  margin: 0 auto;
  opacity: 1;
  background: #000;
}

.hobby-lightbox-shield {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: transparent;
}

.hobby-lightbox-nav {
  appearance: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 2px;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.hobby-lightbox-prev {
  left: 0.55rem;
}

.hobby-lightbox-next {
  right: 0.55rem;
}

.hobby-lightbox-nav:hover {
  color: var(--accent-hot);
  border-color: color-mix(in srgb, var(--accent-hot) 45%, var(--line));
}

.hobby-lightbox-caption {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

/* ==========================================================================
   Forms / footer / cookies / legal
   ========================================================================== */

.forms-grid {
  display: grid;
  grid-template-columns: minmax(0, 36rem);
  gap: 2rem;
  align-items: start;
  justify-content: center;
  width: 100%;
}

.form-panel {
  width: 100%;
  text-align: center;
}

.form-panel .prose,
.form-panel .alert {
  margin-left: auto;
  margin-right: auto;
}

.form-panel .form {
  max-width: none;
  margin-inline: auto;
  text-align: left;
}

.form {
  display: grid;
  gap: 0.85rem;
  max-width: 36rem;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.req {
  color: var(--danger);
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
  padding: 0.65rem 0.8rem;
  font: inherit;
}

input:focus,
textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent-hot) 55%, transparent);
  outline-offset: 1px;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Alerts: tint comes from the theme's --ok / --danger, text stays --ink, so both themes stay readable. */
.alert {
  --alert: var(--ok);
  max-width: 36rem;
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border: 1px solid color-mix(in srgb, var(--alert) 55%, var(--line));
  border-left: 4px solid var(--alert);
  border-radius: 10px;
  background: color-mix(in srgb, var(--alert) 14%, var(--bg-elev));
  color: var(--ink);
  text-align: left;
}

.alert-err {
  --alert: var(--danger);
}

.dock-foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  border-top: 1px solid var(--line);
  background: var(--top-bg);
  backdrop-filter: blur(14px);
  box-shadow: var(--dock-shadow);
}

.dock-foot-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.65rem 1.25rem;
  padding: 0.75rem 0;
  font-size: 0.9rem;
}

.dock-legal,
.dock-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.9rem;
  color: var(--muted);
}

.dock-legal {
  justify-content: flex-start;
}

.dock-copy {
  margin: 0;
  text-align: center;
  color: var(--muted);
  white-space: nowrap;
}

.dock-contact {
  justify-content: flex-end;
}

.dock-legal a,
.dock-contact a {
  color: var(--accent-hot);
  text-decoration: none;
  white-space: nowrap;
}

.dock-legal a:hover,
.dock-contact a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.dock-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.15s ease, filter 0.15s ease, text-shadow 0.15s ease;
}

.dock-icon .ico {
  width: 1.1rem;
  height: 1.1rem;
}

.dock-contact a.dock-linkedin:hover,
a.dock-linkedin:hover {
  color: #0a66c2;
  text-decoration: none;
  filter: brightness(1.2);
  text-shadow: 0 0 10px rgba(10, 102, 194, 0.65), 0 0 22px rgba(10, 102, 194, 0.35);
}

.page-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.to-top {
  appearance: none;
  position: fixed;
  right: 1.1rem;
  bottom: 4.75rem;
  z-index: 35;
  width: 2.5rem;
  height: 2.5rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
  padding: 0;
  font: inherit;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.15s ease, color 0.15s ease;
}

.to-top .ico {
  width: 1.2rem;
  height: 1.2rem;
}

.to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.to-top:hover {
  color: var(--accent-hot);
  border-color: color-mix(in srgb, var(--accent-hot) 45%, var(--line));
  text-decoration: none;
}

.dock-contact a.dock-github:hover {
  color: #f0f6fc;
  text-decoration: none;
  filter: brightness(1.25);
  text-shadow: 0 0 10px rgba(240, 246, 252, 0.55), 0 0 22px rgba(240, 246, 252, 0.28);
}

[data-theme="light"] .dock-contact a.dock-github:hover {
  color: #181717;
  text-shadow: 0 0 10px rgba(24, 23, 23, 0.28), 0 0 18px rgba(24, 23, 23, 0.14);
}

.dock-mail {
  width: 2rem;
  height: 2rem;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--bg-elev);
  text-decoration: none;
}

.dock-mail:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--accent-hot) 40%, var(--line));
}

.gtm-noscript {
  display: none;
  visibility: hidden;
}

.cookie-bar {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 4.25rem;
  z-index: 40;
  background: var(--cookie-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.75rem;
}

.cookie-bar p {
  margin: 0;
  color: var(--muted);
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.legal {
  max-width: 65ch;
  color: var(--muted);
}

.legal h1 {
  font-family: var(--font-display);
  color: var(--ink);
}

/* ==========================================================================
   Motion
   ========================================================================== */

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

/* ==========================================================================
   Desktop (≥901px)
   ========================================================================== */

@media (min-width: 901px) {
  .tl-chevron {
    display: inline-block;
  }

  .tl-head {
    cursor: pointer;
  }
}

/* ==========================================================================
   Tablet / mobile (≤900px)
   hamburger · timeline rail · collapsed cards · hobby stack
   ========================================================================== */

@media (max-width: 900px) {
  /* —— nav —— */
  .nav-burger {
    display: inline-grid;
    order: 1;
  }

  .brand {
    order: 2;
    margin-right: 0;
    flex: 1 1 auto;
    text-align: center;
    font-size: 1.25rem;
    min-width: 0;
  }

  .nav-tools {
    order: 3;
  }

  .nav {
    order: 5;
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    margin: 0.15rem 0 0;
    padding: 0.35rem 0 0.15rem;
    border-top: 1px solid var(--line);
  }

  .nav-toggle:checked ~ .nav {
    display: flex;
  }

  .nav a {
    font-size: 1.05rem;
    padding: 0.7rem 0.15rem;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  }

  .nav a:last-child {
    border-bottom: 0;
  }

  .skills {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* —— timeline (single column, rail on the left) —— */
  .career-timeline {
    --tl-rail: 1.35rem;
    gap: 1.75rem;
    max-width: none;
    padding: 0.25rem 0;
  }

  .career-timeline::before {
    left: calc(var(--tl-rail) / 2);
    margin-left: 0;
  }

  .tl-item {
    grid-template-columns: 1fr;
    padding-left: calc(var(--tl-rail) + 0.85rem);
  }

  .tl-marker {
    inset: auto;
    left: 0;
    top: 0;
    width: var(--tl-rail);
    height: 100%;
  }

  .tl-dot {
    left: calc(var(--tl-rail) / 2);
    top: 1.05rem;
  }

  .tl-left .tl-card,
  .tl-right .tl-card {
    grid-column: 1;
    justify-self: stretch;
    width: 100%;
    text-align: left;
  }

  .tl-left .tl-head {
    flex-direction: row;
  }

  .tl-left .tl-flag-wrap,
  .tl-right .tl-flag-wrap {
    float: none;
  }

  /* caret points up to the rail node */
  .tl-left .tl-flag::after,
  .tl-right .tl-flag::after {
    top: auto;
    bottom: 100%;
    left: 1.1rem;
    right: auto;
    margin-top: 0;
    border: 8px solid transparent;
    border-bottom-color: var(--tl-flag-bg);
  }

  .tl-time {
    white-space: normal;
  }

  /* —— hobbies —— */
  .hobby-grid {
    grid-template-columns: 1fr;
  }

  .photogallery {
    --row-h: 11rem;
    --gap: 0.3rem;
    width: 100%;
  }

  .forms-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Phone (≤720px)
   ========================================================================== */

@media (max-width: 720px) {
  /* Reliable 2-col grid on phones — flex math is flaky in narrow viewports */
  .photogallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    width: 100%;
    margin-top: 1.1rem;
  }

  .hobby-slot {
    flex: none;
    height: auto;
  }

  .hobby-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: var(--w) / var(--h);
    max-height: 42vw;
  }

  .hobby-lightbox {
    max-width: 100vw;
    margin: auto 0.5rem;
  }

  .hobby-lightbox-stage {
    max-height: min(78vh, 36rem);
  }

  .hobby-lightbox-img {
    max-height: min(78vh, 36rem);
  }

  .hobby-lightbox-nav {
    width: 2.75rem;
    height: 2.75rem;
  }

  .hero {
    padding: 1.5rem 0 2rem;
  }

  .dock-foot-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    padding: 0.65rem 0 0.75rem;
  }

  .dock-legal,
  .dock-contact {
    justify-content: center;
  }

  .dock-copy {
    order: -1;
  }

  .shell:not(.top-inner):not(.dock-foot-inner) {
    padding-bottom: 8rem;
  }

  .cookie-bar {
    bottom: 5.75rem;
  }

  .to-top {
    bottom: 6.25rem;
    right: 0.85rem;
  }
}

/* ==========================================================================
   A11y
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .hero,
  .section {
    animation: none;
  }

  .hobby-thumb,
  .hobby-thumb .hobby-photo {
    transition: none;
  }

  .hobby-thumb:hover,
  .hobby-thumb:focus-visible,
  .hobby-thumb:hover .hobby-photo,
  .hobby-thumb:focus-visible .hobby-photo {
    transform: none;
    filter: none;
  }
}
