/* ==========================================================================
   Tokens
   Breakpoints (literals in @media — keep in sync with nav.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: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", 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 — Kawasaki-ish black metallic (cool navy flake, green accent) */
  --bg: #06080d;
  --bg-elev: #10151f;
  --bg-card: linear-gradient(
    155deg,
    #161d2c 0%,
    #0c1018 48%,
    #080b12 100%
  );
  --ink: #e8ecf4;
  --muted: #8a95a8;
  --accent: #6f8f7a;
  --accent-deep: #557a66;
  --accent-hot: #8fb4d4;
  --line: rgba(170, 190, 230, 0.12);
  --danger: #d98989;
  --ok: #8fbf9a;
  --top-bg: rgba(6, 8, 13, 0.9);
  --input-bg: rgba(255, 255, 255, 0.035);
  --cookie-bg: rgba(16, 21, 31, 0.97);
  --btn-from: #4a84c4;
  --btn-to: #2c568c;
  --btn-fg: #f3f7fc;
  --btn-shadow: 0 6px 20px rgba(55, 110, 180, 0.42);
  --dot-ring: #06080d;
  --hero-glow-a: rgba(72, 118, 190, 0.16);
  --hero-glow-b: rgba(40, 55, 95, 0.22);
  --icon-well: rgba(0, 0, 0, 0.4);
  --shadow: 0 22px 52px rgba(0, 0, 0, 0.5);
  --dock-shadow: 0 -10px 32px rgba(0, 0, 0, 0.35);
}

/* 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:
    radial-gradient(1100px 520px at 12% -8%, var(--hero-glow-a), transparent 52%),
    radial-gradient(900px 480px at 92% 4%, var(--hero-glow-b), transparent 48%),
    linear-gradient(180deg, #0a0e18 0%, var(--bg) 42%, #04060a 100%);
  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;
}

.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: rect(0 0 0 0);
  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 .bi {
  font-size: 1.35rem;
  line-height: 1;
}

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

.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 .bi {
  font-size: 1.25rem;
  line-height: 1;
}

.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 0 0) 0 16.66% / 100% 8.33%,
    linear-gradient(#fff 0 0) 0 33.33% / 100% 8.33%,
    linear-gradient(#fff 0 0) 0 50% / 100% 8.33%,
    linear-gradient(#fff 0 0) 0 66.66% / 100% 8.33%,
    linear-gradient(#fff 0 0) 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 .bi {
  font-size: 1.15em;
  line-height: 1;
}

.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;
}

.section-drift {
  position: relative;
  overflow: hidden;
}

.section-drift > :not(.tech-drift) {
  position: relative;
  z-index: 2;
}

.tech-drift {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.42;
}

/* empty right margin only — never over headings / prose */
.tech-drift-gutter {
  left: auto;
  right: 0;
  width: min(26%, 12.5rem);
  opacity: 0.38;
}

.tech-chip {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  background: color-mix(in srgb, var(--bg-elev) 55%, transparent);
  color: color-mix(in srgb, var(--accent-hot) 55%, var(--muted));
  font-family: var(--font-display);
  font-size: clamp(0.7rem, 1.3vw, 0.9rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  user-select: none;
  will-change: left, top;
  box-shadow: none;
}

.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: 0.55rem;
  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;
}

.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
  user-select: none;
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--accent-hot);
}

.card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

/* ==========================================================================
   Career timeline (git-ish trunk + side branches)
   ========================================================================== */

.career-timeline {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  position: relative;
  display: grid;
  gap: var(--tl-gap);
}

/* main */
.career-timeline::before {
  content: "";
  position: absolute;
  top: 0.35rem;
  bottom: 0.5rem;
  left: 50%;
  width: 3px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent-hot) 35%, transparent),
    var(--accent-hot) 10%,
    var(--accent) 55%,
    color-mix(in srgb, var(--accent) 25%, transparent)
  );
}

.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: var(--tl-col-gap);
  align-items: start;
}

/* branch stub: elbow into the trunk (git-style) */
.tl-item::after {
  content: "";
  position: absolute;
  top: 1.55rem;
  width: calc(var(--tl-col-gap) / 2 - 0.45rem);
  height: 0.95rem;
  pointer-events: none;
  z-index: 1;
  transform: translateY(-100%);
  border-color: color-mix(in srgb, var(--accent-hot) 70%, var(--line));
  border-style: solid;
  border-width: 0;
}

.tl-left::after {
  right: 50%;
  border-bottom-width: 2px;
  border-right-width: 2px;
  border-bottom-right-radius: 0.85rem;
}

.tl-right::after {
  left: 50%;
  border-bottom-width: 2px;
  border-left-width: 2px;
  border-bottom-left-radius: 0.85rem;
}

.tl-soft::after {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--muted) 65%, var(--line));
}

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

.tl-year {
  position: absolute;
  top: 0.05rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--accent-hot);
  background: var(--bg-elev);
  padding: 0.34rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-align: center;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

/* date sits on the empty side of the trunk — never over the card */
.tl-left .tl-year {
  left: calc(50% + 0.7rem);
  right: auto;
}

.tl-right .tl-year {
  right: calc(50% + 0.7rem);
  left: auto;
}

.tl-soft .tl-card {
  background: color-mix(in srgb, var(--bg-card) 55%, transparent);
  border-style: dashed;
  box-shadow: none;
  padding: 1rem 1.15rem;
}

.tl-soft .tl-dot {
  background: radial-gradient(circle at 30% 30%, #c5d4cc, var(--muted));
  box-shadow: 0 0 0 3px var(--dot-ring);
}

.tl-soft .tl-year {
  color: var(--muted);
  border-style: dashed;
}

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

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

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

.tl-dot {
  position: absolute;
  left: 50%;
  top: 1.55rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 30% 30%, #d7f0e4, var(--accent));
  box-shadow: 0 0 0 3px var(--dot-ring), 0 0 14px rgba(111, 143, 122, 0.45);
}

.tl-now .tl-year {
  text-transform: lowercase;
  letter-spacing: 0.02em;
  color: var(--btn-fg);
  background: linear-gradient(135deg, var(--btn-from), var(--btn-to));
  border-color: transparent;
}

.tl-now .tl-dot {
  width: 14px;
  height: 14px;
  background: radial-gradient(circle at 30% 30%, #cfe4f8, var(--accent-hot));
  box-shadow: 0 0 0 3px var(--dot-ring), 0 0 16px rgba(79, 140, 200, 0.55);
}

.tl-now::after {
  border-color: color-mix(in srgb, var(--accent-hot) 85%, var(--btn-from));
}

.tl-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow);
  user-select: none;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.tl-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent-hot) 45%, var(--line));
}

.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.65rem;
  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-chevron {
  display: none;
  flex: 0 0 auto;
  margin-top: 0.2rem;
  font-size: 1.1rem;
  color: var(--accent-hot);
  transition: transform 0.2s ease;
}

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

.tl-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--ink);
}

.tl-company {
  margin: 0.25rem 0 0;
  color: var(--accent-hot);
  font-weight: 600;
}

.tl-mode {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: lowercase;
}

.tl-period {
  margin: 0.2rem 0 0;
  color: var(--accent);
  font-size: 0.9rem;
}

.tl-points {
  margin: 0.9rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  display: grid;
  gap: 0.35rem;
}

.tl-left .tl-points {
  padding-left: 0;
  padding-right: 1.1rem;
  list-style-position: inside;
}

.tl-aside {
  margin-top: 1rem;
  padding: 0.8rem 0 0.1rem 0.9rem;
  border-left: 3px solid var(--accent);
  text-align: left;
}

.tl-left .tl-aside {
  border-left: 0;
  border-right: 3px solid var(--accent);
  padding-left: 0;
  padding-right: 0.9rem;
}

.tl-aside strong {
  display: block;
  font-size: 0.95rem;
  color: var(--accent-hot);
  margin-bottom: 0.35rem;
}

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

.tl-left .tl-aside ul {
  padding-left: 0;
  padding-right: 1.05rem;
  list-style-position: inside;
}

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

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

.hobby-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 1.35rem 1.35rem 1.4rem;
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  user-select: none;
  min-height: 11rem;
}

.hobby-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  pointer-events: none;
}

.hobby-bike::before {
  background:
    radial-gradient(circle at 90% 10%, rgba(143, 184, 201, 0.45), transparent 40%),
    linear-gradient(135deg, transparent 40%, rgba(111, 143, 122, 0.2));
}

.hobby-wrench::before {
  background:
    radial-gradient(circle at 10% 80%, rgba(201, 168, 120, 0.35), transparent 45%),
    linear-gradient(200deg, transparent 30%, rgba(143, 184, 201, 0.12));
}

.hobby-chip::before {
  background:
    radial-gradient(circle at 80% 70%, rgba(120, 180, 150, 0.4), transparent 42%),
    repeating-linear-gradient(
      -20deg,
      transparent,
      transparent 10px,
      rgba(232, 238, 244, 0.03) 10px,
      rgba(232, 238, 244, 0.03) 11px
    );
}

.hobby-thai::before {
  background:
    radial-gradient(circle at 20% 20%, rgba(217, 137, 137, 0.28), transparent 40%),
    linear-gradient(160deg, transparent 50%, rgba(111, 143, 122, 0.18));
}

.hobby-pets::before {
  background:
    radial-gradient(circle at 70% 30%, rgba(201, 168, 120, 0.35), transparent 42%),
    linear-gradient(140deg, transparent 45%, rgba(143, 180, 212, 0.14));
}

.hobby-bike {
  grid-column: 1 / -1;
}

.hobby-icon {
  width: 2.55rem;
  height: 2.55rem;
  margin-bottom: 0.85rem;
  border-radius: 0.7rem;
  border: 1px solid var(--line);
  background: var(--icon-well);
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  color: var(--accent-hot);
}

.hobby-icon .bi {
  font-size: 1.35rem;
  line-height: 1;
}

.hobby-thai .hobby-icon {
  color: var(--danger);
}

.hobby-pets .hobby-icon {
  color: #d4a574;
}

.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-thumbs {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0.55rem;
  margin-top: 1.1rem;
  padding: 0.15rem 0.1rem 0.55rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent-hot) 55%, var(--line)) transparent;
}

.hobby-thumbs::-webkit-scrollbar {
  height: 6px;
}

.hobby-thumbs::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent-hot) 50%, var(--line));
  border-radius: 999px;
}

.hobby-thumb {
  appearance: none;
  flex: 0 0 auto;
  width: 8.25rem;
  height: 11rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  padding: 0;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  cursor: pointer;
  scroll-snap-align: start;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.hobby-thumb:hover {
  border-color: color-mix(in srgb, var(--accent-hot) 55%, var(--line));
  transform: translateY(-2px);
}

.hobby-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.hobby-lightbox {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 0.85rem 1rem;
  background: var(--cookie-bg);
  color: var(--ink);
  max-width: min(92vw, 42rem);
  width: 100%;
  box-shadow: var(--shadow);
}

.hobby-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

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

.hobby-lightbox-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.35rem;
}

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

.hobby-lightbox-stage {
  position: relative;
  border-radius: 0.55rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  max-height: min(70vh, 36rem);
}

.hobby-lightbox-img {
  width: 100%;
  height: auto;
  max-height: min(70vh, 36rem);
  object-fit: contain;
}

.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.25rem;
  height: 2.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-elev) 85%, transparent);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

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

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

.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.65rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

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

.forms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem 2.5rem;
  align-items: start;
}

.form-panel .form {
  max-width: none;
}

.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;
}

.ok {
  color: var(--ok);
}

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

.entries {
  display: grid;
  gap: 0.85rem;
  margin: 1.25rem 0 2rem;
  max-height: min(22rem, 50vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.35rem;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent-hot) 55%, var(--line)) transparent;
}

.entries::-webkit-scrollbar {
  width: 6px;
}

.entries::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent-hot) 50%, var(--line));
  border-radius: 999px;
}

.entry {
  border-left: 3px solid var(--accent);
  padding: 0.35rem 0 0.35rem 0.9rem;
}

.entry strong {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--ink);
}

.entry time {
  color: var(--muted);
  font-size: 0.85rem;
}

.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 .bi {
  font-size: 1.1rem;
  line-height: 1;
}

.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: rect(0 0 0 0);
}

.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 .bi {
  font-size: 1.2rem;
  line-height: 1;
}

.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));
}

.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-card > summary {
    cursor: default;
    pointer-events: none;
  }
}

/* ==========================================================================
   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;
  }

  /* —— tech drift (ovals hurt readability on small screens) —— */
  .tech-drift {
    display: none;
  }

  /* —— timeline —— */
  /* narrow rail = line + dots only; date pills sit above cards (readable) */
  .career-timeline {
    --tl-rail: 1.35rem;
    gap: 1.75rem;
  }

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

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

  .tl-item::after {
    left: calc(var(--tl-rail) / 2);
    right: auto;
    top: 2.55rem;
    width: 0.85rem;
    height: 2px;
    transform: none;
    border: 0;
    border-radius: 0;
    background: color-mix(in srgb, var(--accent-hot) 70%, var(--line));
  }

  .tl-left::after,
  .tl-right::after {
    left: calc(var(--tl-rail) / 2);
    right: auto;
    border: 0;
  }

  .tl-soft::after {
    background: color-mix(in srgb, var(--muted) 65%, var(--line));
    border: 0;
  }

  .tl-marker {
    inset: auto;
    left: 0;
    top: 0;
    width: 100%;
    z-index: 2;
  }

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

  .tl-left .tl-year,
  .tl-right .tl-year {
    left: calc(var(--tl-rail) + 0.85rem);
    right: auto;
    top: 0;
    transform: none;
    max-width: calc(100% - var(--tl-rail) - 1rem);
    font-size: 0.78rem;
    padding: 0.32rem 0.6rem;
    white-space: nowrap;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tl-now .tl-year {
    white-space: normal;
    text-overflow: unset;
    line-height: 1.3;
  }

  .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-head {
    cursor: pointer;
  }

  .tl-chevron {
    display: inline-block;
  }

  .tl-left .tl-points {
    padding-right: 0;
    padding-left: 1.1rem;
    list-style-position: outside;
  }

  .tl-left .tl-aside {
    border-right: 0;
    border-left: 3px solid var(--accent);
    padding-right: 0;
    padding-left: 0.9rem;
  }

  .tl-left .tl-aside ul {
    padding-right: 0;
    padding-left: 1.05rem;
    list-style-position: outside;
  }

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

  .hobby-thumb {
    width: 7rem;
    height: 9.5rem;
  }

  /* —— guestbook + contact —— */
  .forms-grid {
    grid-template-columns: 1fr;
  }
}

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

@media (max-width: 720px) {
  .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) {
  .tech-drift {
    display: none;
  }

  .hero,
  .section {
    animation: none;
  }
}
