/* ═══════════════════════════════════════════════════
   Mark Zhou Portfolio — style.css
   Design tokens from Claude Design handoff,
   converted to vanilla CSS.
   ═══════════════════════════════════════════════════ */

/* ── Fonts (self-hosted, China accessible) ── */
@import url('assets/fonts/inter.css');
@import url('assets/fonts/jetbrains.css');
@import url('assets/fonts/notoserif.css');

/* ── Color tokens ── */
:root {
  --bg: #FDF6EE;
  --fg: #1a1c2e;
  --fg-secondary: #4a4e6a;
  --accent: #d97706;
  --accent-hover: #b45309;
  --highlight-bg: #fef3c7;
  --card: #FFFFFF;
  --border: #d4c4b0;

  --surface-page: var(--bg);
  --surface-card: var(--card);
  --text-body: var(--fg);
  --text-secondary: var(--fg-secondary);
  --text-link: var(--accent);
  --text-link-hover: var(--accent-hover);
  --border-card: var(--border);

  --status-live: #16a34a;
  --status-live-bg: #dcfce7;
  --status-beta: #d97706;
  --status-beta-bg: #fef3c7;
  --status-oss: #2563eb;
  --status-oss-bg: #dbeafe;
  --status-gated: #64748b;
  --status-gated-bg: #f1f5f9;

  --quant-tint: #f0f7f1;
}


/* ── Typography tokens ── */
:root {
  --font-sans: "Inter", -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-serif-display: "Noto Serif SC", "Songti SC", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --text-hero: clamp(2rem, 5vw, 4rem);
  --text-section: clamp(1.5rem, 3vw, 2.5rem);
  --text-body-size: 16px;
  --text-mono-size: 14px;
  --text-pill: 13px;
  --text-caption: 13px;

  --leading: 1.55;
  --tracking-tight: -0.01em;
}

/* ── Spacing tokens ── */
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;
  --space-8: 96px;

  --content-max: 1080px;
  --section-gap: var(--space-8);

  --radius-card: 10px;
  --radius-button: 8px;
  --radius-pill: 999px;

  --border-width: 1px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --hover-lift: translateY(-2px);
}

/* ── Base ── */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: var(--text-body-size);
  line-height: var(--leading);
  letter-spacing: var(--tracking-tight);
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s cubic-bezier(0.4,0,0.2,1), color 0.2s cubic-bezier(0.4,0,0.2,1);
}

a { color: var(--text-link); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--text-link-hover); }

::selection { background: var(--highlight-bg); }

code, pre, .mono { font-family: var(--font-mono); font-weight: 500; font-size: var(--text-mono-size); }

img { max-width: 100%; height: auto; }

/* ── Layout ── */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 56px 0; }

.grid-lr {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}

.grid-rl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 56px;
  align-items: center;
}

/* ── Sticky Nav ── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-nav .container {
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-logo {
  font-weight: 700;
  font-size: 16px;
  color: var(--fg);
  white-space: nowrap;
  text-decoration: none;
}
.nav-logo:hover { color: var(--fg); }

.nav-links {
  display: flex;
  gap: 20px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}

.nav-links a {
  font-size: 14px;
  color: var(--fg-secondary);
}
.nav-links a:hover { color: var(--accent); }

.nav-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-btn {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--fg-secondary);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  transition: var(--transition);
  line-height: 1.4;
}
.nav-btn:hover { border-color: var(--accent); }

/* ── Section Header ── */
.section-header {
  margin-bottom: var(--space-5);
}

.section-header h2 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: var(--text-section);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-body);
  margin: 0;
}

.section-header p {
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--text-secondary);
  margin: 8px 0 0;
}

/* ── Pill ── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: var(--text-pill);
  font-weight: 500;
  line-height: 1.4;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.pill--outline { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-card); }
.pill--neutral { background: var(--surface-card); color: var(--text-secondary); border: 1px solid var(--border-card); }
.pill--accent  { background: var(--highlight-bg); color: var(--accent-hover); border: 1px solid transparent; }

/* ── Status Tag ── */
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-tag .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-tag--live    { color: var(--status-live);  background: var(--status-live-bg); }
.status-tag--live .dot { background: var(--status-live); }
.status-tag--beta    { color: var(--status-beta);  background: var(--status-beta-bg); }
.status-tag--beta .dot { background: var(--status-beta); }
.status-tag--oss     { color: var(--status-oss);   background: var(--status-oss-bg); }
.status-tag--oss .dot  { background: var(--status-oss); }
.status-tag--wip     { color: var(--status-gated); background: var(--status-gated-bg); }
.status-tag--wip .dot  { background: var(--status-gated); }

/* ── Metric Card ── */
.metric-card {
  background: var(--surface-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}

.metric-card .value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.1;
  color: var(--accent);
}

.metric-card .label {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── QuickLink ── */
.quick-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-body);
  background: var(--surface-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-button);
  padding: 10px 16px;
  text-decoration: none;
  transition: var(--transition);
}
.quick-link:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  color: var(--text-body);
}

/* ── GFW Mark ── */
.gfw-mark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-family: var(--font-sans);
}

.gfw-mark--direct  { color: var(--status-live); }
.gfw-mark--vpn     { color: var(--status-gated); }
.gfw-mark--app     { color: var(--status-oss); }
.gfw-mark--github  { color: var(--status-gated); }

/* ── NowItem ── */
.now-item {
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.now-item .emoji {
  font-size: 18px;
  width: 24px;
  flex-shrink: 0;
  text-align: center;
}

.now-item p {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--text-body);
  line-height: 1.55;
}

.now-item .name { font-weight: 600; }
.now-item .desc { color: var(--text-secondary); }

/* ── Product Row ── */
.product-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.product-row:last-child { border-bottom: none; }

.product-row .pname {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
}

.product-row .pdesc {
  font-size: 13px;
  color: var(--fg-secondary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Platform Card ── */
.platform-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  transition: var(--transition);
  text-decoration: none;
}
.platform-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.platform-card .pf-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #fff;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.platform-card .pf-info { min-width: 0; flex: 1; }
.platform-card .pf-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.platform-card .pf-handle {
  display: block;
  font-size: 12px;
  color: var(--fg-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.platforms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ── Timeline Item ── */
.timeline-item {
  display: flex;
  gap: 16px;
}

.timeline-item .tl-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.timeline-item .tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 6px;
  flex-shrink: 0;
}

.timeline-item .tl-stem {
  width: 1px;
  flex: 1;
  background: var(--border-card);
  margin-top: 4px;
}

.timeline-item .tl-content {
  padding-bottom: 24px;
}
.timeline-item:last-child .tl-content { padding-bottom: 0; }
.timeline-item:last-child .tl-stem { display: none; }

.timeline-item .tl-period {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-hover);
  font-weight: 500;
}

.timeline-item .tl-title {
  margin: 2px 0 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-body);
  font-family: var(--font-sans);
}

.timeline-item .tl-text {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ── Skill Groups ── */
.skill-group {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.skill-group .sg-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-secondary);
  width: 52px;
  flex-shrink: 0;
}

.skill-group .sg-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ── Repo Row ── */
.repo-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.repo-row:last-child { border-bottom: none; }

.repo-row .rname {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.repo-row .rdesc {
  font-size: 13px;
  color: var(--fg-secondary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repo-row .rlang {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--fg-secondary);
  flex-shrink: 0;
}

/* ── Button ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  padding: 12px 24px;
  border-radius: var(--radius-button);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

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

.btn--secondary {
  background: var(--surface-card);
  color: var(--text-body);
  border: 1px solid var(--border-card);
}
.btn--secondary:hover { border-color: var(--accent); color: var(--text-body); }

/* ── Hero ── */
.hero { position: relative; overflow: hidden; }

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
}

.hero h1 {
  font-family: var(--font-serif-display);
  font-weight: 700;
  font-size: var(--text-hero);
  line-height: 1.15;
  margin: 0;
  color: var(--fg);
}

.hero .metrics {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero .quick-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hero .updated-line {
  margin: 0;
  font-size: 12px;
  color: var(--fg-secondary);
  font-family: var(--font-mono);
}

/* ── Illustration frame ── */
.illust-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 16px 40px -20px rgba(43, 36, 28, 0.3);
}


.illust-frame img {
  display: block;
  width: 100%;
  object-fit: cover;
}

/* ── Avatar circle ── */
.avatar-circle {
  position: absolute;
  bottom: 18px;
  left: -24px;
  z-index: 2;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--card);
  box-shadow: 0 8px 24px -12px rgba(43, 36, 28, 0.4);
  overflow: hidden;
}
.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Floating decorations ── */
.floating {
  position: absolute;
  pointer-events: none;
  animation: mz-float 9s ease-in-out infinite alternate;
}

@keyframes mz-float {
  from { transform: translateY(-8px); }
  to   { transform: translateY(10px); }
}

/* ── Quant tinted section ── */
.section--quant { background: var(--quant-tint); }

.quant-frameworks {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.quant-bullets {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  color: var(--fg-secondary);
  line-height: 1.7;
}

/* ── Next tiers ── */
.next-tier h4 {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-hover);
}

.next-tier ul {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  color: var(--fg-secondary);
  line-height: 1.7;
}

/* ── Open To pills ── */
.open-to {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.open-to .label {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}

/* ── Contact ── */
.contact-headline {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  color: var(--fg);
}

.contact-body {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--fg-secondary);
  line-height: 1.55;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

.contact-links span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding: 20px 24px 0;
  text-align: center;
}

.site-footer p {
  margin: 4px 0;
  font-size: 12px;
  color: var(--fg-secondary);
}

.site-footer .mono-line { font-family: var(--font-mono); }

/* ── Language toggle: hide inactive lang ── */
[data-lang="en"] .cn { display: none; }
[data-lang="cn"] .en { display: none; }

/* ── Scroll reveal (initial state, JS animates) ── */
[data-reveal] {
  opacity: 0;
  will-change: transform, opacity;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .grid-lr, .grid-rl {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* On mobile, always content first, illustration second */
  .grid-rl > :first-child { order: 2; }
  .grid-rl > :last-child  { order: 1; }

  .hero .container {
    padding-top: 48px;
    padding-bottom: 40px;
  }

  .hero h1 { font-size: clamp(1.75rem, 8vw, 2.5rem); }

  .nav-links { display: none; }

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

  .metric-card { padding: 12px 16px; }
  .metric-card .value { font-size: 22px; }

  .avatar-circle {
    position: relative;
    bottom: auto;
    left: auto;
    width: 80px;
    height: 80px;
    margin-top: -40px;
    margin-left: 16px;
  }

  .quick-link { padding: 8px 12px; font-size: 13px; }
}

@media (max-width: 480px) {
  .hero .metrics { flex-direction: column; }
  .hero .quick-links { flex-direction: column; }
  .quick-link { width: 100%; justify-content: center; }
}
