:root {
    --bg: #fbfff2;
    --bg-accent-1: #215E61;
    --bg-accent-2: #30858a;
    --surface: #ffffff;
    --surface-soft: #F5FBE6;
    --text: #233D4D;
    --muted: #30858a;
    --line: #d9d9d9;
    --brand: #215E61;
    --brand-strong: #FE7F2D;
    --highlight: #FE7F2D;
    --shadow: rgba(0, 0, 0, 0.08);
    --focus-ring: #F5FBE6;
}

[data-theme="dark"] {
  --bg: #070707;
  --bg-accent-1: rgba(30, 195, 64, 0.2);
  --bg-accent-2: rgba(30, 195, 64, 0.1);
  --surface: #101010;
  --surface-soft: #151a15;
  --text: #eafbea;
  --muted: #9ce4ab;
  --line: rgba(30, 195, 64, 0.35);
  --brand: #1ec340;
  --brand-strong: #71e687;
  --highlight: #1ec340;
  --shadow: rgba(0, 0, 0, 0.45);
  --focus-ring: rgba(30, 195, 64, 0.3);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, var(--bg-accent-1) 0%, transparent 35%),
    radial-gradient(circle at 90% 20%, var(--bg-accent-2) 0%, transparent 30%),
    var(--bg);
}

a {
  color: var(--brand);
}

a:hover,
a:focus-visible {
  color: var(--brand-strong);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 1000;
  background: var(--surface);
  border: 2px solid var(--brand);
  border-radius: 0.5rem;
  padding: 0.4rem 0.7rem;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 1.25rem;
  min-height: calc(100vh - 44px);
  padding: 1.25rem;
}

.sidebar {
  position: sticky;
  top: 1.25rem;
  height: fit-content;
  display: grid;
  gap: 0.9rem;
}

.sidebar-card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 6px 18px var(--shadow);
}

.profile-card {
  text-align: center;
}

.sidebar-kicker {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--highlight);
}

.sidebar-photo {
  width: 100%;
  max-width: 180px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0.9rem;
  border: 1px solid var(--line);
  box-shadow: 0 6px 16px var(--shadow);
  margin: 0 auto 0.75rem;
}

.sidebar-name {
  margin: 0;
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
  line-height: 1.2;
  white-space: nowrap;
}

.sidebar-role {
  margin: 0.4rem 0 0.2rem;
  font-weight: 600;
}

.sidebar-focus {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.theme-toggle {
  margin-top: 0.8rem;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface);
  color: var(--text);
  padding: 0.48rem 0.7rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
}

.theme-toggle i {
  color: var(--brand);
  margin-right: 0.4rem;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: var(--surface-soft);
  border-color: var(--brand);
}

.sidebar-nav {
  display: grid;
  gap: 0.45rem;
}

.sidebar-link-group {
  display: grid;
  gap: 0.35rem;
}

.sidebar-link {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  padding: 0.52rem 0.72rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}

.sidebar-link:hover,
.sidebar-link:focus-visible,
.sidebar-link.active {
  background: var(--surface-soft);
  border-color: var(--line);
}

.sidebar-subnav {
  display: grid;
  gap: 0.25rem;
  padding: 0 0 0 0.6rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.22s ease, opacity 0.22s ease, padding 0.22s ease;
}

.sidebar-link-group.expanded .sidebar-subnav {
  max-height: 14rem;
  opacity: 1;
  padding: 0.2rem 0 0.2rem 0.6rem;
}

.sidebar-sublink {
  display: block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
  border-left: 2px solid var(--line);
  padding: 0.18rem 0 0.18rem 0.55rem;
}

.sidebar-sublink:hover,
.sidebar-sublink:focus-visible {
  color: var(--brand-strong);
  border-left-color: var(--brand);
}

.sidebar-sublink.active {
  color: var(--brand-strong);
  border-left-color: var(--brand);
  font-weight: 600;
}

.sidebar-contact p {
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
}

.social-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.35rem;
}

.social-list li {
  font-size: 0.92rem;
}

.social-list i {
  width: 1.05rem;
  margin-right: 0.35rem;
  color: var(--brand);
}

.content-area {
  display: grid;
  gap: 1rem;
}

.content-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.2rem;
  box-shadow: 0 6px 18px var(--shadow);
}

.section-title {
  margin-bottom: 0.9rem;
  color: var(--brand-strong);
}

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

.metric-tile {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.75rem;
}

.metric-value {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--brand-strong);
}

.metric-label {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.info-card {
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.95rem;
  margin-bottom: 0.85rem;
  background: var(--surface);
}

.info-card:target {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.meta-line {
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.project-accordion .accordion-item {
  overflow: hidden;
}

.project-accordion .accordion-button {
  font-weight: 600;
  background: var(--surface-soft);
  color: var(--text);
}

.project-accordion .accordion-button:not(.collapsed) {
  color: var(--brand-strong);
  background: var(--surface-soft);
}

.project-accordion .accordion-body,
.project-accordion .accordion-body p,
.project-accordion .accordion-body li {
  color: var(--text);
}

.diagram-wrap {
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.85rem;
  background: var(--surface-soft);
  margin-top: 0.9rem;
}

.diagram-wrap .mermaid {
  overflow-x: auto;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.pill-list li {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.86rem;
}

.footer-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
  padding: 0.55rem 1rem 0.85rem;
}

@media (max-width: 992px) {
  .page-shell {
    grid-template-columns: 1fr;
    padding: 0.9rem;
  }

  .sidebar {
    position: static;
  }
}
