:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #666666;
  --border: #e6e6e6;
  --hover-bg: #f6f6f6;
  --panel: #ffffff;
  --backdrop: rgba(20, 20, 20, 0.28);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme="dark"] {
  --bg: #0d0d0d;
  --fg: #f2f2f2;
  --muted: #9a9a9a;
  --border: #262626;
  --hover-bg: #171717;
  --panel: #161616;
  --backdrop: rgba(0, 0, 0, 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d0d;
    --fg: #f2f2f2;
    --muted: #9a9a9a;
    --border: #262626;
    --hover-bg: #171717;
    --panel: #161616;
    --backdrop: rgba(0, 0, 0, 0.55);
  }
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.page {
  max-width: 620px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

/* Intro */

.top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.intro h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.role {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.theme-toggle {
  border: 1px solid var(--border);
  background: none;
  color: var(--fg);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.15s var(--ease), transform 0.2s var(--ease);
}

.theme-toggle:hover {
  border-color: var(--fg);
  transform: rotate(20deg);
}

.bio {
  margin: 0 0 14px;
  font-size: 1rem;
}

.contact-row {
  margin: 0 0 40px;
  font-size: 0.88rem;
  color: var(--muted);
}

.contact-row a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.15s var(--ease);
}

.contact-row a:hover {
  border-bottom-color: var(--fg);
}

.copy-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  margin-left: 6px;
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
  transition: color 0.15s var(--ease), text-decoration-color 0.15s var(--ease);
}

.copy-btn:hover {
  color: var(--fg);
  text-decoration-color: var(--fg);
}

.copy-btn.copied {
  color: var(--fg);
}

.contact-row .sep {
  margin: 0 8px;
  color: var(--border);
}

/* Accordion sections */

.sections {
  border-top: 1px solid var(--border);
}

.accordion {
  border-bottom: 1px solid var(--border);
}

.accordion-trigger {
  width: 100%;
  background: none;
  border: none;
  color: var(--fg);
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 500;
  cursor: pointer;
  padding: 16px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.accordion-trigger:hover .accordion-label {
  opacity: 0.7;
}

.accordion-label {
  transition: opacity 0.15s var(--ease);
}

.chevron {
  color: var(--muted);
  font-size: 0.8rem;
  transition: transform 0.25s var(--ease);
}

.accordion.open .chevron {
  transform: rotate(90deg);
}

.accordion-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s var(--ease);
}

.accordion.open .accordion-panel {
  grid-template-rows: 1fr;
}

.accordion-inner {
  overflow: hidden;
  min-height: 0;
}

.accordion-inner-pad {
  padding: 0 2px 22px;
}

/* Work list */

.work-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.work-item {
  padding: 14px 10px;
  margin: 0 -10px;
  border-radius: 6px;
}

.work-item + .work-item {
  border-top: 1px solid var(--border);
}

.work-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px;
}

.work-name {
  font-size: 0.94rem;
  font-weight: 500;
}

.work-meta {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.work-summary {
  margin: 0 0 10px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
}

.info-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.78rem;
  border-radius: 20px;
  padding: 4px 12px 4px 8px;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background 0.15s var(--ease);
}

.info-btn:hover,
.info-btn:focus-visible {
  border-color: var(--fg);
  color: var(--fg);
  background: var(--hover-bg);
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: 0.66rem;
  font-style: italic;
  font-family: Georgia, serif;
}

/* About content */

.skills-group {
  margin-bottom: 12px;
}

.skills-label {
  font-weight: 600;
  font-size: 0.88rem;
}

.skills-value {
  color: var(--muted);
  font-size: 0.9rem;
}

.about-entry {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
  margin-top: 6px;
}

.about-entry .muted {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.empty-state {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}

/* Detail modal (for hovered work items) */

.overlay {
  position: fixed;
  inset: 0;
  background: var(--backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease);
  z-index: 20;
}

.overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 76vh;
  overflow-y: auto;
  padding: 30px 34px;
  position: relative;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: opacity 0.22s var(--ease-out), transform 0.22s var(--ease-out);
}

.overlay.open .modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal-close {
  position: sticky;
  float: right;
  top: 0;
  margin: -6px -6px 0 0;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 6px;
  transition: color 0.15s var(--ease);
}

.modal-close:hover {
  color: var(--fg);
}

.modal-meta {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0 0 16px;
}

.modal h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 4px;
  padding-right: 24px;
}

.modal p {
  margin: 0 0 12px;
}

ul.bullets {
  margin: 6px 0 0;
  padding-left: 18px;
}

ul.bullets li {
  margin-bottom: 7px;
  font-size: 0.94rem;
}

ul.bullets li::marker {
  color: var(--muted);
}

@media (max-width: 480px) {
  .page {
    padding: 40px 20px 64px;
  }
  .modal {
    padding: 24px 22px;
  }
}
