:root {
  --bg: #0f1319;
  --bg-panel: #161c26;
  --bg-panel-2: #1b2230;
  --line: rgba(236, 234, 227, 0.08);
  --line-strong: rgba(236, 234, 227, 0.16);
  --text: #eceae3;
  --text-dim: #acacac;
  --muted: #8991a3;
  --muted-2: #5c6478;
  --accent: #f2a93b; /* amber — active state */
  --accent-2: #59c8b4; /* teal — hover / focus */
  --accent-dim: rgba(242, 169, 59, 0.14);
  --accent-dim-2: #f2a93b60;
  --accent-2-dim: #59c8b420;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --nav-h: 72px;
  --nav-h-min: 64px;
  --nav-gap: 28px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: none;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  background-image: radial-gradient(circle at 1px 1px, rgba(236, 234, 227, 0.12) 1px, transparent 0);
  background-size: 28px 28px;
  background-attachment: fixed;
}

::selection {
  background: var(--accent-dim);
  color: var(--accent);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Root chrome: edge fades + profile mark ----------
     Both gradients sit ABOVE page content but BELOW .tab-nav
     (z-index 100), so content visually fades out before it
     reaches the floating tab bar / the top edge.               */

.top-gradient,
.bottom-gradient {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 40;
  pointer-events: none;
}

.top-gradient {
  top: 0;
  height: 120px;
  background: linear-gradient(to bottom, var(--bg) 0%, transparent 100%);
}

.bottom-gradient {
  bottom: 0;
  height: 170px;
  background: linear-gradient(to top, var(--bg) 25%, transparent 100%);
}

.profile-mark {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 60;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--bg-panel);
  display: block;
}

.profile-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Page routing (CSS-only, no JS) ----------
     Each <section class="page"> is hidden by default.
     :target shows the section whose id matches the URL hash.
     When no hash is present, :has() detects that no page is
     targeted and falls back to showing #home.                */

.page {
  display: none;
  min-height: 100vh;
  padding: 88px 28px calc(var(--nav-h) + var(--nav-gap) + 40px);
}

.page:target {
  display: block;
  animation: pageIn 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

body:not(:has(.page:target)) #home {
  display: block;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .page:target {
    animation: none;
  }
  html {
    scroll-behavior: smooth;
  }
}

/* ---------- Shared page chrome ---------- */

.page-inner {
  max-width: 760px;
  margin: 0 auto;
}

h1.page-title {
  font-size: clamp(2.5rem, 4.5vw, 3.5rem);
  line-height: 1.08;
  margin: 0 0 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-title .accent {
  color: var(--accent);
}

.description {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-dim);
  max-width: 58ch;
  margin: 0 0 40px;
}

.description code {
  color: var(--accent-2);
  background-color: var(--accent-2-dim);
  border-radius: 4px;
  padding-inline: 10px;
}

.section-label {
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted-2);
  margin: 0 0 16px;
  padding-left: 14px;
  border-left: 2px solid var(--line-strong);
}

/* ---------- Home ---------- */

.greetings-text {
  margin: 20px 0 2px;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
}

.my-name {
  margin: 0 0 26px;
  color: var(--accent);
}

#home .description {
  margin: 58px 0 20px;
}

.dev-focus {
  list-style: none;
  margin: 0 0 68px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.dev-focus li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
}

.dev-focus .bullet {
  color: var(--accent-2);
  font-weight: 700;
}

.dev-focus code {
  font-family: var(--mono);
  font-size: 0.92rem;
  background: var(--bg-panel);
  border: 1px solid var(--accent-dim-2);
  padding: 4px 11px;
  border-radius: 7px;
  color: var(--text);
}

.social-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  max-width: 220px;
}

@media (min-width: 768px) {
  .greetings-text {
    margin: 60px 0 2px;
  }
  #home .description {
    margin: 86px 0 20px;
  }
  .social-list {
    grid-template-columns: repeat(5, 46px);
    max-width: none;
  }
  .dev-focus {
    margin: 0 0 58px;
  }
}

.social-list a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 12px;
  color: var(--muted);
  background: var(--bg-panel);
  -webkit-tap-highlight-color: transparent;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.social-list a:hover,
.social-list a:focus-visible,
.social-list a:active {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  outline: none;
}

.social-list svg {
  /* width: 28px;
  height: 28px; */
  stroke: currentColor;
  fill: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.social-list text {
  font-family: var(--mono);
  font-weight: 700;
  fill: currentColor;
  stroke: none;
}

/* ---------- Projects ---------- */

.project-card {
  border: 1px solid var(--line-strong);
  background: var(--bg-panel);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 16px;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.project-card:hover {
  border-color: var(--accent-2);
  transform: translateY(-2px);
}

.project-card h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-card h3 .tag {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  background: var(--accent-dim);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.project-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.project-address {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
  margin-top: 20px;
}

.project-address a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 12px;
  color: var(--muted);
  background: var(--bg-panel);
  -webkit-tap-highlight-color: transparent;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.project-address a:hover,
.project-address a:focus-visible,
.project-address a:active {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  outline: none;
}

.project-address svg {
  /* width: 28px;
  height: 28px; */
  stroke: currentColor;
  fill: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Skills ---------- */

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.skill-group {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--bg-panel);
  border-radius: 14px;
  padding: 20px;
}

.skill-group::before {
  content: attr(data-letter);
  position: absolute;
  top: -26px;
  right: -8px;
  z-index: 0;
  font-family: var(--mono);
  font-size: 96px;
  font-weight: 700;
  line-height: 1;
  color: var(--accent-dim-2);
  pointer-events: none;
}

.skill-group h4 {
  position: relative;
  z-index: 1;
  margin: 0 0 14px;
  font-size: 0.85rem;
  font-family: var(--mono);
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.chip-cloud {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-cloud span {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 6px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--accent-2);
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.chip-cloud span:nth-child(3n + 1) {
  transform: rotate(-1.5deg);
}
.chip-cloud span:nth-child(3n + 2) {
  transform: rotate(1.5deg);
}

.chip-cloud span:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ---------- Resume ---------- */

.resume-block {
  border: 1px solid var(--line-strong);
  background: var(--bg-panel);
  border-radius: 14px;
  padding: 26px;
  margin-bottom: 20px;
}

.resume-block h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.resume-block .role-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-2);
  margin-bottom: 12px;
}

.resume-block p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-block: 16px;
  background: var(--accent);
  color: #1a1204;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 13px 22px;
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.download-btn:hover,
.download-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -10px var(--accent);
  outline: none;
}

/* ================= Tab bar navigation ================= */

.tab-nav {
  position: fixed;
  left: 50%;
  bottom: var(--nav-gap);
  transform: translateX(-50%);
  z-index: 100;

  display: flex;
  padding: 8px;
  gap: 2px;

  background: rgba(22, 28, 38, 0.72);
  border: 1px solid var(--line-strong);
  border-radius: 80px;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}

.tab-track {
  position: relative;
  display: flex;
}

/* the sliding "focus pill" */
.pill {
  position: absolute;
  top: 0;
  left: 0;
  width: 25%;
  height: 100%;
  background: var(--accent-dim);
  border: 1px solid rgba(242, 169, 59, 0.45);
  border-radius: 80px;
  transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.25, 1.15);
  pointer-events: none;
}

/* default: home active → pill sits at position 0 */
body:has(#projects:target) .pill {
  transform: translateX(100%);
}
body:has(#skills:target) .pill {
  transform: translateX(200%);
}
body:has(#resume:target) .pill {
  transform: translateX(300%);
}

.tab-item {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 76px;
  padding: 10px 6px 9px;
  border-radius: 80px;
  color: var(--muted);
  transition: color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.tab-item svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s ease;
}

.tab-item .label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* hover / keyboard focus → colour change only (not the pill) */
.tab-item:hover,
.tab-item:focus-visible {
  color: var(--accent);
  outline: none;
}

.tab-item:hover svg,
.tab-item:focus-visible svg {
  transform: translateY(-1px);
}

.tab-item:focus-visible {
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* active page → tab label/icon shift to accent colour,
     independent of hover/focus.
     Home needs BOTH cases: no hash at all (initial load), and
     the URL being explicitly "#home" (after navigating back to
     it), since only the latter makes #home itself match :target. */
body:has(#home:target) .tab-item[href="#home"],
body:not(:has(.page:target)) .tab-item[href="#home"],
body:has(#projects:target) .tab-item[href="#projects"],
body:has(#skills:target) .tab-item[href="#skills"],
body:has(#resume:target) .tab-item[href="#resume"] {
  color: var(--accent);
}

@media (max-width: 480px) {
  .profile-mark {
    width: 38px;
    height: 38px;
  }
  .tab-nav {
    height: var(--nav-h-min);
    padding: 6px;
  }
  .tab-item {
    width: 64px;
    padding: 8px 4px 7px;
  }
  .page {
    padding-left: 18px;
    padding-right: 18px;
  }
}
