/* =====================================================================
   Sicheng Shen · Personal site shared style
   Aesthetic: clean, generous, professional (not sparse, not crowded)
   ===================================================================== */

:root {
  --bg:         #fafaf7;
  --paper:      #ffffff;
  --ink:        #1a1a1a;
  --ink-soft:   #333;
  --muted:      #666;
  --muted-soft: #999;
  --accent:     #b45309;
  --accent-soft:#fef3c7;
  --border:     #e5e5e0;
  --border-soft:#f0f0eb;
  --code-bg:    #f5f5f0;
  --green:      #059669;
  --blue:       #2563eb;
  --amber:      #d97706;
  --red:        #dc2626;

  --font-body:  -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono:  "JetBrains Mono", "Consolas", "Courier New", monospace;

  --w-container: 1080px;
  /* The reading measure for prose inside the shell. Was hard-coded as 780px in
     7 rules while an unused --w-narrow:720px sat here claiming the same job —
     two numbers for one concept is how this drifts. One token now. */
  --w-prose:     780px;

  --radius:     6px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  margin: 0;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 14px; }
ul { margin: 0 0 14px; padding-left: 22px; }
li { margin: 4px 0; }
strong { font-weight: 600; }

/* =====================================================================
   TOP NAV (shared across pages)
   ===================================================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 247, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.top-nav .inner {
  max-width: var(--w-container);
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.top-nav .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  letter-spacing: -0.01em;
  text-decoration: none;
}
.top-nav .brand:hover { color: var(--accent); text-decoration: none; }

/* Inline SVG marks inherit currentColor, so the logo picks up brand hover too. */
.logo-mark {
  display: block;
  flex: none;
  height: 30px;
  width: auto;
}
.brand-name { white-space: nowrap; }

/* Below 480px the wordmark is dropped and the mark alone carries the brand. */
@media (max-width: 479px) {
  .brand-name { display: none; }
}

.top-nav .links {
  display: flex;
  gap: 28px;
  font-size: 15px;
}
.top-nav .links a {
  color: var(--ink-soft);
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 120ms, border-color 120ms;
}
.top-nav .links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-decoration: none;
}
.top-nav .links a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* =====================================================================
   SUB NAV (second row — private section only)
   Primary nav above stays identical on every page; this row carries the
   within-section links so /private/* pages never lose their way back out.
   ===================================================================== */
.sub-nav {
  background: var(--code-bg);
  border-bottom: 1px solid var(--border);
}
.sub-nav .inner {
  max-width: var(--w-container);
  margin: 0 auto;
  padding: 10px 32px;
  display: flex;
  align-items: center;
  gap: 8px 20px;
  flex-wrap: wrap;
}
.sub-nav .sub-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-soft);
  flex: none;
}
.sub-nav .links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 14px;
}
.sub-nav .links a {
  color: var(--muted);
  font-weight: 500;
  padding: 2px 0;
  border-bottom: 2px solid transparent;
  transition: color 120ms, border-color 120ms;
}
.sub-nav .links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-decoration: none;
}
.sub-nav .links a.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* =====================================================================
   PAGE CONTAINER
   ===================================================================== */
.page {
  max-width: var(--w-container);
  margin: 0 auto;
  padding: 0 32px;
}
.page.narrow {
  max-width: var(--w-prose);
}

/* =====================================================================
   HERO (landing page)
   ===================================================================== */
.hero {
  padding: 80px 0 60px;
  border-bottom: 1px solid var(--border-soft);
}
.hero h1 {
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 20px;
  color: var(--ink);
}
.hero .tagline {
  font-size: 22px;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: var(--w-prose);
  margin: 0 0 12px;
  font-weight: 400;
}
.hero .sub {
  font-size: 16px;
  color: var(--muted);
  max-width: var(--w-prose);
  margin: 0 0 32px;
}
.hero .cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: all 120ms;
  cursor: pointer;
  font-family: inherit;
}
.btn.primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn.primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
  text-decoration: none;
}
.btn.secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--border);
}
.btn.secondary:hover {
  border-color: var(--ink);
  color: var(--ink);
  text-decoration: none;
}
.btn.large { padding: 14px 28px; font-size: 16px; }

/* =====================================================================
   SECTIONS
   ===================================================================== */
.section {
  padding: 64px 0;
  border-bottom: 1px solid var(--border-soft);
}
.section:last-of-type { border-bottom: none; }
.section h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin: 0 0 24px;
  font-weight: 600;
}
.section h3 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 24px;
  max-width: var(--w-prose);
}
.section .lead {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: var(--w-prose);
  margin: 0 0 20px;
}

/* =====================================================================
   ABOUT (prose block)
   ===================================================================== */
.prose {
  max-width: var(--w-prose);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-soft);
}
.prose p { margin: 0 0 18px; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); }

/* =====================================================================
   FEATURED WORK CARDS
   ===================================================================== */
.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 32px 0 0;
}
@media (min-width: 780px) {
  .work-grid { grid-template-columns: repeat(3, 1fr); }
}
.work-card {
  padding: 28px 26px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 150ms, transform 150ms, box-shadow 150ms;
}
.work-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.work-card .title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.work-card .meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  margin: 0 0 14px;
  letter-spacing: 0.02em;
}
.work-card .desc {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

/* =====================================================================
   METRICS GRID
   ===================================================================== */
.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 32px 0 0;
}
@media (min-width: 640px) {
  .metrics { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .metrics { grid-template-columns: repeat(6, 1fr); }
}
.metric {
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}
.metric .value {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.metric .label {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

/* =====================================================================
   EXPLORE list (what I'm open to)
   ===================================================================== */
.explore-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  max-width: var(--w-prose);
}
@media (min-width: 640px) {
  .explore-list { grid-template-columns: repeat(2, 1fr); }
}
.explore-list li {
  padding: 14px 16px 14px 32px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14.5px;
  color: var(--ink-soft);
  position: relative;
  line-height: 1.5;
  margin: 0;
}
.explore-list li::before {
  content: "→";
  position: absolute;
  left: 14px;
  color: var(--accent);
  font-weight: 700;
}

/* =====================================================================
   FINAL CTA BAND
   ===================================================================== */
.cta-band {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 40px;
  margin-top: 32px;
  max-width: var(--w-prose);
}
.cta-band .lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 20px;
}

/* =====================================================================
   FOOTER
   ===================================================================== */
.site-footer {
  padding: 40px 0 60px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  border-top: 1px solid var(--border-soft);
  margin-top: 40px;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* =====================================================================
   CONTACT PAGE
   ===================================================================== */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  margin: 32px 0;
}
@media (min-width: 860px) {
  .contact-layout { grid-template-columns: 1.5fr 1fr; gap: 56px; }
}
.contact-form {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 32px;
}
.contact-form .form-group {
  margin-bottom: 18px;
}
.contact-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  transition: border-color 120ms, box-shadow 120ms;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.contact-form textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.5;
}
.contact-form .form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}
.contact-form .status {
  font-size: 14px;
  color: var(--muted);
}
.contact-form .status.success { color: var(--green); font-weight: 600; }
.contact-form .status.error   { color: var(--red);   font-weight: 600; }
.contact-form .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.contact-alt {
  font-size: 15px;
}
.contact-alt h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
.contact-alt ul {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}
.contact-alt li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
  color: var(--ink-soft);
  display: flex;
  gap: 12px;
  align-items: baseline;
}
.contact-alt li:last-child { border-bottom: none; }
.contact-alt li .k {
  min-width: 76px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.contact-alt li .v {
  color: var(--ink-soft);
  font-size: 14.5px;
  flex: 1;
}
.contact-alt .interests {
  padding: 16px 20px;
  background: var(--code-bg);
  border-radius: var(--radius);
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 20px;
}
.contact-alt .interests strong {
  color: var(--ink-soft);
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* =====================================================================
   PAGE HEADER (contact + other simple pages)
   ===================================================================== */
.page-header {
  padding: 60px 0 32px;
}
.page-header h1 {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 12px;
  color: var(--ink);
}
.page-header .tagline {
  font-size: 17px;
  color: var(--muted);
  max-width: var(--w-prose);
  margin: 0;
  line-height: 1.6;
}

/* =====================================================================
   Legacy shared components (kept for /private/* pages)
   ===================================================================== */
/* Same shell as .page — nav, sub-nav, and content must share one width and one
   gutter, or the header's left edge won't line up with the content's. This was
   720px/24px against a 1080px/32px nav, which misaligned by 180px per side. */
.container {
  max-width: var(--w-container);
  margin: 0 auto;
  padding: 64px 32px 80px;
  background: var(--paper);
  min-height: 100vh;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
header.top {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 16px;
  margin-bottom: 32px;
}
header.top h1 {
  font-size: 28px;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}
header.top .tagline {
  color: var(--muted);
  font-size: 14px;
}
.nav-links {
  margin: 16px 0;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
}
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--accent); }
.link-card {
  display: block;
  padding: 16px 20px;
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 120ms, box-shadow 120ms;
}
.link-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.link-card .title { font-weight: 600; font-size: 16px; color: var(--ink); }
.link-card .desc { color: var(--muted); font-size: 13px; margin-top: 2px; }
.link-card .arrow { float: right; color: var(--muted); }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
}
.badge.green { background: #ecfdf5; color: var(--green); }
.badge.blue  { background: #eff6ff; color: var(--blue); }
.badge.amber { background: #fffbeb; color: var(--amber); }
.footer {
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}
.contact-list { list-style: none; padding: 0; }
.contact-list li { margin: 8px 0; font-size: 15px; }
.contact-list li .label {
  display: inline-block; min-width: 80px; color: var(--muted); font-size: 13px;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.stat {
  padding: 12px 16px;
  background: var(--code-bg);
  border-radius: 4px;
  border-left: 3px solid var(--accent);
}
.stat .value { font-size: 20px; font-weight: 700; color: var(--ink); }
.stat .label { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* =====================================================================
   FRAMED (inside a /co-workspace tab)
   The workspace shell already provides nav; showing the page's own header
   inside the iframe stacks two navs. The class is set by a one-line script in
   each page's <head> so it lands before first paint — a CSS-only solution
   isn't possible, there is no "am I in an iframe" media query.
   ===================================================================== */
html.framed .top-nav,
html.framed .sub-nav { display: none; }
