/*
Theme Name: Shun Theme
Theme URI: https://example.com/shun-theme
Author: Shun
Author URI: https://example.com
Description: オリジナルWordPressテーマ
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: shun-theme
Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ============================================
   Design Tokens
   ============================================ */
:root {
  /* Colors */
  --bg:            #f5f5f3;
  --surface:       #ffffff;
  --border:        #e2e2de;
  --border-strong: #c5c5c0;
  --text:          #1a1a18;
  --text-2:        #4a4a47;
  --text-muted:    #8a8a86;
  --dark:          #0e0e0d;
  --dark-surface:  #161614;
  --dark-border:   rgba(255, 255, 255, 0.08);
  --green:         #16a34a;
  --green-dim:     rgba(22, 163, 74, 0.15);

  /* Typography */
  --sans: 'Inter', 'Noto Sans JP', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  /* Spacing / Shape */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --gap:        16px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
}

/* ============================================
   Reset
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ============================================
   Base
   ============================================ */
html { height: 100%; }

body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  background-color: var(--bg);
  /* Dot grid */
  background-image: radial-gradient(circle, #d0d0cc 1px, transparent 1px);
  background-size: 24px 24px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.site {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.site-content { flex: 1; }

a {
  color: inherit;
  text-decoration: none;
}

img { max-width: 100%; height: auto; display: block; }

/* ============================================
   Layout
   ============================================ */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

@media (min-width: 1024px) { .container { padding: 0 40px; } }
@media (min-width: 1440px) { .container { padding: 0 56px; } }

/* ============================================
   Header
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 245, 243, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 24px;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.site-title {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-title a { color: var(--text); }
.site-title a:hover { color: var(--text-2); }

/* Version badge */
.site-version {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  letter-spacing: 0.02em;
  line-height: 1.6;
}

.site-description {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: none;
}

/* Nav */
.main-navigation ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2px;
}

.main-navigation ul li a {
  font-size: 0.85rem;
  color: var(--text-2);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
  display: block;
}

.main-navigation ul li a:hover {
  background: var(--surface);
  color: var(--text);
}

.main-navigation ul li.current-menu-item a {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
}

/* ============================================
   Key Visual — Common (light pages)
   ============================================ */
.key-visual {
  position: relative;
  width: 100%;
  height: 300px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

/* Featured image — extremely subtle on white KV */
.key-visual .kv-bg {
  position: absolute;
  inset: -50px;
  background-size: cover;
  background-position: center;
  filter: blur(40px) saturate(0.4) brightness(1.1);
  transform: scale(1.12);
  /*opacity: 0.06;*/
  z-index: 0;
}

/* Fallback gradient — almost invisible on white */
.kv-bg-gradient {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
}

.kv-overlay {
  position: absolute;
  inset: 0;
  background: rgba(245, 245, 243, 0.55);
  z-index: 1;
}

.kv-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
  width: 100%;
  max-width: 860px;
}

.kv-label {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* Label with square bracket decoration */
.kv-label::before { content: '['; margin-right: 3px; }
.kv-label::after  { content: ']'; margin-left:  3px; }

.kv-title {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
}

.kv-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 14px;
}

/* Bottom rule */
.key-visual::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 2px;
  background: var(--text);
  z-index: 3;
}

/* ============================================
   Hero Section (index.php)
   ============================================ */
.kv-hero {
  position: relative;
  overflow: hidden;
  background-color: var(--dark);
  /* Grid lines */
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  min-height: 88vh;
  display: flex;
  align-items: center;
}

/* Blinking dots at grid intersections */
.hero-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  z-index: 1;
}

.hero-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0.15;
}

.hero-dot:nth-child(1) { animation: dot-blink 2.0s ease-in-out infinite; }
.hero-dot:nth-child(2) { animation: dot-blink 2.8s ease-in-out infinite 0.4s; }
.hero-dot:nth-child(3) { animation: dot-blink 2.4s ease-in-out infinite 1.1s; }
.hero-dot:nth-child(4) { animation: dot-blink 3.2s ease-in-out infinite 0.7s; }
.hero-dot:nth-child(5) { animation: dot-blink 2.6s ease-in-out infinite 1.6s; }

@keyframes dot-blink {
  0%, 100% { opacity: 1;   box-shadow: 0 0 8px var(--green); }
  50%       { opacity: 0.15; box-shadow: 0 0 2px var(--green); }
}

/* Content */
.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 860px;
  padding: 100px 0;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--green);
  letter-spacing: 0.08em;
  margin-bottom: 24px;
}

.hero-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  animation: dot-blink 2s ease-in-out infinite;
}

.hero-title {
  font-size: clamp(2.8rem, 6.5vw, 5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: #ffffff;
  margin-bottom: 20px;
}

.hero-sub {
  font-size: clamp(0.9rem, 1.4vw, 1rem);
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.8;
  max-width: 520px;
  margin-bottom: 36px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s;
}

.btn-hero:hover {
  transform: translateY(-2px);
}

.btn-hero--primary {
  background: #ffffff;
  color: var(--dark);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
}

.btn-hero--primary:hover {
  box-shadow: 0 8px 28px rgba(255, 255, 255, 0.22);
}

.btn-hero--secondary {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-hero--secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* Scroll indicator */
.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.18);
}

.hero-scroll-line {
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.3), transparent);
  animation: scroll-grow 2.4s ease-in-out infinite;
  transform-origin: top center;
}

@keyframes scroll-grow {
  0%       { transform: scaleY(0); opacity: 0; }
  30%, 70% { opacity: 1; }
  100%     { transform: scaleY(1); opacity: 0; }
}

/* ============================================
   Home Sections — Common
   ============================================ */
.home-section {
  padding: 80px 0;
}

.home-section--alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.home-section--dark {
  background-color: var(--dark);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  border-top: none;
  border-bottom: none;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 36px;
}

.section-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.section-label::before { content: '['; }
.section-label::after  { content: ']'; }

.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.home-section--dark .section-title { color: #ffffff; }
.home-section--dark .section-label { color: rgba(255,255,255,0.3); }

.section-more {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
}

.section-more:hover { color: var(--text); }

/* ============================================
   Profile Section
   ============================================ */
.profile-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 48px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 48px;
}

.profile-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 2rem;
  color: var(--text-muted);
  background: var(--bg);
}

.profile-social {
  display: flex;
  gap: 8px;
}

.profile-social a {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.profile-social a:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.profile-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-name {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
}

.profile-role {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.profile-bio {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.85;
  max-width: 600px;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.skill-badge {
  font-family: var(--mono);
  font-size: 0.67rem;
  color: var(--text-2);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 3px 9px;
  line-height: 1.5;
}

/* ============================================
   Latest Posts Grid
   ============================================ */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}

.post-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.post-card-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg);
}

.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.post-card:hover .post-card-thumb img { transform: scale(1.04); }

.post-card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.post-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.post-card-cat {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
}
.post-card-cat::before { content: '['; }
.post-card-cat::after  { content: ']'; }

.post-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.45;
  color: var(--text);
}

.post-card-title a { color: inherit; }
.post-card-title a:hover { color: var(--text-2); }

.post-card-date {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ============================================
   Works Grid
   ============================================ */
.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.work-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}

.work-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.work-card-thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg);
  position: relative;
}

.work-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.work-card:hover .work-card-thumb img { transform: scale(1.04); }

.work-card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0ec;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.work-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.work-card-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.work-card-title a { color: inherit; }
.work-card-title a:hover { color: var(--text-2); }

.work-card-desc {
  font-size: 0.82rem;
  color: var(--text-2);
  line-height: 1.65;
}

.work-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
}

.work-tag {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 2px 7px;
}

/* ============================================
   Contact Section (dark)
   ============================================ */
.contact-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.contact-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #ffffff;
  margin-bottom: 16px;
}

.contact-desc {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.8;
  margin-bottom: 36px;
}

.btn-contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: #ffffff;
  color: var(--dark);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.15s;
}

.btn-contact:hover {
  opacity: 0.88;
  transform: translateY(-2px);
}

/* ============================================
   Bento Grid
   ============================================ */
.bento-wrapper {
  padding: 40px 0 64px;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  gap: var(--gap);
}

.bento-card:nth-child(7n + 1) { grid-column: span 2; grid-row: span 2; }
.bento-card:nth-child(7n + 2) { grid-column: span 2; }
.bento-card:nth-child(7n + 3) { grid-column: span 1; }
.bento-card:nth-child(7n + 4) { grid-column: span 1; }
.bento-card:nth-child(7n + 5) { grid-column: span 2; }
.bento-card:nth-child(7n + 6) { grid-column: span 1; }
.bento-card:nth-child(7n + 7) { grid-column: span 1; }

/* Card base */
.bento-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}

.bento-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

/* Thumbnail */
.bento-card .card-thumbnail {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.bento-card .card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.75;
  transition: opacity 0.25s;
}

.bento-card:hover .card-thumbnail img { opacity: 0.88; }

.bento-card .card-thumbnail::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(255,255,255,0.97) 0%, rgba(255,255,255,0.5) 50%, transparent 100%);
}

/* No-thumb card */
.bento-card.no-thumb {
  background: var(--surface);
}

/* Left accent line for no-thumb */
.bento-card.no-thumb::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 0;
  width: 2px;
  height: calc(100% - 40px);
  background: var(--border-strong);
  border-radius: 0 1px 1px 0;
  z-index: 1;
}

/* Card body */
.card-body {
  position: relative;
  z-index: 1;
  padding: 18px 20px 20px;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* Category badge — monospace terminal style */
.card-category {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  align-self: flex-start;
}

.card-category::before { content: '['; }
.card-category::after  { content: ']'; }

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--text);
}

.bento-card:nth-child(7n + 1) .card-title { font-size: 1.2rem; }

.card-title a { color: inherit; }
.card-title a:hover { color: var(--text-2); }

.card-meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-muted);
}

.card-excerpt {
  font-size: 0.8rem;
  color: var(--text-2);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
  margin-top: 40px;
  display: flex;
  justify-content: center;
}

.pagination .nav-links {
  display: flex;
  gap: 6px;
  align-items: center;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 0.8rem;
  transition: all 0.15s;
}

.pagination .page-numbers:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.pagination .page-numbers.current {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

/* ============================================
   Single Post / Page
   ============================================ */
.single-wrapper {
  padding: 48px 0 80px;
}

.single-post-inner {
  max-width: min(1600px, 100%);
  margin: 0 auto;
}

.post-header {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.post-title {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 16px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.post-thumbnail {
  margin-bottom: 36px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.post-thumbnail img {
  width: 100%;
  height: auto;
}

/* Entry content */
.entry-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 48px;
  color: var(--text);
  line-height: 1.85;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 2.2em;
  margin-bottom: 0.8em;
  color: var(--text);
}

.entry-content h2 {
  font-size: 1.4rem;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.entry-content h3 { font-size: 1.1rem; }
.entry-content h4 { font-size: 0.95rem; }

.entry-content p {
  margin-bottom: 1.5em;
  color: var(--text-2);
}

.entry-content a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-strong);
}

.entry-content a:hover {
  text-decoration-color: var(--text);
}

.entry-content ul,
.entry-content ol {
  margin-bottom: 1.5em;
  padding-left: 1.5em;
  color: var(--text-2);
}

.entry-content li { margin-bottom: 0.4em; }

/* Code inline */
.entry-content code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: #f0f0ec;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  color: var(--text);
}

/* Code block — dark terminal */
.entry-content pre {
  background: var(--dark);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  overflow-x: auto;
  margin: 2em 0;
  position: relative;
}

/* Fake terminal titlebar on code blocks */
.entry-content pre::before {
  content: '● ● ●';
  display: block;
  font-size: 0.5rem;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.2);
  margin-bottom: 16px;
}

.entry-content pre code {
  font-family: var(--mono);
  font-size: 0.82rem;
  background: transparent;
  border: none;
  padding: 0;
  color: #d4d4d0;
  line-height: 1.7;
}

/* Blockquote */
.entry-content blockquote {
  border-left: 3px solid var(--border-strong);
  padding: 4px 20px;
  margin: 1.8em 0;
  color: var(--text-muted);
  font-style: italic;
}

/* Horizontal rule */
.entry-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

/* Post navigation */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  margin-top: 32px;
}

.nav-previous, .nav-next {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.nav-previous:hover, .nav-next:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.nav-previous a, .nav-next a {
  font-size: 0.85rem;
  color: var(--text-2);
  display: block;
}

.nav-next { text-align: right; }

/* ============================================
   Sidebar
   ============================================ */
.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: var(--gap);
}

.widget-title {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.widget ul { list-style: none; }

.widget ul li {
  padding: 6px 0;
  border-bottom: 1px solid #f0f0ec;
  font-size: 0.875rem;
  color: var(--text-2);
}

.widget ul li:last-child { border-bottom: none; }
.widget ul li a { color: var(--text-2); transition: color 0.15s; }
.widget ul li a:hover { color: var(--text); }

/* ============================================
   Page Header (archive, search, 404)
   ============================================ */
.page-header {
  padding: 48px 0 32px;
}

.page-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.archive-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 8px;
}

/* ============================================
   Search Form
   ============================================ */
.search-form {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.search-field {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.search-field:focus { border-color: var(--border-strong); }

.search-submit {
  background: var(--text);
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  color: #fff;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.search-submit:hover { opacity: 0.8; }

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--text);
  color: #fff;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.15s;
}

.btn:hover {
  opacity: 0.82;
  transform: translateY(-1px);
}

/* ============================================
   Comments
   ============================================ */
.comments-area {
  margin-top: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
}

.comments-title,
.comment-reply-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
}

.comment-list { list-style: none; }

.comment {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.comment:last-child { border-bottom: none; }
.comment-author .fn { color: var(--text); font-weight: 600; font-size: 0.9rem; }

.comment-metadata {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.comment-content {
  font-size: 0.9rem;
  margin-top: 8px;
  color: var(--text-2);
}

.comment-form input,
.comment-form textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.875rem;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}

.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--border-strong); }

.comment-form .submit {
  background: var(--text);
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 22px;
  color: #fff;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  margin-top: 12px;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer .site-info {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
}

.footer-nav ul li a {
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: color 0.15s;
}

.footer-nav ul li a:hover { color: var(--text); }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .bento-card:nth-child(7n + 1) { grid-column: span 2; grid-row: span 2; }
  .bento-card:nth-child(7n + 2) { grid-column: span 1; }
  .bento-card:nth-child(7n + 3) { grid-column: span 1; }
  .bento-card:nth-child(7n + 4) { grid-column: span 1; }
  .bento-card:nth-child(7n + 5) { grid-column: span 2; }
  .bento-card:nth-child(7n + 6) { grid-column: span 1; }
  .bento-card:nth-child(7n + 7) { grid-column: span 1; }

  .posts-grid,
  .works-grid { grid-template-columns: repeat(2, 1fr); }

  .profile-card {
    grid-template-columns: 1fr;
    padding: 28px;
    gap: 24px;
  }

  .profile-avatar-wrap { flex-direction: row; align-items: center; }
}

@media (max-width: 768px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 200px;
  }
  .bento-card:nth-child(n) { grid-column: span 1; grid-row: span 1; }
  .bento-card:nth-child(7n + 1),
  .bento-card:nth-child(7n + 5) { grid-column: span 2; }

  .posts-grid,
  .works-grid { grid-template-columns: 1fr; }

  .entry-content { padding: 24px 20px; }
  .post-navigation { grid-template-columns: 1fr; }
  .key-visual { height: 240px; }
  .kv-hero { min-height: 75vh; }
  .hero-content { padding: 80px 0; }
  .hero-cta { flex-direction: column; }
  .container { padding: 0 16px; }
  .home-section { padding: 56px 0; }
}

@media (max-width: 480px) {
  .bento-grid { grid-template-columns: 1fr; }
  .bento-card:nth-child(n) { grid-column: span 1; }
}
