:root {
  color-scheme: dark;

  --bg: #0d1117;
  --sidebar: #101720;
  --panel: #151c26;
  --panel-2: #192231;
  --panel-3: #1f2a3a;
  --text: #f3f5f7;
  --muted: #a6b0bf;
  --subtle: #768294;
  --border: #293241;
  --border-soft: #222b38;
  --accent: #d8a72d;
  --accent-dark: #b88616;
  --accent-soft: rgba(216, 167, 45, 0.13);

  --radius: 5px;
  --container: 1180px;
  --header-height: 66px;
  --sidebar-width: 270px;
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg: #f4f6f8;
  --sidebar: #ffffff;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --panel-3: #eef2f7;
  --text: #111827;
  --muted: #4b5563;
  --subtle: #6b7280;
  --border: #d6dde7;
  --border-soft: #e4e9f1;
  --accent: #9a6b10;
  --accent-dark: #7a5208;
  --accent-soft: rgba(154, 107, 16, 0.12);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.6;
}

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

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

p {
  color: var(--muted);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.container {
  width: min(var(--container), calc(100% - 42px));
  margin-inline: auto;
}

/* Header / navigation */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--border);
  background: var(--sidebar);
}

.nav {
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 750;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-menu a,
.theme-toggle,
.filter-button {
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
}

.nav-menu a,
.theme-toggle {
  padding: 8px 10px;
}

.nav-menu a:hover,
.nav-menu a.is-active,
.theme-toggle:hover,
.filter-button:hover,
.filter-button.is-active {
  border-color: var(--border);
  background: var(--panel);
  color: var(--text);
}

.theme-toggle {
  min-width: 64px;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--text);
}

/* Main layout */

.hero {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 260px);
  padding: 68px 0;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 36px;
  align-items: start;
}

.hero-main {
  max-width: 820px;
}

.section-label {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 {
  max-width: 760px;
  margin-bottom: 12px;
  font-size: clamp(2.4rem, 5.5vw, 4.5rem);
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(1.7rem, 3vw, 2.55rem);
}

h3 {
  margin-bottom: 8px;
  font-size: 1.04rem;
}

.hero-title {
  max-width: 780px;
  margin-bottom: 18px;
  color: var(--text);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 650;
}

.hero-copy {
  max-width: 730px;
  margin-bottom: 0;
  font-size: 1.02rem;
}

.hero-actions,
.contact-actions,
.project-links,
.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.hero-actions {
  margin-top: 26px;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 13px;
  font-weight: 700;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #161106;
}

.button-primary:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

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

.button-secondary:hover {
  background: var(--panel-2);
}

/* Dashboard panels */

.overview-panel,
.info-card,
.project-card,
.contact-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.overview-panel {
  overflow: hidden;
}

.overview-row {
  display: grid;
  grid-template-columns: 122px minmax(0, 1fr);
  gap: 14px;
  border-bottom: 1px solid var(--border-soft);
  padding: 14px 15px;
}

.overview-row:last-child {
  border-bottom: 0;
}

.overview-row span {
  color: var(--subtle);
  font-size: 0.88rem;
}

.overview-row strong {
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 700;
}

.section {
  padding: 68px 0;
}

.section-muted {
  border-block: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.018);
}

.split-section {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 48px;
}

.section-heading {
  max-width: 780px;
  margin-bottom: 28px;
}

.section-heading p {
  max-width: 720px;
}

.text-stack {
  display: grid;
  gap: 16px;
}

.text-stack p {
  margin-bottom: 0;
}

/* Filters */

.filter-group {
  margin-bottom: 20px;
}

.filter-button {
  padding: 7px 10px;
  background: var(--panel);
}

.filter-button.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* Projects */

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

.project-card {
  display: flex;
  min-height: 370px;
  flex-direction: column;
  padding: 19px;
}

.project-card__top,
.card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin-bottom: 12px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(216, 167, 45, 0.45);
  border-radius: var(--radius);
  padding: 4px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 850;
  white-space: nowrap;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 15px 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 8px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 0.8rem;
}

.highlight-list {
  display: grid;
  gap: 7px;
  margin: 0 0 19px;
  padding-left: 18px;
  color: var(--muted);
}

.project-links,
.project-note {
  margin-top: auto;
  border-top: 1px solid var(--border-soft);
  padding-top: 14px;
}

.project-links a {
  color: var(--accent);
  font-weight: 760;
}

.project-note {
  margin-bottom: 0;
  color: var(--subtle);
  font-size: 0.9rem;
}

/* Skills / info cards */

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

.info-card {
  padding: 19px;
}

.info-card p:last-child {
  margin-bottom: 0;
}

.timeline {
  display: grid;
  gap: 14px;
}

/* Contact */

.contact-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  padding: 24px;
}

.contact-panel h2 {
  max-width: 680px;
  margin-bottom: 0;
}

.contact-actions {
  justify-content: flex-end;
}

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

.site-footer p {
  margin: 0;
  color: var(--subtle);
  font-size: 0.92rem;
}

/* Desktop dashboard sidebar */

@media (min-width: 941px) {
  html {
    scroll-padding-top: 24px;
  }

  body {
    padding-left: var(--sidebar-width);
  }

  .site-header {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    border-right: 1px solid var(--border);
    border-bottom: 0;
  }

  .site-header .container {
    width: auto;
    margin: 0;
  }

  .nav {
    min-height: 100vh;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 22px 18px;
  }

  .brand {
    margin-bottom: 26px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
  }

  .nav-menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
  }

  .nav-menu a,
  .theme-toggle {
    width: 100%;
    text-align: left;
  }

  .theme-toggle {
    margin-top: 10px;
  }

  .hero {
    padding-top: 54px;
  }
}

/* Tablet/mobile */

@media (max-width: 940px) {
  .nav-toggle {
    display: block;
  }

  .nav-menu {
    position: absolute;
    top: calc(100% + 1px);
    right: 18px;
    left: 18px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    background: var(--panel);
  }

  .nav-menu.is-open {
    display: flex;
  }

  .nav-menu a,
  .theme-toggle {
    width: 100%;
    text-align: center;
  }

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

  .dashboard-hero,
  .split-section {
    gap: 32px;
  }

  .projects-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .container {
    width: min(100% - 28px, var(--container));
  }

  .hero {
    padding: 48px 0;
  }

  h1 {
    font-size: 2.35rem;
  }

  .section {
    padding: 54px 0;
  }

  .hero-actions .button,
  .contact-actions .button {
    width: 100%;
  }

  .overview-row,
  .project-card__top,
  .card-header {
    grid-template-columns: 1fr;
  }

  .project-card,
  .info-card,
  .contact-panel {
    padding: 17px;
  }

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

  .status-badge {
    width: fit-content;
  }
}