:root {
  --bg: #0d1117;
  --header: rgba(13, 17, 23, 0.88);
  --surface: #161b22;
  --surface-subtle: #0d1117;
  --border: #30363d;
  --border-muted: #21262d;
  --text: #e6edf3;
  --muted: #8b949e;
  --subtle: #6e7681;
  --blue: #58a6ff;
  --green: #3fb950;
  --green-soft: rgba(46, 160, 67, 0.15);
  --shadow: 0 8px 24px rgba(1, 4, 9, 0.18);
  --radius: 6px;
  --header-height: 64px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

[data-theme="light"] {
  --bg: #ffffff;
  --header: rgba(255, 255, 255, 0.9);
  --surface: #f6f8fa;
  --surface-subtle: #ffffff;
  --border: #d0d7de;
  --border-muted: #d8dee4;
  --text: #1f2328;
  --muted: #59636e;
  --subtle: #6e7781;
  --blue: #0969da;
  --green: #1a7f37;
  --green-soft: rgba(26, 127, 55, 0.1);
  --shadow: 0 8px 24px rgba(140, 149, 159, 0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 24px); }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; }

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

.header-inner { width: min(1180px, calc(100% - 40px)); height: 100%; margin: 0 auto; display: flex; align-items: center; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; white-space: nowrap; }
.brand:hover { color: var(--text); text-decoration: none; }
.brand svg { width: 26px; height: 26px; fill: currentColor; }
nav { margin-left: auto; display: flex; align-items: center; gap: 24px; }
nav a { color: var(--muted); font-size: 0.9rem; font-weight: 550; }
nav a:hover { color: var(--text); text-decoration: none; }

.header-actions { display: flex; align-items: center; gap: 8px; }
.language-toggle { min-width: 46px; height: 34px; padding: 0 9px; color: var(--muted); background: transparent; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; font-size: 0.8rem; font-weight: 650; }
.language-toggle:hover { color: var(--text); background: var(--surface); }

.theme-toggle { width: 34px; height: 34px; padding: 7px; display: grid; place-items: center; color: var(--muted); background: transparent; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.theme-toggle:hover { color: var(--text); background: var(--surface); }
.theme-toggle svg { grid-area: 1 / 1; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

.layout { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 72px; display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 56px; }
.profile { position: sticky; top: calc(var(--header-height) + 32px); align-self: start; }
.avatar { width: 176px; height: 176px; display: block; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); object-fit: cover; box-shadow: var(--shadow); }
.identity { margin-top: 22px; }
.identity h1 { margin: 0; font-size: 1.65rem; line-height: 1.25; }
.handle { margin: 3px 0 0; color: var(--muted); font-size: 1.15rem; font-weight: 300; }
.role { margin: 18px 0 0; font-weight: 650; }
.bio { margin: 8px 0 0; color: var(--muted); }
.availability { margin-top: 20px; padding: 9px 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); font-size: 0.87rem; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); flex: none; }
.profile-meta { margin: 20px 0 0; padding: 0; list-style: none; display: grid; gap: 9px; color: var(--muted); font-size: 0.9rem; }
.profile-meta li { display: flex; align-items: center; gap: 9px; min-width: 0; }
.profile-meta svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.profile-meta a { overflow-wrap: anywhere; }

.content { min-width: 0; }
.section { padding: 0 0 44px; margin: 0 0 44px; border-bottom: 1px solid var(--border-muted); }
.section-heading { max-width: 760px; }
.eyebrow { margin: 0 0 10px; color: var(--green); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; font-weight: 650; letter-spacing: 0.02em; text-transform: uppercase; }
h2 { margin: 0; font-size: clamp(1.45rem, 3vw, 2.2rem); line-height: 1.25; letter-spacing: -0.025em; }
.intro-section h2 { max-width: 710px; }
.readme-card { margin-top: 24px; padding: 24px; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.readme-card p { margin: 0; color: var(--muted); max-width: 760px; }
.readme-card p + p { margin-top: 16px; }

.section-title-row { margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section-title-row h2 { font-size: 1.25rem; letter-spacing: 0; }
.section-count { color: var(--muted); font-size: 0.8rem; }
.section-subtitle { margin: 16px 0 0; color: var(--muted); font-size: 0.9rem; max-width: 640px; }
.repo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.repo-card { min-height: 220px; padding: 20px; display: flex; flex-direction: column; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease; }
.repo-card:hover { border-color: var(--subtle); transform: translateY(-2px); box-shadow: var(--shadow); }
.repo-card:hover { color: inherit; text-decoration: none; }
.repo-card--private { cursor: default; }
.repo-card--private:hover { border-color: var(--border); transform: none; box-shadow: none; }
.repo-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.repo-header h3 { margin: 0; color: var(--blue); font-size: 1rem; font-weight: 650; }
.repo-icon { margin-right: 7px; color: var(--muted); }
.visibility { padding: 2px 7px; flex: none; border: 1px solid var(--border); border-radius: 2em; color: var(--muted); font-size: 0.68rem; font-weight: 600; }
.repo-card p { margin: 12px 0 22px; color: var(--muted); font-size: 0.87rem; }
.tag-list { margin: auto 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px; list-style: none; color: var(--muted); font-size: 0.76rem; }
.tag-list li::before { content: ""; width: 9px; height: 9px; margin-right: 6px; display: inline-block; border-radius: 50%; background: var(--blue); }
.tag-list li:nth-child(2)::before { background: #a371f7; }
.tag-list li:nth-child(3)::before { background: var(--green); }
.repo-link { margin-top: 14px; color: var(--blue); font-size: 0.78rem; font-weight: 650; }
.repo-link--muted { color: var(--subtle); }

.disclosure-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.disclosure-card { padding: 20px; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--radius); }
.disclosure-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.disclosure-head h3 { margin: 0; font-size: 1rem; font-weight: 650; }
.disclosure-chain { flex: none; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.72rem; }
.disclosure-status { margin-top: 10px; display: inline-block; padding: 3px 9px; border: 1px solid var(--border); border-radius: 2em; color: var(--muted); font-size: 0.72rem; font-weight: 650; }
.disclosure-status--positive { border-color: transparent; background: var(--green-soft); color: var(--green); }
.disclosure-status--neutral { color: var(--subtle); }
.disclosure-card p { margin: 12px 0 0; color: var(--muted); font-size: 0.87rem; }

.audit-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.audit-list li { position: relative; padding-left: 20px; color: var(--muted); font-size: 0.9rem; }
.audit-list li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }

.approach-grid { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.approach-item { padding: 19px 20px; display: grid; grid-template-columns: 38px 1fr; gap: 14px; background: var(--surface-subtle); }
.approach-item + .approach-item { border-top: 1px solid var(--border); }
.approach-item > span { color: var(--green); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.78rem; font-weight: 650; }
.approach-item h3 { margin: -2px 0 3px; font-size: 0.96rem; }
.approach-item p { margin: 0; color: var(--muted); font-size: 0.9rem; }

.skills-table { border-top: 1px solid var(--border); }
.skill-row { min-height: 62px; padding: 16px 4px; display: grid; grid-template-columns: 165px 1fr; gap: 20px; border-bottom: 1px solid var(--border); }
.skill-row strong { font-size: 0.9rem; }
.skill-row span { color: var(--muted); font-size: 0.9rem; }

.contact-card { padding: 28px; display: flex; align-items: center; justify-content: space-between; gap: 28px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.contact-card h2 { max-width: 610px; font-size: 1.45rem; }
.contact-card p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 0.92rem; }
.primary-button { min-height: 40px; padding: 9px 15px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; flex: none; border: 1px solid rgba(240, 246, 252, 0.1); border-radius: var(--radius); background: #238636; color: #fff; font-size: 0.9rem; font-weight: 650; box-shadow: 0 1px 0 rgba(27, 31, 36, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.03); }
.primary-button:hover { color: #fff; background: #2ea043; text-decoration: none; }
.primary-button:focus-visible, .theme-toggle:focus-visible, .language-toggle:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

footer { display: flex; justify-content: space-between; gap: 16px; color: var(--subtle); font-size: 0.78rem; }
footer p { margin: 0; }
.footer-links { display: flex; gap: 16px; }
.footer-links a:hover { color: var(--blue); }

@media (max-width: 860px) {
  nav { display: none; }
  .header-actions { margin-left: auto; }
  .layout { grid-template-columns: 1fr; gap: 38px; padding-top: 34px; }
  .profile { position: static; display: grid; grid-template-columns: 112px 1fr; column-gap: 24px; }
  .avatar { width: 112px; height: 112px; grid-row: 1 / span 3; font-size: 2.2rem; }
  .identity { margin-top: 4px; }
  .role { margin-top: 10px; }
  .bio, .availability, .profile-meta { grid-column: 1 / -1; }
  .bio { margin-top: 22px; }
  .availability { width: fit-content; }
}

@media (max-width: 620px) {
  .header-inner, .layout { width: min(100% - 28px, 1180px); }
  .layout { padding-bottom: 40px; }
  .repo-grid { grid-template-columns: 1fr; }
  .disclosure-grid { grid-template-columns: 1fr; }
  .skill-row { grid-template-columns: 1fr; gap: 4px; }
  .contact-card { align-items: stretch; flex-direction: column; }
  .primary-button { width: 100%; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
