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

:root {
  scroll-behavior: smooth;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fb;
  --bg-gradient-top: #ffffff;
  --text: #1c1c1c;
  --muted: #6b7280;
  --panel: #ffffff;
  --panel-border: rgba(255, 255, 255, 0.7);
  --tile-shadow: rgba(25, 42, 112, 0.08);
  --accent: #2d62ff;
  --accent-dark: #1d3fbf;
  --ghost-border: rgba(28, 28, 28, 0.2);
  --border: rgba(17, 24, 39, 0.15);
  --input-bg: rgba(255, 255, 255, 0.9);
  --badge-bg: rgba(45, 98, 255, 0.1);
  --stat-bg: rgba(45, 98, 255, 0.06);
  --header-bg: rgba(244, 246, 251, 0.85);
  --header-border: rgba(255, 255, 255, 0.5);
  --image-shadow: rgba(37, 57, 111, 0.14);
  --hero-panel: rgba(255, 255, 255, 0.9);
  --hero-panel-border: rgba(255, 255, 255, 0.4);
  --hero-panel-shadow: rgba(19, 32, 72, 0.08);
  --cta-bg: #1f3fb8;
  --cta-bg-hover: #192f8c;
  --cta-shadow: rgba(25, 48, 132, 0.35);
  --theme-toggle-bg: rgba(255, 255, 255, 0.65);
  --theme-toggle-border: rgba(12, 18, 34, 0.18);
  --form-btn-bg: #111827;
  --form-btn-text: #ffffff;
  --form-btn-hover: #0b1120;
  --eyebrow-bg: rgba(45, 98, 255, 0.12);
  --form-label: #111827;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f141f;
  --bg-gradient-top: #1e2740;
  --text: #f5f7ff;
  --muted: #9ca3af;
  --panel: #1a2333;
  --panel-border: rgba(255, 255, 255, 0.08);
  --tile-shadow: rgba(0, 0, 0, 0.45);
  --accent: #7aa2ff;
  --accent-dark: #4a74f2;
  --ghost-border: rgba(245, 247, 255, 0.3);
  --border: rgba(255, 255, 255, 0.12);
  --input-bg: rgba(22, 29, 44, 0.95);
  --badge-bg: rgba(122, 162, 255, 0.12);
  --stat-bg: rgba(122, 162, 255, 0.12);
  --header-bg: rgba(15, 20, 31, 0.85);
  --header-border: rgba(255, 255, 255, 0.08);
  --image-shadow: rgba(5, 7, 11, 0.65);
  --hero-panel: rgba(20, 27, 44, 0.92);
  --hero-panel-border: rgba(255, 255, 255, 0.04);
  --hero-panel-shadow: rgba(0, 0, 0, 0.55);
  --cta-bg: #4a74f2;
  --cta-bg-hover: #688af7;
  --cta-shadow: rgba(74, 116, 242, 0.35);
  --theme-toggle-bg: rgba(21, 28, 45, 0.9);
  --theme-toggle-border: rgba(255, 255, 255, 0.12);
  --form-btn-bg: #d1d5db;
  --form-btn-text: #0f141f;
  --form-btn-hover: #e5e7eb;
  --eyebrow-bg: rgba(122, 162, 255, 0.2);
  --form-label: #f5f7ff;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, var(--bg-gradient-top), var(--bg) 60%);
  color: var(--text);
  transition: background 0.3s ease, color 0.3s ease;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
  border-radius: 18px;
  box-shadow: 0 20px 45px var(--image-shadow);
}

.container {
  width: min(1200px, 90vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(16px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  z-index: 3;
}

.site-header .container {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

@media (max-width: 720px) {
  .header-actions {
    justify-content: center;
    flex-wrap: wrap;
  }
}

.logo {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  padding: 0;
  margin: 0;
  font-weight: 500;
}

.cta-btn,
.ghost-btn,
.tile button,
.cta-form button {
  border-radius: 999px;
  padding: 0.85rem 1.8rem;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-btn {
  background: var(--cta-bg);
  color: white;
  box-shadow: 0 12px 30px var(--cta-shadow);
}

.cta-btn:hover {
  background: var(--cta-bg-hover);
  transform: translateY(-1px);
}

.ghost-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--ghost-border);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--theme-toggle-border);
  background: var(--theme-toggle-bg);
  color: var(--text);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

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

.theme-toggle .toggle-track {
  width: 36px;
  height: 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.15);
  display: inline-flex;
  align-items: center;
  padding: 0 2px;
  transition: background 0.2s ease;
}

.theme-toggle .toggle-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s ease;
}

.theme-toggle.is-dark .toggle-track {
  background: rgba(255, 255, 255, 0.4);
}

.theme-toggle.is-dark .toggle-thumb {
  transform: translateX(18px);
}

.theme-toggle .toggle-text {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  font-size: 0.7rem;
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

main {
  padding: 4vw 0 8vw;
}

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

.projects-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: start;
  grid-auto-rows: 1fr;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.project-search {
  margin-top: 1.5rem;
}

.project-search label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.project-search input {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  font-size: 1rem;
  font-family: inherit;
  background: var(--input-bg);
  color: var(--text);
  caret-color: var(--accent);
}

.project-search input::placeholder {
  color: var(--muted);
}

.projects-grid .tile {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.projects-grid .project-description {
  margin-top: 0.5rem;
  flex-grow: 1;
}

.project-links {
  margin-top: 1.25rem;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.project-links a:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 30px rgba(45, 98, 255, 0.35);
}

.tile {
  background: var(--panel);
  border-radius: 24px;
  padding: 1.8rem;
  box-shadow: 0 25px 60px var(--tile-shadow);
  border: 1px solid var(--panel-border);
}

.hero {
  margin-bottom: 3rem;
}

.hero .tile,
.hero-tile {
  background: var(--hero-panel);
  border-color: var(--hero-panel-border);
  box-shadow: 0 25px 60px var(--hero-panel-shadow);
  backdrop-filter: blur(10px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: flex-start;
  justify-content: flex-start;
}

.hero-actions a {
  flex: 0 0 auto;
  min-width: 160px;
  max-width: 220px;
  text-align: center;
}

.hero .tile-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: center;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  color: var(--muted);
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  margin: 0 0 1rem;
}

h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: 0.5rem;
}

h3 {
  margin: 0.2rem 0 0.4rem;
}

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

.stats article {
  background: var(--stat-bg);
  border-radius: 20px;
  padding: 1rem;
  text-align: center;
}

.stats h3 {
  font-size: 2rem;
}

.projects .card-grid,
.learning .timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.course-list {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 1rem;
}

.course-list > li {
  margin: 0;
}

.course-tech {
  margin: 0.5rem 0 0.25rem;
  padding-left: 1.25rem;
}

.skill-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.skill-badges span {
  background: var(--badge-bg);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card a {
  font-weight: 600;
  color: var(--accent);
}

.meta {
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.meta li::before {
  content: "•";
  margin-right: 0.35rem;
  color: var(--accent);
}

.cta {
  margin-top: 3rem;
}

.contact-panel {
  display: grid;
  gap: 2rem;
}

.cta .tile-grid {
  grid-template-columns: 1fr 1fr;
}

.cta-form {
  display: grid;
  gap: 1rem;
}

.cta-form label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.95rem;
  color: var(--form-label);
}

.cta-form input,
.cta-form textarea {
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  background: var(--input-bg);
  color: var(--text);
  caret-color: var(--accent);
}

.cta-form input::placeholder,
.cta-form textarea::placeholder {
  color: var(--muted);
}

.cta-form button {
  justify-self: start;
  background: var(--form-btn-bg);
  color: var(--form-btn-text);
  padding-inline: 2.4rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.cta-form button:hover {
  background: var(--form-btn-hover);
}

.site-footer {
  padding: 2rem 0 3rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-links {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  padding: 0;
  margin: 0;
}

@media (max-width: 720px) {
  .site-header .container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .main-nav ul {
    justify-content: center;
  }

  .cta .tile-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .hero-actions a {
    width: min(220px, 80vw);
    padding: 0.7rem 1.2rem;
  }
}

@media (max-width: 480px) {
  .hero-actions a {
    width: min(200px, 90vw);
    min-width: 0;
  }
}

/* Center only the contact tile on the home page */
.home-page #contact .cta-content {
  text-align: center;
}

.home-page #contact .cta-content .skill-badges {
  justify-content: center;
}

.side-panel {
  float: left;
  width: 260px;
  margin: 4vw 1.5rem 8vw max(5vw, calc((100vw - 1200px) / 2));
  padding: 1.2rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: 0 25px 60px var(--tile-shadow);
  position: sticky;
  top: 6rem;
}

.side-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-panel a {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  color: var(--text);
  font-weight: 600;
}

.side-panel a:hover {
  background: var(--badge-bg);
  color: var(--accent);
}

.main-page {
  width: min(calc(90vw - 260px - 1.5rem), calc(1200px - 260px - 1.5rem));
  min-height: 60vh;
  margin: 4vw auto 8vw 0;
  padding: 1.8rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: 0 25px 60px var(--tile-shadow);
  overflow: hidden;
}

.site-footer {
  clear: both;
}

@media (max-width: 720px) {
  .side-panel,
  .main-page {
    float: none;
    width: min(1200px, 90vw);
    margin: 2rem auto;
  }
}

.git-main {
  width: min(calc(90vw - 260px - 1.5rem), calc(1200px - 260px - 1.5rem));
  min-height: 60vh;
  margin: 4vw auto 8vw 0;
  padding: 1.8rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: 0 25px 60px var(--tile-shadow);
  overflow: hidden;
}

.git-service-toolbar {
  border-bottom: 1px solid var(--border);
}

.git-service-toolbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 0;
}

.git-service-shell {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding-bottom: 0.85rem;
}

.git-service-nav,
.git-service-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.git-service-nav a,
.git-service-actions a,
.clone-chip {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 700;
  border: 1px solid transparent;
  color: var(--muted);
}

.git-service-nav a.is-active,
.git-service-nav a:hover {
  color: var(--accent);
}

.git-service-nav a.is-active {
  box-shadow: inset 0 -2px 0 var(--accent);
  border-radius: 0;
}

.git-service-actions a,
.clone-chip {
  border-color: var(--border);
  background: var(--input-bg);
  color: var(--text);
}

.git-service-actions a {
  min-height: 34px;
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
}

.git-service-actions .sign-in-link {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: none;
}

.git-page {
  width: min(1200px, 90vw);
  margin: 2rem auto 8vw;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.git-page.no-profile {
  grid-template-columns: 1fr;
}

.git-page.no-profile .git-profile-panel {
  display: none;
}

.git-profile-panel,
.git-tabs,
.repo-toolbar,
.repo-card,
.login-intro,
.login-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: 0 25px 60px var(--tile-shadow);
}

.git-profile-panel {
  position: sticky;
  top: 6rem;
  border-radius: 24px;
  padding: 1.25rem;
}

.git-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  background: var(--badge-bg);
  color: var(--accent);
  font-size: 2.4rem;
  font-weight: 700;
}

.git-profile-panel h1 {
  min-height: 1.65rem;
  font-size: 1.65rem;
  margin-bottom: 0.25rem;
}

.git-handle,
.repo-description,
.repo-meta,
.profile-meta {
  color: var(--muted);
}

.git-handle {
  min-height: 1rem;
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.profile-bio {
  min-height: 3rem;
  line-height: 1.6;
  margin: 0 0 1rem;
}

.profile-meta,
.repo-meta {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.65rem;
  font-size: 0.9rem;
}

.profile-actions {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.25rem;
}

.profile-actions a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 999px;
  padding: 0.75rem 1rem;
  font-weight: 600;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.profile-actions a:first-child {
  background: var(--cta-bg);
  border-color: var(--cta-bg);
  color: #fff;
  box-shadow: 0 12px 30px var(--cta-shadow);
}

.profile-activity {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.profile-activity h2 {
  margin: 0 0 0.85rem;
  font-size: 1rem;
}

.activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.85rem;
  min-height: 7rem;
}

.activity-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.activity-dot {
  width: 0.65rem;
  height: 0.65rem;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--badge-bg);
}

.activity-list strong {
  color: var(--text);
  font-weight: 700;
}

.activity-time {
  display: block;
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.git-content {
  min-width: 0;
  display: grid;
  gap: 1rem;
}

.git-tabs {
  border-radius: 20px;
  padding: 0.45rem;
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
}

.git-tabs a {
  flex: 0 0 auto;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
}

.git-tabs a.is-active,
.git-tabs a:hover {
  background: var(--badge-bg);
  color: var(--accent);
}

.repo-toolbar {
  border-radius: 20px;
  padding: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  align-items: center;
}

.repo-toolbar input,
.repo-toolbar select,
.login-card input {
  width: 100%;
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  padding: 0.65rem 0.85rem;
}

.repo-list {
  display: grid;
  gap: 1rem;
  min-height: 18rem;
}

.repo-card {
  border-radius: 20px;
  padding: 1.25rem;
}

.repo-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.repo-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.repo-header a {
  color: var(--accent);
}

.repo-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.repo-visibility {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.repo-description {
  margin: 0.65rem 0 0;
  max-width: 70ch;
  line-height: 1.6;
}

.repo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.repo-language {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.repo-language::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--accent);
}

.login-page {
  width: min(960px, 90vw);
  margin: 4vw auto 8vw;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1.5rem;
  align-items: start;
}

.login-intro,
.login-card {
  border-radius: 24px;
  padding: 1.5rem;
}

.login-intro h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.login-intro p {
  color: var(--muted);
  line-height: 1.7;
}

.login-stats {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: grid;
  gap: 0.75rem;
  color: var(--muted);
}

.login-card form {
  display: grid;
  gap: 1rem;
}

.login-card label {
  display: grid;
  gap: 0.4rem;
  color: var(--form-label);
  font-weight: 600;
}

.login-card button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--cta-bg);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 30px var(--cta-shadow);
}

.login-links {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.login-links a {
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 820px) {
  .git-service-toolbar .container {
    align-items: stretch;
    flex-direction: column;
  }

  .git-service-shell {
    grid-template-columns: 1fr;
  }

  .git-service-nav,
  .git-service-actions {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.15rem;
  }

  .git-page,
  .login-page {
    grid-template-columns: 1fr;
  }

  .git-profile-panel {
    position: static;
  }

  .repo-toolbar {
    grid-template-columns: 1fr;
  }

  .repo-header {
    flex-direction: column;
  }

  .repo-actions {
    justify-content: flex-start;
  }
}
