:root {
  color-scheme: light;
  --page: #e8edf3;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --line: #e5e7eb;
  --chip-bg: #f3f4f6;
  --chip-ink: #374151;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --sidebar-width: 320px;
  --radius: 14px;
  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --button-ink: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0b1220;
    --card: #111827;
    --ink: #f3f4f6;
    --muted: #9ca3af;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --line: #1f2937;
    --chip-bg: #1f2937;
    --chip-ink: #e5e7eb;
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    --button-ink: #0b1220;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --page: #e8edf3;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --line: #e5e7eb;
  --chip-bg: #f3f4f6;
  --chip-ink: #374151;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --button-ink: #ffffff;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0b1220;
  --card: #111827;
  --ink: #f3f4f6;
  --muted: #9ca3af;
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --line: #1f2937;
  --chip-bg: #1f2937;
  --chip-ink: #e5e7eb;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  --button-ink: #0b1220;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--page);
  line-height: 1.55;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--ink);
}

p {
  margin: 0 0 0.85rem;
  color: var(--muted);
}

ul {
  margin: 0;
  padding: 0;
}

.page-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.5rem;
  padding: 0.15rem 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1.1rem;
}

.top-nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  color: var(--accent);
}

.layout-body {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 1.25rem;
}

.sidebar-card,
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sidebar-card {
  padding: 0.35rem 0.35rem 1.5rem 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
  text-align: center;
}

.profile-photo {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  opacity: 0.88;
  border: 3px solid var(--card);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px var(--line),
    0 8px 20px rgba(15, 23, 42, 0.14);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--accent);
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar h1 {
  font-size: 1.7rem;
  line-height: 1.15;
  margin-bottom: 0.35rem;
}

.role {
  margin: 0 0 0.75rem;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 600;
}

.sidebar-email {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.sidebar-location {
  margin: 0.35rem 0 1rem;
  font-size: 0.9rem;
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.social-link {
  display: inline-flex;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}

.social-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

.sidebar-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.sidebar-actions {
  margin-bottom: 1.15rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.15rem;
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.button:hover {
  text-decoration: none;
}

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

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

.button-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.button-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.glance {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  margin-bottom: 0;
}

.glance h2,
.card h2 {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
}

.meta-list {
  list-style: none;
}

.meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}

.meta-list li:last-child {
  border-bottom: 0;
}

.meta-list strong {
  color: var(--muted);
  font-weight: 500;
}

.meta-list span {
  color: var(--ink);
  font-weight: 600;
  text-align: right;
}

.content {
  display: grid;
  gap: 1.1rem;
}

.card {
  padding: 1.35rem 1.4rem 1.45rem;
}

.card h3 {
  margin: 1.1rem 0 0.65rem;
  font-size: 1rem;
}

.section-intro {
  margin-top: -0.15rem;
  margin-bottom: 1rem;
}

.strengths,
.entry ul {
  margin: 0.35rem 0 0.9rem;
  padding-left: 1.15rem;
  color: var(--muted);
}

.strengths li,
.entry li {
  margin-bottom: 0.35rem;
}

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

.skill-group {
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--page) 55%, var(--card));
}

.skill-group h3 {
  margin: 0 0 0.65rem;
  color: var(--accent);
  font-size: 0.92rem;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
}

.chip {
  display: inline-flex;
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  background: var(--chip-bg);
  color: var(--chip-ink);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.entry-list {
  display: grid;
  gap: 1.15rem;
}

.entry {
  padding-bottom: 1.05rem;
  border-bottom: 1px solid var(--line);
}

.entry:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.entry-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.entry-head h3 {
  margin: 0;
  font-size: 1.02rem;
}

.entry-date {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 650;
  white-space: nowrap;
}

.entry-meta {
  margin: 0.2rem 0 0.55rem;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
}

.entry-links {
  margin-top: 0.55rem;
}

.repo-list {
  list-style: none;
  display: grid;
  gap: 0.85rem;
}

.repo-list li {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.repo-list a {
  font-weight: 700;
}

.repo-lang {
  margin-left: 0.45rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 650;
}

.repo-list p {
  margin: 0.35rem 0 0;
}

.contact-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.contact-grid li {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.contact-grid strong {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0.2rem 0;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 960px) {
  .layout-body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 1.25rem, 1180px);
    padding-top: 1rem;
  }

  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .top-nav {
    gap: 0.45rem 0.85rem;
  }

  .theme-toggle {
    align-self: flex-end;
  }

  .theme-label {
    display: none;
  }

  .entry-head {
    flex-direction: column;
    gap: 0.2rem;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media print {
  body {
    background: white;
  }

  .theme-toggle,
  .top-nav,
  .sidebar-actions,
  .actions {
    display: none;
  }

  .page-shell,
  .layout-body {
    display: block;
    width: 100%;
  }

  .sidebar-card,
  .card {
    box-shadow: none;
    break-inside: avoid;
  }
}
