/* ============================================================
   cray_gitbook — design system
   Based on the Vercel DESIGN.md language:
   near-white canvas, ink black, hairline borders, mono labels,
   and the mesh gradient as the only decorative colour.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500&display=swap');

/* ------------------------------------------------------------
   Tokens — light
   ------------------------------------------------------------ */
:root {
  /* Surfaces */
  --bg-base: #fafafa;
  --bg-surface: #f5f5f5;
  --bg-elevated: #ebebeb;
  --bg-card: #ffffff;
  --bg-hover: #f5f5f5;

  /* Ink */
  --text-primary: #171717;
  --text-secondary: #4d4d4d;
  --text-muted: #888888;
  --text-inverse: #ffffff;

  /* Action */
  --accent: #171717;
  --accent-hover: #000000;
  --accent-2: #0070f3;
  --accent-3: #7928ca;
  --accent-muted: #f5f5f5;
  --accent-border: #ebebeb;
  --gradient: linear-gradient(90deg, #007cf0, #00dfd8, #7928ca, #ff0080, #f9cb28);
  --gradient-soft: linear-gradient(135deg, rgba(0, 124, 240, 0.08), rgba(255, 0, 128, 0.08));
  --glow: none;

  /* Semantics */
  --green: #16a34a;
  --amber: #b45309;
  --red: #ee0000;
  --violet: #7928ca;
  --link: #0070f3;
  --link-hover: #0761d1;
  --selection-bg: #171717;
  --selection-fg: #f2f2f2;

  /* Lines */
  --border: #ebebeb;
  --border-strong: #d4d4d4;
  --border-accent: #d4d4d4;

  /* Type */
  --font-body: 'Geist', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'Geist', 'Inter', system-ui, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;

  /* Layout */
  --nav-h: 64px;
  --max-w: 1200px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --pill: 100px;

  /* Motion */
  --t: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);

  /* Elevation — stacked small offsets + inset hairline */
  --shadow-sm: 0 0 0 1px rgba(0, 0, 0, 0.04) inset, 0 1px 1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 0 0 1px rgba(0, 0, 0, 0.04) inset, 0 1px 1px rgba(0, 0, 0, 0.02), 0 2px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 0 0 1px rgba(0, 0, 0, 0.04) inset, 0 2px 2px rgba(0, 0, 0, 0.04), 0 8px 16px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 0 0 1px rgba(0, 0, 0, 0.04) inset, 0 1px 1px rgba(0, 0, 0, 0.02), 0 8px 16px -4px rgba(0, 0, 0, 0.04), 0 24px 32px -8px rgba(0, 0, 0, 0.06);
}

/* ------------------------------------------------------------
   Tokens — dark
   ------------------------------------------------------------ */
[data-theme="dark"] {
  --bg-base: #000000;
  --bg-surface: #0a0a0a;
  --bg-elevated: #111111;
  --bg-card: #0a0a0a;
  --bg-hover: #141414;

  --text-primary: #ededed;
  --text-secondary: #a1a1a1;
  --text-muted: #6f6f6f;
  --text-inverse: #000000;

  --accent: #ededed;
  --accent-hover: #ffffff;
  --accent-2: #3291ff;
  --accent-3: #a855f7;
  --accent-muted: #141414;
  --accent-border: #262626;
  --gradient: linear-gradient(90deg, #007cf0, #00dfd8, #7928ca, #ff0080, #f9cb28);
  --gradient-soft: linear-gradient(135deg, rgba(0, 124, 240, 0.12), rgba(255, 0, 128, 0.12));
  --glow: none;

  --green: #4ade80;
  --amber: #f5a623;
  --red: #ff4d4d;
  --violet: #a855f7;
  --link: #3291ff;
  --link-hover: #66b1ff;
  --selection-bg: #ededed;
  --selection-fg: #000000;

  --border: #262626;
  --border-strong: #3a3a3a;
  --border-accent: #3a3a3a;

  --shadow-sm: 0 0 0 1px rgba(255, 255, 255, 0.04) inset, 0 1px 1px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 0 0 1px rgba(255, 255, 255, 0.04) inset, 0 2px 2px rgba(0, 0, 0, 0.4), 0 4px 8px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 0 0 1px rgba(255, 255, 255, 0.05) inset, 0 2px 2px rgba(0, 0, 0, 0.4), 0 8px 16px -4px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 0 0 1px rgba(255, 255, 255, 0.05) inset, 0 8px 16px -4px rgba(0, 0, 0, 0.5), 0 24px 32px -8px rgba(0, 0, 0, 0.6);
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  max-width: 100vw;
}

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

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-fg);
}

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

/* ------------------------------------------------------------
   Navigation
   ------------------------------------------------------------ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: color-mix(in srgb, var(--bg-card) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  white-space: nowrap;
}

.nav-logo span {
  color: var(--text-muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin-left: auto;
}

.nav-links a {
  display: block;
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.28px;
  color: var(--text-secondary);
  border-radius: var(--pill);
  transition: var(--t);
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}

.nav-links a.active {
  color: var(--text-primary);
  font-weight: 500;
  background: var(--bg-surface);
}

.nav-cta {
  margin-left: 8px;
  background: var(--text-primary) !important;
  color: var(--text-inverse) !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  padding: 7px 12px !important;
  border-radius: 6px !important;
  line-height: 1.2;
}

.nav-cta:hover {
  background: var(--text-primary) !important;
  opacity: 0.86;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: var(--t);
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-surface);
}

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

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

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

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

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 6px;
  transition: var(--t);
}

.nav-toggle:hover {
  background: var(--bg-surface);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--t);
}

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

.page-wrapper {
  padding-top: var(--nav-h);
  flex: 1;
}

.section {
  padding: 96px 0;
}

.section-sm {
  padding: 48px 0;
}

.section-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2rem);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin-bottom: 10px;
}

.section-sub {
  font-size: 16px;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
  max-width: 620px;
}

.section-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.page-head {
  padding: 80px 0 32px;
}

.page-head-title {
  font-size: clamp(2.25rem, 4.5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.05;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.page-head-sub {
  font-size: 16px;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
  max-width: 560px;
}

.post-count {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */
.hero {
  position: relative;
  overflow: hidden;
  padding: 152px 0 88px;
  text-align: center;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.hero-mesh {
  position: absolute;
  top: -360px;
  left: 50%;
  transform: translateX(-50%);
  width: 1500px;
  height: 900px;
  pointer-events: none;
  background:
    radial-gradient(30% 38% at 18% 45%, rgba(0, 124, 240, 0.72), transparent 70%),
    radial-gradient(26% 34% at 38% 28%, rgba(0, 223, 216, 0.62), transparent 70%),
    radial-gradient(28% 38% at 58% 40%, rgba(121, 40, 202, 0.62), transparent 70%),
    radial-gradient(24% 32% at 76% 26%, rgba(255, 0, 128, 0.48), transparent 70%),
    radial-gradient(24% 32% at 88% 50%, rgba(249, 203, 40, 0.4), transparent 70%);
  filter: blur(70px) saturate(1.1);
  opacity: 0.62;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.6) 55%, transparent 92%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.6) 55%, transparent 92%);
}

[data-theme="dark"] .hero-mesh {
  opacity: 0.3;
  filter: blur(80px) saturate(1.15);
  background:
    radial-gradient(30% 38% at 18% 45%, rgba(0, 124, 240, 0.85), transparent 70%),
    radial-gradient(26% 34% at 38% 28%, rgba(0, 223, 216, 0.5), transparent 70%),
    radial-gradient(28% 38% at 58% 40%, rgba(121, 40, 202, 0.7), transparent 70%),
    radial-gradient(24% 32% at 78% 30%, rgba(255, 0, 128, 0.55), transparent 70%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 840px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--bg-card) 70%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--pill);
  padding: 5px 12px;
  margin-bottom: 28px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.hero-label::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 16%, transparent);
}

.hero-title {
  font-size: clamp(2.65rem, 6.2vw, 4.25rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.05em;
  color: var(--text-primary);
  margin-bottom: 24px;
  text-wrap: balance;
}

.hero-title .accent {
  color: var(--text-primary);
}

.hero-desc {
  font-size: 18px;
  line-height: 1.65;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-meta {
  display: flex;
  align-items: stretch;
  justify-content: center;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  width: 100%;
  max-width: 520px;
}

.hero-meta-item {
  flex: 1;
  padding: 0 24px;
  text-align: center;
  border-left: 1px solid var(--border);
}

.hero-meta-item:first-child {
  border-left: none;
}

.hero-meta-num {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.04em;
}

.hero-meta-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  border-radius: var(--pill);
  border: 1px solid transparent;
  transition: var(--t);
  white-space: nowrap;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--text-inverse);
  border-color: var(--text-primary);
}

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

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-surface);
  border-color: var(--border-strong);
}

.btn-ghost {
  height: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
}

.btn-ghost:hover {
  color: var(--link);
}

/* ------------------------------------------------------------
   Post grid & cards
   ------------------------------------------------------------ */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--t);
}

.post-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.post-card-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.post-card-title {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.post-card-desc {
  font-size: 14px;
  line-height: 1.62;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 18px;
}

.post-card-footer {
  margin-top: auto;
  padding-top: 22px;
}

.read-link {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--t);
}

.post-card:hover .read-link {
  gap: 8px;
  color: var(--link);
}

/* Badges & tags */
.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--pill);
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-article {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-color: var(--border);
}

.badge-ctf {
  background: var(--text-primary);
  color: var(--text-inverse);
}

.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  transition: var(--t);
}

.tag:hover {
  color: var(--text-primary);
}

/* ------------------------------------------------------------
   Search & filters
   ------------------------------------------------------------ */
.search-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.search-bar {
  position: relative;
  flex: 1 1 280px;
  max-width: 400px;
  display: flex;
  align-items: center;
}

.search-bar svg {
  position: absolute;
  left: 12px;
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 36px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--t);
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--text-primary) 10%, transparent);
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--pill);
}

.filter-tab {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--pill);
  transition: var(--t);
  white-space: nowrap;
}

.filter-tab:hover {
  color: var(--text-primary);
}

.filter-tab.active {
  background: var(--text-primary);
  color: var(--text-inverse);
}

/* ------------------------------------------------------------
   Skills, chips, projects
   ------------------------------------------------------------ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--t);
}

.skill-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.skill-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-primary);
}

.skill-icon svg {
  width: 17px;
  height: 17px;
}

.skill-name {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.skill-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--pill);
  padding: 5px 10px;
  transition: var(--t);
}

.chip:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--t);
}

.project-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.project-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.project-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.project-links {
  display: flex;
  gap: 16px;
}

.project-link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  border-bottom: 1px solid transparent;
  transition: var(--t);
}

.project-link:hover {
  border-color: var(--text-primary);
}

/* ------------------------------------------------------------
   Dark band (about snapshot)
   ------------------------------------------------------------ */
.band-dark {
  background: #171717;
  border-top: none;
  border-bottom: none;
  color: #ededed;
}

[data-theme="dark"] .band-dark {
  background: #0f0f0f;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.band-dark .section-eyebrow,
.band-dark .section-sub {
  color: #a1a1a1;
}

.band-dark .section-title {
  color: #ffffff;
}

.band-dark p {
  color: #a1a1a1 !important;
}

.band-dark .chip {
  background: #1f1f1f;
  border-color: #333333;
  color: #d4d4d4;
}

.band-dark .chip:hover {
  color: #ffffff;
  border-color: #555555;
}

.band-dark .skill-card {
  background: #1a1a1a;
  border-color: #2e2e2e;
}

.band-dark .skill-card:hover {
  border-color: #444444;
  box-shadow: none;
}

.band-dark .skill-icon {
  background: #111111;
  border-color: #2e2e2e;
  color: #ededed;
}

.band-dark .skill-name {
  color: #ededed;
}

.band-dark .skill-desc {
  color: #888888;
}

.band-dark .btn-secondary {
  background: transparent;
  color: #ededed;
  border-color: #3a3a3a;
  box-shadow: none;
}

.band-dark .btn-secondary:hover {
  background: #1f1f1f;
  border-color: #555555;
}

.about-snapshot-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: center;
}

/* ------------------------------------------------------------
   Post page
   ------------------------------------------------------------ */
.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 64px;
  align-items: start;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 56px 24px 96px;
}

.post-layout main {
  min-width: 0;
  max-width: 760px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  transition: var(--t);
}

.back-btn:hover {
  color: var(--text-primary);
}

.post-header {
  padding-bottom: 32px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.post-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.post-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.045em;
  color: var(--text-primary);
  margin: 20px 0 20px;
  text-wrap: balance;
}

.post-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* Article body */
.post-content {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-secondary);
  letter-spacing: -0.005em;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.25;
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.post-content h1 {
  font-size: 32px;
  margin: 0 0 20px;
}

.post-content h2 {
  font-size: 26px;
  margin: 48px 0 16px;
  padding-top: 8px;
}

.post-content h3 {
  font-size: 20px;
  margin: 36px 0 12px;
}

.post-content h4 {
  font-size: 17px;
  margin: 28px 0 10px;
}

.post-content p {
  margin: 0 0 20px;
}

.post-content a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.post-content a:hover {
  color: var(--link-hover);
}

.post-content strong {
  font-weight: 600;
  color: var(--text-primary);
}

.post-content ul,
.post-content ol {
  margin: 0 0 20px;
  padding-left: 24px;
}

.post-content li {
  margin-bottom: 6px;
}

.post-content li::marker {
  color: var(--text-muted);
}

.post-content blockquote {
  margin: 28px 0;
  padding: 4px 0 4px 20px;
  border-left: 2px solid var(--text-primary);
  color: var(--text-secondary);
  font-size: 18px;
}

.post-content blockquote p:last-child {
  margin-bottom: 0;
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 5px;
  color: var(--text-primary);
}

.post-content pre {
  background: #0a0a0a;
  border: 1px solid #262626;
  border-radius: var(--radius-lg);
  padding: 20px;
  overflow-x: auto;
  margin: 28px 0;
  line-height: 1.7;
}

[data-theme="dark"] .post-content pre {
  background: #0a0a0a;
  border-color: #262626;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: #ededed;
  font-size: 13px;
  line-height: 1.7;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin: 28px 0;
  box-shadow: none;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 14px;
}

.post-content th {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  color: var(--text-secondary);
  background: var(--bg-surface);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

.post-content td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.post-content tr:last-child td {
  border-bottom: none;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 44px 0;
}

/* Sidebar */
.side-widget {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}

.widget-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.widget-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.widget-content {
  display: flex;
  flex-direction: column;
}

.recent-post-item {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  transition: var(--t);
}

.recent-post-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.recent-post-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.recent-post-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.recent-post-item:hover .recent-post-title {
  color: var(--text-primary);
}

/* ------------------------------------------------------------
   Portfolio legacy blocks (still used on about page)
   ------------------------------------------------------------ */
.about-hero {
  padding: 96px 0 56px;
  border-bottom: 1px solid var(--border);
}

.about-avatar {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  filter: grayscale(1);
  margin-bottom: 20px;
}

.about-name {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.about-handle {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.about-bio {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 640px;
  margin-bottom: 24px;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contact-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 12px;
  background: var(--bg-card);
  transition: var(--t);
}

.contact-link:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-surface);
}

.timeline {
  display: flex;
  flex-direction: column;
}

.timeline-item {
  padding: 24px 0 24px 24px;
  border-left: 1px solid var(--border);
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 32px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-primary);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.timeline-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.timeline-sub {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}

/* ------------------------------------------------------------
   States
   ------------------------------------------------------------ */
.state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 56px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  grid-column: 1 / -1;
}

.state-box .state-icon {
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--text-muted);
  margin-bottom: 12px;
  filter: grayscale(1);
}

.state-box .state-msg {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.state-box .state-sub {
  font-size: 14px;
  color: var(--text-secondary);
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-elevated) 37%, var(--bg-surface) 63%);
  background-size: 400% 100%;
  animation: skeleton 1.4s ease infinite;
}

@keyframes skeleton {
  0% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0 50%;
  }
}

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  padding: 64px 0 32px;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
}

.footer-brand .nav-logo {
  display: inline-block;
  font-size: 14px;
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 300px;
}

.footer-cols {
  display: flex;
  gap: 64px;
  justify-content: flex-end;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-heading {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.footer-col a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: var(--t);
  width: fit-content;
}

.footer-col a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  max-width: var(--max-w);
  margin: 48px auto 0;
  padding: 24px 24px 0;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* Legacy footer bits kept for safety */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: var(--t);
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* ------------------------------------------------------------
   Helpers
   ------------------------------------------------------------ */
.hidden {
  display: none !important;
}

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.gap-sm {
  gap: 8px;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 1024px) {
  .post-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }

  .side-widget {
    position: static;
    max-width: 420px;
  }

  .about-snapshot-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 16px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 12px;
    border-radius: var(--radius);
    font-size: 15px;
  }

  .nav-cta {
    margin: 8px 0 0;
    text-align: center;
    border-radius: var(--radius) !important;
    padding: 12px !important;
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    padding: 120px 0 64px;
  }

  .hero-meta {
    margin-top: 48px;
  }

  .hero-meta-item {
    padding: 0 12px;
  }

  .section {
    padding: 64px 0;
  }

  .page-head {
    padding: 56px 0 24px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-cols {
    justify-content: flex-start;
    gap: 48px;
  }
}

@media (max-width: 640px) {
  .posts-grid {
    grid-template-columns: 1fr;
  }

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

  .hero-title {
    font-size: clamp(2.2rem, 10vw, 2.75rem);
    letter-spacing: -0.045em;
  }

  .hero-desc {
    font-size: 16px;
  }

  .hero-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-meta-num {
    font-size: 20px;
  }

  .search-area {
    flex-direction: column;
    align-items: stretch;
  }

  .search-bar {
    max-width: none;
  }

  .filter-tabs {
    align-self: flex-start;
    max-width: 100%;
    overflow-x: auto;
  }

  .post-layout {
    padding: 32px 20px 64px;
  }

  .post-title {
    font-size: 2rem;
    letter-spacing: -0.04em;
  }

  .post-content {
    font-size: 16px;
  }

  .post-content h2 {
    font-size: 23px;
  }

  .band-dark {
    padding: 64px 0;
  }
}
