/* ===== Tokens ===== */
:root {
  --bg: #f0f3f8;
  --card: #ffffff;
  --ink: #151a22;
  --ink-muted: #5b6573;
  --ink-soft: #8b95a5;
  --line: #e8edf2;
  --line-strong: #d5dde6;
  --accent: rgb(22, 93, 255);
  --accent-hover: rgb(16, 72, 220);
  --accent-soft: rgba(22, 93, 255, 0.08);
  --shadow:
    0 1px 1px rgba(30, 36, 48, 0.03),
    0 8px 16px rgba(30, 36, 48, 0.04),
    0 24px 48px rgba(30, 36, 48, 0.08);
  --shadow-avatar:
    0 2px 4px rgba(30, 36, 48, 0.06),
    0 12px 28px rgba(30, 36, 48, 0.14);
  --radius: 10px;
  --radius-sm: 7px;
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  --max: 1080px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  display: block;
}

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

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

/* ===== Soft bokeh + grain ===== */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 15% 10%, rgba(22, 93, 255, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse 55% 40% at 88% 85%, rgba(22, 93, 255, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse 50% 35% at 70% 15%, rgba(148, 163, 184, 0.18) 0%, transparent 55%),
    var(--bg);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(28px);
  opacity: 0.45;
}

.blob-1 {
  width: 320px;
  height: 320px;
  top: -80px;
  left: 4%;
  background: radial-gradient(circle, rgba(22, 93, 255, 0.22) 0%, transparent 70%);
}

.blob-2 {
  width: 260px;
  height: 260px;
  top: 8%;
  right: 6%;
  background: radial-gradient(circle, rgba(100, 116, 139, 0.2) 0%, transparent 70%);
}

.blob-3 {
  width: 200px;
  height: 200px;
  bottom: 18%;
  left: 20%;
  background: radial-gradient(circle, rgba(22, 93, 255, 0.12) 0%, transparent 70%);
}

.blob-4 {
  width: 280px;
  height: 280px;
  bottom: -60px;
  right: 16%;
  background: radial-gradient(circle, rgba(148, 163, 184, 0.25) 0%, transparent 70%);
}

.blob-5 {
  width: 160px;
  height: 160px;
  top: 42%;
  left: 46%;
  background: radial-gradient(circle, rgba(22, 93, 255, 0.08) 0%, transparent 70%);
  opacity: 0.5;
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== Page ===== */
.page {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  padding: 4rem 0 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.35rem;
  align-items: start;
  flex: 1;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

/* ===== Sidebar ===== */
.sidebar {
  padding: 0 1.35rem 1.45rem;
  position: sticky;
  top: 3.5rem;
}

.avatar-wrap {
  display: flex;
  justify-content: center;
  margin: -2.75rem 0 1.25rem;
  position: relative;
  z-index: 2;
}

.avatar {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  background: #c8d9e6;
  border: 4px solid #fff;
  box-shadow: var(--shadow-avatar);
}

.name {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  text-align: center;
  margin-bottom: 0.2rem;
  line-height: 1.15;
}

.tagline {
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--accent);
  margin-bottom: 0.7rem;
}

.bio {
  text-align: center;
  font-size: 0.86rem;
  font-weight: 450;
  color: var(--ink-muted);
  margin-bottom: 1.2rem;
  line-height: 1.6;
}

.socials {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.3rem;
}

.social {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 4px 10px rgba(30, 36, 48, 0.12);
  transition: transform 0.2s var(--ease), filter 0.2s var(--ease);
}

.social svg {
  width: 15px;
  height: 15px;
}

.social:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.social-gh { background: #24292f; }
.social-mail { background: rgb(22, 93, 255); }
.social-blog { background: #10b981; }
.social-x { background: #0f172a; }

.info-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 0.25rem;
  padding: 0.1rem 0.1rem 0;
}

.info-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.info-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(22, 93, 255, 0.1);
}

.info-icon svg {
  width: 18px;
  height: 18px;
}

.info-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  line-height: 1.2;
  margin-bottom: 0.1rem;
}

.info-value {
  display: block;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

a.info-value:hover {
  color: var(--accent);
}

/* ===== Main content ===== */
.main {
  padding: 1.65rem 1.7rem 1.85rem;
  position: relative;
  min-width: 0;
}

.block {
  margin-bottom: 2.1rem;
  scroll-margin-top: 1.5rem;
}

.block-last {
  margin-bottom: 0.25rem;
}

.block h2 {
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.7rem;
  line-height: 1.2;
}

.block > p {
  color: var(--ink-muted);
  max-width: 58ch;
  font-size: 0.94rem;
  font-weight: 450;
}

.about-section {
  margin-top: 1.65rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.about-section h3 {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
  color: var(--ink-muted);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.skill-tags li {
  font-size: 0.88rem;
  font-weight: 550;
  color: var(--ink);
  line-height: 1.4;
}

.skill-tags li:not(:last-child)::after {
  content: "·";
  margin: 0 0.55rem;
  color: #b0b8c4;
  font-weight: 400;
}

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin-top: 1.05rem;
}

.project-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(30, 36, 48, 0.03);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(30, 36, 48, 0.1);
}

.project-body {
  padding: 1.05rem 1.05rem 1.15rem;
}

.project-body h3 {
  font-size: 0.94rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin-bottom: 0.55rem;
}

.project-tags li {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  line-height: 1.2;
}

.project-tags li:not(:last-child)::after {
  content: "·";
  margin-left: 0.55rem;
  color: var(--line-strong);
  font-weight: 500;
}

.project-body p {
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-weight: 500;
  line-height: 1.55;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(22, 93, 255, 0.28);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: #fff;
}

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

/* ===== Footer ===== */
.site-footer {
  margin-top: 1.85rem;
  padding-top: 1.15rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 1.5rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.beian:hover {
  color: var(--accent);
}

/* ===== Projects-only page (index2) — tech ===== */
.tech-page {
  --tech-bg: #f7f8fa;
  --tech-ink: #111827;
  --tech-muted: #6b7280;
  --tech-line: #e5e7eb;
  --tech-accent: rgb(22, 93, 255);
  --tech-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --tech-sans: "IBM Plex Sans", system-ui, sans-serif;
  background: var(--tech-bg);
  font-family: var(--tech-sans);
  color: var(--tech-ink);
}

.tech-page .page-projects {
  width: min(100% - 2rem, 820px);
  max-width: 820px;
  padding: 3rem 0 1.5rem;
  min-height: 100vh;
}

.tech-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--tech-line);
}

.tech-prompt {
  font-family: var(--tech-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--tech-muted);
  margin-bottom: 0.45rem;
}

.tech-prompt span {
  color: var(--tech-accent);
}

.tech-header h1 {
  font-family: var(--tech-mono);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1.2;
}

.tech-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tech-item {
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--tech-line);
}

.tech-item:first-child {
  padding-top: 0.25rem;
}

.tech-item h2 {
  font-family: var(--tech-mono);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  line-height: 1.3;
}

.tech-tags {
  font-family: var(--tech-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--tech-muted);
  margin: 0 0 0.55rem;
  letter-spacing: 0.01em;
}

.tech-desc {
  font-size: 0.88rem;
  font-weight: 400;
  color: #4b5563;
  line-height: 1.6;
  margin: 0 0 0.85rem;
  max-width: 48ch;
}

.tech-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--tech-mono);
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.45rem;
}

.tech-meta a {
  color: var(--tech-accent);
}

.tech-meta a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tech-meta span {
  color: #d1d5db;
}

.tech-path {
  display: block;
  font-family: var(--tech-mono);
  font-size: 0.72rem;
  font-weight: 400;
  color: #9ca3af;
  background: none;
  padding: 0;
  word-break: break-all;
}

.tech-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 1.5rem;
  font-family: var(--tech-mono);
  font-size: 0.72rem;
  font-weight: 400;
  color: #9ca3af;
}

.tech-footer a {
  color: #9ca3af;
}

.tech-footer a:hover {
  color: var(--tech-accent);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .page {
    padding-top: 3.5rem;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .avatar {
    width: 112px;
    height: 112px;
  }

  .avatar-wrap {
    margin-top: -2.4rem;
  }

  .project-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .page {
    width: min(100% - 1.25rem, var(--max));
    padding: 3.25rem 0 1.25rem;
  }

  .tech-page .page-projects {
    width: min(100% - 1.25rem, 820px);
    padding-top: 2rem;
  }

  .main {
    padding: 1.25rem 1.1rem 1.4rem;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .info-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
  }

  .site-footer,
  .tech-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-card {
    animation: none;
    transition: none;
  }
}
