/* ===========================================================
   solarise — personal site
   System font stack, no external resources, CSS variable theming
   =========================================================== */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --max-width: 1100px;
  --radius: 14px;
  --radius-sm: 8px;
  --header-h: 60px;
}

/* ---- Light theme (default) ---- */
html[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --bg-soft-2: #f1f3f5;
  --card-bg: #ffffff;
  --border: #eeeeee;
  --border-soft: rgba(0, 0, 0, 0.06);

  --text: #1f2937;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;

  --accent: #0ca678;
  --accent-2: #12b886;
  --accent-contrast: #ffffff;

  --hl-bg: #e7f0fe;
  --hl-text: #3b82f6;

  --chip-bg: #f1f3f5;
  --pill-bg: #eef2f7;
  --pill-text: #6b7280;

  --btn-bg: #111317;
  --btn-text: #ffffff;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.10);

  --avatar-bg: var(--accent);
}

/* ---- Dark theme ---- */
html[data-theme="dark"] {
  --bg: #0f1115;
  --bg-soft: #12151b;
  --bg-soft-2: #161a22;
  --card-bg: #161a22;
  --border: #232730;
  --border-soft: rgba(255, 255, 255, 0.08);

  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --text-faint: #6b7280;

  --accent: #12b886;
  --accent-2: #0ca678;
  --accent-contrast: #0a0c0f;

  --hl-bg: rgba(59, 130, 246, 0.18);
  --hl-text: #7fb3ff;

  --chip-bg: #1b2129;
  --pill-bg: #1f242e;
  --pill-text: #9ca3af;

  --btn-bg: #e5e7eb;
  --btn-text: #111317;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.55);

  --avatar-bg: var(--accent);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 700; }
p { margin: 0; }
img { display: block; max-width: 100%; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===========================================================
   Header
   =========================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.logo strong { font-weight: 800; }
.logo-icon {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 700;
  font-size: 16px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.nav > a {
  font-size: 14.5px;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.15s ease;
}
.nav > a:hover { color: var(--text); }

.icon {
  display: block;
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-faint); }
.icon-link {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  transition: color 0.15s ease;
}
.icon-link:hover { color: var(--text); }

/* toggle icon visibility by theme */
.icon-moon { display: none; }
.icon-sun { display: block; }
html[data-theme="dark"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: block; }

/* ===========================================================
   Hero
   =========================================================== */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
  padding: 72px 0 64px;
}
.hero-title {
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.accent { color: var(--accent); }

.hero-tagline {
  font-family: var(--font-mono);
  font-size: clamp(18px, 2.4vw, 24px);
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 22px;
}
.hl {
  background: var(--hl-bg);
  color: var(--hl-text);
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--chip-bg);
  border: 1px solid var(--border-soft);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--text);
}
.chip-emoji { font-size: 15px; line-height: 1; }

.hero-desc {
  color: var(--text-muted);
  font-size: 15.5px;
  max-width: 46ch;
  margin-bottom: 26px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 22px;
}
.btn-primary {
  display: inline-block;
  background: var(--btn-bg);
  color: var(--btn-text);
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn-primary:hover { transform: translateY(-1px); opacity: 0.92; }
.btn-link {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  transition: color 0.15s ease;
}
.btn-link:hover { color: var(--accent); }

/* avatar */
.hero-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.avatar-wrap {
  position: relative;
  width: 260px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-bg {
  position: absolute;
  inset: -30px;
  width: calc(100% + 60px);
  height: calc(100% + 60px);
  color: var(--accent);
  opacity: 0.07;
  pointer-events: none;
}
.avatar {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  border: 4px solid var(--bg);
}

/* ===========================================================
   Content grid
   =========================================================== */
.content-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  padding: 16px 0 64px;
}
.col-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 19px;
  margin-bottom: 18px;
}
.col-icon { font-size: 18px; }

/* ---- Project cards ---- */
.project-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.project-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-soft);
}
.project-icon {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
}
.grad-blue   { background: linear-gradient(135deg, #6366f1, #3b82f6); }
.grad-green  { background: linear-gradient(135deg, #12b886, #0ca678); }
.grad-purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }

.project-body { flex: 1 1 auto; min-width: 0; }
.project-title {
  font-size: 15.5px;
  margin-bottom: 3px;
}
.project-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.45;
}
.project-arrow {
  flex: 0 0 auto;
  color: var(--text-faint);
  font-size: 18px;
  transition: transform 0.18s ease, color 0.18s ease;
}
.project-card:hover .project-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* ---- Notes ---- */
.notes-list {
  border-top: 1px solid var(--border-soft);
}
.note-row {
  display: block;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border-soft);
  transition: opacity 0.15s ease;
}
.note-row:hover { opacity: 0.75; }
.note-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}
.note-date {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
}
.note-tag {
  font-size: 11.5px;
  color: var(--pill-text);
  background: var(--pill-bg);
  padding: 2px 9px;
  border-radius: 999px;
}
.note-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}

/* ---- More links ---- */
.more-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.15s ease;
}
.more-link:hover { opacity: 0.8; }
.more-teal { color: var(--accent); }
.more-blue { color: var(--hl-text); }

/* ===========================================================
   About
   =========================================================== */
.about {
  padding: 8px 0 56px;
}
.about-text {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 60ch;
}

/* ===========================================================
   Footer
   =========================================================== */
.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 26px 0;
}
.footer-inner {
  text-align: center;
  font-size: 13px;
  color: var(--text-faint);
}
.icp-line {
  margin-top: 4px;
  font-size: 12px;
}
.icp-line a {
  color: inherit;
  text-decoration: none;
}
.icp-line a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 820px) {
  body { overflow-x: hidden; }

  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 36px 0;
  }
  .hero-right { order: -1; }
  .avatar-wrap { width: 180px; height: 180px; }
  .avatar { width: 148px; height: 148px; }
  .hero-title { margin-bottom: 14px; }
  .hero-tagline { margin-bottom: 18px; }
  .hero-desc { max-width: none; margin-bottom: 22px; }

  .content-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 8px 0 48px;
  }
  .nav { gap: 14px; }
  .nav > a { font-size: 14px; }

  .project-card { padding: 14px; gap: 13px; }
  .project-icon-img { width: 48px; height: 48px; border-radius: 12px; }
  .note-article { padding-top: 28px; }
  .note-byline { flex-wrap: wrap; }
}

@media (max-width: 640px) {
  /* Single-column page: same-page anchor shortcuts add little, hide them */
  .nav > a[href$="#projects"],
  .nav > a[href$="#about"] { display: none; }
  .nav { gap: 12px; }
  .nav > a { font-size: 13.5px; padding: 6px 0; }
  .hero-actions { flex-wrap: wrap; gap: 12px 18px; }
  .chips { gap: 8px; }
  .chip { font-size: 12.5px; padding: 5px 11px; }
  .prose { font-size: 15.5px; }
  .prose pre { font-size: 13px; padding: 14px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero { padding: 28px 0 32px; }
  .avatar-wrap { width: 150px; height: 150px; }
  .avatar { width: 124px; height: 124px; }
  /* Declutter the header; GitHub stays reachable via project cards */
  .nav .icon-github { display: none; }
  .about { padding-bottom: 40px; }
}

/* ====== BEGIN GENERATED (build.py) ====== */
/* Page headers (notes / projects / experience) */
.page-head { padding: 56px 0 28px; }
.page-title {
  font-size: clamp(26px, 4vw, 36px);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.page-sub {
  color: var(--text-muted);
  font-size: 15.5px;
  max-width: 60ch;
}

/* Project icon as image (replaces gradient emoji squares) */
.project-icon-img {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--bg-soft-2);
}

/* Full notes list page */
.notes-full { padding: 8px 0 72px; }
.notes-full .notes-list { border-top: 1px solid var(--border-soft); }
.notes-full .note-row { padding: 18px 4px; }
/* Blog-style row: title, excerpt, right-aligned plain meta. */
.notes-full .note-row-full { padding: 24px 4px 20px; }
.notes-full .note-row-full .note-title {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-bottom: 7px;
}
.note-excerpt {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.7;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.note-row-meta {
  display: flex;
  justify-content: flex-end;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
}

/* Projects grid page */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 8px 0 72px;
}
.projects-grid .project-card { margin-bottom: 0; height: 100%; }

/* ===========================================================
   Note article (prose)
   =========================================================== */
.note-article { padding: 40px 0 72px; max-width: 760px; }
.back-link {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.15s ease;
}
.back-link:hover { color: var(--accent); }
.back-link-bottom { margin-top: 40px; }

.note-h1 {
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 18px 0 12px;
}
.note-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-soft);
}
.note-byline .note-date { font-size: 13.5px; }
.tag-pill {
  font-size: 12px;
  color: var(--pill-text);
  background: var(--pill-bg);
  padding: 3px 11px;
  border-radius: 999px;
  transition: opacity 0.15s ease;
}
.tag-pill:hover { opacity: 0.75; }

/* Prose typography */
.prose { font-size: 16px; line-height: 1.75; color: var(--text); }
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 0 0 1.1em; }
.prose h2 {
  font-size: 22px;
  margin: 1.8em 0 0.6em;
  letter-spacing: -0.01em;
}
.prose h3 {
  font-size: 18px;
  margin: 1.5em 0 0.5em;
}
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.5em; }
.prose li { margin: 0.3em 0; }
.prose blockquote {
  margin: 1.4em 0;
  padding: 0.4em 1.1em;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
  background: var(--bg-soft);
  border-radius: 0 8px 8px 0;
}
.prose blockquote p { margin: 0.3em 0; }
.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-soft-2);
  padding: 2px 6px;
  border-radius: 5px;
}
.prose pre {
  margin: 1.3em 0;
  padding: 16px 18px;
  background: #0f1115;
  color: #e5e7eb;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid var(--border);
}
html[data-theme="dark"] .prose pre { background: #0a0c10; }
.prose pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
.prose img { border-radius: 10px; margin: 1.2em 0; }
.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ===========================================================
   Timeline (experience)
   =========================================================== */
.timeline {
  position: relative;
  padding: 16px 0 72px;
  max-width: 820px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}
.tl-item {
  position: relative;
  padding: 0 0 32px 32px;
}
.tl-dot {
  position: absolute;
  left: 1px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--border);
}
.tl-content {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}
.tl-content:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-soft);
}
.tl-dates {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
  margin-bottom: 4px;
}
.tl-role {
  font-size: 17px;
  margin-bottom: 10px;
}
.tl-org { color: var(--text-muted); font-weight: 500; }
.tl-bullets {
  margin: 0;
  padding-left: 1.25em;
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.6;
}
.tl-bullets li { margin: 0.3em 0; }

/* Active nav link */
.nav > a.nav-active { color: var(--text); font-weight: 600; }

/* Language switcher */
.lang-switch {
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-left: 4px;
  margin-right: 2px;
  white-space: nowrap;
}
.lang-switch .lang-cur {
  color: var(--text);
  font-weight: 700;
}
.lang-switch .lang-other {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.lang-switch .lang-other:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ===========================================================
   Comments (note pages)
   =========================================================== */
.comments {
  max-width: 760px;
  margin: 8px 0 32px;
  padding: 24px 0 8px;
  border-top: 1px solid var(--border-soft);
}
.comments-title {
  font-size: 20px;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.comments-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 20px;
}
.cmt-box { margin-bottom: 24px; }
.cmt-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cmt-item {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.cmt-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.cmt-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.cmt-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}
.cmt-body {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.cmt-empty {
  color: var(--text-muted);
  font-size: 14px;
  font-style: italic;
}
.cmt-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 520px;
}
.cmt-form input,
.cmt-form textarea {
  font-family: var(--font-sans);
  font-size: 14.5px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text);
  resize: vertical;
}
.cmt-form input:focus,
.cmt-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.cmt-submit {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.cmt-submit:hover { filter: brightness(1.06); transform: translateY(-1px); }
.cmt-submit:disabled { opacity: 0.6; cursor: default; transform: none; }

/* ===========================================================
   Project detail sub page (projects/<slug>.html)
   =========================================================== */
.project-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 18px 0 10px;
}
.project-head .project-icon-img { width: 64px; height: 64px; }
.project-h1 {
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0;
}
.project-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-soft);
}
.project-byline .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 14px;
}
.project-subnav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 32px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--bg-soft);
}
.project-subnav-label {
  width: 100%;
  padding: 0 4px 3px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.project-subnav-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  transition: background .15s ease, color .15s ease;
}
.project-subnav-link:hover { color: var(--text); background: var(--bg-soft-2); }
.project-subnav-link.is-active {
  color: var(--accent-contrast);
  background: var(--accent);
}

/* ===========================================================
   Responsive — generated pages
   =========================================================== */
@media (max-width: 820px) {
  .projects-grid { grid-template-columns: 1fr; }
  .note-article, .timeline { padding-left: 0; padding-right: 0; }
}

/* ====== END GENERATED (build.py) ====== */
