:root {
  --bg: #f4f7ff;
  --panel: rgba(255, 255, 255, 0.78);
  --surface: rgba(255, 255, 255, 0.92);
  --text: #0f172a;
  --muted: #475569;
  --accent: #334155;
  --accent-2: #64748b;
  --accent-soft: rgba(51, 65, 85, 0.12);
  --line: rgba(148, 163, 184, 0.3);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(79, 70, 229, 0.16);
}
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background:
    radial-gradient(circle at 10% 10%, rgba(51,65,85,.16), transparent 30%),
    radial-gradient(circle at 90% 8%, rgba(100,116,139,.12), transparent 32%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 52%);
  color: var(--text);
}

#siteContent {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .6s ease, transform .6s ease, visibility .6s step-end;
}

#siteContent.site-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity .6s ease, transform .6s ease;
}

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: radial-gradient(circle at 20% 20%, rgba(51,65,85,.22), transparent 42%),
    radial-gradient(circle at 80% 10%, rgba(100,116,139,.18), transparent 36%),
    linear-gradient(180deg, #f7faff 0%, #eef3ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: opacity .6s ease, visibility .6s step-end;
}

.intro-overlay.intro-hidden {
  opacity: 0;
  visibility: hidden;
}

#intro3dCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.intro-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1rem;
  max-width: 540px;
  pointer-events: none;
}

.intro-kicker {
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
  font-size: .72rem;
  color: #334155;
}

.intro-content h2 {
  font-family: "Playfair Display", serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin: .25rem 0 .5rem;
}

.intro-sub {
  color: #334155;
  margin-bottom: .9rem;
}

.intro-skip:focus-visible {
  outline: 2px solid #334155;
  outline-offset: 2px;
}

.intro-skip {
  pointer-events: auto;
}
.layout { min-height: 100vh; }
.sidebar {
  background: #ffffff;
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 2rem 1.5rem;
}
.brand-title { font-family: "Playfair Display", serif; font-size: 2rem; line-height: 1.1; }
.role { color: #1e293b; font-weight: 600; margin-top: .4rem; }
.summary { color: var(--muted); font-size: .95rem; max-width: 320px; }
.side-nav a {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--muted);
  text-decoration: none;
  font-size: .86rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin: .45rem 0;
  transition: .2s;
}
.side-nav a::before {
  content: "";
  width: 28px;
  height: 1px;
  background: rgba(149,163,200,.5);
  transition: .2s;
}
.side-nav a:hover,
.side-nav a.active-link { color: #0f172a; }
.side-nav a:hover::before,
.side-nav a.active-link::before { width: 48px; background: var(--accent); }
.sidebar-library {
  background: linear-gradient(145deg, #0f172a, #1e293b);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  padding: .8rem;
}
.sidebar-library-label {
  color: #cbd5e1;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 800;
}
.reading-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .35rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  padding: .2rem;
}
.reading-switch-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.reading-switch-pill {
  text-align: center;
  border-radius: 999px;
  padding: .35rem .45rem;
  font-size: .78rem;
  font-weight: 700;
  color: #cbd5e1;
  cursor: pointer;
  transition: .2s ease;
}
.reading-switch-input:checked + .reading-switch-pill {
  background: linear-gradient(135deg, #cbd5e1, #e2e8f0);
  color: #0f172a;
  box-shadow: 0 6px 16px rgba(51,65,85,.2);
}
.social a {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: #334155;
  text-decoration: none;
  transition: .2s;
}
.social a:hover { transform: translateY(-2px); color: #0f172a; border-color: var(--accent); background: var(--accent-soft); }

.main {
  padding: 2rem 1rem 3rem;
  background: transparent;
}
.section {
  padding: 1.4rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.eyebrow { color: var(--accent); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.section h2 { font-size: 1.7rem; margin: .35rem 0 .9rem; }
.section p { color: #334155; }

.resume-card {
  background: rgba(255,255,255,.95);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem;
  transition: .25s ease;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}
.resume-card:hover { transform: translateY(-4px); border-color: rgba(79,70,229,.4); box-shadow: var(--shadow-lg); }
.meta { font-size: .78rem; color: var(--muted); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

.project { text-decoration: none; color: inherit; display: block; }
.project:hover .project-title { color: var(--accent); }
.project-title { font-weight: 700; transition: .2s; }

.rec-list .rec-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  padding: .45rem;
  min-height: 78px;
  transition: .2s ease;
}

.rec-list .rec-item:hover {
  transform: translateY(-2px);
  border-color: rgba(79,70,229,.35);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.rec-thumb {
  width: 80px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.rec-list .rec-item span {
  font-size: .86rem;
  color: #1e293b;
  line-height: 1.35;
}

.blog-card .blog-thumb {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin-bottom: .1rem;
}

.cert-grid img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #eef2ff;
  transition: .25s;
}
.cert-grid a:hover img { transform: scale(1.02); border-color: rgba(112,165,255,.6); }

.tag {
  display: inline-block;
  padding: .35rem .7rem;
  border: 1px solid rgba(51,65,85,.22);
  border-radius: 999px;
  color: #334155;
  background: rgba(226,232,240,.75);
  font-size: .82rem;
  margin: .2rem;
}

.cta-box {
  background: linear-gradient(145deg, rgba(51,65,85,.12), rgba(100,116,139,.13));
  border: 1px solid rgba(51,65,85,.26);
  border-radius: 16px;
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.btn-main {
  background: linear-gradient(135deg, #334155, #475569);
  color: #ffffff;
  font-weight: 800;
  border: none;
  border-radius: 999px;
  padding: .65rem 1.05rem;
  box-shadow: 0 10px 20px rgba(51,65,85,.28);
}

.btn-main:hover {
  background: linear-gradient(135deg, #1e293b, #334155);
  color: #fff;
}

.hero-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1.5rem;
  background: linear-gradient(145deg, rgba(15,23,42,.08), rgba(30,41,59,.06), rgba(255,255,255,.94));
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.14);
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

.hero-panel::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30,41,59,.22), transparent 70%);
  right: -60px;
  top: -60px;
  pointer-events: none;
}

.hero-title {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.1;
  margin-bottom: .5rem;
}

.hero-kpi {
  display: inline-flex;
  gap: .4rem;
  align-items: center;
  font-weight: 700;
  color: #1e293b;
  background: rgba(255,255,255,.8);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .35rem .75rem;
  margin: .15rem .25rem .15rem 0;
  font-size: .8rem;
}

.btn-secondary-cta {
  border: 1px solid rgba(51,65,85,.35);
  background: #ffffff;
  color: #334155;
  font-weight: 700;
  border-radius: 999px;
  padding: .65rem 1.05rem;
}

.btn-secondary-cta:hover {
  background: #eef2f7;
  color: #1e293b;
  border-color: rgba(51,65,85,.55);
}

.about-highlight {
  border-left: 3px solid var(--accent);
  padding-left: .9rem;
  font-weight: 600;
  color: #1e293b;
}

.like-btn {
  margin-top: .8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: .82rem;
  font-weight: 700;
  padding: .35rem .7rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  cursor: pointer;
}

.like-btn.liked {
  border-color: rgba(220,38,38,.35);
  background: rgba(254,226,226,.7);
  color: #dc2626;
}

body.reading-open {
  overflow: hidden;
}

.reading-dock {
  position: relative;
  border-radius: 20px;
  padding: 1.35rem 1.4rem;
  margin-bottom: 1rem;
  overflow: hidden;
  background: linear-gradient(145deg, #0f172a 0%, #1e293b 48%, #0f172a 100%);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow:
    0 0 0 1px rgba(79, 70, 229, 0.15),
    0 24px 50px rgba(15, 23, 42, 0.35);
}

.reading-dock-glow {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.45), transparent 65%);
  top: -120px;
  right: -80px;
  pointer-events: none;
  filter: blur(2px);
}

.reading-dock-inner {
  position: relative;
  z-index: 1;
}

.reading-dock-label {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.75);
  margin-bottom: .35rem;
}

.reading-dock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 10px rgba(100, 116, 139, 0.65);
}

.reading-dock-title {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  color: #f8fafc;
  margin: 0 0 .5rem;
}

.reading-dock-lead {
  color: rgba(203, 213, 225, 0.92);
  font-size: .9rem;
  max-width: 42rem;
}

.reading-open-btn {
  flex: 0 0 auto;
  border-radius: 12px;
  font-weight: 800;
  padding: .6rem 1.1rem;
  border: none;
  color: #0f172a;
  background: linear-gradient(135deg, #cbd5e1, #e2e8f0);
  box-shadow: 0 8px 20px rgba(51, 65, 85, 0.2);
}

.reading-open-btn:hover {
  filter: brightness(1.06);
  color: #0f172a;
}

.reading-dock-hint {
  font-size: .75rem;
  color: rgba(148, 163, 184, 0.95);
}

.reading-dock-hint kbd {
  display: inline-block;
  padding: .08rem .35rem;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.5);
  font-size: .68rem;
  font-weight: 700;
}

.reading-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1160;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .32s ease, visibility .32s step-end;
}

.reading-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity .32s ease;
}

.reading-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(100vw - 1rem, 760px);
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  z-index: 1170;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 50px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  transform: translateX(104%);
  transition: transform .38s cubic-bezier(0.22, 1, 0.36, 1);
}

.reading-drawer.is-open {
  transform: translateX(0);
}

.reading-drawer-head {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.1rem .85rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
}

.reading-drawer-kicker {
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.reading-drawer-title {
  color: var(--text);
  font-weight: 800;
}

.reading-drawer-close {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: .2s;
}

.reading-drawer-close:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.reading-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.1rem 2rem;
  -webkit-overflow-scrolling: touch;
}

.reading-drawer .rec-list .rec-item span {
  font-size: .82rem;
}
.reading-group-title {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
  color: #475569;
  margin: .25rem 0 .2rem;
}

@media (max-width: 991.98px) {
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .main { padding-top: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  #siteContent,
  .intro-overlay,
  .reading-backdrop,
  .reading-drawer {
    transition: none;
  }
}

