/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #eef1f5;
  --paper: #ffffff;
  --paper-shadow: 0 1px 8px rgba(38, 64, 83, 0.08), 0 0 1px rgba(38, 64, 83, 0.1);
  --border: #dce3eb;
  --border-light: #edf0f5;
  --text: #264053;
  --text-secondary: #5e7d91;
  --accent: #377EC9;
  --accent-hover: #2c6ab0;
  --accent-glow: rgba(55, 126, 201, 0.07);
  --green: #1a915c;
  --toc-bg: #f6f8fb;
  --radius: 10px;
  --radius-sm: 6px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

@view-transition {
  navigation: auto;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
strong { color: var(--accent); font-weight: 700; }

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.16s;
  animation-timing-function: ease-out;
}

/* ===== Nav ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(238, 241, 245, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.nav-logo {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--accent);
}
.nav-links { display: flex; gap: 2rem; }
.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
  position: relative;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--accent); font-weight: 600; }
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -18px;
  left: 0; right: 0;
  height: 2px;
  background: var(--accent);
}
.nav-toggle { display: none; background: none; border: none; cursor: pointer; }
.nav-toggle span {
  display: block;
  width: 20px; height: 2px;
  background: var(--text);
  margin: 4px 0;
  transition: 0.3s;
}

/* ===== A4 Paper Layout ===== */
.paper-layout {
  padding-top: 80px;
  padding-bottom: 4rem;
  display: flex;
  justify-content: center;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

/* TOC Sidebar */
.toc {
  position: sticky;
  top: 80px;
  width: 200px;
  min-width: 200px;
  height: fit-content;
  padding: 1.5rem 0;
  align-self: flex-start;
}
.toc-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  padding-left: 1rem;
}
.toc-list { display: flex; flex-direction: column; }
.toc-list a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-left: 2px solid transparent;
  transition: all 0.15s;
}
.toc-list a:hover {
  color: var(--text);
  background: var(--accent-glow);
}
.toc-list a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
  background: var(--accent-glow);
}
.toc-num {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  opacity: 0.5;
  min-width: 1.2rem;
}
.toc-list a.active .toc-num { opacity: 1; }
.toc-parent {
  display: flex;
  align-items: center;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-left: 2px solid transparent;
  cursor: default;
}
.toc-list a.toc-cs {
  padding-left: 2rem;
  font-size: 0.74rem;
  color: var(--text-muted);
}
.toc-list a.toc-cs.active {
  padding-left: 2rem;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-glow);
  border-left-color: var(--accent);
}

/* Blog Post List & Article */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
}
.post-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}
.post-item:hover {
  background: var(--accent-glow);
}
.post-item.active {
  border-left-color: var(--accent);
  background: var(--accent-glow);
}
.post-title {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}
.post-date {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: 1rem;
}
.post-meta-line {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--mono);
}
.blog-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 2rem 0;
  text-align: center;
}

.blog-notion {
  max-width: 760px;
}
.blog-notion h1 {
  font-size: 1.95rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2rem;
}
.blog-notion h2 {
  font-size: 1.35rem;
  font-weight: 750;
  color: var(--text);
  margin: 2.25rem 0 0.9rem;
}
.blog-notion p {
  font-size: 0.93rem;
  line-height: 1.9;
  color: var(--text);
  margin: 1rem 0;
}
.blog-notion blockquote {
  margin: 0.6rem 0 1rem;
  padding-left: 1rem;
  border-left: 3px solid var(--border);
  color: var(--text-secondary);
}
.blog-notion blockquote p {
  font-size: 0.82rem;
  line-height: 1.75;
  margin: 0;
  color: var(--text-secondary);
}
.blog-notion .blog-heavy {
  display: inline-block;
  font-size: 1.05rem;
  line-height: 1.8;
  font-weight: 800;
  color: var(--text);
}
.blog-notion pre {
  margin: 1rem 0 1.5rem;
  padding: 1rem;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--toc-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}
.blog-notion pre code {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.75;
  color: var(--text);
  background: transparent;
}
.blog-notion em {
  color: var(--accent);
  font-style: italic;
}
.blog-notion strong {
  color: var(--text);
  font-weight: 700;
}
.blog-notion strong.blog-heavy {
  color: var(--accent);
  font-weight: 800;
}
.blog-notion strong.blog-project {
  color: var(--accent);
  font-weight: 700;
}
.blog-notion ol {
  margin: 0.8rem 0 0;
  padding-left: 1.4rem;
}
.blog-notion li {
  padding-left: 0.2rem;
  margin: 0.45rem 0;
  font-size: 0.93rem;
  line-height: 1.8;
}
.post-article {
  border-top: 1px solid var(--border-light);
  padding-top: 1.5rem;
}
.post-content {
  font-size: 0.88rem;
  line-height: 1.8;
  color: var(--text);
}
.post-content h1 { font-size: 1.4rem; font-weight: 700; margin: 1.5rem 0 0.75rem; }
.post-content h2 { font-size: 1.15rem; font-weight: 700; margin: 1.25rem 0 0.5rem; }
.post-content h3 { font-size: 1rem; font-weight: 600; margin: 1rem 0 0.5rem; }
.post-content code {
  font-family: var(--mono);
  font-size: 0.82rem;
  background: var(--toc-bg);
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
}
.post-content .highlighter-rouge,
.post-content .highlight {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0.75rem 0 1rem;
}
.post-content pre,
.post-content .highlight pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  background: var(--toc-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  margin: 0;
}
.post-content pre code,
.post-content pre code *,
.post-content .highlight pre code,
.post-content .highlight pre code *,
.post-content .highlighter-rouge code {
  display: block;
  white-space: inherit;
  overflow-wrap: inherit;
  word-break: inherit;
  background: transparent;
  padding: 0;
  border-radius: 0;
  border: 0;
  box-shadow: none;
}
.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  color: var(--text-secondary);
  margin: 0.75rem 0;
}
.post-content ul {
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}
.post-content li { margin-bottom: 0.25rem; }
.post-content hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 1.5rem 0;
}
.post-content a { color: var(--accent); }
.post-content img { border-radius: var(--radius-sm); margin: 1rem 0; }

/* PS Section */
.ps-section { margin-top: 1rem; }
.ps-section h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.5rem; }
.ps-summary {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}
.ps-table-wrap {
  max-height: 70vh;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}
.ps-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.ps-table thead { position: sticky; top: 0; z-index: 1; }
.ps-table th {
  background: var(--toc-bg);
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.ps-table td {
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
}
.ps-table tbody tr:hover { background: var(--accent-glow); }
.ps-num {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 3rem;
}
.ps-table td a {
  color: var(--text);
  transition: color 0.15s;
}
.ps-table td a:hover { color: var(--accent); }
.ps-tier {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
}
.tier-platinum { color: #43b5a0; }
.tier-gold { color: #d4a843; }
.tier-silver { color: #8a8f95; }
.tier-bronze { color: #ad6e33; }
.ps-table tbody tr { cursor: pointer; }
.ps-title-cell { color: var(--text); }
.ps-time {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* PS Modal */
/* PS Detail Page */
.ps-back {
  margin-bottom: 1rem;
}
.ps-back a {
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: color 0.15s;
}
.ps-back a:hover { color: var(--accent); }
.ps-code-title {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.ps-detail-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}
.ps-detail-cat {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.ps-detail-desc {
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text);
  border-top: 1px solid var(--border-light);
  padding-top: 1rem;
}
.ps-detail-desc img { max-width: 100%; }
.ps-code {
  background: var(--toc-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.78rem;
  font-family: var(--mono);
  line-height: 1.6;
}

/* Paper */
.paper {
  flex: 1;
  max-width: 780px;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--paper-shadow);
  padding: 3rem 3.5rem;
  min-height: 80vh;
}

/* ===== Home Page ===== */
.home .paper {
  max-width: 780px;
}

/* Hero */
.home-hero {
  margin-bottom: 2.25rem;
}
.home-hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 0.25rem;
}
.home-role {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.home-contact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}
.home-contact a {
  color: var(--text-secondary);
  transition: color 0.2s;
}
.home-contact a:hover { color: var(--accent); }
.contact-sep { color: var(--border); }

/* Top nav bar */
.home-top-nav {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2.25rem;
  padding-top: 0;
}
.top-nav-item {
  flex: 1;
  padding: 0.7rem 1rem;
  background: var(--toc-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.top-nav-item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(55, 126, 201, 0.08);
  transform: translateY(-1px);
}
.top-nav-item h2 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.1rem;
}
.top-nav-item p {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* ===== Timeline ===== */
.home-timeline {
  position: relative;
}
/* Continuous vertical line — spans full height, positioned on the line column */
.home-timeline::before {
  content: '';
  position: absolute;
  left: calc(3.25rem + 0.75rem - 0.5px); /* center of 1.5rem line column */
  top: 0.5rem;
  bottom: 0.5rem;
  width: 1px;
  background: var(--border);
  z-index: 0;
}

/* Timeline item — 3 columns: year | line | body */
.tl-row {
  position: relative;
  display: grid;
  grid-template-columns: 3.25rem 1.5rem 1fr;
  gap: 0;
  padding: 0.78rem 0;
  min-height: 104px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
}
.tl-row:hover { background: var(--accent-glow); }

/* Extra top spacing for year-transition rows */
.tl-row-year { margin-top: 0.5rem; }

/* Linked rows */
a.tl-row-link { cursor: pointer; }
a.tl-row-link:hover h3 { color: var(--accent); }

/* Year label — left of line */
.tl-year-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
  padding-right: 0.5rem;
  line-height: 1;
  align-self: start;
  padding-top: 0.25rem;
}

/* Line column — holds marker, line drawn by parent ::before */
.tl-line {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}

.tl-marker {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(55, 126, 201, 0.28);
  flex-shrink: 0;
  margin-top: 0.35rem;
  transition: all 0.15s;
  box-shadow: 0 0 0 2px var(--paper);
}
.tl-marker.tl-blue {
  background: var(--accent);
}
.tl-row:hover .tl-marker {
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 5px var(--accent-glow);
}
.tl-row:hover .tl-marker.tl-blue {
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 5px rgba(55, 126, 201, 0.15);
}

/* Body: text + image */
.tl-body {
  display: flex;
  gap: 1rem;
  padding-left: 0.75rem;
  align-items: flex-start;
  min-height: 92px;
}
.tl-text {
  flex: 1;
  min-width: 0;
}
.tl-text h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  transition: color 0.15s;
}
.tl-text p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
  line-height: 1.45;
}
.tl-period {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.15rem;
}
.tl-detail {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  margin-top: 0.2rem;
}

/* Inline thumbnail — fixed width */
.tl-img {
  width: 100px;
  min-width: 100px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tl-img img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
}

.home-timeline.is-filtered .tl-row.is-dim .tl-text,
.home-timeline.is-filtered .tl-row.is-dim .tl-img,
.home-timeline.is-filtered .tl-row.is-dim .tl-year-label,
.home-timeline.is-filtered .tl-row.is-dim .tl-line {
  opacity: 0.22;
}

.home-timeline.is-filtered .tl-row:not(.is-dim) .tl-text,
.home-timeline.is-filtered .tl-row:not(.is-dim) .tl-img,
.home-timeline.is-filtered .tl-row:not(.is-dim) .tl-year-label,
.home-timeline.is-filtered .tl-row:not(.is-dim) .tl-line {
  opacity: 1;
}

.home-timeline.is-filtered .tl-row.is-dim:hover {
  background: transparent;
}

.toc-list .home-filter {
  cursor: pointer;
}

/* ===== Article / Detail Page ===== */
.back-link {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
  transition: opacity 0.2s;
}
.back-link:hover { opacity: 0.7; }

.article-body {
  line-height: 1.7;
  font-size: 0.92rem;
  color: var(--text);
}
.article-body h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2rem 0 0.5rem;
  color: var(--text);
}
.article-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.4rem;
  color: var(--text);
}
.article-body p {
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}
.article-body ul {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}
.article-body li {
  position: relative;
  padding: 0.2rem 0 0.2rem 0.75rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
}
.article-body li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65rem;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}
.article-img {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--toc-bg);
  border: 1px solid var(--border-light);
  margin-bottom: 1.5rem;
}
.article-img img {
  width: 100%;
  display: block;
}

.article-callout {
  background: var(--accent-glow);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.25rem 0;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
}

/* ===== Resume Sections ===== */
.resume-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 2.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.resume-name h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
}
.resume-role {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}
.resume-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: var(--mono);
}
.resume-contact a:hover { color: var(--accent); }

.resume-section {
  margin-bottom: 2.25rem;
  scroll-margin-top: 92px;
}
.resume-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

/* Stack */
.stack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.stack-item { font-size: 0.88rem; }
.stack-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-right: 0.4rem;
}

/* Entry */
.resume-entry {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}
.resume-entry:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.resume-entry.compact {
  margin-bottom: 0.9rem;
  padding-bottom: 0.9rem;
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.entry-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.entry-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}
.entry-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
}
.entry-tags {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
}
.entry-period {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
}
.entry-org {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0.2rem 0 0.4rem;
}
.entry-list { padding-left: 0.75rem; }
.entry-list li {
  position: relative;
  font-size: 0.84rem;
  color: var(--text-secondary);
  padding: 0.15rem 0;
  padding-left: 0.75rem;
}
.entry-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.entry-detail {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* Education */
.edu-row {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.4rem;
  font-size: 0.84rem;
  color: var(--text-secondary);
}
.edu-row strong { font-family: var(--mono); }

/* Cert */
.cert-list { display: flex; flex-direction: column; gap: 0.6rem; }
.cert-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cert-item div { display: flex; flex-direction: column; }
.cert-item strong {
  font-size: 0.88rem;
  color: var(--text);
}
.cert-item span { font-size: 0.78rem; color: var(--text-secondary); }

/* ===== Page Header (Portfolio / Blog) ===== */
.page-header { margin-bottom: 2.5rem; }
.page-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
}
.page-header p {
  color: var(--text-secondary);
  margin-top: 0.4rem;
  font-size: 0.9rem;
}

/* ===== Project Card (Portfolio) ===== */
.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.75rem;
  background: var(--paper);
  scroll-margin-top: 92px;
}
.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.project-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
}
.project-sub {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
}
.project-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.4rem; }
.project-tags span {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.2rem 0.65rem;
  background: var(--accent-glow);
  color: var(--accent);
  border-radius: 16px;
  border: 1px solid rgba(55, 126, 201, 0.12);
}
.project-period {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.project-highlight {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}
.highlight-value {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: var(--mono);
  color: var(--green);
}
.highlight-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Issue Cards */
.issue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}
.issue-card {
  background: var(--toc-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
}
.issue-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.issue-label.sol { margin-top: 0.8rem; }
.issue-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
}
.issue-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.result-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.result-item { display: flex; flex-direction: column; gap: 0.1rem; }
.result-metric {
  font-size: 0.68rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.result-change {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.result-delta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--green);
  font-weight: 600;
}

.highlight-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.highlight-list li:last-child { border: none; }

/* ===== Footer ===== */
.footer {
  padding: 2rem 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ===== Mobile ===== */
@media (max-width: 960px) {
  .toc { display: none; }
  .paper-layout { padding-left: 1rem; padding-right: 1rem; }
  .paper { padding: 2rem 1.5rem; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 56px;
    left: 0; right: 0;
    background: rgba(238, 241, 245, 0.97);
    backdrop-filter: blur(16px);
    padding: 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.active a.active::after { display: none; }
  .nav-toggle { display: block; }

  .resume-header { flex-direction: column; }
  .resume-contact { align-items: flex-start; }
  .edu-row { flex-direction: column; gap: 0.2rem; }
  .entry-header { flex-direction: column; gap: 0.2rem; }
  .entry-right { align-items: flex-start; }

  .home-top-nav { flex-direction: column; gap: 0.5rem; }
  .home-timeline::before { left: calc(2.5rem + 0.625rem - 0.5px); }
  .tl-row { grid-template-columns: 2.5rem 1.25rem 1fr; }
  .tl-body { flex-direction: column; gap: 0.5rem; }
  .tl-img { display: none; }

  .issue-grid { grid-template-columns: 1fr; }
  .project-header { flex-direction: column; }
  .project-highlight { align-items: flex-start; }

  .blog-notion h1 {
    font-size: 1.7rem;
  }

  .blog-notion h2 {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .resume-name h1 { font-size: 1.6rem; }
  .stack-row { flex-direction: column; gap: 0.4rem; }
  .home-hero h1 { font-size: 1.8rem; }
  .paper { padding: 1.5rem 1.25rem; }

  .blog-notion p,
  .blog-notion li,
  .blog-notion pre code {
    font-size: 0.86rem;
  }
}

/* ===== Document Hub ===== */
.doc-home,
.doc-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 104px 2rem 4rem;
}

.doc-home-hero,
.doc-shell {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--paper-shadow);
}

.doc-home-hero {
  padding: 3rem;
  margin-bottom: 1.5rem;
}

.doc-home-kicker,
.doc-kicker {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.doc-home-hero h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
  margin-bottom: 0.9rem;
}

.doc-home-copy,
.doc-copy {
  max-width: 760px;
  font-size: 1rem;
  color: var(--text-secondary);
}

.doc-home-actions,
.doc-actions,
.doc-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.doc-home-actions {
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.8rem 1.15rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 46%, #60a5fa 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 46%, #3b82f6 100%);
}

.btn-secondary {
  background: var(--paper);
  color: var(--text);
  border: 1px solid var(--border);
}

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

.doc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.doc-card {
  padding: 2rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--paper-shadow);
}

.doc-card-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0.85rem;
}

.doc-card-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: var(--accent-glow);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
}

.doc-card h2 {
  font-size: 1.35rem;
  line-height: 1.1;
}

.doc-card-copy {
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
}

.doc-shell {
  padding: 2rem;
}

.doc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.doc-actions {
  flex-shrink: 0;
}

.doc-header-simple {
  align-items: flex-end;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.doc-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0;
}

.btn-doc-open {
  width: auto;
  min-height: 38px;
  padding: 0.55rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.16);
}

.pdf-frame {
  height: 1580px;
  min-height: 1580px;
  background: #dfe5eb;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
}

.pdf-frame-portfolio {
  height: 3690px;
  min-height: 3690px;
}

.pdf-object {
  width: 100%;
  height: 100%;
  display: block;
  background: #fff;
}

.pdf-fallback {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
}

@media (max-width: 960px) {
  .doc-home,
  .doc-page {
    padding-left: 1rem;
    padding-right: 1rem;
  }

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

  .doc-home-hero,
  .doc-shell,
  .doc-card {
    padding: 1.5rem;
  }

  .doc-header {
    flex-direction: column;
  }

  .doc-header-simple {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
  }
}

@media (max-width: 768px) {
  .doc-home,
  .doc-page {
    padding-top: 88px;
  }

  .pdf-frame,
  .pdf-frame-portfolio {
    height: 1000px;
    min-height: 1000px;
  }

  .pdf-frame-portfolio {
    height: 2190px;
    min-height: 2190px;
  }

  .btn {
    width: 100%;
  }

  .btn-doc-open {
    width: auto;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .doc-home-hero h1,
  .doc-header h1 {
    font-size: 1.8rem;
  }

  .pdf-frame,
  .pdf-frame-portfolio {
    height: 660px;
    min-height: 660px;
  }

  .pdf-frame-portfolio {
    height: 1310px;
    min-height: 1310px;
  }
}
