:root {
  --accent: #111318;
  --accent-2: #000000;
  --accent-soft: rgba(17, 19, 24, 0.12);
  --bg: #f5f6f8;
  --bg-2: #eceef2;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --border: rgba(20, 20, 20, 0.08);
  --text: #111318;
  --muted: #5c6470;
  --accent-contrast: #ffffff;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 16px 36px rgba(0, 0, 0, 0.12);
  --radius: 22px;
}

html[data-theme="dark"] {
  --accent: #f3f6fb;
  --accent-2: #ffffff;
  --accent-soft: rgba(243, 246, 251, 0.14);
  --bg: #0f1115;
  --bg-2: #171a20;
  --surface: rgba(24, 28, 35, 0.88);
  --surface-strong: rgba(31, 36, 44, 0.96);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f3f6fb;
  --muted: #a7b0bc;
  --accent-contrast: #0f1115;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
  --shadow-hover: 0 20px 42px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: var(--surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}

.brand-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-name {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 1;
}

.topbar-toggle {
  flex: 0 0 auto;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.tab,
.theme-toggle,
.btn,
.project-link,
.contact-card,
.card,
.hero-left,
.hero-right,
.panel-card,
.role,
.detail-card,
.mini,
.pill,
.badge {
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  will-change: transform;
}

.tab {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.tab:hover,
.tab:focus-visible {
  background: var(--accent-soft);
  border-color: var(--accent);
  outline: none;
}

.tab.active {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: transparent;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.theme-toggle {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: var(--accent-soft);
  outline: none;
}

.theme-toggle-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.theme-toggle-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
}

.theme-toggle-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.theme-toggle-state {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text);
}

.container {
  flex: 1;
  width: min(1100px, calc(100% - 32px));
  margin: 28px auto 0;
  padding-bottom: 48px;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.panel > * + * {
  margin-top: 22px;
}

.panel.active {
  animation: panelFade 180ms ease;
}

@keyframes panelFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card,
.hero-left,
.hero-right,
.panel-card,
.role,
.detail-card,
.project-link,
.contact-card,
.mini,
.pill,
.badge {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card,
.hero-left,
.hero-right {
  border-radius: var(--radius);
}

.section {
  padding: 22px;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  margin-bottom: 16px;
}

.hero-left,
.hero-right {
  padding: 24px;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  color: var(--muted);
}

.hero h1 {
  margin: 14px 0 10px;
  font-size: clamp(2rem, 3.5vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.hero-sub {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.hero-sub-spaced {
  margin-top: 14px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
  outline: none;
}

.btn.ghost {
  background: var(--surface-strong);
  color: var(--text);
  border-color: var(--border);
}

.photo-frame {
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface-strong);
  border: 1px solid var(--border);
}

.photo-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.quick-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.mini {
  border-radius: 18px;
  padding: 14px;
}

.mini-top {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 700;
}

.mini-main {
  margin-top: 5px;
  font-weight: 800;
}

.mini-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.92rem;
}

.section-head {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  line-height: 1.1;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

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

.panel-card,
.detail-card {
  border-radius: 18px;
  padding: 16px;
}

.panel-title,
.project-title,
.contact-title,
.detail-title,
.extra-title {
  font-weight: 800;
}

.panel-body,
.project-meta,
.contact-sub,
.detail-text,
.detail-list,
.role ul,
.extra-body {
  color: var(--muted);
  line-height: 1.7;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
}

.project-link {
  display: block;
  text-decoration: none;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 14px;
}

.project-link:hover,
.project-link:focus-visible,
.contact-card:hover,
.contact-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  outline: none;
}

.project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
}

.arrow,
.chev {
  color: var(--muted);
  font-size: 1.2rem;
}

.exp-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 14px;
  align-items: start;
}

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

.role {
  position: relative;
  border-radius: 18px;
  padding: 16px;
}

.role::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  border-radius: 18px 0 0 18px;
  background: linear-gradient(180deg, var(--accent), transparent);
}

.role-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-left: 8px;
}

.role-logo {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}

.role-logo img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  display: block;
}

.role-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.role h3 {
  margin: 0;
}

.meta {
  color: var(--muted);
  font-weight: 700;
}

.role ul,
.detail-list,
.extra-body ul {
  margin: 10px 0 0;
  padding-left: 22px;
}

.extra-head {
  font-size: 1.35rem;
}

.extra-item {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.extra-item:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

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

.contact-card {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  border-radius: 18px;
  padding: 16px;
}

.icon-slot {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex: 0 0 auto;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 14px;
}

.tech-stack-wide {
  grid-column: 1 / -1;
}

.detail-actions {
  margin-top: 16px;
}

.footer {
  padding: 18px 20px 24px;
  text-align: center;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 980px) {
  .topbar,
  .topbar-right {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-right {
    gap: 10px;
  }

  .tabs {
    justify-content: flex-start;
  }

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

  .hero,
  .two-col,
  .detail-grid,
  .exp-grid,
  .contact-grid,
  .quick-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 20px, 1100px);
  }

  .topbar {
    padding: 12px;
  }

  .section,
  .hero-left,
  .hero-right {
    padding: 18px;
  }

  .project-row,
  .contact-card {
    padding: 14px;
  }

  .brand-name {
    font-size: 0.95rem;
  }
}


.card:hover,
.hero-left:hover,
.hero-right:hover,
.panel-card:hover,
.role:hover,
.detail-card:hover,
.project-link:hover,
.contact-card:hover,
.mini:hover,
.pill:hover,
.badge:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.tab:hover,
.tab:focus-visible,
.theme-toggle:hover,
.theme-toggle:focus-visible,
.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
}


.detail-card,
.tech-stack-wide {
  background: var(--surface-strong);
}

.detail-actions .btn {
  min-width: 190px;
}

.topbar .tab[aria-current="page"] {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: transparent;
}

.detail-text,
.detail-list {
  font-size: 0.98rem;
}
