/* ==========================================================================
   Rodrigo Lopes — portfolio
   Plain CSS, no build step. Dark theme by default, light via [data-theme="light"].
   Sections: 1 tokens · 2 base · 3 header · 4 buttons · 5 hero · 6 sections & cards
             7 chips/skills · 8 tags & media · 9 timeline · 10 hobbies · 11 languages
             12 contacts · 13 detail page · 14 footer · 15 lightbox · 16 motion
   ========================================================================== */

/* 1 · TOKENS ------------------------------------------------------------- */
:root {
  --bg: #0a0f16;
  --bg-alt: #0e1520;
  --surface: #121b27;
  --surface-2: #182333;
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .2);
  --text: #e8eef6;
  --text-2: #b6c2d2;
  --muted: #8493a8;
  --accent: #7ba6ff;
  --accent-2: #e5a98f;
  --on-accent: #08101c;
  --grad: linear-gradient(120deg, #7ba6ff 0%, #a9b5ff 48%, #e5a98f 100%);
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, .65);
  --glow-1: rgba(123, 166, 255, .22);
  --glow-2: rgba(229, 169, 143, .16);
  --tile-bg: #f4f6fa;           /* light tile behind logos so dark logos stay visible */

  --c-blue: #8db3ff;  --c-green: #7fd8a6;  --c-amber: #f2c36b;  --c-rose: #f28fa6;
  --c-violet: #b79dff; --c-teal: #5fd3cf;  --c-slate: #a7b3c4;

  --radius: 18px;
  --radius-sm: 12px;
  --header-h: 68px;
  --maxw: 1120px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Space Grotesk", "Inter", system-ui, sans-serif;
}

[data-theme="light"] {
  --bg: #f5f7fa;
  --bg-alt: #eaeff5;
  --surface: #ffffff;
  --surface-2: #f0f3f8;
  --border: rgba(16, 28, 45, .1);
  --border-strong: rgba(16, 28, 45, .22);
  --text: #101a27;
  --text-2: #3b495c;
  --muted: #667589;
  --accent: #2c59cf;
  --accent-2: #b4664d;
  --on-accent: #ffffff;
  --grad: linear-gradient(120deg, #2c59cf 0%, #6a5ad1 50%, #c0705a 100%);
  --shadow: 0 18px 40px -22px rgba(25, 40, 70, .35);
  --glow-1: rgba(44, 89, 207, .13);
  --glow-2: rgba(192, 112, 90, .12);
  --tile-bg: #ffffff;

  --c-blue: #2b55c4;  --c-green: #1b7f4f;  --c-amber: #8f5f08;  --c-rose: #b3244d;
  --c-violet: #6542c4; --c-teal: #0b7a76;  --c-slate: #4a586c;
}

/* 2 · BASE ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 1.25rem; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--accent); color: var(--on-accent); padding: .6rem 1rem; border-radius: 8px; }
.skip-link:focus { top: 1rem; }

/* language switch: elements tagged data-l="en|pt" show only in the active language */
html[data-lang="en"] [data-l="pt"],
html[data-lang="pt"] [data-l="en"] { display: none !important; }

.icon { width: 1.1em; height: 1.1em; flex: none; }

/* 3 · HEADER --------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--border);
}
.nav-bar { height: var(--header-h); display: flex; align-items: center; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--text); font-family: var(--font-head); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  background: var(--grad); color: var(--on-accent); font-weight: 700; font-size: .95rem; letter-spacing: .02em;
}
/* your photo (admin/_data/profile.yml → photo) in a round gradient ring */
.brand-mark.has-photo { width: 42px; height: 42px; padding: 2px; border-radius: 50%; }
.brand-mark.has-photo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid var(--bg); }
.nav-links { display: flex; gap: .15rem; margin-left: auto; }
.nav-links a {
  position: relative; padding: .5rem .8rem; border-radius: 999px; color: var(--text-2);
  font-size: .92rem; font-weight: 500; transition: color .2s, background-color .2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-strong); }
.nav-actions { display: flex; align-items: center; gap: .4rem; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
  min-width: 38px; height: 38px; padding: 0 .55rem; border-radius: 11px;
  background: var(--surface); color: var(--text-2); border: 1px solid var(--border);
  font: 600 .8rem var(--font); cursor: pointer; transition: color .2s, border-color .2s, background-color .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
[data-theme="dark"] .i-moon, [data-theme="light"] .i-sun { display: none; }
.nav-toggle { display: none; }
.nav-toggle .i-close { display: none; }
.nav-toggle[aria-expanded="true"] .i-open { display: none; }
.nav-toggle[aria-expanded="true"] .i-close { display: inline; }

@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .nav-actions { margin-left: auto; }
  .nav-links {
    position: absolute; inset: var(--header-h) 0 auto 0; margin: 0;
    flex-direction: column; gap: .25rem; padding: .75rem 1.25rem 1.25rem;
    background: var(--bg); border-bottom: 1px solid var(--border);
    display: none; box-shadow: var(--shadow);
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: .8rem 1rem; border-radius: 12px; font-size: 1rem; }
}
@media (max-width: 420px) { .brand-name { display: none; } }

/* 4 · BUTTONS -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; padding: .8rem 1.3rem; border-radius: 999px;
  font: 600 .95rem var(--font); border: 1px solid transparent; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s, border-color .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn--primary { background: var(--grad); color: var(--on-accent); box-shadow: 0 10px 26px -10px var(--accent); }
.btn--primary:hover { box-shadow: 0 14px 32px -10px var(--accent); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--surface-2); }

.text-link { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; white-space: nowrap; }
.text-link .icon { transition: transform .2s; }
.text-link:hover .icon { transform: translateX(4px); }

/* 5 · HERO ----------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding: clamp(3rem, 8vw, 6rem) 0 2.5rem; }
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-bg::before, .hero-bg::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(70px);
  width: 46vw; height: 46vw; max-width: 620px; max-height: 620px;
}
.hero-bg::before { background: var(--glow-1); top: -18%; left: -10%; animation: drift 18s ease-in-out infinite alternate; }
.hero-bg::after  { background: var(--glow-2); bottom: -30%; right: -8%; animation: drift 22s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(40px, 30px) scale(1.08); } }

.hero-grid { position: relative; display: grid; grid-template-columns: 1.25fr .75fr; align-items: center; gap: 3rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem; margin-bottom: 1.1rem;
  font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}
.dot-sep { color: var(--muted); }
.hero-title { font-size: clamp(2.6rem, 6.4vw, 4.6rem); margin-bottom: .4em; }
.hero-title .hello { display: block; font-size: .42em; font-weight: 500; color: var(--text-2); letter-spacing: 0; margin-bottom: .25em; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-summary { max-width: 58ch; font-size: 1.1rem; color: var(--text-2); margin-bottom: 1.8rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.8rem; }

.social { display: flex; gap: .5rem; list-style: none; flex-wrap: wrap; }
.social a {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  color: var(--text-2); background: var(--surface); border: 1px solid var(--border);
  transition: color .2s, border-color .2s, transform .2s;
}
.social a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-3px); text-decoration: none; }
.social .icon { width: 20px; height: 20px; }

.hero-photo { display: grid; place-items: center; }
.photo-ring {
  position: relative; width: min(100%, 360px); aspect-ratio: 1; border-radius: 50%; padding: 6px;
  background: var(--grad); box-shadow: 0 30px 70px -25px var(--accent);
}
.photo-ring::before {
  content: ""; position: absolute; inset: -18px; border-radius: 50%;
  border: 1px dashed var(--border-strong); animation: spin 60s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.photo-ring img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 5px solid var(--bg); }

.stats { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 1rem; list-style: none; margin-top: 3.2rem; }
.stats li {
  display: flex; flex-direction: column; gap: .2rem; padding: 1.1rem 1.3rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.stats strong { font: 700 2rem/1 var(--font-head); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats span { color: var(--muted); font-size: .9rem; line-height: 1.4; }

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero-photo { order: -1; justify-self: start; }
  .photo-ring { width: 190px; }
  .photo-ring::before { inset: -12px; }
}

/* 6 · SECTIONS & CARDS ----------------------------------------------------- */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section--tight { padding-top: 1rem; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.8rem; }
.section-head h2 { margin-bottom: .15em; }
.section-head p { margin: 0; color: var(--muted); }
.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; gap: 2.2rem; } }

.page-head { padding: clamp(2.5rem, 6vw, 4.2rem) 0 1rem; }
.page-head--center { text-align: center; padding-block: 6rem; }
.page-head h1 { margin-bottom: .3em; }
.lead { max-width: 64ch; font-size: 1.1rem; color: var(--text-2); }
.page-head--center .lead { margin-inline: auto; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); gap: 1.25rem; }
.card, .tile, .mini-card {
  display: flex; flex-direction: column; color: inherit; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.card:hover, .tile:hover, .mini-card:hover, .hobby-card:hover, .contact-card:hover {
  text-decoration: none; transform: translateY(-5px); border-color: var(--border-strong); box-shadow: var(--shadow);
}
.card-media { height: 170px; }
.card-body { padding: 1.25rem 1.3rem 1.4rem; display: flex; flex-direction: column; gap: .15rem; }
.card-body h3 { margin: .55rem 0 .1rem; }
.card-sub { color: var(--muted); font-size: .88rem; margin-bottom: .6rem; }
.card-text { color: var(--text-2); font-size: .95rem; margin: 0; }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 1.1rem; }
.tile { position: relative; padding: 1.5rem; gap: .3rem; }
.tile h3 { margin: .7rem 0 .2rem; }
.tile p { color: var(--muted); font-size: .93rem; margin: 0; padding-right: 1.5rem; }
.tile-icon {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
}
.tile-icon .icon { width: 22px; height: 22px; }
.tile-arrow { position: absolute; right: 1.2rem; bottom: 1.2rem; color: var(--muted); transition: transform .2s, color .2s; }
.tile:hover .tile-arrow { transform: translateX(5px); color: var(--accent); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem 1.5rem; }
.panel-title { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 1rem; }

/* 7 · CHIPS & SKILLS ------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; }
.chips li {
  padding: .22rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 500;
  color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border);
}
.chips .chip-more { color: var(--muted); }
.chips--lg li { font-size: .95rem; padding: .45rem 1rem; }

.skill-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 1.25rem; }
.skills { display: flex; flex-wrap: wrap; gap: .55rem; list-style: none; margin-top: 1rem; }
.skill-groups .skills { margin-top: 0; }
.skill {
  display: inline-flex; align-items: center; gap: .55rem; padding: .35rem .85rem .35rem .4rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: .88rem; font-weight: 500; color: var(--text-2);
}
.skill-ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--tile-bg); flex: none; }
.skill-ico img { width: 18px; height: 18px; }
.skill-ico--dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); opacity: .6; }
.skill.is-core {
  color: var(--text); border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-2));
}
.legend { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .85rem; margin: .5rem 0 0; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 30%, transparent); }

/* 8 · TAGS & MEDIA --------------------------------------------------------- */
.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag {
  --tc: var(--c-slate);
  display: inline-block; padding: .18rem .65rem; border-radius: 999px; font-size: .72rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: var(--tc);
  background: var(--surface-2); border: 1px solid var(--border);
  background: color-mix(in srgb, var(--tc) 14%, transparent); border-color: color-mix(in srgb, var(--tc) 38%, transparent);
}
.tag--blue { --tc: var(--c-blue); } .tag--green { --tc: var(--c-green); } .tag--amber { --tc: var(--c-amber); }
.tag--rose { --tc: var(--c-rose); } .tag--violet { --tc: var(--c-violet); } .tag--teal { --tc: var(--c-teal); }
.tag--slate { --tc: var(--c-slate); }

/* cover image / gradient placeholder with initials */
.card-media, .tl-media, .hobby-media, .mini-media {
  position: relative; overflow: hidden; background: var(--g, var(--surface-2)); display: grid; place-items: center;
}
.card-media img, .tl-media img, .hobby-media img, .mini-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover img, .tl-card:hover img, .hobby-card:hover img, .mini-card:hover img { transform: scale(1.05); }
.is-contain { background: var(--tile-bg) !important; }
.is-contain img { object-fit: contain !important; padding: 12%; }
.is-contain.is-bleed img { padding: 0 !important; }   /* logo with its own background (cover_bg) */
.is-empty { background: var(--g); }
.media-initials { font: 700 2.2rem var(--font-head); color: rgba(255, 255, 255, .92); letter-spacing: .06em; text-transform: uppercase; text-shadow: 0 2px 18px rgba(0, 0, 0, .25); }
.hue-0 { --g: linear-gradient(135deg, #3d63c9, #7c5ac9); }
.hue-1 { --g: linear-gradient(135deg, #1c7f86, #3d63c9); }
.hue-2 { --g: linear-gradient(135deg, #c9803d, #c94d6e); }
.hue-3 { --g: linear-gradient(135deg, #2b8a63, #1c7f86); }
.hue-4 { --g: linear-gradient(135deg, #7c5ac9, #c94d6e); }
.hue-5 { --g: linear-gradient(135deg, #53708f, #b57b66); }

/* 9 · TIMELINE ------------------------------------------------------------- */
/* Experience: two views (data-active="employee|own"). Items outside the active track get
   .is-compact and fold down to a single title row; the ones inside stay full cards. */
.timeline { --date-w: 9.5rem; --gap: 3rem; --t: .45s; list-style: none; position: relative; padding: .5rem 0 1rem; }
.timeline::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--date-w) + var(--gap) / 2 - 1px); width: 2px; border-radius: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--accent-2) 75%, transparent);
}
.tl-item { position: relative; display: grid; grid-template-columns: var(--date-w) 1fr; column-gap: var(--gap); padding-bottom: 2rem; transition: padding-bottom var(--t) ease; }
.tl-date {
  text-align: right; padding-top: 1.2rem; font-weight: 600; font-size: .9rem; color: var(--text-2); line-height: 1.3;
  transition: padding-top var(--t) ease, font-size var(--t) ease, color var(--t) ease;
}
.tl-dot {
  position: absolute; top: 1.45rem; left: calc(var(--date-w) + var(--gap) / 2 - 8px);
  width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent);
  box-shadow: 0 0 0 5px var(--bg); transition: top var(--t) ease, transform var(--t) ease, background-color .3s ease;
}
.tl-item[data-current] .tl-dot { background: var(--accent); }
.tl-item[data-current] .tl-dot::after {
  content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 2px solid var(--accent);
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.5); opacity: 0; } }

.tl-card {
  display: grid; grid-template-columns: 180px 1fr; color: inherit; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  transition: grid-template-columns var(--t) ease, background-color var(--t) ease, transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.tl-card:hover { text-decoration: none; transform: translateX(6px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.tl-media { min-width: 0; min-height: 100%; transition: height var(--t) ease; }
.tl-body { min-width: 0; padding: 1.25rem 1.4rem 1.2rem; display: flex; flex-direction: column; transition: padding var(--t) ease; }

/* foldable parts: grid-rows 1fr → 0fr animates the height without knowing it */
.tl-fold { display: grid; grid-template-rows: 1fr; transition: grid-template-rows var(--t) ease, opacity .35s ease; }
.tl-fold-in { overflow: hidden; min-height: 0; }
.tl-fold-in > .tags { padding-bottom: .6rem; }
.tl-title { margin: 0 0 .1rem; font-size: 1.3rem; transition: font-size var(--t) ease, color var(--t) ease, margin var(--t) ease; }
.tl-sub { margin: 0 0 .6rem; font-weight: 500; color: var(--accent); font-size: .92rem; }
.tl-text { color: var(--text-2); font-size: .95rem; margin-bottom: .8rem; }
.tl-body .chips { margin-bottom: .9rem; }
.tl-more { display: inline-flex; align-items: center; gap: .4rem; margin-top: auto; font-weight: 600; font-size: .9rem; color: var(--accent); }
.tl-card:hover .tl-more .icon { transform: translateX(4px); }
.tl-more .icon { transition: transform .2s; }

/* collapsed state */
.tl-item.is-compact { padding-bottom: .7rem; }
.is-compact .tl-date { padding-top: .78rem; font-size: .8rem; color: var(--muted); }
.is-compact .tl-dot { top: .98rem; transform: scale(.6); background: var(--surface-2); }
.is-compact .tl-card { grid-template-columns: 0px 1fr; background: transparent; }
.is-compact .tl-body { padding: .7rem 1.1rem; }
.is-compact .tl-fold { grid-template-rows: 0fr; opacity: 0; }
.is-compact .tl-title { margin: 0; font-size: 1rem; font-weight: 500; color: var(--text-2); }
.is-compact .tl-card:hover { transform: translateX(4px); }
.is-compact .tl-card:hover .tl-title { color: var(--accent); }
.timeline:not(.is-ready) *, .timeline:not(.is-ready) *::before { transition: none !important; }

/* switch above the timeline */
.track-bar {
  position: sticky; top: var(--header-h); z-index: 40; padding: .8rem 0; margin-top: .6rem;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-block: 1px solid var(--border);
}
html:not(.js) .track-bar { display: none; }
.track-inner { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1.5rem; }
.track-switch {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; width: min(100%, 560px); padding: 4px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--border-strong);
}
.track-thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px;
  background: var(--grad); box-shadow: 0 8px 22px -10px var(--accent); transition: transform .4s cubic-bezier(.4, 0, .2, 1);
}
.track-bar[data-active="own"] .track-thumb { transform: translateX(100%); }
.track-btn {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .6rem .9rem; border: 0; border-radius: 999px; background: none; cursor: pointer;
  font: 600 .92rem/1.2 var(--font); color: var(--text-2); transition: color .25s ease;
}
.track-btn:hover { color: var(--text); }
.track-btn[aria-selected="true"] { color: var(--on-accent); }
.track-btn .icon { flex: none; }
.track-count {
  font: 700 .72rem var(--font); font-style: normal; min-width: 1.5em; padding: .1em .45em; border-radius: 999px; text-align: center;
  background: color-mix(in srgb, currentColor 16%, transparent);
}
.track-hint { margin: 0; flex: 1 1 260px; color: var(--muted); font-size: .88rem; line-height: 1.4; }
.track-hint { display: none; }
.track-bar[data-active="employee"] .track-hint[data-for="employee"],
.track-bar[data-active="own"] .track-hint[data-for="own"] { display: block; }

@media (max-width: 760px) {
  .timeline { --date-w: 0rem; --gap: 0rem; padding-left: 1.6rem; }
  .timeline::before { left: 6px; }
  .tl-item { grid-template-columns: 1fr; }
  .tl-date, .is-compact .tl-date { text-align: left; padding: 0 0 .5rem; }
  .tl-date { color: var(--accent); }
  .is-compact .tl-date { padding-bottom: .35rem; }
  .tl-dot, .is-compact .tl-dot { left: calc(-1.6rem + 6px - 8px + 1px); top: .2rem; }
  .tl-card, .is-compact .tl-card { grid-template-columns: 1fr; }
  .tl-media { height: 150px; min-height: 0; }
  .is-compact .tl-media { height: 0; }
  .track-hint { display: none !important; }
  .track-btn { flex-direction: column; gap: .15rem; padding: .55rem .5rem; font-size: .82rem; text-align: center; }
  .track-btn .track-count { display: none; }
}

/* 10 · HOBBIES ------------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.4rem; }
.filter {
  padding: .45rem 1rem; border-radius: 999px; background: var(--surface); color: var(--text-2);
  border: 1px solid var(--border); font: 500 .88rem var(--font); cursor: pointer; transition: all .2s;
}
.filter:hover { border-color: var(--border-strong); color: var(--text); }
.filter.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.hobby-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 1.25rem; }
.hobby-card {
  display: flex; flex-direction: column; color: inherit; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.hobby-card[hidden] { display: none; }
.hobby-media { aspect-ratio: 4 / 3; }
.hobby-body { padding: 1.15rem 1.3rem 1.4rem; }
.hobby-body h3 { margin: .6rem 0 .3rem; font-size: 1.2rem; }
.hobby-date { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .85rem; margin-bottom: .5rem; }
.hobby-text { color: var(--text-2); font-size: .94rem; margin: 0; }

/* 11 · LANGUAGES ----------------------------------------------------------- */
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 1.25rem; }
.lang-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.lang-top h2 { margin: 0; font-size: 1.5rem; }
.cefr { padding: .2rem .7rem; border-radius: 8px; font: 700 .85rem var(--font-head); color: var(--on-accent); background: var(--grad); }
.lang-level { color: var(--text-2); margin: .3rem 0 1rem; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 99px; background: var(--grad); }
.lang-note { margin: 1rem 0 0; color: var(--muted); font-size: .92rem; }

/* 12 · CONTACTS ------------------------------------------------------------ */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 1rem; }
.contact-card {
  display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.contact-card.is-static:hover { transform: none; box-shadow: none; border-color: var(--border); }
.contact-icon {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; flex: none;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
}
.contact-icon .icon { width: 22px; height: 22px; }
.contact-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.contact-text small { color: var(--muted); font-size: .8rem; }
.contact-text strong { font-weight: 600; overflow-wrap: anywhere; }
.contact-go { margin-left: auto; color: var(--muted); transition: transform .2s, color .2s; }
.contact-card:hover .contact-go { transform: translateX(4px); color: var(--accent); }

/* 13 · DETAIL PAGE --------------------------------------------------------- */
.detail-hero { padding: clamp(1.8rem, 4vw, 3rem) 0 1.5rem; background: radial-gradient(900px 300px at 15% 0%, var(--glow-1), transparent 70%); }
.detail-hero-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: center; }
.detail-hero-grid:has(.detail-cover) { grid-template-columns: 1.3fr .8fr; }
.back-link { display: inline-flex; align-items: center; gap: .4rem; margin-bottom: 1.4rem; color: var(--muted); font-size: .9rem; font-weight: 500; }
.back-link:hover { color: var(--accent); text-decoration: none; }
.detail-head .tags { margin-bottom: .8rem; }
.detail-title { font-size: clamp(2rem, 4.6vw, 3.2rem); margin-bottom: .2em; }
.detail-sub { font-size: 1.2rem; color: var(--accent); font-weight: 500; margin-bottom: 1rem; }
.meta { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; list-style: none; margin-bottom: 1.2rem; color: var(--text-2); font-size: .93rem; }
.meta li { display: inline-flex; align-items: center; gap: .45rem; }
.meta .icon { color: var(--muted); }
.detail-lead { font-size: 1.1rem; color: var(--text-2); max-width: 62ch; margin: 0; }
.detail-cover {
  margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
  box-shadow: var(--shadow); aspect-ratio: 4 / 3; background: var(--surface-2);
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-cover.is-contain img { object-fit: contain; padding: 14%; }
.detail-cover.is-contain.is-bleed img { padding: 0; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2rem; padding-block: 1.5rem 2.5rem; align-items: start; }
.detail-grid:not(:has(.detail-side)) { grid-template-columns: minmax(0, 1fr); max-width: 820px; }
.detail-main, .detail-side { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.detail-side { position: sticky; top: calc(var(--header-h) + 18px); }
.check-list { list-style: none; display: grid; gap: .8rem; }
.check-list li { display: grid; grid-template-columns: 22px 1fr; gap: .7rem; color: var(--text-2); }
.check-list .icon { color: var(--accent); margin-top: .2rem; }

.story { padding: .5rem .25rem; }
.prose { color: var(--text-2); font-size: 1.05rem; line-height: 1.75; overflow-wrap: anywhere; }
.prose h2 { font-size: 1.4rem; margin-top: 1.8em; color: var(--text); }
.prose h3 { margin-top: 1.5em; color: var(--text); }
.prose strong { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3rem; margin-bottom: 1em; }
.prose li { margin-bottom: .45em; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose blockquote { margin: 1.2em 0; padding: .2em 1.2em; border-left: 3px solid var(--accent); color: var(--muted); }
.prose code { padding: .1em .4em; border-radius: 6px; background: var(--surface-2); font-size: .9em; }
.prose pre { overflow-x: auto; padding: 1rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.prose pre code { padding: 0; background: none; }
.prose img { border-radius: var(--radius-sm); border: 1px solid var(--border); cursor: zoom-in; }
.prose p:has(> img) { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: .8rem; }
.prose p:has(> img:only-child) { display: block; }

.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 1rem; }
.mini-card { background: var(--surface-2); }
.mini-media { height: 110px; }
.mini-body { padding: .9rem 1rem 1.1rem; }
.mini-body h3 { font-size: 1rem; margin: .5rem 0 .15rem; }
.mini-body p { margin: 0; color: var(--muted); font-size: .85rem; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: .9rem; }
.gallery-item { margin: 0; }
.gallery-item a { display: block; overflow: hidden; border-radius: var(--radius-sm); border: 1px solid var(--border); aspect-ratio: 4 / 3; cursor: zoom-in; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.gallery-item a:hover img { transform: scale(1.06); }
/* crops of portrait photos keep the upper part (faces) in frame */
.gallery-item img, .hobby-media:not(.is-contain) img, .detail-cover:not(.is-contain) img { object-position: 50% 15%; }
.gallery-item figcaption { margin-top: .4rem; font-size: .82rem; color: var(--muted); }

.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 1rem; }
.video-item { margin: 0; }
.video-item video { width: 100%; display: block; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #000; }
.video-item figcaption { margin-top: .5rem; font-size: .85rem; color: var(--muted); }

.link-list { list-style: none; display: grid; gap: .5rem; }
.link-list a { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border-radius: 10px; background: var(--surface-2); color: var(--text); font-weight: 500; font-size: .92rem; }
.link-list a:hover { text-decoration: none; background: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); color: var(--accent); }

.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-block: 1rem 3.5rem; }
.pager-link {
  display: flex; flex-direction: column; gap: .15rem; max-width: 48%; min-width: 0; overflow-wrap: anywhere; padding: 1rem 1.3rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color .2s, transform .2s;
}
.pager-link:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-3px); }
.pager-link small { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.pager-link span { font-weight: 600; }
.pager-link.is-next { margin-left: auto; text-align: right; }
.pager-link.is-next small { justify-content: flex-end; }

@media (max-width: 520px) { .pager-link, .pager-link.is-next { max-width: 100%; flex: 1 1 100%; margin-left: 0; text-align: left; } .pager-link.is-next small { justify-content: flex-start; } }

@media (max-width: 900px) {
  .detail-hero-grid:has(.detail-cover) { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-side { position: static; }
  .detail-cover { max-width: 460px; }
}

/* 14 · FOOTER -------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: 1.6rem; }
.footer-inner p { margin: 0; color: var(--muted); font-size: .88rem; }
.site-footer .social a { width: 38px; height: 38px; }
.footer-badge { display: inline-flex; align-items: center; }
.footer-badge img { display: block; }

/* 15 · LIGHTBOX ------------------------------------------------------------ */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 2rem 1rem;
  background: rgba(4, 7, 12, .9); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 94vw; text-align: center; }
.lightbox img { max-width: 94vw; max-height: 80vh; margin-inline: auto; border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.lightbox figcaption { margin-top: .9rem; color: #d3dbe6; font-size: .95rem; }
.lightbox-close { position: absolute; top: 1rem; right: 1rem; }

/* 16 · MOTION -------------------------------------------------------------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .tl-item.reveal.is-visible .tl-card:hover { transform: translateX(6px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .nav-actions, .site-footer, .lightbox, .filters, .pager, .back-link { display: none !important; }
  body { background: #fff; color: #000; }
}
