/* ── Theme Variables ── */
:root, [data-theme="katsujii"] {
  --bg:           #F8F6F1;
  --surface:      #FDFCF9;
  --border:       #E0DDDA;
  --border-mid:   #BFBCB8;
  --text-1:       #0A0A0A;
  --text-2:       #555555;
  --text-3:       #999999;
  --accent:       #0A0A0A;
  --accent-r:     10; --accent-g: 10; --accent-b: 10;
  --nav-bg:       rgba(248,246,241,0.92);
  --surface-bar:  #F2F0EB;
  --font-body:    'Noto Serif JP', serif;
  --font-display: 'Noto Serif JP', serif;
}
[data-theme="sumi"] {
  --bg:           #0C0C0C;
  --surface:      #141414;
  --border:       #1E1E1E;
  --border-mid:   #2E2E2E;
  --text-1:       #E0E0E0;
  --text-2:       #888888;
  --text-3:       #444444;
  --accent:       #FFFFFF;
  --accent-r:     255; --accent-g: 255; --accent-b: 255;
  --nav-bg:       rgba(12,12,12,0.92);
  --surface-bar:  #101010;
  --font-body:    'Noto Sans JP', sans-serif;
  --font-display: 'Syne', sans-serif;
}
[data-theme="koushi"] {
  --bg:           #FFFFFF;
  --surface:      #FAFAFA;
  --border:       #DCDCDC;
  --border-mid:   #CCCCCC;
  --text-1:       #1A1A1A;
  --text-2:       #555555;
  --text-3:       #AAAAAA;
  --accent:       #1A1A1A;
  --accent-r:     26; --accent-g: 26; --accent-b: 26;
  --nav-bg:       rgba(255,255,255,0.92);
  --surface-bar:  #F5F5F5;
  --font-body:    'Noto Sans JP', sans-serif;
  --font-display: 'Syne', sans-serif;
}
[data-theme="hakushi"] {
  --bg:           #FFFFFF;
  --surface:      #FFFFFF;
  --border:       #EEEEEE;
  --border-mid:   #CCCCCC;
  --text-1:       #111111;
  --text-2:       #666666;
  --text-3:       #BBBBBB;
  --accent:       #111111;
  --accent-r:     17; --accent-g: 17; --accent-b: 17;
  --nav-bg:       rgba(255,255,255,0.96);
  --surface-bar:  #F9F9F9;
  --font-body:    'Noto Sans JP', sans-serif;
  --font-display: 'Syne', sans-serif;
}
[data-theme="terminal"] {
  --bg:           #0D0D0D;
  --surface:      #111111;
  --border:       #1E1E1E;
  --border-mid:   #2E4A2E;
  --text-1:       #C8C8C8;
  --text-2:       #666666;
  --text-3:       #333333;
  --accent:       #39D353;
  --accent-r:     57; --accent-g: 211; --accent-b: 83;
  --nav-bg:       rgba(13,13,13,0.94);
  --surface-bar:  #0A0A0A;
  --font-body:    'JetBrains Mono', monospace;
  --font-display: 'JetBrains Mono', monospace;
}

/* ── Terminal: text effects ── */
[data-theme="terminal"] .hero-sub,
[data-theme="terminal"] .feature-card p,
[data-theme="terminal"] .section-title,
[data-theme="terminal"] .section-label {
  color: var(--text-1);
}
[data-theme="terminal"] .section-title {
  color: #39D353;
}
/* typing cursor on section labels */
[data-theme="terminal"] .section-label::after {
  content: '_';
  animation: blink 1.1s step-end infinite;
  color: #39D353;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
/* feature card: prompt prefix */
[data-theme="terminal"] .feature-card h3::before {
  content: '> ';
  color: #39D353;
}
/* hero sub: dim green */
[data-theme="terminal"] .hero-sub {
  color: #4a9e5c;
}
/* hero stack: bright green */
[data-theme="terminal"] .hero-stack {
  color: #39D353;
}
/* tech tags: terminal style */
[data-theme="terminal"] .tech-tag {
  color: #39D353;
  border-color: #2E4A2E;
  background: rgba(57,211,83,0.05);
}
[data-theme="terminal"] .tech-tag::before {
  content: '$ ';
  opacity: 0.5;
}

[data-theme="stellar"] {
  --bg:           #000000;
  --surface:      #0A0A0A;
  --border:       #222222;
  --border-mid:   #333333;
  --text-1:       #FFFFFF;
  --text-2:       #888888;
  --text-3:       #444444;
  --accent:       #FFFFFF;
  --accent-r:     255; --accent-g: 255; --accent-b: 255;
  --nav-bg:       rgba(0,0,0,0.94);
  --surface-bar:  #050505;
  --font-body:    'Syne', sans-serif;
  --font-display: 'Syne', sans-serif;
}
[data-theme="oldfilm"] {
  --bg:           #1A1918;
  --surface:      #222120;
  --border:       #3A3835;
  --border-mid:   #4A4845;
  --text-1:       #F0F0E8;
  --text-2:       #B5B0A8;
  --text-3:       #7A7570;
  --accent:       #D9D4CC;
  --accent-r:     217; --accent-g: 212; --accent-b: 204;
  --nav-bg:       rgba(26,25,24,0.94);
  --surface-bar:  #171615;
  --font-body:    'Noto Serif JP', serif;
  --font-display: 'Noto Serif JP', serif;
}
[data-theme="mist"] {
  --bg:           #F0F9FF;
  --surface:      #FFFFFF;
  --border:       #E0F2FE;
  --border-mid:   #BAE6FD;
  --text-1:       #334155;
  --text-2:       #64748B;
  --text-3:       #93C5FD;
  --accent:       #0EA5E9;
  --accent-r:     14; --accent-g: 165; --accent-b: 233;
  --nav-bg:       rgba(240,249,255,0.92);
  --surface-bar:  #E0F2FE;
  --font-body:    'Noto Sans JP', sans-serif;
  --font-display: 'Syne', sans-serif;
}
[data-theme="dreamy"] {
  --bg:           #FFF5F7;
  --surface:      #FFFFFF;
  --border:       #FFD1DC;
  --border-mid:   #FFB7C5;
  --text-1:       #5D4037;
  --text-2:       #8D6E63;
  --text-3:       #D4A0A8;
  --accent:       #FF99AA;
  --accent-r:     255; --accent-g: 153; --accent-b: 170;
  --nav-bg:       rgba(255,245,247,0.92);
  --surface-bar:  #FFE4EC;
  --font-body:    'Noto Sans JP', sans-serif;
  --font-display: 'Syne', sans-serif;
}
[data-theme="blueprint"] {
  --bg:           #0F172A;
  --surface:      #1E293B;
  --border:       #384459;
  --border-mid:   #475569;
  --text-1:       #F8FAFC;
  --text-2:       #94A3B8;
  --text-3:       #64748B;
  --accent:       #38BDF8;
  --accent-r:     56; --accent-g: 189; --accent-b: 248;
  --nav-bg:       rgba(15,23,42,0.94);
  --surface-bar:  #0A1628;
  --font-body:    'JetBrains Mono', monospace;
  --font-display: 'JetBrains Mono', monospace;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

/* Koushi: grid background */
[data-theme="koushi"] body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none; z-index: 0;
}
/* Terminal: scanline */
[data-theme="terminal"] body::before {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent, transparent 3px,
    rgba(0,0,0,0.06) 3px, rgba(0,0,0,0.06) 4px
  );
  pointer-events: none; z-index: 0;
}

/* ── Nav ── */
nav {
  position: sticky; top: 0; z-index: 200;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background 0.4s, border-color 0.4s;
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 1.5rem; height: 58px;
  display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
}
.nav-logo {
  display: flex; align-items: center; gap: 0.5rem;
  text-decoration: none; flex-shrink: 0;
}
.nav-logo-mark {
  width: 30px; height: 30px; border-radius: 7px;
  overflow: hidden; flex-shrink: 0;
}
.nav-logo-mark img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.nav-logo-text {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.05rem; color: var(--text-1);
  transition: color 0.4s, font-family 0.1s;
}
.nav-links {
  display: flex; align-items: center; gap: 0.25rem;
}
.nav-links a {
  color: var(--text-2); text-decoration: none;
  font-size: 0.82rem; padding: 0.35rem 0.65rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text-1);
  background: rgba(var(--accent-r), var(--accent-g), var(--accent-b), 0.08);
}
.nav-back a {
  color: var(--text-3); text-decoration: none;
  font-size: 0.82rem; white-space: nowrap;
  transition: color 0.2s;
}
.nav-back a:hover { color: var(--text-2); }

/* ── Theme Bar ── */
.theme-bar {
  position: sticky; top: 58px; z-index: 190;
  background: var(--surface-bar);
  border-bottom: 1px solid var(--border);
  transition: background 0.4s, border-color 0.4s;
}
.theme-bar-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0.55rem 1.5rem;
  display: flex; align-items: center; gap: 0.65rem;
  overflow-x: auto; scrollbar-width: none;
}
.theme-bar-inner::-webkit-scrollbar { display: none; }
.theme-label {
  font-size: 0.68rem; color: var(--text-3);
  white-space: nowrap; flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.1em;
}
.theme-btn {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.8rem; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-2);
  font-size: 0.78rem; cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
  font-family: var(--font-body);
  flex-shrink: 0;
}
.theme-btn:hover {
  border-color: var(--border-mid);
  color: var(--text-1);
}
.theme-btn.active {
  border-color: var(--accent);
  background: rgba(var(--accent-r), var(--accent-g), var(--accent-b), 0.1);
  color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-r), var(--accent-g), var(--accent-b), 0.1);
}
.theme-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}

/* ── Hero ── */
.hero {
  min-height: 76vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 6rem 1.5rem 4rem;
  position: relative; z-index: 1; overflow: hidden;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(var(--accent-r), var(--accent-g), var(--accent-b), 0.08);
  border: 1px solid rgba(var(--accent-r), var(--accent-g), var(--accent-b), 0.25);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-family: 'JetBrains Mono', monospace; font-size: 0.74rem;
  color: var(--accent); margin-bottom: 2rem;
  transition: background 0.4s, border-color 0.4s, color 0.4s;
}
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  animation: pulse-anim 2.2s ease-in-out infinite;
  transition: background 0.4s;
}
@keyframes pulse-anim {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(var(--accent-r), var(--accent-g), var(--accent-b), 0.5); }
  50% { opacity: 0.75; box-shadow: 0 0 0 6px rgba(var(--accent-r), var(--accent-g), var(--accent-b), 0); }
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 14vw, 9rem);
  font-weight: 700; line-height: 1;
  color: var(--text-1); margin-bottom: 1.5rem;
  transition: color 0.4s, font-family 0.1s;
}
[data-theme="terminal"] .hero-title {
  color: var(--accent);
  text-shadow: 0 0 50px rgba(57,211,83,0.25);
}
/* blinking cursor after title */
[data-theme="terminal"] .hero-title::after {
  content: '|';
  animation: blink 1.1s step-end infinite;
  font-weight: 300;
  margin-left: 0.05em;
}
.hero-sub {
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  color: var(--text-2); max-width: 540px;
  line-height: 1.8; margin-bottom: 0.5rem;
  transition: color 0.4s;
}
.hero-stack {
  font-size: 0.78rem; color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 1.25rem; letter-spacing: 0.05em;
  transition: color 0.4s;
}

/* ── Glow divider ── */
.glow-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-r), var(--accent-g), var(--accent-b), 0.3), transparent);
  max-width: 800px; margin: 0 auto;
  transition: background 0.4s;
}

/* ── Sections ── */
section { padding: 5rem 1.5rem; position: relative; z-index: 1; }
.section-inner { max-width: 1100px; margin: 0 auto; }
.section-label {
  font-family: 'JetBrains Mono', monospace; font-size: 0.72rem;
  color: rgba(var(--accent-r), var(--accent-g), var(--accent-b), 0.75);
  letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 0.75rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700; color: var(--text-1); margin-bottom: 1rem;
  transition: color 0.4s, font-family 0.1s;
}

/* ── Feature cards ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 1.75rem;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s, background 0.4s;
}
.feature-card:hover {
  border-color: var(--border-mid);
  box-shadow: 0 8px 32px rgba(var(--accent-r), var(--accent-g), var(--accent-b), 0.07);
  transform: translateY(-3px);
}
.feature-icon { font-size: 1.75rem; margin-bottom: 0.85rem; }
.feature-card h3 {
  font-family: var(--font-display); font-size: 1.05rem;
  font-weight: 700; margin-bottom: 0.6rem; color: var(--text-1);
  transition: color 0.4s, font-family 0.1s;
}
.feature-card p {
  color: var(--text-2); line-height: 1.75; font-size: 0.9rem;
  transition: color 0.4s;
}

/* ── Theme showcase ── */
.theme-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.85rem; margin-top: 1.75rem;
}
.theme-showcase-card {
  border-radius: 12px; padding: 1.1rem;
  border: 1px solid; cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.theme-showcase-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.12);
}
.tsc-name { font-size: 0.75rem; font-weight: 600; margin-bottom: 0.2rem; }
.tsc-sub  { font-size: 0.65rem; opacity: 0.6; }
.tsc-bar  { margin-top: 0.6rem; height: 3px; border-radius: 2px; width: 45%; }

/* ── Screenshot strip ── */
.screenshot-strip {
  display: flex; gap: 1rem;
  overflow-x: auto;
  padding: 1rem 0.5rem 1.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-r), var(--accent-g), var(--accent-b), 0.3) transparent;
}
.screenshot-strip::-webkit-scrollbar { height: 4px; }
.screenshot-strip::-webkit-scrollbar-track { background: transparent; }
.screenshot-strip::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-r), var(--accent-g), var(--accent-b), 0.3);
  border-radius: 4px;
}
.screenshot-strip img {
  height: 480px; max-height: 480px; width: auto;
  border-radius: 12px;
  scroll-snap-align: start;
  object-fit: contain;
  border: 1px solid var(--border);
  flex-shrink: 0;
  transition: transform 0.3s, box-shadow 0.3s;
}
.screenshot-strip img:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(var(--accent-r), var(--accent-g), var(--accent-b), 0.12);
}
@media (max-width: 768px) {
  .screenshot-strip img { height: 340px; }
}

/* ── Tech tags ── */
.tech-tags { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.tech-tag {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.82rem; color: var(--text-2);
  font-family: 'JetBrains Mono', monospace;
  background: var(--surface);
  transition: background 0.4s, border-color 0.4s, color 0.4s;
}

/* ── Scroll reveal ── */
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem 5rem; text-align: center;
  color: var(--text-3); font-size: 0.8rem;
  position: relative; z-index: 1;
  transition: border-color 0.4s, color 0.4s;
}
footer a {
  color: rgba(var(--accent-r), var(--accent-g), var(--accent-b), 0.85);
  text-decoration: none; transition: color 0.2s;
}
footer a:hover { color: var(--accent); }
footer p + p { margin-top: 0.4rem; }

/* ── Hamburger ── */
.nav-hamburger {
  display: none; flex-direction: column;
  justify-content: center; gap: 5px;
  cursor: pointer; padding: 8px;
  background: none; border: none; flex-shrink: 0;
}
.nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text-2); border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s, background 0.4s;
}
nav.open .nav-hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
nav.open .nav-hamburger span:nth-child(2) { opacity: 0; }
nav.open .nav-hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  nav.open .nav-links {
    display: flex; flex-direction: column;
    position: absolute; top: 58px; left: 0; right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem; gap: 0.5rem; z-index: 190;
  }
  nav.open .nav-links a { padding: 0.6rem 0.5rem; font-size: 0.9rem; }
}

/* ── Theme Swipe Gauge ── */
#tsg {
  position: fixed; bottom: 1.1rem; left: 50%; transform: translateX(-50%);
  z-index: 290; display: flex; flex-direction: column; align-items: center;
  gap: .32rem; pointer-events: none;
}
#tsg-hint {
  font-family: 'JetBrains Mono', monospace; font-size: .58rem;
  color: var(--text-3); letter-spacing: .1em; white-space: nowrap;
  transition: color .4s, opacity .3s;
}
#tsg-bar {
  display: flex; align-items: center;
  background: var(--nav-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border); border-radius: 999px;
  padding: .48rem 1.1rem; pointer-events: all; touch-action: none; cursor: ew-resize;
  position: relative; overflow: hidden;
  transition: border-color .4s, background .4s;
}
#tsg-fill {
  position: absolute; inset: 0; transform: scaleX(0); transform-origin: left;
  background: rgba(var(--accent-r), var(--accent-g), var(--accent-b), .12);
  pointer-events: none; transition: none;
}
.tsg-item { display: flex; align-items: center; position: relative; z-index: 1; }
.tsg-dot {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid var(--border-mid);
  background: var(--tsg-dc, transparent);
  flex-shrink: 0;
  transition: transform .25s, background .25s, border-color .25s, box-shadow .25s;
}
.tsg-dot.on {
  background: var(--accent); border-color: var(--accent); transform: scale(1.4);
  box-shadow: 0 0 0 3px rgba(var(--accent-r), var(--accent-g), var(--accent-b), .2);
}
.tsg-lbl {
  font-family: 'JetBrains Mono', monospace; font-size: .6rem;
  color: var(--text-3); white-space: nowrap; margin-left: .28rem;
  transition: color .25s;
}
.tsg-lbl.on { color: var(--text-1); }
.tsg-conn { width: 12px; height: 1px; background: var(--border); flex-shrink: 0; transition: background .4s, width .2s; }
/* 狭い画面: 現在±1以外のアイテムを省略表示 */
@media (max-width: 540px) {
  .tsg-far .tsg-lbl { display: none; }
  .tsg-far .tsg-dot { width: 5px; height: 5px; }
  .tsg-conn-far { width: 5px; }
}
@media (max-width: 400px) {
  .tsg-lbl { font-size: .5rem; } .tsg-conn { width: 7px; }
}

/* ────────────────────────────────────────
   Live Preview Carousel
──────────────────────────────────────── */
.nd-carousel {
  position: relative;
  max-width: 460px;
  margin: 0 auto;
  user-select: none;
}

/* ── Stage ── */
.nd-stage {
  position: relative;
  height: 440px;
  overflow: hidden;
}
.nd-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
  pointer-events: none;
}
.nd-slide.nd-active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.nd-slide.nd-exit {
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

/* ── Phone pair ── */
.nd-phones {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

/* ── Phone frame ── */
.nd-phone {
  width: 180px;
  height: 390px;
  border-radius: 36px;
  border: 6px solid var(--nd-frame, #222);
  background: var(--nd-bg, #fff);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 16px 48px rgba(0,0,0,0.28);
}
/* Notch */
.nd-phone::before {
  content: '';
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  width: 44px; height: 8px;
  background: var(--nd-frame, #111);
  border-radius: 4px;
  z-index: 20;
}
/* Home bar */
.nd-phone::after {
  content: '';
  position: absolute;
  bottom: 7px; left: 50%;
  transform: translateX(-50%);
  width: 48px; height: 3px;
  background: var(--nd-text, #111);
  opacity: 0.2;
  border-radius: 2px;
  z-index: 20;
}
/* Inner screen wrapper */
.nd-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--nd-bg, #fff);
}

/* ── AppBar ── */
.nd-appbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 10px 8px;
  border-bottom: 1px solid var(--nd-border, #eee);
  background: var(--nd-surface, #fff);
  flex-shrink: 0;
}
.nd-appbar-title {
  font-size: 11px;
  color: var(--nd-text, #111);
  letter-spacing: 0.05em;
  font-family: inherit;
}
.nd-appbar-icons {
  display: flex; gap: 1px;
}
.nd-icon {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.45;
  color: var(--nd-text, #111);
}
.nd-icon svg { display: block; }

/* ── Timeline ── */
.nd-timeline {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.nd-card {
  margin: 6px 8px;
  padding: 8px 10px;
  background: var(--nd-surface, #fff);
  border: 1px solid var(--nd-border, #eee);
  position: relative;
}
.nd-card-date {
  font-size: 9px;
  color: var(--nd-text-mid, #666);
  margin-bottom: 4px;
  display: block;
  font-family: inherit;
}
.nd-card-body {
  font-size: 10px;
  line-height: 1.6;
  color: var(--nd-text, #111);
  margin-bottom: 6px;
  font-family: inherit;
}
.nd-card-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.nd-tag {
  font-size: 8px;
  color: var(--nd-text-mid, #666);
  border: 1px solid var(--nd-border, #eee);
  padding: 1px 5px;
  font-family: inherit;
}
.nd-fab {
  position: absolute;
  bottom: 18px; right: 10px;
  width: 30px; height: 30px;
  background: var(--nd-accent, #111);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1;
  color: var(--nd-bg, #fff);
  z-index: 5;
}

/* ── AI Screen ── */
.nd-tabbar {
  display: flex;
  border-bottom: 1px solid var(--nd-border, #eee);
  background: var(--nd-surface, #fff);
  flex-shrink: 0;
}
.nd-tab {
  flex: 1;
  padding: 7px 2px;
  font-size: 7.5px;
  color: var(--nd-text-mid, #666);
  text-align: center;
  border-bottom: 2px solid transparent;
  font-family: inherit;
}
.nd-tab.nd-tab-active {
  color: var(--nd-text, #111);
  border-bottom-color: var(--nd-accent, #111);
}
.nd-aicontent {
  flex: 1;
  overflow: hidden;
  padding: 8px;
}
.nd-proposal {
  background: var(--nd-surface, #fff);
  border: 1px solid var(--nd-border, #eee);
  padding: 9px 10px;
}
.nd-proposal-header {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 6px;
}
.nd-proposal-title {
  flex: 1;
  font-size: 10px;
  font-weight: 600;
  color: var(--nd-text, #111);
  line-height: 1.4;
  font-family: inherit;
}
.nd-fav-btn {
  flex-shrink: 0;
  width: 18px; height: 18px;
  border: 1px solid var(--nd-border, #eee);
  background: transparent;
  color: var(--nd-text-mid, #999);
  font-size: 10px;
  cursor: default;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.nd-meta-label {
  font-size: 7px;
  color: var(--nd-text-mid, #666);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 6px;
  margin-bottom: 3px;
  font-family: inherit;
}
.nd-section-body {
  font-size: 8.5px;
  color: var(--nd-text-mid, #666);
  line-height: 1.5;
  font-family: inherit;
}
.nd-features {
  margin: 0 0 0 11px;
  padding: 0;
  font-size: 8.5px;
  color: var(--nd-text-mid, #666);
  line-height: 1.7;
  font-family: inherit;
}
.nd-prompt {
  font-size: 7.5px;
  color: var(--nd-text-mid, #666);
  line-height: 1.5;
  font-family: 'JetBrains Mono', monospace;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  opacity: 0.75;
}
.nd-copy-btn {
  width: 100%;
  margin-top: 7px;
  padding: 6px;
  background: transparent;
  border: 1px solid var(--nd-border, #eee);
  color: var(--nd-text-mid, #666);
  font-size: 8px;
  cursor: default;
  letter-spacing: 0.04em;
  font-family: inherit;
}

/* ── Theme-specific visual effects ── */
.nd-slide--koushi .nd-phone {
  background-image:
    linear-gradient(rgba(0,0,0,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.05) 1px, transparent 1px);
  background-size: 14px 14px;
}
.nd-slide--stellar .nd-screen::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 25px 40px, #fff, transparent),
    radial-gradient(1px 1px at 85px 110px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 140px 200px, #fff, transparent),
    radial-gradient(1px 1px at 55px 310px, #fff, transparent),
    radial-gradient(1px 1px at 165px 80px, #fff, transparent),
    radial-gradient(1px 1px at 110px 260px, #fff, transparent),
    radial-gradient(1px 1px at 30px 170px, #fff, transparent);
  pointer-events: none; z-index: 1;
}
.nd-slide--oldfilm .nd-phone {
  box-shadow:
    0 16px 48px rgba(0,0,0,0.5),
    inset 8px 0 0 #2D2C2A,
    inset -8px 0 0 #2D2C2A;
}
.nd-slide--mist .nd-card { border-radius: 14px; }
.nd-slide--mist .nd-card::after {
  content: '☁';
  position: absolute; top: 5px; right: 8px;
  color: #0EA5E9; opacity: 0.4; font-size: 11px;
}
.nd-slide--dreamy .nd-card { border-radius: 14px; }
.nd-slide--dreamy .nd-card::after {
  content: '♡';
  position: absolute; top: 5px; right: 8px;
  color: #FF99AA; opacity: 0.5; font-size: 11px;
}
.nd-slide--blueprint .nd-phone {
  box-shadow: 0 16px 48px rgba(0,0,0,0.4), 0 0 24px rgba(56,189,248,0.12);
}
.nd-slide--terminal .nd-phone {
  box-shadow: 0 16px 48px rgba(0,0,0,0.6), 0 0 24px rgba(57,211,83,0.18);
}
.nd-slide--katsujii .nd-card-body,
.nd-slide--katsujii .nd-appbar-title,
.nd-slide--katsujii .nd-proposal-title,
.nd-slide--katsujii .nd-section-body {
  font-family: 'Noto Serif JP', serif;
}
.nd-slide--oldfilm .nd-card-body,
.nd-slide--oldfilm .nd-appbar-title,
.nd-slide--oldfilm .nd-proposal-title,
.nd-slide--oldfilm .nd-section-body {
  font-family: 'Noto Serif JP', serif;
}
.nd-slide--blueprint .nd-appbar-title,
.nd-slide--terminal .nd-appbar-title,
.nd-slide--blueprint .nd-card-date,
.nd-slide--terminal .nd-card-date {
  font-family: 'JetBrains Mono', monospace;
}

/* ── Navigation ── */
.nd-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
.nd-prev, .nd-next {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-2);
  font-size: 20px; line-height: 1;
  transition: border-color 0.2s, color 0.2s;
  flex-shrink: 0;
}
.nd-prev:hover, .nd-next:hover {
  border-color: var(--border-mid);
  color: var(--text-1);
}
.nd-dots {
  display: flex; gap: 5px; align-items: center;
}
.nd-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--border-mid);
  cursor: pointer;
  border: none; padding: 0;
  transition: background 0.2s, transform 0.2s;
}
.nd-dot.nd-dot-active {
  background: var(--accent);
  transform: scale(1.4);
}
.nd-label {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-2);
  margin-top: 10px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.1em;
  transition: color 0.4s;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .nd-stage { height: 380px; }
  .nd-phone { width: 150px; height: 325px; border-radius: 30px; border-width: 5px; }
  .nd-phones { gap: 10px; }
}
@media (max-width: 380px) {
  .nd-stage { height: 310px; }
  .nd-phone { width: 120px; height: 260px; border-radius: 24px; border-width: 4px; }
  .nd-phones { gap: 8px; }
}
