@font-face {
  font-family: "Melon Tea";
  src: url("../assets/fonts/Melon%20Tea.otf") format("opentype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Midnight Slate Theme */
  --bg: #0B0B0D;
  --bg-raised: #17171B;
  --bg-subtle: #111115;
  --ink: #e8edf0;
  --ink-soft: #8fa5b0;
  --ink-faint: #7F8994;
  --rule: #303036;
  --rule-light: #41414A;
  --accent: #7189A8;
  --accent-base: #526B89;
  --accent-ink: #0B0B0D;
  --shadow: 0 4px 20px rgba(10, 12, 14, 0.7);

  --font-display: "Melon Tea", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Consolas, "Roboto Mono", "Liberation Mono", monospace;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --container: 42rem;
  --container-wide: 46rem;

  /* Motion tokens */
  --duration-micro: 80ms;
  --duration-quick: 150ms;
  --duration-fast: 250ms;
  --duration-medium: 350ms;
  --duration-slow: 400ms;
  --ease-smooth-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: ease-in-out;
  --ease-bounce-strong: cubic-bezier(0.34, 3.85, 0.64, 1);
}

/* ---------- wallpaper theme ---------- */
body.wallpaper-active,
html[data-theme="anime-wallpaper"] body {
  --bg: #0B0B0D;
  --bg-raised: rgba(18, 25, 35, 0.84);
  --bg-subtle: rgba(23, 32, 44, 0.76);
  --ink: #f8fafc;
  --ink-soft: #c8d0da;
  --ink-faint: #758090;
  --rule: rgba(113, 137, 168, 0.13);
  --rule-light: rgba(113, 137, 168, 0.22);
  --accent: #7189A8;
  --accent-base: #526B89;
  --accent-ink: #0B0B0D;
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.9);
}

* {
  box-sizing: border-box;
}


/* Minimal circular pointer follows the active theme accent. */
html, body, a, button, [role="button"], input, textarea, select {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='4' fill='%237189A8'/%3E%3C/svg%3E") 8 8, auto;
}

html[data-color-theme="light"],
html[data-color-theme="light"] body,
html[data-color-theme="light"] a,
html[data-color-theme="light"] button,
html[data-color-theme="light"] [role="button"],
html[data-color-theme="light"] input,
html[data-color-theme="light"] textarea,
html[data-color-theme="light"] select {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='4' fill='%23526F91'/%3E%3C/svg%3E") 8 8, auto;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition:
    background-color var(--duration-medium) var(--ease-smooth-out),
    color var(--duration-medium) var(--ease-smooth-out);
}

@media (prefers-reduced-motion: reduce) {
  html,
  body {
    scroll-behavior: auto;
  }

  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: normal;
  text-wrap: balance;
  margin: 0;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.path {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--accent);
}

/* ---------- nav ---------- */
nav.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1.25rem, 4vw, 2.5rem);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

nav.topbar .home {
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  font-weight: 600;
}

nav.topbar ul {
  list-style: none;
  display: flex;
  gap: clamp(0.9rem, 2vw, 1.5rem);
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

nav.topbar a {
  text-decoration: none;
  color: var(--ink-soft);
  position: relative;
  padding-bottom: 2px;
  transition: color var(--duration-quick) var(--ease-smooth-out);
}

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

nav.topbar a.active {
  color: var(--ink);
  font-weight: 600;
}

nav.topbar a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transition: right var(--duration-fast) var(--ease-smooth-out);
}

nav.topbar a:hover::after,
nav.topbar a.active::after {
  right: 0;
}

/* ---------- hero ---------- */
header.hero {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: clamp(2.75rem, 7vw, 5rem) clamp(1.25rem, 4vw, 2.5rem) clamp(2rem, 5vw, 3rem);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-faint);
  margin: 0 0 0.9rem;
}

.t-shimmer {
  position: relative;
  display: inline-block;
}

.t-shimmer::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(
    90deg,
    transparent 0%,
    transparent 35%,
    var(--accent) 50%,
    transparent 65%,
    transparent 100%
  );
  background-size: 300% 100%;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: t-shimmer 3.5s linear infinite;
}

@keyframes t-shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

h1.name {
  font-size: clamp(2.4rem, 4vw + 1rem, 3.75rem);
  line-height: 1.1;
  letter-spacing: normal;
}

.role {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  color: var(--accent);
  margin: 0.85rem 0 0;
}

.blurb {
  max-width: 44ch;
  margin: 1.1rem 0 0;
  color: var(--ink-soft);
}

.terminal {
  margin-top: 2rem;
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: var(--shadow);
  max-width: 32rem;
  overflow: hidden;
  transition:
    border-color var(--duration-medium) var(--ease-smooth-out),
    box-shadow var(--duration-medium) var(--ease-smooth-out);
}

.terminal:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--rule));
}

.terminal .bar {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--rule);
}

.terminal .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rule);
}

.terminal .bar > .dot:nth-of-type(1) {
  background-color: #ff5f57 !important;
}

.terminal .bar > .dot:nth-of-type(2) {
  background-color: #febc2e !important;
}

.terminal .bar > .dot:nth-of-type(3) {
  background-color: #28c840 !important;
}

.terminal .label {
  margin-left: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--ink-faint);
}

.terminal pre {
  margin: 0;
  padding: 1rem 1.1rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.75;
  color: var(--ink-soft);
  white-space: pre-wrap;
  min-height: 6.5rem;
}

.terminal .prompt {
  color: var(--accent);
}

.terminal .out {
  color: var(--ink);
}

.cursor {
  display: inline-block;
  width: 0.55ch;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}

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

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.cta-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  text-decoration: none;
  padding: 0.55rem 1rem;
  border-radius: 4px;
  border: 1px solid var(--rule);
  color: var(--ink);
  transition:
    border-color var(--duration-quick) var(--ease-smooth-out),
    color var(--duration-quick) var(--ease-smooth-out),
    background var(--duration-quick) var(--ease-smooth-out),
    transform var(--duration-quick) var(--ease-smooth-out);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn.primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1.5px);
}

.btn:not(.primary):hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1.5px);
}

/* ---------- GitHub profile and activity ---------- */
.github-profile-card,
.github-activity-card {
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg-raised) 82%, transparent);
}

.github-profile-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  margin: 1.35rem 0 1rem;
}

.github-avatar {
  width: 3.5rem;
  height: 3.5rem;
  flex: 0 0 3.5rem;
  border-radius: 50%;
  border: 1px solid var(--rule-light);
  object-fit: cover;
}

.github-profile-info {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 0.15rem;
}

.github-handle,
.github-profile-note,
.github-activity-heading span,
.github-chart-caption {
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.github-profile-info strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.github-profile-note {
  font-family: var(--font-body);
  font-size: 0.8rem;
}

.github-profile-link {
  flex: 0 0 auto;
  white-space: nowrap;
}

.github-activity-card {
  padding: 1rem;
}

.github-activity-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.github-chart-link {
  display: block;
  width: 100%;
  overflow-x: auto;
}

.github-contribution-chart {
  display: block;
  width: 100%;
  min-width: 34rem;
  height: auto;
  image-rendering: auto;
}

.github-chart-caption {
  margin: 0.65rem 0 0;
  font-size: 0.68rem;
}

html[data-color-theme="light"] .github-profile-card,
html[data-color-theme="light"] .github-activity-card {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(65, 83, 105, 0.25);
}

@media (max-width: 600px) {
  .github-profile-card {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .github-profile-link {
    width: 100%;
    justify-content: center;
  }

  .github-activity-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }
}

/* ---------- Interactive GitHub contribution calendar ---------- */
.github-calendar-wrap {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0.2rem 0 0.5rem;
}

.github-weekdays {
  display: flex;
  flex: 0 0 1.5rem;
  flex-direction: column;
  gap: 3px;
  margin-top: 1.55rem;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 0.72rem;
}

.github-weekdays span {
  height: 0.72rem;
}

.github-calendar {
  flex: 1 0 34rem;
  min-width: 34rem;
}

.github-month-labels,
.github-calendar-grid {
  display: grid;
  grid-template-columns: repeat(53, 0.72rem);
  column-gap: 3px;
  width: max-content;
}

.github-month-labels {
  min-height: 1.2rem;
  margin-bottom: 0.35rem;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 0.65rem;
}

.github-month-labels span {
  white-space: nowrap;
}

.github-calendar-grid {
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 0.72rem);
  row-gap: 3px;
}

.github-calendar-week {
  display: grid;
  grid-template-rows: repeat(7, 0.72rem);
  gap: 3px;
  width: 0.72rem;
}

.github-calendar-day {
  display: block;
  width: 0.72rem;
  height: 0.72rem;
  min-width: 0;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--ink-faint) 14%, transparent);
  border-radius: 2px;
  cursor: pointer;
  background: var(--bg-raised);
}

.github-calendar-day.level-0 { background: var(--bg-raised); }
.github-calendar-day.level-1 { background: #d5e4ef; }
.github-calendar-day.level-2 { background: #9bbbd3; }
.github-calendar-day.level-3 { background: #5d91b5; }
.github-calendar-day.level-4 { background: #285d82; }
.github-calendar-day:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.github-calendar-loading {
  color: var(--ink-faint);
  font-size: 0.8rem;
  padding: 0.75rem 0;
}

.github-calendar-tooltip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--rule-light);
  border-radius: 5px;
  background: var(--bg-raised);
  color: var(--ink);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  white-space: nowrap;
}

.github-calendar-tooltip[hidden] { display: none; }

html[data-color-theme="light"] .github-calendar-day.level-0 { background: #ebedf0; }
html[data-color-theme="light"] .github-calendar-day.level-1 { background: #c6e0d2; }
html[data-color-theme="light"] .github-calendar-day.level-2 { background: #8cc6a8; }
html[data-color-theme="light"] .github-calendar-day.level-3 { background: #4a9b70; }
html[data-color-theme="light"] .github-calendar-day.level-4 { background: #216e39; }

@media (max-width: 600px) {
  .github-calendar {
    flex-basis: 34rem;
  }
}
/* ---------- sections ---------- */
section {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 3.5rem) clamp(1.25rem, 4vw, 2.5rem);
  border-top: 1px solid var(--rule);
}

section.wide {
  max-width: var(--container-wide);
}

section > .path {
  display: block;
  margin-bottom: 0.6rem;
}

section h2 {
  font-size: clamp(1.4rem, 1vw + 1.1rem, 1.75rem);
  margin-bottom: 1.1rem;
}

section > p.lede {
  color: var(--ink-soft);
  max-width: 62ch;
}

/* ---------- repo list ---------- */
.repo-list {
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
}

.repo-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
  transition: background-color var(--duration-quick) var(--ease-smooth-out);
}

.repo-row:first-child {
  border-top: none;
}

.repo-row:hover {
  background: color-mix(in srgb, var(--bg-raised) 70%, var(--bg));
}

.repo-row a.repo-name {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid transparent;
  font-weight: 600;
  transition:
    color var(--duration-quick) var(--ease-smooth-out),
    border-color var(--duration-quick) var(--ease-smooth-out);
}

.repo-row a.repo-name:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.repo-row .repo-lang {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  align-self: start;
}

.repo-row .repo-note {
  grid-column: 1 / -1;
  color: var(--ink-soft);
  font-size: 0.875rem;
  margin: 0;
}

.repo-row .repo-note a {
  font-size: 0.8125rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  display: inline-block;
  transition:
    border-color var(--duration-quick) var(--ease-smooth-out),
    transform var(--duration-quick) var(--ease-smooth-out);
}

.repo-row .repo-note a:hover {
  border-bottom-color: var(--accent);
  transform: translateX(2px);
}

/* ---------- stack ---------- */
.stack-groups {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.stack-group .glabel {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin-bottom: 0.55rem;
}

.stack-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  padding: 0.35rem 0.7rem;
  border-radius: 4px;
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  color: var(--ink);
  transition:
    border-color var(--duration-quick) var(--ease-smooth-out),
    color var(--duration-quick) var(--ease-smooth-out),
    transform var(--duration-quick) var(--ease-smooth-out),
    background var(--duration-quick) var(--ease-smooth-out);
}

/* Skill icons: support both SVG and image-based icons */
.chip img,
.chip svg {
  display: block;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  object-fit: contain;
  vertical-align: middle;
  transition: transform var(--duration-quick) var(--ease-smooth-out);
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1.5px);
}

.chip:hover img,
.chip:hover svg {
  transform: scale(1.1);
}

/* ---------- contact ---------- */
.contact-block {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.1rem 1.25rem;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.contact-row .k {
  color: var(--ink-faint);
  min-width: 4.5rem;
}

.contact-val-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.contact-row a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-quick) var(--ease-smooth-out);
}

.contact-row a:hover {
  border-bottom-color: var(--accent);
}

.contact-row .val-text {
  color: var(--ink-soft);
}

.copy-btn {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  background: var(--bg-subtle);
  color: var(--ink-faint);
  border: 1px solid var(--rule);
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--duration-quick) var(--ease-smooth-out);
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.copy-btn.copied {
  border-color: #7189A8;
  color: #7189A8;
}

footer {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 2rem clamp(1.25rem, 4vw, 2.5rem) 3rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.footer-meta {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

/* ---------- split layout ---------- */
.split-layout {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.side-nav {
  margin: 2rem 0 1.5rem;
}

.side-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.side-link {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-faint);
  transition: color var(--duration-quick) var(--ease-smooth-out);
}

.side-indicator {
  display: inline-block;
  width: 1.25rem;
  height: 1px;
  background: var(--rule);
  transition:
    width var(--duration-fast) var(--ease-smooth-out),
    background var(--duration-fast) var(--ease-smooth-out);
}

.side-link:hover,
.side-link.active {
  color: var(--ink);
}

.side-link:hover .side-indicator,
.side-link.active .side-indicator {
  width: 2.75rem;
  background: var(--accent);
}

@media (max-width: 1023px) {
  .side-nav {
    display: none;
  }
}

@media (min-width: 1024px) {
  nav.topbar {
    display: none;
  }

  .split-layout {
    display: flex;
    justify-content: space-between;
    gap: clamp(2.5rem, 5vw, 5rem);
    max-width: 82rem;
    margin: 0 auto;
    padding: 0 clamp(2rem, 5vw, 4rem);
    min-height: 100vh;
  }

  .split-left {
    position: sticky;
    top: 0;
    width: 44%;
    max-height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(3rem, 6vh, 4.5rem) 0 3rem;
    scrollbar-width: none;
  }

  .split-left::-webkit-scrollbar {
    display: none;
  }

  .split-left header.hero {
    margin: 0;
    padding: 0;
    max-width: 100%;
  }

  .split-right {
    width: 52%;
    padding: clamp(3rem, 6vh, 4.5rem) 0 4rem;
  }

  .split-right section {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
  }

  .split-right section:first-of-type {
    border-top: none;
    padding-top: 0;
  }

  .split-right footer {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
  }
}

/* ---------- wallpaper background ---------- */
.wallpaper-bg {
  position: fixed;
  inset: -35px;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  transition:
    opacity var(--duration-slow) var(--ease-smooth-out),
    visibility var(--duration-slow) var(--ease-smooth-out);
}

body.wallpaper-active .wallpaper-bg,
html[data-theme="anime-wallpaper"] .wallpaper-bg {
  opacity: 1;
  visibility: visible;
}

.wallpaper-img {
  position: absolute;
  inset: 0;
  background-image: url("../background/87146-755552-animegif.gif");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  filter: blur(8px) brightness(0.66) contrast(1.1);
  transform: scale(1.05);
  will-change: transform;
}

.wallpaper-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(6, 7, 9, 0.42) 0%, rgba(4, 5, 7, 0.84) 100%),
    linear-gradient(to bottom, rgba(6, 7, 9, 0.3) 0%, rgba(4, 5, 7, 0.75) 100%);
}

/* ---------- wallpaper glass effects ---------- */
body.wallpaper-active .terminal,
html[data-theme="anime-wallpaper"] .terminal {
  background: rgba(18, 25, 35, 0.84);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: rgba(113, 137, 168, 0.13);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.75);
}

body.wallpaper-active .terminal:hover,
html[data-theme="anime-wallpaper"] .terminal:hover {
  border-color: rgba(113, 137, 168, 0.28);
}

body.wallpaper-active .repo-list,
html[data-theme="anime-wallpaper"] .repo-list {
  background: rgba(17, 17, 21, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-color: var(--rule);
}

body.wallpaper-active .repo-row:hover,
html[data-theme="anime-wallpaper"] .repo-row:hover {
  background: rgba(113, 137, 168, 0.035);
}

body.wallpaper-active .chip,
html[data-theme="anime-wallpaper"] .chip {
  background: rgba(16, 24, 35, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-color: var(--rule);
}

body.wallpaper-active .chip:hover,
html[data-theme="anime-wallpaper"] .chip:hover {
  background: rgba(35, 48, 65, 0.92);
  border-color: var(--accent);
}

body.wallpaper-active .contact-block,
html[data-theme="anime-wallpaper"] .contact-block {
  background: rgba(18, 25, 35, 0.84);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: var(--rule);
}

body.wallpaper-active nav.topbar,
html[data-theme="anime-wallpaper"] nav.topbar {
  background: rgba(11, 11, 13, 0.84);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--rule);
}

/* ---------- wallpaper toggle ---------- */
.topbar-right {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.25rem);
  flex-wrap: wrap;
}

.wallpaper-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-quick) var(--ease-smooth-out);
}

.wallpaper-toggle:hover {
  border-color: var(--accent);
  color: var(--ink);
  transform: translateY(-1px);
}

.wallpaper-toggle.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 14px rgba(113, 137, 168, 0.12);
}

.wallpaper-toggle .wp-icon {
  font-size: 0.8125rem;
  line-height: 1;
  color: var(--accent);
  transition:
    transform var(--duration-fast) var(--ease-smooth-out),
    color var(--duration-quick) var(--ease-smooth-out);
}

.wallpaper-toggle.active .wp-icon {
  color: var(--accent-ink);
  transform: rotate(90deg) scale(1.15);
}

.wallpaper-toggle .wp-status {
  font-weight: 600;
}

.wallpaper-float {
  display: none;
}

@media (min-width: 1024px) {
  .wallpaper-float {
    display: inline-flex;
    position: fixed;
    top: 1.5rem;
    right: 2rem;
    z-index: 99;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
  }
}

/* ---------- icon-only social links ---------- */
.social-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
}
.social-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  color: var(--ink-soft);
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: 0.55rem;
  cursor: pointer;
  text-decoration: none;
  transition: color var(--duration-quick) var(--ease-smooth-out),
              border-color var(--duration-quick) var(--ease-smooth-out),
              background var(--duration-quick) var(--ease-smooth-out),
              transform var(--duration-quick) var(--ease-smooth-out);
}
.social-icon svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.social-icon svg .filled { fill: currentColor; stroke: none; }
.social-icon:hover,
.social-icon:focus-visible {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--bg-subtle);
  transform: translateY(-2px);
}
.social-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.65rem);
  z-index: 20;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--rule-light);
  border-radius: 0.35rem;
  background: var(--bg-raised);
  color: var(--ink);
  font: 0.72rem/1.2 var(--font-mono);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity var(--duration-quick) ease, transform var(--duration-quick) ease, visibility var(--duration-quick) ease;
}
.social-icon:hover::after,
.social-icon:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
.social-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 480px) {
  .social-links { gap: 0.65rem; }
  .social-icon { width: 2.8rem; height: 2.8rem; }
}


/* Accessibility improvements */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 1000;
  padding: 0.65rem 0.9rem;
  color: #fff;
  background: #24242A;
  border: 2px solid var(--accent);
  border-radius: 4px;
  font-family: var(--font-mono);
}
.skip-link:focus { top: 1rem; }
:focus-visible {
  outline: 2px solid #A9BED8;
  outline-offset: 3px;
}
.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1rem;
}
.legal-links a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal-links a:hover, .legal-links a:focus-visible { color: var(--ink); }
@media (max-width: 600px) {
  footer { gap: 0.9rem; }
  .legal-links { gap: 0.65rem; }
}


/* ---------- light / dark color theme ---------- */
html[data-color-theme="light"] body {
  color-scheme: light;
  --bg: #f4f6f8;
  --bg-raised: #ffffff;
  --bg-subtle: #eaf0f5;
  --ink: #1c2733;
  --ink-soft: #526273;
  --ink-faint: #748294;
  --rule: #dce3e9;
  --rule-light: #c8d2dc;
  --accent: #526f91;
  --accent-base: #3f5d80;
  --accent-ink: #ffffff;
  --shadow: 0 5px 22px rgba(37, 53, 70, 0.10);
}

html[data-color-theme="light"] body.wallpaper-active,
html[data-color-theme="light"][data-theme="anime-wallpaper"] body {
  --bg: #edf1f5;
  --bg-raised: rgba(255, 255, 255, 0.88);
  --bg-subtle: rgba(247, 249, 251, 0.88);
  --ink: #1c2733;
  --ink-soft: #526273;
  --ink-faint: #748294;
  --rule: rgba(75, 99, 125, 0.17);
  --rule-light: rgba(75, 99, 125, 0.27);
  --accent: #526f91;
  --accent-base: #3f5d80;
  --accent-ink: #ffffff;
  --shadow: 0 8px 28px rgba(37, 53, 70, 0.13);
}

html[data-color-theme="light"] .wallpaper-img {
  filter: blur(5px) brightness(1.02) saturate(0.92) contrast(1.02);
}

html[data-color-theme="light"] .wallpaper-overlay {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(245, 248, 251, 0.29) 0%, rgba(239, 243, 247, 0.49) 100%),
    linear-gradient(to bottom, rgba(245, 248, 251, 0.21) 0%, rgba(239, 243, 247, 0.39) 100%);
}

html[data-color-theme="light"] body.wallpaper-active .terminal,
html[data-color-theme="light"][data-theme="anime-wallpaper"] body .terminal {
  background: rgba(255, 255, 255, 0.86);
  border-color: var(--rule);
  box-shadow: 0 8px 28px rgba(37, 53, 70, 0.12);
}

html[data-color-theme="light"] body.wallpaper-active .repo-list,
html[data-color-theme="light"][data-theme="anime-wallpaper"] body .repo-list {
  background: rgba(255, 255, 255, 0.84);
  border-color: var(--rule);
}

html[data-color-theme="light"] body.wallpaper-active .chip,
html[data-color-theme="light"][data-theme="anime-wallpaper"] body .chip {
  background: rgba(255, 255, 255, 0.84);
  border-color: var(--rule);
}

html[data-color-theme="light"] body.wallpaper-active .chip:hover,
html[data-color-theme="light"][data-theme="anime-wallpaper"] body .chip:hover {
  background: #e8eef4;
  border-color: var(--accent);
}

html[data-color-theme="light"] body.wallpaper-active .contact-block,
html[data-color-theme="light"][data-theme="anime-wallpaper"] body .contact-block {
  background: rgba(255, 255, 255, 0.88);
  border-color: var(--rule);
}

html[data-color-theme="light"] body.wallpaper-active nav.topbar,
html[data-color-theme="light"][data-theme="anime-wallpaper"] body nav.topbar {
  background: rgba(247, 249, 251, 0.88);
  border-bottom-color: var(--rule);
}

html[data-color-theme="light"] .repo-row:hover {
  background: rgba(82, 111, 145, 0.055);
}

html[data-color-theme="light"] .skip-link {
  color: #ffffff;
  background: #26384b;
}

/* ---------- appearance controls ---------- */
.utility-toggles {
  align-items: center;
  gap: 0.55rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  padding: 0.48rem;
  color: var(--ink-soft);
  background: var(--bg-subtle);
  border: 1px solid var(--rule);
  border-radius: 4px;
  cursor: pointer;
  transition: color var(--duration-quick) var(--ease-smooth-out),
              background var(--duration-quick) var(--ease-smooth-out),
              border-color var(--duration-quick) var(--ease-smooth-out),
              transform var(--duration-quick) var(--ease-smooth-out);
}

.theme-toggle:hover {
  color: var(--ink);
  background: var(--bg-raised);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.theme-toggle svg {
  display: block;
  width: 1.12rem;
  height: 1.12rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon-moon { display: none !important; }
html[data-color-theme="light"] .theme-icon-sun { display: none !important; }
html[data-color-theme="light"] .theme-icon-moon { display: block !important; }

html[data-color-theme="light"] .wallpaper-toggle,
html[data-color-theme="light"] .theme-toggle {
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--rule-light);
  box-shadow: 0 3px 12px rgba(37, 53, 70, 0.08);
}

html[data-color-theme="light"] .wallpaper-toggle.active {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 1023px) {
  .topbar-right .utility-toggles {
    display: none;
  }
  .topbar-right {
    gap: 0.5rem;
  }
  .topbar-right .theme-toggle {
    width: 2.15rem;
    height: 2.15rem;
  }
}

@media (min-width: 1024px) {
  .wallpaper-float {
    display: flex;
    position: fixed;
    top: 1.5rem;
    right: 2rem;
    z-index: 99;
    box-shadow: var(--shadow);
  }
}



/* ---------- terminal-style contact card ---------- */
.contact-card {
  margin-top: 1.5rem;
  padding: 1.1rem 1.35rem;
  border: 1px solid var(--rule-light);
  border-radius: 0.55rem;
  background: rgba(13, 16, 20, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.contact-card-row {
  display: grid;
  grid-template-columns: 5.8rem minmax(0, 1fr);
  align-items: center;
  gap: 0.7rem;
  min-height: 2.8rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}
.contact-key {
  color: var(--ink-faint);
  font-weight: 600;
}
.contact-value {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  min-width: 0;
  color: var(--ink);
  font-weight: 650;
  overflow-wrap: anywhere;
}
.contact-value a,
.contact-copy-value {
  color: var(--ink);
  font: inherit;
  text-decoration: none;
}
.contact-value a:hover,
.contact-copy-value:hover {
  color: var(--accent);
}
.contact-copy-value {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.contact-card .copy-btn {
  padding: 0.18rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.68rem;
}
.contact-card .copy-btn:hover {
  color: var(--ink);
  border-color: var(--accent);
}
html[data-color-theme="light"] .contact-card {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(65, 83, 105, 0.25);
}
html[data-color-theme="light"] .contact-value,
html[data-color-theme="light"] .contact-value a,
html[data-color-theme="light"] .contact-copy-value {
  color: #26313e;
}
@media (max-width: 520px) {
  .contact-card { padding: 0.9rem 0.85rem; }
  .contact-card-row {
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 0.45rem;
    font-size: 0.76rem;
  }
}


/* GitHub overview matching the current Techfolio palette */
.github-profile-modern{display:block;text-align:center;padding:1.5rem;margin-bottom:1rem;border-radius:1rem}
.github-profile-modern .github-avatar{display:block;width:5.8rem;height:5.8rem;margin:0 auto 1rem;border-radius:50%}
.github-profile-modern .github-profile-info{align-items:center;gap:.3rem}
.github-profile-modern .github-handle{font-family:var(--font-body);font-size:1.55rem;font-weight:800;color:var(--ink)}
.github-profile-modern .github-profile-info strong{font-family:var(--font-body);font-size:.95rem;color:var(--ink-faint)}
.github-profile-modern .github-profile-note{font-size:.9rem}
.github-stats-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.65rem;margin-top:1.5rem;text-align:left}
.github-stat{display:flex;flex-direction:column;gap:.2rem;min-height:6rem;padding:.9rem 1rem;border:1px solid var(--rule);border-radius:.9rem;background:var(--bg-subtle)}
.github-stat .stat-icon{font-size:1.15rem;color:var(--accent)}
.github-stat strong{font-size:1.25rem;line-height:1.2;color:var(--ink)}
.github-stat small{font-size:.66rem;line-height:1.35;font-weight:750;letter-spacing:.045em;color:var(--ink-faint)}
.github-contributions-card{padding:1.1rem;border-radius:1rem}
.github-contributions-title{display:flex;justify-content:space-between;align-items:end;gap:1rem;margin-bottom:1rem}
.github-contributions-title span,.github-languages-card h3,.github-calendar-footer{font:700 .62rem var(--font-mono);letter-spacing:.12em;color:var(--ink-faint)}
.github-contributions-title h3{font-size:1.1rem;margin:.35rem 0 0;color:var(--ink)}
.github-contributions-title>strong{font-size:.7rem;color:var(--ink-faint);text-align:right}
.github-calendar-wrap{overflow-x:auto;display:block;padding:.15rem 0 .55rem}
.github-calendar{min-width:0;width:max-content}
.github-month-labels,.github-calendar-grid{grid-template-columns:repeat(53,.62rem);column-gap:3px}
.github-month-labels{min-height:1rem;margin-bottom:.3rem}
.github-calendar-grid{grid-template-rows:repeat(7,.62rem)}
.github-calendar-week{grid-template-rows:repeat(7,.62rem);width:.62rem;gap:3px}
.github-calendar-day{width:.62rem;height:.62rem;border-radius:1px}
.github-calendar-footer{display:flex;justify-content:space-between;gap:1rem;border-top:1px solid var(--rule);padding-top:.75rem;margin-top:.5rem;font-size:.55rem}
.github-legend{display:flex;align-items:center;gap:3px;white-space:nowrap}
.github-legend i{display:block;width:.48rem;height:.48rem;border-radius:1px;background:var(--bg-raised)}
.github-legend i:nth-of-type(2){background:#d5e4ef}.github-legend i:nth-of-type(3){background:#9bbbd3}.github-legend i:nth-of-type(4){background:#5d91b5}.github-legend i:nth-of-type(5){background:#285d82}
.github-languages-card{margin-top:1rem;padding:1.1rem;border:1px solid var(--rule);border-radius:1rem;background:color-mix(in srgb,var(--bg-raised) 82%,transparent)}
.github-languages-card h3{margin:0 0 .65rem}
.github-languages-card>p{font-size:.75rem;color:var(--ink-faint);margin:0 0 1.1rem}
.github-language-row{margin:.85rem 0}
.github-language-label{display:flex;align-items:center;justify-content:space-between;margin-bottom:.35rem;font-size:.78rem;font-weight:650}
.github-language-label>span{display:flex;align-items:center;gap:.45rem}
.github-language-label img{width:1rem;height:1rem;object-fit:contain}
.github-language-label strong{color:var(--ink-faint);font-size:.75rem}
.github-language-track{height:.38rem;border-radius:99px;background:var(--bg-subtle);overflow:hidden}
.github-language-track span{display:block;height:100%;border-radius:99px;background:var(--accent)}
html[data-color-theme="light"] .github-stat{background:#f4f6f9}
@media(max-width:600px){.github-contributions-title{align-items:flex-start;flex-direction:column}.github-contributions-title>strong{text-align:left}.github-calendar{min-width:max-content}.github-calendar-footer{font-size:.48rem}.github-profile-modern{padding:1.2rem}.github-stats-grid{gap:.5rem}}


/* GitHub section: responsive, readable layout */
.github-profile-modern{display:flex!important;flex-direction:column!important;align-items:stretch!important;text-align:center}
.github-profile-modern .github-avatar{margin:0 auto 1rem}
.github-profile-modern .github-profile-info{display:flex;flex-direction:column;align-items:center;flex:0 0 auto;width:100%}
.github-stats-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%;min-width:0}
.github-stat{min-width:0}
.github-stat small{ text-transform:none;letter-spacing:0;font-size:.7rem}
.github-contributions-title span,.github-languages-card h3,.github-calendar-footer{ text-transform:none;letter-spacing:.02em;font-family:var(--font-body);font-weight:650}
.github-contributions-title h3{font-family:var(--font-body)!important;font-weight:700!important;font-style:normal!important;text-transform:none!important;letter-spacing:normal!important}
.github-contributions-title>strong{font-family:var(--font-body);font-weight:600}
.github-calendar-wrap{overflow:visible!important;width:100%;max-width:100%;min-width:0}
.github-calendar{width:100%!important;min-width:0!important;max-width:100%}
.github-month-labels,.github-calendar-grid{display:grid;grid-template-columns:repeat(53,minmax(0,1fr))!important;column-gap:clamp(1px,.35vw,3px);width:100%!important}
.github-calendar-grid{grid-template-rows:1fr!important;grid-auto-flow:column!important;row-gap:0}
.github-calendar-week{display:grid;grid-template-rows:repeat(7,clamp(5px,1.15vw,9px))!important;gap:clamp(1px,.35vw,3px);width:auto!important;min-width:0}
.github-calendar-day{width:100%!important;height:100%!important;min-width:0}
.github-month-labels span{font-size:clamp(.42rem,1.3vw,.65rem)}
.github-calendar-footer{flex-wrap:wrap;font-size:.62rem}
.github-languages-card h3{font-size:.82rem}
.github-language-label{font-family:var(--font-body);text-transform:none}
.github-language-label img{flex:0 0 1rem}
@media(max-width:600px){
 .github-profile-modern{padding:1.2rem}
 .github-stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .github-calendar-grid{grid-template-rows:1fr!important}
 .github-calendar-week{grid-template-rows:repeat(7,6px)!important}
 .github-calendar-footer{font-size:.52rem}
}


/* Basic text and link copying deterrents */
html, body, body * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input, textarea, [contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}
.github-profile-modern .github-profile-note {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: .01em;
}
a { -webkit-user-drag: none; }
