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

:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --border: #30363d;
  --text: #c9d1d9;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --green: #3fb950;
  --white: #f0f6fc;
}

html {
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family:
    "SF Mono", "Fira Code", "Cascadia Code", "JetBrains Mono", Consolas,
    monospace;
  line-height: 1.7;
  min-height: 100vh;
}

/* Japanese: prioritize CJK-aware font, wider spacing for readability */
:lang(ja) {
  font-family: "M PLUS 1 Code", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 1.05rem;
  line-height: 1.9;
  letter-spacing: 0.02em;
}

:lang(ja) .post-content {
  max-width: 38em;
}

:lang(ja) .post-content p {
  margin-bottom: 1.5rem;
}

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

a:hover {
  text-decoration: underline;
}

/* Layout */
.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.site-header .prompt {
  color: var(--green);
  font-size: 1.1rem;
}

.site-header .prompt .path {
  color: var(--accent);
  text-decoration: none;
}

.site-header .prompt .path:hover {
  color: var(--white);
}

.site-header .prompt .cursor {
  color: var(--white);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.site-header nav {
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

.site-header nav a {
  color: var(--text-muted);
  margin-right: 1.5rem;
}

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

/* Tagline */
.tagline {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  font-style: italic;
}

.lang-note {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 2.5rem;
  opacity: 0.7;
}

/* Post list */
.post-list {
  list-style: none;
}

.post-list li {
  border-left: 2px solid var(--border);
  padding: 0.75rem 0 0.75rem 1.25rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

.post-list li:hover {
  border-color: var(--green);
}

.post-list .post-date {
  color: var(--text-muted);
  font-size: 0.8rem;
  display: block;
  margin-bottom: 0.25rem;
}

.post-list .post-title {
  font-size: 1rem;
  color: var(--white);
}

.post-list .post-summary {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.post-list li.pending {
  border-left-color: #f0883e;
  opacity: 0.6;
}

.post-list li.pending:hover {
  border-color: #f0883e;
}

.post-list .pending-tag {
  color: #f0883e;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Section headings */
.section-heading {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

/* Start here */
.start-here {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.featured-posts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.featured-card {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  flex: 1 1 calc(50% - 0.5rem);
  min-width: 180px;
  transition: border-color 0.2s;
}

.featured-card:hover {
  border-color: var(--green);
  text-decoration: none;
}

.featured-label {
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.featured-title {
  color: var(--white);
  font-size: 0.9rem;
}

/* Section bar */
.section-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.tag-filters {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.tag-active {
  background: rgba(255, 255, 255, 0.1);
}

.tag-clear {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-left: 0.25rem;
}

.tag-clear:hover {
  color: var(--white);
  text-decoration: none;
}

/* About headings */
.about-content h1 {
  color: var(--white);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.about-content h2 {
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

/* Post page */
.post-header {
  margin-bottom: 2rem;
}

.post-header h1 {
  color: var(--white);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.post-header .post-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Post hero image (OG image displayed on page) */
img.post-hero {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-top: 1.25rem;
}

.post-content {
  font-size: 0.95rem;
  line-height: 1.8;
}

.post-content p {
  margin-bottom: 1.25rem;
}

.post-content ol,
.post-content ul {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content blockquote {
  border-left: 2px solid var(--green);
  padding-left: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.post-content pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  font-size: 0.8em;
  line-height: 1.3;
  color: var(--green);
}

.post-content code {
  background: var(--bg-card);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
}

/* Post images */
.post-content img {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 1.25rem;
}

.post-content .screenshot-caption {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-style: italic;
  margin-top: -0.75rem;
  margin-bottom: 1.25rem;
}

/* Tags */
.tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.7em;
  text-decoration: none;
  vertical-align: middle;
}

.tag:hover {
  text-decoration: none;
  opacity: 0.8;
}

.tag-engineering {
  border: 1px solid #58a6ff;
  color: #58a6ff;
}

.tag-identity {
  border: 1px solid #bc8cff;
  color: #bc8cff;
}

.tag-industry {
  border: 1px solid #7ee787;
  color: #7ee787;
}

.tag-team {
  border: 1px solid #e3b341;
  color: #e3b341;
}

.tag-safety {
  border: 1px solid #f85149;
  color: #f85149;
}

.tag-discoveries {
  border: 1px solid #00bcd4;
  color: #00bcd4;
}

.tag-pending {
  border: 1px solid #f0883e;
  color: #f0883e;
}

.post-tags {
  display: inline;
  margin-left: 0.5rem;
}

.reading-time {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.4rem;
}

.post-meta .post-tags {
  margin-left: 0.75rem;
}

.tag-heading {
  margin-bottom: 2rem;
  font-size: 1.2rem;
  font-weight: 400;
}

.tag-back {
  margin-top: 2rem;
  font-size: 0.85rem;
}

/* Share buttons */
.post-share {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.post-share .share-label {
  color: var(--text-muted);
}

.post-share a {
  color: var(--accent);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  transition: border-color 0.2s;
}

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

/* Post navigation */
.post-nav {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.post-nav .prev,
.post-nav .next {
  color: var(--text-muted);
}

.post-nav .prev:hover,
.post-nav .next:hover {
  color: var(--accent);
}

/* About page */
.about-content {
  font-size: 0.95rem;
  line-height: 1.8;
}

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

/* Start guide */
.start-guide {
  margin-top: 2rem;
  margin-bottom: 2.5rem;
}

.guide-section {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.guide-section:first-child {
  padding-top: 0;
}

.guide-section:last-child {
  border-bottom: none;
}

.guide-number {
  color: var(--text-muted);
  font-size: 0.8rem;
  min-width: 2rem;
  padding-top: 0.15rem;
  opacity: 0.5;
}

.guide-content {
  flex: 1;
}

.guide-theme {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}

.guide-title {
  color: var(--white);
  font-size: 1.05rem;
}

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

.guide-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.3rem;
  margin-bottom: 0;
  line-height: 1.6;
}

.more-picks {
  list-style: none;
  margin-bottom: 1.5rem;
}

.more-picks li {
  padding: 0.4rem 0;
  font-size: 0.9rem;
  border-left: 2px solid var(--border);
  padding-left: 1rem;
  margin-bottom: 0.5rem;
}

.more-picks li:hover {
  border-color: var(--green);
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: center;
}

.site-footer a {
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 1.25rem 1rem;
  }

  .site-header nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
  }

  .site-header nav a {
    margin-right: 0;
  }

  .post-header h1 {
    font-size: 1.25rem;
  }

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

  .featured-card {
    flex: 1 1 100%;
  }

  .section-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .tag-filters {
    flex-wrap: wrap;
  }
}

/* cookie banner */
.cookie-toggle {
  display: none;
}

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1a1a2e;
  border-top: 1px solid #333;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.8rem;
  z-index: 1000;
}

.cookie-text {
  color: #888;
}

.cookie-text em {
  color: #50fa7b;
  font-style: normal;
}

.cookie-close {
  color: #ff79c6;
  cursor: pointer;
  white-space: nowrap;
  margin-left: 1rem;
}

.cookie-close:hover {
  color: #fff;
}

.cookie-toggle:checked ~ .cookie-banner {
  display: none;
}

@media (max-width: 600px) {
  .cookie-banner {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
    padding: 0.75rem;
  }
}
