* { box-sizing: border-box; }

:root {
  --page-bg: #f4f2ee;
  --page-fg: #141312;
  --page-muted: rgba(20, 19, 18, 0.58);
  --page-border: rgba(20, 19, 18, 0.12);
  --accent: #1b5e3a;
  --accent-soft: rgba(27, 94, 58, 0.12);
  --radius-sharp: 6px;
  --radius-card: 0px;
  --font: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --max-readable: 720px;
  --header-h: 56px;
}
:root.dark {
  --page-bg: #0d1117;
  --page-fg: #e6edf3;
  --page-muted: rgba(230, 237, 243, 0.65);
  --page-border: rgba(230, 237, 243, 0.12);

  --accent: #3fb950;
  --accent-soft: rgba(63, 185, 80, 0.12);
}

/* smooth transition (makes it feel premium) */
html {
  transition: background-color 0.25s ease, color 0.25s ease;
}
html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overflow-x: hidden;
  width: 100%;
  background: var(--page-bg);
  color: var(--page-fg);
  font-family: var(--font);
}

#main-content {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 100vh;
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 2.5rem);
  padding-bottom: 4rem;

  background-color: var(--page-bg);
  color: var(--page-fg);
  position: relative;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 1rem 0;
  margin-bottom: 0.25rem;
  background: color-mix(in srgb, var(--page-bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
}

.site-mark {
  font-weight: 650;
  letter-spacing: -0.03em;
  font-size: 0.95rem;
  text-decoration: none;
  color: inherit;
}

.site-mark:hover {
  text-shadow: none;
  color: var(--accent);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.site-nav a {
  color: var(--page-muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--page-fg);
  text-shadow: none;
}

.site-nav-current {
  color: var(--page-fg);
  font-weight: 600;
}

.site-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 6vw, 4rem);
}

/* Hero */
.hero {
  padding-top: clamp(0.75rem, 2vw, 1.5rem);
  max-width: var(--max-readable);
}

.hero-hello {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--page-muted);
}

.hero-name {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.hero-roles-wrap {
  height: 1.75rem;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.hero-roles {
  display: flex;
  flex-direction: column;
  transition: transform 0.55s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.hero-role {
  margin: 0;
  height: 1.75rem;
  display: flex;
  align-items: center;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.hero-lede {
  margin: 0;
  font-size: clamp(0.98rem, 1.7vw, 1.08rem);
  line-height: 1.65;
  color: var(--page-muted);
  max-width: 38em;
}

/* Selected works */
.section-heading {
  font-size: clamp(1.35rem, 2.5vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0 0 1.5rem;
}

.section-arrow {
  font-weight: 500;
  opacity: 0.45;
}

.featured-works {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(2rem, 4vw, 2.75rem);
}

.featured-card {
  margin: 0;
  width: 45%;
}

.featured-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-card);
  outline-offset: 4px;
}

.featured-card-link:focus-visible {
  outline: 2px solid var(--accent);
}

.featured-card-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--page-border);
  background: rgba(0, 0, 0, 0.04);
}

.featured-card-cover {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.45s ease, filter 0.45s ease;
  filter: saturate(0.98);
}

.featured-card-link:hover .featured-card-cover {
  transform: scale(1.02);
  filter: saturate(1);
}

.featured-card-body {
  margin-top: 0.85rem;
}

.featured-card-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--page-muted);
}

.featured-card-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  font-weight: 650;
  letter-spacing: -0.025em;
}

.featured-card-title .arrow {
  font-weight: 500;
  opacity: 0.4;
  font-size: 0.92em;
}

.featured-card-desc {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--page-muted);
  max-width: 42em;
}

.featured-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
}

.featured-card-tags .tag-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.works-cta-wrap {
  margin: 2rem 0 0;
}

.works-cta {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--accent);
  text-decoration: none;
}

.works-cta:hover {
  text-shadow: none;
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

/* Works page */
.works-page-main {
  padding-top: 0.25rem;
}

.back-link-wrap {
  margin: 0 0 0.5rem;
}

.text-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--page-muted);
  text-decoration: none;
}

.text-link:hover {
  color: var(--page-fg);
  text-shadow: none;
}

.page-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.65rem, 3vw, 2rem);
  font-weight: 650;
  letter-spacing: -0.035em;
}

.page-lede {
  margin: 0 0 1.75rem;
  color: var(--page-muted);
  font-size: 1rem;
  line-height: 1.55;
  max-width: 40em;
}

.works-page-section {
  width: 100%;
}

/* Project grid (works page) */
.more-projects {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.projects-filter-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  margin-bottom: 1.5rem;
  width: 100%;
}

.selected-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.4rem;
  flex: 0 1 auto;
  max-width: 100%;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: clamp(1.25rem, 2vw, 1.75rem);
  justify-items: stretch;
  align-items: start;
  width: 100%;
  padding-bottom: 48px;
}

.project-link {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 100%;
  text-decoration: none;
  color: inherit;
  overflow: visible;
}

.project-link:focus-visible {
  outline: 2px solid rgba(27, 94, 58, 0.55);
  outline-offset: 4px;
  border-radius: var(--radius-sharp);
}

.project-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-card);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--page-border);
}

.project {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  border: none;
}

.project .overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.06);
  z-index: 1;
  pointer-events: none;
  transition: background-color 0.22s ease;
}

.project-link:hover .project .overlay {
  background-color: rgba(0, 0, 0, 0.12);
}

.project-card-title {
  margin: 0;
  font-size: clamp(0.9rem, 1.05vw, 1.05rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
  color: var(--page-fg);
}

.project-card-title::after {
  content: " ↘";
  font-weight: 500;
  opacity: 0.35;
  font-size: 0.85em;
}

.project-card-text {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.project-card-desc {
  margin: 0;
  font-size: clamp(0.78rem, 0.92vw, 0.875rem);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0.01em;
  color: var(--page-muted);
}

.project-link:hover .project-card-desc {
  color: color-mix(in srgb, var(--page-fg) 65%, var(--page-muted));
}

.filter-title {
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--page-muted);
  font-size: 0.62rem;
  margin: 0;
  flex-shrink: 0;
}

#filter-input {
  background-color: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--page-border);
  border-radius: 999px;
  height: fit-content;
  color: var(--page-fg);
  font-family: var(--font);
  font-size: 0.82rem;
  padding: 0.4rem 0.85rem;
  width: clamp(9.5rem, 22vw, 13rem);
  max-width: 100%;
  box-sizing: border-box;
}

#filter-input::placeholder {
  color: color-mix(in srgb, var(--page-muted) 80%, transparent);
}

#filter-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 45%, var(--page-border));
  background-color: rgba(255, 255, 255, 0.85);
}

.search-box {
  position: relative;
  flex-shrink: 0;
}

.dropdown {
  position: absolute;
  right: 0;
  width: max(200px, 100%);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--page-border);
  border-radius: var(--radius-sharp);
  margin-top: 6px;
  display: none;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.08);
  font-family: var(--font);
  color: var(--page-fg);
  font-size: 12px;
  z-index: 9999;
  scrollbar-width: thin;
}

.dropdown div {
  padding: 7px 9px;
  cursor: pointer;
  background-color: transparent;
}

.dropdown div:hover {
  background: var(--accent-soft);
}

.remove-tag {
  background-color: transparent;
  color: inherit;
  opacity: 0.55;
  border: none;
  padding: 0 0.1rem;
  font-size: 0.6rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 2px;
}

.remove-tag:hover {
  opacity: 1;
}

.tag {
  border: none;
  border-radius: 999px;
  margin: 0;
  padding: 0.12rem 0.45rem 0.12rem 0.32rem;
  font-family: var(--font);
  font-size: 0.6rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  color: rgba(255, 255, 255, 0.95);
  opacity: 0.95;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  cursor: pointer;
}

.dropdown-item:hover {
  background: var(--accent-soft);
}

.color-box {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
}

.project-card-tags .tag-icon {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* GitHub-style about (sharper corners) */
.about-me {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background-color: #0d1117;
  color: #e6edf3;
  border-radius: 0;
  width: 100%;
  max-width: 100%;
  margin: 0;
  border: 1px solid rgba(240, 246, 252, 0.1);
}

.about-me-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0.65rem 1.15rem;
  border-bottom: 1px solid rgba(240, 246, 252, 0.12);
}

.about-me-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

.about-me::-webkit-scrollbar {
  display: none;
}

.narrative {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  width: 100%;
  padding: 0;
  gap: 0;

  overflow: visible;
  position: relative;
}

.readme-container {
  flex: 1;
  min-width: 0;
  padding: 1rem 1.15rem 1.25rem;
}

.readme {
  border: 1px solid rgba(240, 246, 252, 0.14);
  border-radius: var(--radius-sharp);
  width: 100% !important;
  padding: 1.35rem 1.5rem !important;
  background: #0d1117;
}

.profile {
  position: absolute;
  left: -170px; /* push it outside */
  top: 0;
  width: 150px;
  margin: 0;
  padding: 1rem 0 1rem 1.15rem;
  flex-shrink: 0;
  z-index: 999;
  background-color: #0d1117;
  border-radius: 2px;
  border: 1px solid rgba(240, 246, 252, 0.1);
}

@media (max-width: 1300px) {
  .profile {
    display: none;
  }
}

/* ===== GitHub Profile Card ===== */
.gh-profile {
  color: #c9d1d9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  font-size: clamp(0.75rem, 0.9vw, 0.9rem);
  line-height: 1.4;
}

/* Avatar */
.gh-avatar {
  width: 80%;
  height: auto;

  border-radius: 50%;
  border: 2px solid #30363d;

  /* GitHub-like cutout effect */
  box-shadow: 0 0 0 4px #0d1117;
}

/* Name */
.gh-name {
  font-size: clamp(0.7rem, 1vw, 1.1rem);
  margin-top: 0.4rem;
  margin-bottom: 0.2rem;
}

/* Followers text */
.gh-meta {
  font-size: clamp(0.7rem, 0.85vw, 0.8rem);
  opacity: 0.85;
}

/* Divider */
.gh-divider {
  border: 1px solid #30363d;
  margin: 0.6rem 0;
}

/* Org title */
.gh-org-title {
  font-size: clamp(0.75rem, 0.9vw, 0.85rem);
  margin-bottom: 0.3rem;
}

/* Org container */
.gh-orgs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Org avatars */
.gh-org-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}
.github-profile-slot {
  padding: 0 !important;
  width: 100%;
  border-radius: var(--radius-sharp);
}

.footer {
  margin-top: auto;
  padding: 2rem 0 0;
  text-align: left;
}

.footer-heading {
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--page-muted);
  margin: 0 0 0.65rem;
}

.footer-links {
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.6;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.footer a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-shadow: none;
  color: color-mix(in srgb, var(--accent) 70%, black);
}

.footer-sep {
  color: var(--page-muted);
  font-weight: 400;
}

/* Legacy / utility */
.car-item,
.bg-overlay {
  display: none;
}

.lineHeader {
  color: #1b5e3a;
}


/* Right side grouping */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Toggle button */
#theme-toggle {
  border: 1px solid var(--page-border);
  background: transparent;
  color: var(--page-muted);
  font-size: 0.8rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s ease;
}

/* Hover = subtle, not loud */
#theme-toggle:hover {
  color: var(--page-fg);
  border-color: var(--page-fg);
}

/* Dark mode tweak (less foggy header) */
:root.dark .site-header {
  background: color-mix(in srgb, var(--page-bg) 96%, transparent);
}