/* ===== Base ===== */
:root {
  --bg: #0b0f19;
  --panel: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --line: rgba(255,255,255,0.12);
  --accent: #60a5fa;
  --accent2: #34d399;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

html {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "PingFang SC", "Microsoft Yahei", sans-serif;
  background:
    radial-gradient(1000px 500px at 15% 0%, rgba(96,165,250,0.18), transparent 60%),
    radial-gradient(900px 500px at 85% 10%, rgba(52,211,153,0.14), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  opacity: 0.9;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.muted {
  color: var(--muted);
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
  background: rgba(11,15,25,0.55);
  border-bottom: 1px solid var(--line);
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.logo {
  font-weight: 700;
  letter-spacing: 0.3px;
}

.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.nav a {
  color: var(--muted);
}

.nav a:hover {
  color: var(--text);
}

/* ===== Hero ===== */
.hero.hero--full {
  min-height: calc(100vh - 72px);
  padding: 56px 0 18px;
  display: flex;
  align-items: stretch;
}

.hero-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 28px;
  align-items: center;
}

.hero-left {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.hero-top {
  margin-top: 6px;
}

.hero-bottom {
  margin-top: auto;
  padding-bottom: 60px;
}

.badge {
  display: inline-block;
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,0.04);
}

.hero-left h1 {
  font-size: clamp(38px, 5.2vw, 60px);
  line-height: 1.05;
  margin: 12px 0 0;
  white-space: nowrap;
}

.lead {
  color: var(--muted);
  font-size: 19px;
  line-height: 1.75;
  max-width: 70ch;
  margin: 22px 0 18px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.avatar-card {
  width: min(460px, 40vw);
  aspect-ratio: 1 / 1;
  padding: 18px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.12);
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
}

.btn.primary {
  border-color: rgba(96,165,250,0.5);
  background: linear-gradient(135deg, rgba(96,165,250,0.28), rgba(52,211,153,0.18));
}

/* ===== Sections ===== */
.section {
  padding: 34px 0;
  border-top: 1px solid var(--line);
}

.section--page {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 46px;
  padding-bottom: 46px;
}

.section h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

/* ===== Cards & Project Grid ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.card {
  background: rgba(17,24,39,0.8);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.card h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

.card p {
  margin: 0 0 10px;
  color: var(--muted);
}

.tags {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags li {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
}

.card-actions {
  display: flex;
  gap: 12px;
}

.card-actions a {
  color: var(--accent);
}

.card-actions a:nth-child(2) {
  color: var(--accent2);
}

/* ===== About ===== */
.section-title {
  margin: 0 0 10px;
  font-size: 18px;
  color: var(--text);
}

.about-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  margin-top: 14px;
  align-items: start;
}

.about-highlights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.mini-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,0.03);
}

.mini-label {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.mini-value {
  margin: 6px 0 0;
  font-weight: 600;
  color: var(--text);
}

.media-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  box-shadow: var(--shadow);
  padding: 10px;
}

.media-card img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
}

.media-card figcaption {
  margin-top: 8px;
  font-size: 12px;
}

.about-block {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

/* ===== Timeline ===== */
.timeline {
  margin-top: 18px;
  border-left: 2px solid rgba(255,255,255,0.10);
  padding-left: 18px;
}

.t-item {
  position: relative;
  padding: 10px 0 18px;
}

.t-dot {
  position: absolute;
  left: -11px;
  top: 16px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(96,165,250,0.8);
  box-shadow: 0 0 0 6px rgba(96,165,250,0.12);
}

.t-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.t-title {
  font-weight: 700;
}

.t-time {
  font-size: 12px;
}

/* ===== Contact ===== */
.contact-section {
  justify-content: flex-start;
}

.contact-gallery {
  margin-top: 18px;
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.contact-card {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  box-shadow: var(--shadow);
}

.contact-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
}

.contact-card figcaption {
  margin-top: 10px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.contact-note {
  margin: 0 0 14px;
  font-size: 16px;
}

.contact {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ===== Footer ===== */
.footer {
  padding: 30px 0 60px;
  border-top: 1px solid var(--line);
  margin-top: 24px;
}

/* ===== Extras from previous pages ===== */
.project-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.project-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 14px;
}

.codeblock {
  margin: 12px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0,0,0,0.25);
  overflow: auto;
}

.codeblock code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre;
}

.pdf-frame {
  width: 100%;
  height: min(85vh, 1100px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0,0,0,0.25);
}

.video-frame {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  max-height: 70vh;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0,0,0,0.25);
  overflow: hidden;
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .hero-left h1 {
    white-space: normal;
  }

  .hero-right {
    justify-content: flex-start;
  }

  .avatar-card {
    width: min(420px, 100%);
  }

  .about-hero {
    grid-template-columns: 1fr;
  }

  .about-highlights {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .contact-gallery {
    grid-template-columns: 1fr;
  }

  .project-meta {
    grid-template-columns: 1fr;
  }

  .section--page {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100%, calc(100% - 24px));
  }

  .header-inner {
    align-items: flex-start;
    gap: 10px;
  }

  .nav {
    justify-content: flex-end;
    gap: 10px;
  }

  .lead {
    font-size: 17px;
  }
}