:root {
  --bg: #0b0f19;
  --bg-alt: #111827;
  --surface: rgba(23, 31, 48, 0.78);
  --surface-solid: #161f33;
  --border: rgba(148, 163, 184, 0.16);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --accent-contrast: #07101d;
  --success: #34d399;
  --error: #f87171;
  --shadow: 0 20px 45px rgba(2, 6, 23, 0.45);
  --radius: 16px;
  --container: 1120px;
}

html[data-theme="light"] {
  --bg: #f8fafc;
  --bg-alt: #eef2f7;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --border: rgba(15, 23, 42, 0.1);
  --text: #0f172a;
  --text-muted: #475569;
  --accent: #0284c7;
  --accent-2: #4f46e5;
  --accent-contrast: #ffffff;
  --success: #059669;
  --error: #dc2626;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 15% 10%, rgba(56, 189, 248, 0.12), transparent 38%),
    radial-gradient(circle at 85% 20%, rgba(129, 140, 248, 0.1), transparent 36%);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 0.65rem 1rem;
  font-weight: 600;
  z-index: 1000;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

.section {
  padding: clamp(4rem, 7vw, 6.5rem) 0;
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.25rem;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-contrast);
  font-size: 0.85rem;
  font-weight: 800;
}

.brand-text {
  font-size: 1rem;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.18s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.icon-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

html[data-theme="dark"] .theme-icon-moon {
  display: none;
}

html[data-theme="light"] .theme-icon-sun {
  display: none;
}

.menu-toggle {
  display: none;
}

.menu-bars {
  position: relative;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.menu-bars::before,
.menu-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.menu-bars::before {
  top: -5px;
}

.menu-bars::after {
  top: 5px;
}

.nav-mobile {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

.nav-mobile[hidden] {
  display: none;
}

/* Hero */
.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.16);
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.25rem, 5vw, 3.65rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  margin: 0 0 1.85rem;
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  color: var(--text-muted);
  max-width: 56ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.78rem 1.3rem;
  border-radius: 11px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-contrast);
}

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

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

.btn-small {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  background: var(--surface-solid);
  border-color: var(--border);
  color: var(--text);
}

.btn-full {
  width: 100%;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
}

.profile-photo-wrap {
  flex-shrink: 0;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.profile-photo {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  background: var(--surface-solid);
}

.profile-identity h2 {
  margin: 0 0 0.15rem;
  font-size: 1.2rem;
  line-height: 1.25;
}

.profile-identity p {
  margin: 0 0 0.45rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}

.quick-facts {
  margin: 0;
  display: grid;
  gap: 0.9rem;
}

.quick-facts div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.95rem;
}

.quick-facts dt {
  color: var(--text-muted);
}

.quick-facts dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.quick-facts a {
  color: var(--accent);
}

/* Section headings */
.section-heading {
  margin-bottom: 2.25rem;
}

.section-kicker {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.65rem, 3vw, 2.3rem);
  letter-spacing: -0.02em;
}

.section-lead {
  margin: 0;
  color: var(--text-muted);
  max-width: 60ch;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: start;
}

.about-text p {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 1.03rem;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.stats-grid {
  display: grid;
  gap: 1rem;
}

.stat-card {
  padding: 1.1rem 1.25rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-value {
  font-weight: 700;
  font-size: 1.05rem;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.9rem;
  font-size: 0.82rem;
}

.project-tag {
  color: var(--accent);
  font-weight: 600;
}

.project-year {
  color: var(--text-muted);
}

.project-card h3 {
  margin: 0 0 0.6rem;
  font-size: 1.2rem;
}

.project-card p {
  margin: 0 0 1.2rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  flex: 1;
}

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

.tech-list li {
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: color-mix(in srgb, var(--text-muted) 12%, transparent);
  color: var(--text-muted);
}

.project-links a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}

/* Timeline (Work Experience) */
.timeline {
  display: grid;
  gap: 1.25rem;
}

.timeline-card {
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
}

.timeline-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem 1.5rem;
  margin-bottom: 0.75rem;
}

.timeline-header h3 {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
}

.timeline-org {
  margin: 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
}

.timeline-period {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.timeline-card > p {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.96rem;
}

.timeline-location {
  color: var(--text-muted);
  font-weight: 500;
}

.timeline-bullets,
.compact-list {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  color: var(--text-muted);
  font-size: 0.94rem;
}

.timeline-bullets li,
.compact-list li {
  margin-bottom: 0.4rem;
}

.compact-list {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.skills-block {
  margin-top: 1.5rem;
}

.skills-block h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.welfare-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.25rem;
}

.welfare-featured {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.contact-list {
  margin-top: 1.25rem;
  display: grid;
  gap: 0.75rem;
}

.contact-item {
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.contact-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.contact-value-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* Focus */
.focus-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.focus-item {
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.focus-item h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.focus-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.contact-info > p {
  color: var(--text-muted);
  max-width: 48ch;
}

.email-box {
  margin-top: 1.35rem;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.email-link {
  font-weight: 600;
  color: var(--accent);
}

.social-links {
  margin-top: 1.25rem;
  display: flex;
  gap: 1.25rem;
  font-weight: 600;
  color: var(--text-muted);
}

.social-links a:hover {
  color: var(--accent);
}

.contact-form {
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label {
  font-size: 0.9rem;
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.72rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.field textarea {
  resize: vertical;
}

.status-text {
  margin: 0.4rem 0 0;
  min-height: 1.3em;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.status-text.is-success {
  color: var(--success);
}

.status-text.is-error {
  color: var(--error);
}

/* Footer */
.site-footer {
  padding: 1.75rem 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-inner a:hover {
  color: var(--text);
}

@media (max-width: 900px) {
  .hero-grid,
  .about-grid,
  .contact-grid,
  .projects-grid,
  .focus-grid,
  .welfare-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .nav-desktop {
    display: none;
  }

  .menu-toggle {
    display: inline-grid;
  }
}

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

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