:root {
  --bg: #09090e;
  --bg2: #0f0f16;
  --bg3: #13131c;
  --border: rgba(255, 255, 255, 0.07);
  --accent: #00e5ff;
  --accent2: #ff00ff;
  --text: #c8c8d8;
  --text-dim: #5a5a72;
  --text-bright: #e8e8f0;
  --code-bg: #0c0c14;
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'Noto Sans JP', sans-serif;
}

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  line-height: 1.7;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
  will-change: transform;
  transform: translateZ(0);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.025) 2px, rgba(0, 0, 0, 0.025) 4px);
  pointer-events: none;
  z-index: 0;
  will-change: transform;
  transform: translateZ(0);
}

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.wrap-narrow {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
  border-left: 1px solid var(--border);
}
::-webkit-scrollbar-thumb {
  background: var(--text-dim);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ── HEADER ── */
header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(9, 9, 14, 0.88);
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 16px;
}

.logo {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.logo .slash {
  color: var(--text-dim);
}

.logo-blink {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--accent2);
  margin-left: 2px;
  animation: blink 1.1s step-end infinite;
  vertical-align: middle;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: 0
  }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* reading progress bar */
.progress-bar {
  position: fixed;
  top: 56px;
  left: 0;
  height: 2px;
  background: linear-gradient(to right, var(--accent), var(--accent2));
  z-index: 200;
  width: 0%;
  transition: width 0.1s linear;
}

/* ── ARTICLE HEADER ── */
.article-header {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
  position: static;
}

.article-breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.article-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.article-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  padding: 2px 8px;
  border: 1px solid var(--accent2);
  border-radius: 1px;
  color: var(--accent2);
  letter-spacing: 0.06em;
}

.article-h1 {
  font-family: var(--font-body);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

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

.meta-item {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 5px;
}

.meta-item .dot {
  color: var(--accent2);
}

/* article hero image */
.article-hero-img {
  aspect-ratio: 1200 / 630;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin: 32px 0;
  width: 100%;
  position: relative;
}

.article-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.article-hero-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  background: repeating-linear-gradient(45deg,
      transparent,
      transparent 4px,
      rgba(255, 255, 255, 0.015) 4px,
      rgba(255, 255, 255, 0.015) 8px);
}

.article-hero-img-placeholder svg {
  opacity: 0.2;
}

.warning-box {
  margin: 32px 0;
  padding: 16px 20px;
  border: 1px solid oklch(65% 0.15 50);
  border-left: 3px solid oklch(65% 0.15 50);
  background: oklch(65% 0.15 50 / 0.05);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: oklch(65% 0.12 50);
  line-height: 1.7;
}

.warning-box strong {
  color: oklch(70% 0.15 50);
}

/* ── ARTICLE BODY ── */
.article-body {
  padding: 48px 0 60px;
}

.article-body h2 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 48px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.article-body h2::before {
  content: '## ';
  color: var(--text-dim);
}

.article-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-bright);
  margin: 32px 0 12px;
  letter-spacing: -0.01em;
}

.article-body p {
  font-size: 0.95rem;
  line-height: 1.9;
  color: var(--text);
  margin-bottom: 16px;
}

.article-body strong {
  color: var(--text-bright);
  font-weight: 600;
}

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

.article-body a:hover {
  opacity: 0.8;
}

/* inline code */
.article-body code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--bg3);
  padding: 1px 6px;
  border-radius: 2px;
  color: var(--accent2);
}

/* code block */
.code-block {
  margin: 24px 0;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.code-block-header {
  background: var(--bg3);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.code-lang {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.copy-btn {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: color 0.15s;
  padding: 2px 6px;
}

.copy-btn:hover {
  color: var(--accent);
}

.code-block pre {
  background: var(--code-bg);
  padding: 20px;
  overflow-x: auto;
  margin: 0;
}

.code-block pre code {
  background: none;
  padding: 0;
  font-size: 0.82rem;
  color: var(--text);
  white-space: pre;
  line-height: 1.7;
}

.code-block pre code .kw {
  color: #00e5ff;
}

.code-block pre code .str {
  color: oklch(70% 0.12 80);
}

.code-block pre code .cm {
  color: var(--text-dim);
}

.code-block pre code .val {
  color: #ff00ff;
}

/* cost / price comparison table */
.cost-table,
.price-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.cost-table th,
.price-table th {
  padding: 10px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  text-align: left;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.65rem;
}

.cost-table td,
.price-table td {
  padding: 10px 16px;
  border: 1px solid var(--border);
  color: var(--text);
}

.cost-table tr:nth-child(even) td,
.price-table tr:nth-child(even) td {
  background: var(--bg2);
}

.cost-table .highlight,
.price-table .highlight {
  color: var(--accent);
  font-weight: 700;
}

.cost-table .dim,
.price-table .dim {
  color: var(--text-dim);
}

.price-table .cross {
  color: oklch(65% 0.15 25);
}

/* steps */
.steps {
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 24px 0;
  border: 1px solid var(--border);
}

.step {
  counter-increment: step;
  padding: 20px 24px 20px 72px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.step:last-child {
  border-bottom: none;
}

.step::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 20px;
  top: 20px;
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--border);
  line-height: 1;
}

.step-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 8px;
}

.step p {
  font-size: 0.88rem;
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.8;
}

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

.step .note {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  background: var(--bg3);
  padding: 8px 12px;
  border-left: 2px solid var(--border);
  margin-top: 8px;
}

/* callout */
.callout {
  margin: 24px 0;
  padding: 16px 20px;
  border-left: 2px solid var(--accent2);
  background: var(--bg2);
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.8;
}

.callout strong {
  color: var(--accent2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* ── SHARE & COMMENTS ── */
.share-section {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.share-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.share-label span {
  color: var(--accent);
}

.share-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.share-btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--bg3);
  color: var(--text-dim);
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.share-btn:hover {
  border-color: var(--accent2);
  color: var(--accent2);
  box-shadow: 0 0 8px rgba(255, 0, 255, 0.2);
}

.share-btn.copied {
  border-color: var(--accent);
  color: var(--accent);
}

/* comment form */
.comment-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 40px;
}

.comment-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-input,
.form-textarea {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 10px 14px;
  border-radius: 2px;
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 1px rgba(255, 0, 255, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-dim);
}

.form-textarea {
  min-height: 100px;
  font-family: var(--font-body);
  font-size: 0.88rem;
}

.submit-btn {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 10px 20px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 2px;
  cursor: pointer;
  letter-spacing: 0.06em;
  font-weight: 600;
  transition: opacity 0.15s;
}

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

/* comment list */
.comment-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
}

.comment-item {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.comment-handle {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent2);
  font-weight: 600;
}

.comment-date {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-dim);
}

.comment-text {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.8;
}

.comment-delete {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  margin-left: auto;
  transition: color 0.15s;
}

.comment-delete:hover {
  color: oklch(65% 0.18 25);
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  position: relative;
  z-index: 1;
}

.footer-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.footer-back {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s;
  line-height: 1;
}

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

.footer-center {
  text-align: center;
  flex: 1;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.footer-disclaimer {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-dim);
  opacity: 0.5;
  margin-top: 4px;
}

.footer-spacer {
  width: 1.5rem;
}

@media (max-width: 600px) {
  .comment-form-row {
    grid-template-columns: 1fr;
  }

  .article-h1 {
    font-size: 1.5rem;
  }
}

/* ── COMMENTS SECTION ── */
.comments-section {
  padding: 48px 0;
}

.comments-title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.comments-title span {
  color: var(--accent);
}

/* ── ARTICLE FOOTNOTE ── */
.footnote {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-top: -8px;
}

/* ── SAVINGS BADGE (002) ── */
.savings-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg2);
  border: 1px solid var(--accent2);
  padding: 12px 20px;
  margin: 24px 0;
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(255, 0, 255, 0.1);
}

.savings-num {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent2);
  line-height: 1;
}

.savings-desc {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.savings-desc strong {
  color: var(--text);
}
