:root {
  color-scheme: light;
  --bg: #f7f7f7;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-strong: #0b0b0c;
  --text: #0b0b0c;
  --text-invert: #ffffff;
  --muted: #696969;
  --muted-strong: #343434;
  --line: #dedede;
  --line-strong: #bcbcbc;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.08);
  --radius: 8px;
  --radius-lg: 8px;
  --shell: min(1120px, calc(100vw - 40px));
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Arial, sans-serif;
}

html.dark {
  color-scheme: dark;
  --bg: #050505;
  --bg-soft: #0b0b0c;
  --surface: #101011;
  --surface-strong: #ffffff;
  --text: #f5f5f5;
  --text-invert: #050505;
  --muted: #9a9a9a;
  --muted-strong: #d8d8d8;
  --line: #252525;
  --line-strong: #3a3a3a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), transparent 55%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), transparent 55%);
}

html.dark body::before {
  background:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
}

img,
svg {
  display: block;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

::selection {
  background: var(--text);
  color: var(--text-invert);
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 1000;
  padding: 10px 14px;
  background: var(--surface-strong);
  color: var(--text-invert);
  border-radius: var(--radius);
  transform: translateY(-140%);
  transition: transform 180ms var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.scroll-meter {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 0;
  height: 2px;
  background: var(--surface-strong);
}

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(22px) saturate(160%);
  transition: border-color 180ms var(--ease), background 180ms var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
}

.header-inner {
  min-height: 72px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.brand-copy strong,
.brand-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy strong {
  font-size: 0.92rem;
  letter-spacing: 0;
}

.brand-copy span {
  color: var(--muted);
  font-size: 0.78rem;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav a {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 0.86rem;
  text-decoration: none;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.is-active {
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  transition: transform 160ms var(--ease), border-color 160ms var(--ease);
}

.icon-button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.icon-button:focus-visible,
.button:focus-visible,
.filter-button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-section {
  min-height: calc(100svh - 72px);
  display: grid;
  align-content: center;
  padding: clamp(56px, 9vw, 128px) 0 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  align-items: center;
  gap: clamp(34px, 7vw, 92px);
}

.hero-copy {
  max-width: 760px;
}

.eyebrow,
.section-label {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 860px;
  margin-bottom: 20px;
  font-size: 9.5rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 0.84;
}

h2 {
  margin-bottom: 18px;
  font-size: 4.5rem;
  font-weight: 680;
  letter-spacing: 0;
  line-height: 0.98;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.1rem;
  line-height: 1.2;
}

.hero-lede,
.section-lede {
  max-width: 780px;
  color: var(--muted-strong);
  font-size: 1.85rem;
  letter-spacing: 0;
  line-height: 1.18;
}

.hero-lede {
  margin-bottom: 30px;
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 11px 18px;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 160ms var(--ease),
    background 160ms var(--ease),
    color 160ms var(--ease),
    border-color 160ms var(--ease);
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  border-color: var(--surface-strong);
  background: var(--surface-strong);
  color: var(--text-invert);
}

.button-secondary {
  background: transparent;
  color: var(--text);
}

.button-secondary:hover {
  border-color: var(--surface-strong);
  background: var(--surface);
}

.profile-frame {
  justify-self: end;
  width: min(100%, 420px);
}

.portrait-wrap {
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.portrait-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
}

.profile-caption {
  display: grid;
  gap: 4px;
  padding: 18px 4px 0;
}

.profile-caption p {
  margin: 0;
  color: var(--muted);
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text) !important;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--text) 10%, transparent);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: clamp(40px, 7vw, 86px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--line);
}

.metric {
  min-height: 122px;
  display: grid;
  align-content: space-between;
  gap: 18px;
  padding: 22px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.metric strong {
  font-size: 3rem;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1;
}

.metric span {
  color: var(--muted);
  font-size: 0.9rem;
}

.section {
  padding: clamp(76px, 11vw, 150px) 0;
}

.section-ruled {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-soft) 72%, transparent);
}

.section-grid {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: clamp(28px, 6vw, 88px);
}

.section-label {
  position: sticky;
  top: 94px;
  align-self: start;
  margin: 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: clamp(26px, 4vw, 44px);
}

.section-heading p,
.contact-panel p {
  color: var(--muted-strong);
  font-size: 1.06rem;
}

.focus-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: clamp(32px, 5vw, 56px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--line);
}

.focus-card {
  min-height: 190px;
  display: grid;
  align-content: space-between;
  gap: 22px;
  padding: 24px;
  background: var(--surface);
}

.focus-card p {
  margin: 0;
  color: var(--muted);
}

.item-meta,
.project-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.xp-panel p,
.project-card p,
.compact-card p {
  color: var(--muted-strong);
}

.clean-list {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.clean-list li {
  position: relative;
  padding-left: 18px;
  color: var(--muted-strong);
}

.clean-list li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 6px;
  height: 1px;
  background: var(--text);
}

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

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted-strong);
  font-size: 0.78rem;
  white-space: nowrap;
}

.project-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.filter-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease);
}

.filter-button:hover,
.filter-button[aria-pressed="true"] {
  border-color: var(--surface-strong);
  background: var(--surface-strong);
  color: var(--text-invert);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.project-card,
.skill-card,
.compact-card,
.contact-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.project-card {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.project-card.is-featured {
  border-top: 2px solid var(--text);
}

.project-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text-invert);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  width: fit-content;
}

.project-card header {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.project-card h3 {
  font-size: 1.75rem;
}

.impact-line {
  margin: auto 0 0;
  padding-top: 20px;
  color: var(--text);
  font-weight: 600;
}

.project-link {
  display: inline-flex;
  width: fit-content;
  margin-top: 20px;
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
}

.project-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.skill-card {
  padding: 22px;
}

.skill-card h3 {
  margin-bottom: 16px;
}

.compact-list {
  display: grid;
  gap: 12px;
}

.compact-card {
  padding: 22px;
}

.compact-card p:last-child,
.project-card p:last-child,
.skill-card p:last-child {
  margin-bottom: 0;
}

.contact-section {
  padding-bottom: clamp(70px, 10vw, 130px);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(320px, 0.72fr);
  gap: clamp(28px, 6vw, 84px);
  align-items: start;
}

.contact-grid h2 {
  max-width: 720px;
}

.contact-panel {
  display: grid;
  gap: 24px;
  padding: clamp(24px, 4vw, 38px);
  box-shadow: var(--shadow);
}

.contact-actions {
  margin-top: 0;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 8px;
}

.social-links a {
  color: var(--muted-strong);
  font-weight: 650;
  text-decoration: none;
}

.social-links a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-inner p {
  margin: 0;
}

.footer-inner a {
  text-decoration: none;
}

.footer-inner a:hover {
  color: var(--text);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

.load-error {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: var(--surface);
  color: var(--text);
}

@media (max-width: 980px) {
  :root {
    --shell: min(100vw - 28px, 760px);
  }

  .site-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    order: 3;
    padding-bottom: 12px;
  }

  .icon-button {
    justify-self: end;
  }

  .hero-section {
    min-height: auto;
  }

  h1 {
    font-size: 6.8rem;
  }

  h2 {
    font-size: 3.35rem;
  }

  .hero-lede,
  .section-lede {
    font-size: 1.55rem;
  }

  .metric strong {
    font-size: 2.55rem;
  }

  .hero-grid,
  .section-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .profile-frame {
    justify-self: stretch;
    width: min(100%, 520px);
  }

  .section-label {
    position: static;
  }

  .metric-strip,
  .focus-grid,
  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  :root {
    --shell: min(100vw - 24px, 560px);
  }

  html {
    scroll-padding-top: 118px;
  }

  .header-inner {
    gap: 12px;
    min-height: 64px;
  }

  .brand-copy span {
    display: none;
  }

  h1 {
    font-size: 4.2rem;
  }

  h2 {
    font-size: 2.45rem;
  }

  .hero-lede,
  .section-lede {
    font-size: 1.28rem;
  }

  .metric strong {
    font-size: 2.2rem;
  }

  .project-card h3 {
    font-size: 1.35rem;
  }

  .hero-actions,
  .contact-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .metric-strip,
  .focus-grid,
  .project-grid,
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    min-height: auto;
  }

  .footer-inner {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* ── Header: two icon buttons ─────────────────────────── */
.header-inner {
  grid-template-columns: auto 1fr auto auto;
}

[data-lang-label] {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* ── Experience: horizontal scroll-driven timeline ────── */
.xp-section {
  position: relative;
}

.xp-scroll {
  position: relative;
}

.is-pinned .xp-scroll {
  height: calc(var(--xp-count, 3) * 100vh);
}

.xp-sticky {
  display: flex;
  flex-direction: column;
}

.is-pinned .xp-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  padding-top: 72px;
}

.xp-viewport {
  width: 100%;
}

.is-pinned .xp-viewport {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.is-carousel .xp-viewport {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 8px;
}

.is-carousel .xp-viewport::-webkit-scrollbar {
  display: none;
}

.xp-track {
  display: flex;
  width: 100%;
}

.is-pinned .xp-track {
  height: 100%;
  will-change: transform;
}

.is-stacked .xp-track {
  flex-direction: column;
  gap: 4px;
}

.xp-panel {
  position: relative;
  flex: 0 0 100%;
  min-width: 0;
  display: flex;
  align-items: center;
}

.is-carousel .xp-panel {
  flex: 0 0 86%;
  scroll-snap-align: center;
  padding-right: 14px;
}

.is-stacked .xp-panel {
  flex: 0 0 auto;
}

.xp-panel-inner {
  position: relative;
  z-index: 1;
  width: var(--shell);
  margin-inline: auto;
}

.is-carousel .xp-panel-inner {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 26px;
}

.is-stacked .xp-panel-inner {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.is-stacked .xp-panel:first-child .xp-panel-inner {
  border-top: 0;
}

/* Ghost year that drifts behind the active card (the "time" effect). */
.xp-ghost {
  position: absolute;
  z-index: 0;
  right: 2%;
  top: 50%;
  transform: translateY(-50%);
  font-size: clamp(9rem, 32vw, 28rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--text);
  opacity: 0.05;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

.is-carousel .xp-ghost,
.is-stacked .xp-ghost {
  display: none;
}

/* Active-panel emphasis, driven by --xp-d (0 = centered, 1 = far). */
.is-pinned .xp-panel-inner {
  opacity: calc(1 - var(--xp-d, 1) * 0.82);
  transform: translateY(calc(var(--xp-d, 1) * 30px));
  transition: opacity 140ms linear, transform 140ms linear;
}

.xp-panel-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.xp-index {
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.xp-range {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.xp-role {
  margin-bottom: 10px;
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
}

.xp-company {
  margin-bottom: 20px;
  font-size: 1rem;
}

.xp-summary {
  max-width: 62ch;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.32;
}

.xp-highlights {
  max-width: 72ch;
}

.is-pinned .xp-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 28px;
}

.xp-panel .tag-row {
  max-width: 74ch;
}

/* Time-axis rail with year ticks and a travelling progress fill. */
.xp-rail {
  position: relative;
  display: flex;
  justify-content: space-between;
  width: var(--shell);
  margin: clamp(26px, 4vh, 52px) auto 0;
}

.is-pinned .xp-rail {
  flex: 0 0 auto;
  margin-bottom: clamp(28px, 5vh, 56px);
}

.xp-rail::before,
.xp-rail::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  height: 2px;
  background: var(--line);
}

.xp-rail::before {
  right: 0;
}

.xp-rail::after {
  width: var(--xp-fill, 0%);
  background: var(--text);
  transition: width 140ms linear;
}

.is-stacked .xp-rail {
  display: none;
}

.xp-tick {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.xp-tick-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--line-strong);
  transition: transform 200ms var(--ease), background 200ms var(--ease), border-color 200ms var(--ease);
}

.xp-tick.is-active .xp-tick-dot {
  background: var(--text);
  border-color: var(--text);
}

.xp-tick[aria-current="true"] .xp-tick-dot {
  transform: scale(1.25);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--text) 12%, transparent);
}

.xp-tick-label {
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  transition: color 200ms var(--ease);
}

.xp-tick[aria-current="true"] .xp-tick-label {
  color: var(--text);
}

.xp-hint {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: opacity 320ms var(--ease);
}

.xp-hint svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: xp-bob 1.7s ease-in-out infinite;
}

.xp-hint.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.is-carousel .xp-hint,
.is-stacked .xp-hint {
  display: none;
}

@keyframes xp-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

@media (max-width: 980px) {
  .is-pinned .xp-highlights {
    grid-template-columns: 1fr;
  }
}

/* ── Back-to-top floating button ──────────────────────── */
.back-to-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 90;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 220ms var(--ease),
    transform 220ms var(--ease),
    border-color 160ms var(--ease);
  pointer-events: none;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  border-color: var(--text);
  transform: translateY(-2px);
}

.back-to-top svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Social links with avatar ─────────────────────────── */
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.social-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  object-fit: cover;
  flex-shrink: 0;
}

/* ── GitHub dashboard ─────────────────────────────────── */
.gh-loading {
  display: flex;
  gap: 10px;
  padding: 16px 0;
}

.gh-loading span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
  animation: gh-pulse 1.2s ease-in-out infinite;
}

.gh-loading span:nth-child(2) { animation-delay: 0.2s; }
.gh-loading span:nth-child(3) { animation-delay: 0.4s; }

@keyframes gh-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}

.gh-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--line);
}

.gh-stat {
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 20px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.gh-stat strong {
  font-size: 2.2rem;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0;
}

.gh-stat span {
  color: var(--muted);
  font-size: 0.85rem;
}

.gh-repos-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.gh-repo-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 180ms var(--ease), transform 180ms var(--ease);
}

.gh-repo-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.gh-repo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gh-repo-name {
  font-weight: 650;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gh-repo-name:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gh-repo-stars {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.gh-repo-desc {
  color: var(--muted-strong);
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gh-repo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  color: var(--muted);
  font-size: 0.78rem;
}

.gh-lang {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.gh-lang::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--lang-color, var(--muted));
}

.gh-error {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── Medium articles ──────────────────────────────────── */
.gh-medium-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 32px 0 14px;
}

.gh-sub-heading {
  font-size: 1rem;
  font-weight: 650;
  margin: 0;
  letter-spacing: 0;
}

.gh-medium-all {
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.gh-medium-all:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gh-medium-placeholder {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
}

.medium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 10px;
}

.medium-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface);
  transition: border-color 180ms var(--ease), transform 180ms var(--ease);
}

.medium-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.medium-title {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text);
  text-decoration: none;
}

.medium-title:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.medium-date {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: auto;
}

/* ── Responsive: dashboard ────────────────────────────── */
@media (max-width: 980px) {
  .gh-stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gh-repos-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .gh-stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gh-repos-grid {
    grid-template-columns: 1fr;
  }

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

  .back-to-top {
    right: 16px;
    bottom: 20px;
    width: 42px;
    height: 42px;
  }
}

@media print {
  :root,
  html.dark {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-strong: #000000;
    --text: #000000;
    --text-invert: #ffffff;
    --muted: #444444;
    --muted-strong: #222222;
    --line: #d4d4d4;
  }

  body::before,
  .site-header,
  .scroll-meter,
  .hero-actions,
  .project-controls,
  .site-footer {
    display: none !important;
  }

  .hero-section,
  .section {
    min-height: auto;
    padding: 28px 0;
  }

  .shell {
    width: 100%;
  }

  .hero-grid,
  .section-grid,
  .contact-grid,
  .project-grid,
  .skills-grid,
  .focus-grid,
  .metric-strip {
    grid-template-columns: 1fr;
  }

  .project-card,
  .skill-card,
  .compact-card,
  .contact-panel,
  .focus-card,
  .metric {
    break-inside: avoid;
    box-shadow: none;
  }
}
