/* ========================================
   Geist Design System
   ======================================== */

@font-face {
  font-family: 'Geist';
  src: url('https://cdn.jsdelivr.net/npm/geist@1.3.1/dist/fonts/geist-sans/Geist[wght].woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('https://cdn.jsdelivr.net/npm/geist@1.3.1/dist/fonts/geist-mono/GeistMono[wght].woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --geist-background: #ffffff;
  --geist-foreground: #171717;
  --geist-secondary: #4d4d4d;
  --geist-tertiary: #666666;
  --geist-quaternary: #808080;
  --geist-border: #ebebeb;
  --geist-success: #0070f3;
  --geist-error: #ff5b4f;
  --geist-warning: #de1d8d;
  --geist-link: #0072f5;
  --geist-code-bg: #fafafa;
  --geist-badge-bg: #171717;
  --geist-badge-text: #ffffff;
  --geist-focus: hsla(212, 100%, 48%, 1);
  --geist-shadow-border: 0px 0px 0px 1px rgba(0, 0, 0, 0.08);
  --geist-shadow-card: 0px 0px 0px 1px rgba(0, 0, 0, 0.08), 0px 2px 2px rgba(0, 0, 0, 0.04), 0px 0px 0px 1px #fafafa;
  --geist-shadow-small: 0px 0px 0px 1px rgba(0, 0, 0, 0.08), 0px 1px 2px rgba(0, 0, 0, 0.04);
  --geist-radius: 6px;
  --geist-radius-lg: 8px;
  --geist-radius-xl: 12px;
  --geist-radius-full: 9999px;
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', 'SF Mono', 'Cascadia Code', 'Consolas', 'Liberation Mono', monospace;
}

[data-theme="dark"] {
  --geist-background: #0a0a0a;
  --geist-foreground: #ededed;
  --geist-secondary: #a1a1a1;
  --geist-tertiary: #888888;
  --geist-quaternary: #666666;
  --geist-border: #2a2a2a;
  --geist-link: #52a8ff;
  --geist-code-bg: #111111;
  --geist-badge-bg: #ededed;
  --geist-badge-text: #0a0a0a;
  --geist-shadow-border: 0px 0px 0px 1px rgba(255, 255, 255, 0.12);
  --geist-shadow-card: 0px 0px 0px 1px rgba(255, 255, 255, 0.08), 0px 2px 2px rgba(0, 0, 0, 0.4);
  --geist-shadow-small: 0px 0px 0px 1px rgba(255, 255, 255, 0.08), 0px 1px 2px rgba(0, 0, 0, 0.4);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "liga" 1;
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-sans);
  background: var(--geist-background);
  color: var(--geist-foreground);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

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

/* ========================================
   Header
   ======================================== */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  box-shadow: var(--geist-shadow-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  color: var(--geist-foreground);
}

.header-logo-icon {
  width: 30px;
  height: 30px;
  fill: currentColor;
  transition: opacity 0.2s ease;
}

.header-logo-text {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.header-logo:hover .header-logo-icon {
  opacity: 0.7;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-self: center;
}

.header-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--geist-secondary);
  padding: 6px 12px;
  border-radius: var(--geist-radius);
  transition: color 0.15s ease, background 0.15s ease;
}

.header-nav a:hover {
  color: var(--geist-foreground);
  background: var(--geist-code-bg);
}

.header-nav a:focus-visible {
  outline: 2px solid var(--geist-focus);
  outline-offset: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

/* Search */
.search-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 36px;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--geist-quaternary);
  background: var(--geist-background);
  box-shadow: var(--geist-shadow-border);
  border-radius: var(--geist-radius);
  cursor: pointer;
  border: none;
  font-family: var(--font-sans);
  min-width: 180px;
  text-align: left;
}

.search-toggle:hover {
  box-shadow: 0px 0px 0px 1px rgba(128, 128, 128, 0.3);
}

.search-toggle:focus-visible {
  outline: 2px solid var(--geist-focus);
  outline-offset: 2px;
}

.search-kbd {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--geist-quaternary);
  padding: 2px 6px;
  background: var(--geist-code-bg);
  border-radius: 4px;
  margin-left: auto;
  font-family: var(--font-sans);
}

/* Search Modal */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  padding-top: 120px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.search-overlay.active {
  opacity: 1;
  visibility: visible;
}

.search-modal {
  width: 100%;
  max-width: 640px;
  margin: 0 16px;
  background: var(--geist-background);
  box-shadow: var(--geist-shadow-card);
  border-radius: var(--geist-radius-xl);
  overflow: hidden;
  max-height: 480px;
  display: flex;
  flex-direction: column;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  gap: 12px;
  box-shadow: var(--geist-shadow-border);
}

.search-input-wrap svg {
  flex-shrink: 0;
  color: var(--geist-quaternary);
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  font-weight: 400;
  font-family: var(--font-sans);
  color: var(--geist-foreground);
  background: transparent;
}

.search-input::placeholder {
  color: var(--geist-quaternary);
}

.search-results {
  overflow-y: auto;
  padding: 8px;
  flex: 1;
}

.search-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--geist-quaternary);
  font-size: 0.875rem;
}

.search-result-item {
  display: block;
  padding: 12px 16px;
  border-radius: var(--geist-radius);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
}

.search-result-item:hover,
.search-result-item:focus-visible {
  background: var(--geist-code-bg);
}

.search-result-item:focus-visible {
  outline: 2px solid var(--geist-focus);
  outline-offset: -2px;
}

.search-result-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--geist-foreground);
  margin-bottom: 4px;
}

.search-result-excerpt {
  font-size: 0.8125rem;
  color: var(--geist-quaternary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-excerpt mark {
  background: #ebf5ff;
  color: var(--geist-badge-text);
  border-radius: 2px;
  padding: 0 2px;
}

/* ========================================
   Main
   ======================================== */

main {
  flex: 1;
  width: 100%;
}

/* ========================================
   Footer
   ======================================== */

.footer {
  box-shadow: var(--geist-shadow-border);
  padding: 24px;
  text-align: center;
  color: var(--geist-quaternary);
  font-size: 0.75rem;
  font-weight: 400;
  flex-shrink: 0;
}

.footer a {
  color: var(--geist-tertiary);
  transition: color 0.15s ease;
}

.footer a:hover {
  color: var(--geist-link);
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--geist-radius);
  color: var(--geist-quaternary);
  transition: color 0.15s ease, background 0.15s ease;
}

.footer-social a:hover {
  color: var(--geist-foreground);
  background: var(--geist-code-bg);
}

/* ========================================
   Homepage
   ======================================== */

.home-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* Hero */
.hero {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
  position: relative;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.1;
  color: var(--geist-foreground);
  margin: 0 0 16px;
  animation: fade-up 0.6s 0.1s ease-out both;
}

.hero-logo {
  margin-bottom: 24px;
  animation: fade-up 0.6s ease-out both, hero-logo-float 4s 0.6s ease-in-out infinite;
}

.hero-logo svg {
  width: 128px;
  height: 128px;
  fill: var(--geist-foreground);
}

@keyframes hero-logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.hero .hero-subtitle {
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--geist-secondary);
  line-height: 1.6;
  max-width: 480px;
  animation: fade-up 0.6s 0.15s ease-out both;
  transition: opacity 0.3s ease;
}

.hero-subtitle.typewriter-cursor::after {
  content: '|';
  animation: cursor-blink 1s step-end infinite;
}

.hero-subtitle-fade {
  opacity: 0;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero .hero-links {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  animation: fade-up 0.6s 0.3s ease-out both;
}

.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--geist-quaternary);
  animation: fade-up 0.6s 0.6s ease-out both, scroll-bounce 2s 1.2s ease-in-out infinite;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.6; }
  50% { transform: translateX(-50%) translateY(8px); opacity: 1; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font-sans);
  border-radius: var(--geist-radius);
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  border: none;
}

.btn-primary {
  background: var(--geist-foreground);
  color: var(--geist-background);
}

.btn-primary:hover {
  opacity: 0.85;
}

.btn-primary:focus-visible {
  outline: 2px solid var(--geist-focus);
  outline-offset: 2px;
}

.btn-secondary {
  background: var(--geist-background);
  color: var(--geist-foreground);
  box-shadow: var(--geist-shadow-border);
}

.btn-secondary:hover {
  box-shadow: 0px 0px 0px 1px rgba(128, 128, 128, 0.3);
}

.btn-secondary:focus-visible {
  outline: 2px solid var(--geist-focus);
  outline-offset: 2px;
}

/* Section */
.section {
  margin-bottom: 80px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 32px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--geist-foreground);
}

.section-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--geist-tertiary);
}

.section-link:hover {
  color: var(--geist-foreground);
}

/* Article Feed */
.article-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.article-feed-item {
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding: 20px 24px;
  background: var(--geist-background);
  box-shadow: var(--geist-shadow-card);
  border-radius: var(--geist-radius-lg);
}

.article-feed-item:hover {
  box-shadow: var(--geist-shadow-card);
}

.article-feed-date {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--geist-quaternary);
  white-space: nowrap;
  font-family: var(--font-mono);
  min-width: 80px;
}

.article-feed-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--geist-foreground);
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.article-feed-title:hover {
  color: var(--geist-link);
}

/* Project Grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.project-card {
  background: var(--geist-background);
  box-shadow: var(--geist-shadow-card);
  border-radius: var(--geist-radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Homepage Project Grid - 3 columns, narrower */
.home-project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.home-project-grid .project-card {
  padding: 12px;
}

.project-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--geist-foreground);
  margin: 0 0 6px;
}

.project-card-title:hover {
  color: var(--geist-link);
}

.project-card-desc {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--geist-secondary);
  line-height: 1.5;
  flex: 1;
  margin-bottom: 12px;
}

.project-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.project-card-date {
  font-size: 0.75rem;
  color: var(--geist-quaternary);
  font-family: var(--font-mono);
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--geist-radius-full);
  background: var(--geist-badge-bg);
  color: var(--geist-badge-text);
  line-height: 1.5;
}

/* ========================================
   Article List Page
   ======================================== */

.page-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 24px 80px;
}

.page-heading {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--geist-foreground);
  margin-bottom: 40px;
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.article-list-item {
  padding: 24px;
  background: var(--geist-background);
  box-shadow: var(--geist-shadow-card);
  border-radius: var(--geist-radius-lg);
}

.article-list-date {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--geist-quaternary);
  font-family: var(--font-mono);
  margin-bottom: 8px;
}

.article-list-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.article-list-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.article-list-reading {
  font-size: 0.75rem;
  color: var(--geist-quaternary);
  font-family: var(--font-mono);
}

/* Filter bar */
.article-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--geist-code-bg);
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--geist-secondary);
  background: var(--geist-code-bg);
  border: 1px solid transparent;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-mono);
}

.filter-tag:hover {
  color: var(--geist-foreground);
  border-color: var(--geist-border);
}

.filter-tag.active {
  color: var(--geist-background);
  background: var(--geist-foreground);
  border-color: var(--geist-foreground);
}

.filter-tag-count {
  font-size: 0.6875rem;
  opacity: 0.7;
}

.filter-sort {
  flex-shrink: 0;
}

.filter-sort-select {
  padding: 5px 28px 5px 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--font-mono);
  color: var(--geist-secondary);
  background: var(--geist-code-bg);
  border: 1px solid var(--geist-border);
  border-radius: var(--geist-radius);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color 0.15s ease;
}

.filter-sort-select:focus {
  outline: none;
  border-color: var(--geist-foreground);
}

.article-list-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.33;
  color: var(--geist-foreground);
  margin-bottom: 8px;
}

.article-list-title:hover {
  color: var(--geist-link);
}

.article-list-excerpt {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--geist-secondary);
  line-height: 1.6;
}

/* ========================================
   Post Detail
   ======================================== */

.post-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 24px 80px;
}

.post-header {
  margin-bottom: 40px;
}

.post-title {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.25;
  color: var(--geist-foreground);
  margin-bottom: 12px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--geist-quaternary);
  font-family: var(--font-mono);
  margin-bottom: 12px;
}

.post-meta-sep {
  color: var(--geist-border);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* Tag badge — Geist-style pill */
.tag-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--font-mono);
  color: var(--geist-tertiary);
  background: var(--geist-code-bg);
  border: 1px solid var(--geist-border);
  border-radius: 9999px;
  line-height: 1.4;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tag-badge:hover {
  color: var(--geist-foreground);
  border-color: var(--geist-tertiary);
}

/* Content */
.content {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.56;
  color: var(--geist-secondary);
}

.content p {
  margin-bottom: 1.25em;
}

.content h1, .content h2, .content h3, .content h4, .content h5, .content h6 {
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-top: 2em;
  margin-bottom: 0.75em;
  color: var(--geist-foreground);
}

.content h1 { font-size: 1.5rem; }
.content h2 { font-size: 1.25rem; }
.content h3 { font-size: 1.1rem; }
.content h4 { font-size: 1rem; }

.content a {
  color: var(--geist-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.content a:hover {
  color: #0051cc;
}

.content blockquote {
  border-left: 2px solid var(--geist-foreground);
  margin: 1.5em 0;
  padding: 12px 20px;
  background: var(--geist-code-bg);
  border-radius: 0 4px 4px 0;
  color: var(--geist-secondary);
  font-style: normal;
}

.content code {
  background: var(--geist-code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--geist-foreground);
  box-shadow: var(--geist-shadow-border);
}

.content pre {
  background: var(--geist-code-bg);
  padding: 20px;
  border-radius: var(--geist-radius);
  overflow-x: auto;
  margin: 1.5em 0;
  box-shadow: var(--geist-shadow-border);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.content pre code {
  background: transparent;
  padding: 0;
  box-shadow: none;
  font-size: inherit;
  font-weight: 400;
}

.content ul, .content ol {
  margin: 0 0 1.25em 20px;
  padding: 0;
}

.content li {
  margin-bottom: 0.4em;
}

.content hr {
  border: none;
  height: 1px;
  background: var(--geist-border);
  margin: 40px 0;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.875rem;
}

.content th, .content td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--geist-border);
  text-align: left;
}

.content th {
  font-weight: 600;
  background: var(--geist-code-bg);
  color: var(--geist-foreground);
}

.content img {
  border-radius: var(--geist-radius-xl);
  box-shadow: var(--geist-shadow-border);
}

/* MathJax */
.content mjx-container,
.content .math.display {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
}

.content mjx-container[display="true"] {
  margin: 1.5em 0;
  padding: 16px 20px;
  background: var(--geist-code-bg);
  box-shadow: var(--geist-shadow-border);
  border-radius: var(--geist-radius);
  font-size: 0.9375rem;
}

.content mjx-container:not([display="true"]) {
  display: inline;
}

/* Navigation between posts */
.post-nav {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--geist-code-bg);
}

.post-nav-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--geist-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

.post-nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.post-nav-card {
  display: block;
  background: var(--geist-background);
  border: 1px solid var(--geist-code-bg);
  border-radius: var(--geist-radius);
  padding: 16px 20px;
  transition: border-color 0.15s ease;
}

.post-nav-card:hover {
  border-color: var(--geist-tertiary);
}

.post-nav-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--geist-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
}

.post-nav-link {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 4px;
  color: var(--geist-foreground);
}

/* ========================================
   Project Detail
   ======================================== */

.project-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 24px 80px;
}

.project-header {
  margin-bottom: 40px;
  padding-bottom: 24px;
  box-shadow: var(--geist-shadow-border);
}

.project-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.project-title {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--geist-foreground);
}

.project-meta {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ========================================
   Archive
   ======================================== */

.archive-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 24px 80px;
}

.archive-list {
  list-style: none;
  padding: 0;
}

.archive-item {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  box-shadow: var(--geist-shadow-border);
  font-size: 0.9375rem;
}

.archive-item-date {
  font-size: 0.8125rem;
  color: var(--geist-quaternary);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-weight: 500;
  min-width: 90px;
}

.archive-item-title {
  font-weight: 500;
  color: var(--geist-foreground);
}

.archive-item-title:hover {
  color: var(--geist-link);
}

/* ========================================
   Pagination
   ======================================== */

.pagination {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  box-shadow: var(--geist-shadow-border);
  border-radius: var(--geist-radius);
  color: var(--geist-secondary);
}

.pagination a:hover {
  box-shadow: 0px 0px 0px 1px rgba(128, 128, 128, 0.3);
  color: var(--geist-foreground);
}

.pagination .page-number.current {
  background: var(--geist-foreground);
  color: var(--geist-background);
  box-shadow: none;
}

/* ========================================
   404
   ======================================== */

.page-404 {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  text-align: center;
  padding: 24px;
}

.page-404-inner {
  animation: fade-up 0.5s ease-out;
}

.page-404-logo {
  width: 64px;
  height: 64px;
  fill: currentColor;
  color: var(--geist-tertiary);
  margin-bottom: 20px;
  opacity: 0.6;
}

.page-404-code {
  font-size: 6rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--geist-foreground);
  line-height: 1;
  margin: 0;
}

.page-404-desc {
  color: var(--geist-tertiary);
  margin: 16px 0 24px;
  font-size: 0.9375rem;
}

.page-404-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  height: 36px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--geist-background);
  background: var(--geist-foreground);
  border-radius: var(--geist-radius);
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.page-404-btn:hover {
  opacity: 0.85;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 900px) {
  .hero h1 {
    font-size: 2.25rem;
  }

  .post-nav-grid {
    grid-template-columns: 1fr;
  }

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

  .content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 768px) {
  .home-project-grid {
    grid-template-columns: repeat(1, 1fr);
  }
}

@media (max-width: 600px) {
  .header {
    padding: 0 16px;
    height: 56px;
  }

  .header-logo-text {
    font-size: 1rem;
  }

  .header-nav {
    margin-left: 12px;
  }

  .header-nav a {
    font-size: 0.8125rem;
    padding: 4px 8px;
  }

  .search-toggle {
    min-width: 0;
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  .search-toggle span:not(.search-kbd) {
    display: none;
  }

  .search-kbd {
    display: none;
  }

  .home-wrap {
    padding: 40px 16px 60px;
  }

  .hero {
    margin-bottom: 48px;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero .hero-subtitle {
    font-size: 1.0625rem;
  }

  .hero-links {
    flex-direction: column;
    align-items: center;
  }

  .hero-links .btn {
    width: 100%;
    max-width: 280px;
    text-align: center;
  }

  .section {
    margin-bottom: 48px;
  }

  .section-title {
    font-size: 1.25rem;
  }

  .project-card {
    padding: 14px;
  }

  .page-wrap,
  .post-wrap,
  .project-wrap,
  .archive-wrap {
    padding: 40px 16px 60px;
  }

  .page-heading {
    font-size: 1.5rem;
  }

  .post-title {
    font-size: 1.5rem;
  }

  .post-header {
    margin-bottom: 32px;
  }

  .content {
    font-size: 1rem;
  }

  .content h2 {
    font-size: 1.25rem;
  }

  .content h3 {
    font-size: 1.1rem;
  }

  .content pre {
    margin: 0 -16px;
    border-radius: 0;
    padding: 16px;
    font-size: 0.875rem;
  }

  .article-list-item {
    padding: 20px;
  }

  .article-list-excerpt {
    font-size: 0.9375rem;
  }

  .article-filter-bar {
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 20px;
  }

  .filter-tag {
    padding: 4px 10px;
    font-size: 0.75rem;
  }

  .filter-sort-select {
    font-size: 0.75rem;
  }

  .page-404-code {
    font-size: 4rem;
  }

  .page-404-logo {
    width: 48px;
    height: 48px;
  }

  .archive-item {
    flex-direction: column;
    gap: 4px;
  }

  .article-feed-item {
    flex-direction: column;
    gap: 6px;
  }

  .footer-social {
    gap: 12px;
  }

  .footer-social a {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 400px) {
  .project-grid {
    grid-template-columns: repeat(1, 1fr);
  }

  .header-logo-text {
    display: none;
  }

  .header-nav a {
    font-size: 0.8125rem;
    padding: 4px 6px;
  }

  .hero-logo svg {
    width: 64px;
    height: 64px;
  }

  .hero h1 {
    font-size: 1.625rem;
  }

  .page-heading {
    font-size: 1.4rem;
  }

  .post-title {
    font-size: 1.4rem;
  }
}

/* ========================================
   Dark Mode
   ======================================== */

[data-theme="dark"] .header {
  background: rgba(10, 10, 10, 0.85);
}

[data-theme="dark"] .search-overlay {
  background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .search-result-item + .search-result-item {
  box-shadow: 0px -1px 0px 0px rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .table-wrap td,
[data-theme="dark"] .table-wrap th {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--geist-radius);
  border: none;
  background: transparent;
  color: var(--geist-tertiary);
  cursor: pointer;
  transition: color 0.15s ease;
}

.theme-toggle:hover {
  color: var(--geist-foreground);
  background: var(--geist-code-bg);
}

.theme-toggle .icon-sun {
  display: none;
}

.theme-toggle .icon-moon {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

/* Footer RSS */
.footer-rss {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 10px;
}

.footer-rss-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--geist-quaternary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-rss-link:hover {
  color: #f26522;
}

.footer-rss-link svg {
  flex-shrink: 0;
}