/* ==========================================================================
   styles.css — kuro-site
   ========================================================================== */

/* --- @font-face: Noto Sans JP (248 unicode-range subsets) --- */
@import url('/noto-fontface.css');

/* --- @font-face: IBM Plex Mono --- */

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/ibm-plex-mono-400.woff2) format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/ibm-plex-mono-700.woff2) format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/ibm-plex-mono-400italic.woff2) format('woff2');
}

/* --- Design Tokens --- */

:root {
  --bg: #0a0a0a;
  --surface: #131313;
  --surface-hover: #181818;
  --border: #1e1e1e;
  --border-hover: #2a2a2a;
  --text: #d8d8d8;
  --text-dim: #606060;
  --text-body: #909090;
  --accent: #c8a2ff;
  --accent-dim: #6b4d8a;
}

/* --- Reset --- */

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

/* --- Skip Link --- */

.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  z-index: 1000;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

/* --- Base Typography --- */

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Mono', 'Noto Sans JP', monospace;
  font-weight: 300;
  line-height: 1.7;
  min-height: 100vh;
}

/* --- Layout --- */

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

/* --- Site Header --- */

header {
  margin-bottom: 3rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.logo-block {}

.logo {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.logo .cat {
  margin-left: 0.25rem;
}

.tagline {
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 400;
}

.tagline-jp {
  color: var(--accent-dim);
  font-size: 0.75rem;
  font-weight: 400;
  margin-top: 0.15rem;
  font-family: 'Noto Sans JP', sans-serif;
}

/* --- Navigation --- */

nav {
  display: flex;
  gap: 1.25rem;
  padding-top: 0.2rem;
}

nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}

nav a:hover,
nav a.active,
nav a[aria-current="page"] {
  color: var(--accent);
}

/* --- Intro Block --- */

.intro {
  margin-bottom: 3rem;
  padding: 1.5rem;
  border-left: 2px solid var(--accent-dim);
  color: var(--text-dim);
  font-size: 0.85rem;
}

.intro p {
  margin-bottom: 0.5rem;
}

.intro p:last-child {
  margin-bottom: 0;
}

.intro a {
  color: var(--accent-dim);
  border-bottom: 1px solid var(--accent-dim);
  text-decoration: none;
}

.intro a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* --- Post Feed / Index List --- */

.feed {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post-card {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: background 0.2s, border-color 0.2s;
}

.post-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.post-date {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

.post-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
  line-height: 1.5;
}

.post-title-link {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.post-title-link:hover {
  color: var(--accent);
}

/* --- Tags --- */

.post-tag {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  color: var(--accent);
  background: rgba(200, 162, 255, 0.08);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tag {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: rgba(200, 162, 255, 0.08);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  text-decoration: none;
}

/* --- Post Body Content --- */

.post-body {
  font-size: 0.8rem;
  color: var(--text-body);
  line-height: 1.7;
}

.post-body p {
  margin-bottom: 0.6rem;
}

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

.post-body ul,
.post-body ol {
  margin: 0.4rem 0 0.6rem 1.2rem;
}

.post-body li {
  margin-bottom: 0.25rem;
}

.post-body strong {
  color: var(--text);
  font-weight: 700;
}

.post-body em {
  color: var(--accent-dim);
  font-style: italic;
}

.post-body a {
  color: #4a9eff;
  text-decoration: none;
  border-bottom: 1px solid rgba(74, 158, 255, 0.3);
}

.post-body a:hover {
  border-bottom-color: #4a9eff;
}

.post-body code {
  background: rgba(200, 162, 255, 0.08);
  padding: 0.1em 0.3em;
  border-radius: 3px;
  font-size: 0.9em;
}

.post-body pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  margin: 0.6rem 0;
  overflow-x: auto;
}

.post-body pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 0.8rem;
  line-height: 1.6;
}

.post-body blockquote {
  border-left: 2px solid var(--accent-dim);
  padding: 0.5rem 1rem;
  margin: 0.6rem 0;
  color: var(--text-dim);
  font-style: italic;
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.post-body h2 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin: 2rem 0 0.75rem;
}

.post-body h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin: 1.5rem 0 0.5rem;
}

/* --- Single Post Page --- */

body.page-post .back-link {
  display: inline-block;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  margin-bottom: 2rem;
  transition: color 0.2s;
}

body.page-post .back-link:hover {
  color: var(--accent);
}

.post-header {
  margin-bottom: 2rem;
}

.post-hero-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.post-hero-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.post-hero-body {
  font-size: 0.85rem;
  color: var(--text-body);
  line-height: 1.8;
}

.post-hero-body p {
  margin-bottom: 1rem;
}

.post-hero-body p:last-child {
  margin-bottom: 0;
}

.post-hero-body ul,
.post-hero-body ol {
  margin: 0.5rem 0 1rem 1.2rem;
}

.post-hero-body li {
  margin-bottom: 0.3rem;
}

.post-hero-body strong {
  color: var(--text);
  font-weight: 700;
}

.post-hero-body em {
  color: var(--accent-dim);
  font-style: italic;
}

.post-hero-body a {
  color: #4a9eff;
  text-decoration: none;
  border-bottom: 1px solid rgba(74, 158, 255, 0.3);
}

.post-hero-body a:hover {
  border-bottom-color: #4a9eff;
}

.post-hero-body code {
  background: rgba(200, 162, 255, 0.08);
  padding: 0.1em 0.3em;
  border-radius: 3px;
  font-size: 0.9em;
}

.post-hero-body pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  margin: 1rem 0;
  overflow-x: auto;
}

.post-hero-body pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 0.8rem;
  line-height: 1.6;
}

.post-hero-body blockquote {
  border-left: 2px solid var(--accent-dim);
  padding: 0.5rem 1rem;
  margin: 0.6rem 0;
  color: var(--text-dim);
  font-style: italic;
}

.post-hero-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.post-hero-body h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 2rem 0 0.75rem;
}

.post-hero-body h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin: 1.5rem 0 0.5rem;
}

/* --- Prev/Next Navigation --- */

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.post-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.75rem;
  transition: color 0.2s;
  max-width: 45%;
}

.post-nav a:hover {
  color: var(--accent);
}

.post-nav .prev {
  text-align: left;
}

.post-nav .next {
  text-align: right;
  margin-left: auto;
}

.post-nav .nav-label {
  display: block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
  color: var(--text-dim);
}

.post-nav .nav-title {
  color: var(--text-body);
}

.post-nav a:hover .nav-title {
  color: var(--accent);
}

/* --- Now Page --- */

body.page-now .about-content,
body.page-home .about-content {
  font-size: 0.85rem;
  color: var(--text-body);
  line-height: 1.8;
}

.about-content h2 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin: 2.5rem 0 1rem 0;
  letter-spacing: 0.03em;
}

.about-content h2:first-child {
  margin-top: 0;
}

.about-content p {
  margin-bottom: 1rem;
}

.about-content a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-dim);
}

.about-content a:hover {
  border-color: var(--accent);
}

/* --- Empty State --- */

.empty {
  color: var(--text-dim);
  font-size: 0.8rem;
  text-align: center;
  padding: 3rem 0;
  border: 1px dashed var(--border);
  border-radius: 6px;
}

.empty-cat {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

/* --- Footer --- */

footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.7rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer a {
  color: var(--text-dim);
  text-decoration: none;
}

footer a:hover {
  color: var(--accent);
}

.pulse {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 0.4rem;
  animation: pulse 2s ease-in-out infinite;
  vertical-align: middle;
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* --- Page-specific body classes --- */

body.page-home .feed {
  margin-top: 0;
}

body.page-post .container {
  padding-top: 3rem;
}

body.page-now .container {
  padding-top: 3rem;
}

/* --- Responsive --- */

@media (max-width: 480px) {
  .container {
    padding: 2rem 1rem;
  }

  header {
    flex-direction: column;
    gap: 1rem;
  }

  .post-nav {
    flex-direction: column;
    gap: 0.75rem;
  }

  .post-nav a {
    max-width: 100%;
  }

  .post-nav .next {
    text-align: left;
    margin-left: 0;
  }
}
