/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }

/* ── Tokens ────────────────────────────────────────────────────── */
:root {
  --font-display: 'Sora', sans-serif;
  --font-body:    'Inter', sans-serif;
  --radius:       14px;
  --max-w:        1080px;
  --transition:   0.25s ease;
}

/* Light theme */
[data-theme="light"] {
  --bg:           #f7f6f2;
  --bg-card:      #ffffff;
  --bg-nav:       rgba(247, 246, 242, 0.88);
  --border:       #e8e4de;
  --text:         #1a1814;
  --text-muted:   #7a7570;
  --accent:       #5b4cf5;
  --web3-color:   #7c3aed;
  --web3-bg:      #ede9fe;
  --web2-color:   #0369a1;
  --web2-bg:      #e0f2fe;
  --tag-bg:       #f0ece8;
  --tag-text:     #5a5550;
}

/* Dark theme */
[data-theme="dark"] {
  --bg:           #111110;
  --bg-card:      #1c1b19;
  --bg-nav:       rgba(17, 17, 16, 0.88);
  --border:       #2e2c28;
  --text:         #f0ede8;
  --text-muted:   #8a8580;
  --accent:       #7c6af7;
  --web3-color:   #a78bfa;
  --web3-bg:      #2e1f5e;
  --web2-color:   #38bdf8;
  --web2-bg:      #082f49;
  --tag-bg:       #252320;
  --tag-text:     #a09890;
}

/* ── Base ──────────────────────────────────────────────────────── */
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
}

section { padding: 96px 0; }

/* ── Header / Nav ──────────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-nav);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--accent);
  letter-spacing: -0.02em;
}

header ul {
  list-style: none;
  display: flex;
  gap: 36px;
}

header ul a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
  letter-spacing: 0.01em;
}
header ul a:hover { color: var(--text); }

.font-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  transition: color var(--transition), border-color var(--transition);
  letter-spacing: 0;
}
.font-toggle:hover { color: var(--text); border-color: var(--text-muted); }

.font-toggle:disabled { opacity: 0.3; cursor: not-allowed; }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition), border-color var(--transition);
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-muted); }

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

/* ── Pills ─────────────────────────────────────────────────────── */
.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
}
.pill.web3 { background: var(--web3-bg); color: var(--web3-color); }
.pill.web2 { background: var(--web2-bg); color: var(--web2-color); }
.pill-sep  { color: var(--text-muted); font-size: 14px; margin: 0 4px; }
.pill-row  { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Hero ──────────────────────────────────────────────────────── */
#hero {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  padding: 60px 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 64px;
  align-items: center;
}

.hero-greeting {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 400;
}

.hero-text h1 {
  font-family: var(--font-display);
  font-size: clamp(52px, 8vw, 88px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  margin-bottom: 6px;
}

.hero-text h1 span {
  color: var(--accent);
}

.hero-title {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 24px;
  letter-spacing: 0.01em;
}

.hero-bio {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 440px;
  margin-bottom: 24px;
  line-height: 1.75;
}
.hero-bio strong { color: var(--text); font-weight: 500; }

.hero-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 32px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  margin-bottom: 36px;
}

.btn-primary {
  padding: 11px 26px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  transition: opacity var(--transition);
}
.btn-primary:hover { opacity: 0.85; }

.btn-outline {
  padding: 11px 26px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition);
}
.btn-outline:hover { border-color: var(--text-muted); color: var(--text); }

.hero-social {
  display: flex;
  gap: 18px;
}
.hero-social a {
  color: var(--text-muted);
  transition: color var(--transition);
  display: flex;
}
.hero-social a:hover { color: var(--text); }

/* Avatar */
.hero-image { display: flex; justify-content: center; }

.avatar-wrap {
  position: relative;
  width: 380px;
  height: 420px;
}

.avatar-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent) 0%, transparent 60%);
  border-radius: 32px;
  opacity: 0.12;
  transform: rotate(-2deg);
}

.avatar-wrap img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom;
  border-radius: 24px;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.15));
}

/* ── Section labels ────────────────────────────────────────────── */
.section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 52px;
  line-height: 1.1;
}

/* ── About ─────────────────────────────────────────────────────── */
#about { background: var(--bg-card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 80px;
  align-items: start;
}

.about-main h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 28px;
}

.about-main p {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 15px;
}
.about-main p:last-child { margin-bottom: 0; }
.about-main strong { color: var(--text); font-weight: 500; }

.about-numbers {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.number-card {
  padding: 20px 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.big-num {
  display: block;
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}

.num-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

/* ── Experience ────────────────────────────────────────────────── */
.exp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.exp-card {
  display: flex;
  gap: 16px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}
.exp-card:hover { border-color: var(--accent); }

.exp-logo {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.exp-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.logo-fb {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.exp-body { flex: 1; min-width: 0; }

.exp-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.exp-body h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  font-family: var(--font-display);
}

.exp-company {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.exp-date {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.exp-body p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
}

/* ── Skills ────────────────────────────────────────────────────── */
#skills { background: var(--bg-card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.skill-block h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  font-family: var(--font-display);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags span {
  font-size: 12px;
  padding: 5px 12px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 6px;
  font-weight: 400;
  border: 1px solid var(--border);
}

/* ── Contact ───────────────────────────────────────────────────── */
.contact-sub {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 480px;
  margin-bottom: 44px;
  margin-top: -32px;
}

.contact-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 440px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition);
}
.contact-card:hover { border-color: var(--accent); color: var(--text); }
.contact-card svg { flex-shrink: 0; color: var(--accent); }

/* ── Fractional card ────────────────────────────────────────────── */
.exp-card--fractional {
  grid-column: 1 / -1;
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg) 100%);
}

.exp-card--fractional .exp-logo {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

/* ── Footer ────────────────────────────────────────────────────── */
footer {
  padding: 28px 0;
  border-top: 1px solid var(--border);
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer span {
  font-size: 12px;
  color: var(--text-muted);
}

.footer-github {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  transition: color var(--transition);
}
.footer-github:hover { color: var(--text); }

/* ── Portfolio page ────────────────────────────────────────────── */

.nav-logo { display: flex; align-items: center; }
header ul a[aria-current="page"] { color: var(--text); font-weight: 600; }

.page-intro {
  padding: 64px 0 52px;
  border-bottom: 1px solid var(--border);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  transition: color var(--transition);
}
.back-link:hover { color: var(--text); }

.page-intro-text {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 520px;
}

/* Conference cards */
.conf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 36px;
}

.conf-card {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}
.conf-card:hover { border-color: var(--accent); }

.conf-card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.conf-card-link:hover { border-color: var(--accent); }
.conf-card-watch {
  margin-top: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.conf-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.conf-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.conf-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.meetup-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.meetup-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meetup-tag {
  font-size: 12px;
  padding: 5px 14px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 100px;
  border: 1px solid var(--border);
}

/* Video grid */
.video-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.video-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}
.video-card:hover { border-color: var(--accent); }

.video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}
.video-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

.video-info { padding: 14px 16px; }

.video-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  font-family: var(--font-display);
  line-height: 1.4;
}

.video-company {
  font-size: 11px;
  color: var(--text-muted);
}

/* Writing groups */
.writing-groups {
  display: flex;
  flex-direction: column;
  gap: 52px;
}

.writing-group-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.writing-logo-sm {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 5px;
}

.writing-group-head h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  flex: 1;
}

.article-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.article-item a {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition);
  line-height: 1.4;
  height: 100%;
}
.article-item a:hover { border-color: var(--accent); color: var(--text); }

.article-arrow {
  flex-shrink: 0;
  opacity: 0.45;
  margin-top: 1px;
}

.writing-subsection-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 24px 0 14px;
}

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.project-card {
  padding: 32px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color var(--transition);
}
.project-card:hover { border-color: var(--accent); }

.project-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}

.project-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.project-card > p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  transition: opacity var(--transition);
}
.project-link:hover { opacity: 0.7; }

/* Other work */
.other-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.other-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), color var(--transition);
  color: var(--text-muted);
}
.other-card:hover { border-color: var(--accent); color: var(--text); }

.other-card h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-display);
}

.other-card p {
  font-size: 12px;
  line-height: 1.5;
  flex: 1;
}

.other-card .article-arrow { align-self: flex-end; }

/* Portfolio responsive */
@media (max-width: 860px) {
  .conf-grid,
  .video-grid,
  .project-grid { grid-template-columns: 1fr; }
  .article-list { grid-template-columns: 1fr; }
  .other-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .other-grid { grid-template-columns: 1fr; }
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 860px) {
  section { padding: 72px 0; }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .hero-image { order: -1; }
  .avatar-wrap { width: 260px; height: 290px; margin: 0 auto; }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .about-numbers {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
  }
  .number-card { flex: 1; min-width: 140px; }

  .exp-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 560px) {
  .container { padding: 0 20px; }
  header nav { height: 52px; }
  header ul { gap: 20px; }
  header ul li:nth-child(4), header ul li:nth-child(5) { display: none; }
  .hero-cta { flex-wrap: wrap; }
}
