/* ===========================================================
   ThreatCube — Landing Page
   Design system: slate-950 dark base, violet glow, risk-5 accents
   Type: Noto Sans JP (headings/body) · JetBrains Mono (labels/code)
   =========================================================== */

:root {
  /* surfaces */
  --bg: #05070f;
  --bg-2: #080b16;
  --panel: rgba(148, 163, 184, 0.045);
  --panel-2: rgba(148, 163, 184, 0.07);
  --line: rgba(148, 163, 184, 0.12);
  --line-strong: rgba(148, 163, 184, 0.22);

  /* text */
  --text: #e7ecf4;
  --muted: #98a4b8;
  --faint: #5d6a82;

  /* violet brand */
  --violet: #8b5cf6;
  --violet-bright: #a98bff;
  --violet-deep: #6d28d9;

  /* risk palette */
  --r-na: #9ca3af;
  --r-low: #22c55e;
  --r-med: #f59e0b;
  --r-high: #ef4444;
  --r-crit: #d946ef;

  --maxw: 1200px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans JP", "Inter", system-ui, sans-serif;
  font-feature-settings: "palt" 1;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: rgba(139, 92, 246, 0.35); color: #fff; }

a { color: inherit; text-decoration: none; }

.mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-feature-settings: normal;
}

/* ---------- layout ---------- */
.wrap { width: min(100% - 48px, var(--maxw)); margin-inline: auto; }

section { position: relative; }

.eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--violet-bright);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, var(--violet), transparent);
}

h1, h2, h3 { line-height: 1.18; letter-spacing: -0.01em; margin: 0; font-weight: 700; }

.section-head { max-width: 720px; }
.section-head h2 {
  font-size: clamp(28px, 4.2vw, 46px);
  margin-top: 18px;
}
.section-head p {
  color: var(--muted);
  font-size: 17px;
  margin-top: 18px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: 11px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  background: linear-gradient(180deg, var(--violet-bright), var(--violet));
  color: #fff;
  box-shadow: 0 0 0 1px rgba(167, 139, 255, 0.3), 0 12px 34px -12px rgba(139, 92, 246, 0.85);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(167, 139, 255, 0.5), 0 18px 44px -12px rgba(139, 92, 246, 1); }
.btn-ghost {
  background: var(--panel);
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-ghost:hover { background: var(--panel-2); border-color: var(--violet); transform: translateY(-2px); }

/* ---------- nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(5, 7, 15, 0.72);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.brand img { width: 26px; height: 26px; display: block; }
.brand b { color: var(--violet-bright); }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { color: var(--muted); font-size: 14px; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }

/* ---------- hero ---------- */
.hero { padding: 168px 0 96px; overflow: hidden; position: relative; }
.hero-glow {
  position: absolute;
  top: -180px; right: -120px;
  width: 820px; height: 820px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.28), rgba(139, 92, 246, 0) 62%);
  pointer-events: none;
  z-index: 0;
  filter: blur(8px);
}
.hero .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  gap: 40px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(38px, 5.6vw, 68px);
  margin-top: 24px;
  letter-spacing: -0.02em;
}
.hero h1 .grad,
.grad {
  background: linear-gradient(110deg, #fff 10%, var(--violet-bright) 55%, var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead {
  color: var(--muted);
  font-size: 18px;
  max-width: 540px;
  margin-top: 26px;
}
.hero-cta { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }
.hero-meta {
  display: flex; gap: 26px; margin-top: 38px; flex-wrap: wrap;
  font-family: "JetBrains Mono", monospace; font-size: 12.5px; color: var(--faint);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta .dot { width: 7px; height: 7px; border-radius: 50%; }

/* ---------- 3D cube stage ---------- */
.cube-stage {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  cursor: grab;
}
.cube-stage:active { cursor: grabbing; }
.cube-stage canvas { display: block; width: 100% !important; height: 100% !important; }
.cube-fallback {
  position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 18px;
  background:
    repeating-linear-gradient(45deg, rgba(148,163,184,0.04) 0 10px, transparent 10px 20px);
  color: var(--faint); font-family: "JetBrains Mono", monospace; font-size: 13px;
}
.axis-tag {
  position: absolute;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--faint);
  text-transform: uppercase;
  pointer-events: none;
  z-index: 2;
}
.axis-x { bottom: 6%; right: 8%; }
.axis-y { top: 14%; left: 2%; }
.axis-z { top: 8%; right: 14%; }

.cube-legend {
  position: absolute;
  left: 50%; bottom: -6px; transform: translateX(-50%);
  display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;
  font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--muted);
  z-index: 2;
}
.cube-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cube-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; box-shadow: 0 0 8px currentColor; }

.drag-hint {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--faint);
  letter-spacing: 0.1em; z-index: 2;
  display: inline-flex; align-items: center; gap: 7px;
  opacity: 0; transition: opacity 0.6s;
}
.cube-stage.ready .drag-hint { opacity: 1; }

/* ---------- generic section spacing ---------- */
.block { padding: 96px 0; }
.block-tight { padding: 72px 0; }

/* divider rule */
.rule { height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); border: 0; margin: 0; }

/* ---------- problem (Excel limits) ---------- */
.compare {
  margin-top: 56px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 36px;
}
.compare-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  padding: 26px;
}
.compare-card .tag { font-family: "JetBrains Mono", monospace; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.compare-card.before .tag { color: var(--faint); }
.compare-card.after { border-color: rgba(139, 92, 246, 0.4); background: rgba(139, 92, 246, 0.06); box-shadow: 0 0 60px -28px rgba(139,92,246,0.8); }
.compare-card.after .tag { color: var(--violet-bright); }
.compare-card h3 { font-size: 19px; margin-top: 12px; }
.compare-card p { color: var(--muted); font-size: 14.5px; margin: 12px 0 0; }
.compare-arrow { color: var(--faint); font-size: 26px; }

/* flat 2d grid sketch */
.flat-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.flat-grid i { aspect-ratio: 1; border-radius: 3px; background: rgba(148,163,184,0.1); }
.flat-grid i.hot { background: rgba(148,163,184,0.16); }

/* ---------- axes (3 dimensions) ---------- */
.axes-grid { margin-top: 56px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.axis-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s;
}
.axis-card:hover { transform: translateY(-4px); border-color: var(--line-strong); background: var(--panel-2); }
.axis-card .axis-id {
  font-family: "JetBrains Mono", monospace; font-size: 13px; font-weight: 700;
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); color: var(--violet-bright);
}
.axis-card h3 { font-size: 20px; margin-top: 18px; }
.axis-card .jp { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.axis-card p { color: var(--muted); font-size: 14.5px; margin-top: 14px; }
.axis-card ul { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 7px; }
.axis-card li { font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.axis-card .glowline { position: absolute; left: 0; top: 0; height: 3px; width: 100%; background: linear-gradient(90deg, var(--violet), transparent); opacity: 0; transition: opacity 0.3s; }
.axis-card:hover .glowline { opacity: 1; }

/* encoding row (color/size/opacity) */
.encoding { margin-top: 20px; display: flex; gap: 28px; flex-wrap: wrap; font-family: "JetBrains Mono", monospace; font-size: 12.5px; color: var(--muted); }
.encoding b { color: var(--text); font-weight: 600; }
.encoding span { display: inline-flex; align-items: center; gap: 9px; }
.swatch-row { display: inline-flex; gap: 4px; }
.swatch-row i { width: 12px; height: 12px; border-radius: 3px; box-shadow: 0 0 8px currentColor; }

/* ---------- features ---------- */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  padding: 64px 0;
}
.feature:nth-child(even) .feature-visual { order: -1; }
.feature-text .fnum { font-family: "JetBrains Mono", monospace; font-size: 12px; letter-spacing: 0.2em; color: var(--violet-bright); }
.feature-text h3 { font-size: clamp(24px, 3vw, 32px); margin-top: 14px; }
.feature-text p { color: var(--muted); font-size: 16px; margin-top: 18px; }
.feature-text ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.feature-text li { display: flex; gap: 12px; align-items: flex-start; color: var(--text); font-size: 15px; }
.feature-text li svg { width: 19px; height: 19px; color: var(--violet-bright); flex: none; margin-top: 2px; }

.feature-visual {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  padding: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 40px 80px -50px rgba(0,0,0,0.9);
}
.win-bar { display: flex; gap: 7px; padding: 4px 4px 14px; }
.win-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--line-strong); }

/* mock: 3d cube hotspot (mini static) */
.mock-cube { display: grid; place-items: center; min-height: 280px; position: relative; }
.mock-glow { position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, rgba(139,92,246,0.18), transparent 60%); }

/* mock: table */
.mock-table { font-family: "JetBrains Mono", monospace; font-size: 11.5px; width: 100%; border-collapse: collapse; }
.mock-table th { text-align: left; color: var(--faint); font-weight: 500; padding: 9px 10px; border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: 0.08em; font-size: 10px; }
.mock-table td { padding: 10px; border-bottom: 1px solid var(--line); color: var(--muted); }
.mock-table tr:hover td { background: rgba(139,92,246,0.05); color: var(--text); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 10px; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* mock: export */
.mock-export { display: grid; gap: 12px; padding: 8px; }
.export-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 11px; background: rgba(148,163,184,0.03); transition: border-color 0.25s, background 0.25s, transform 0.25s; }
.export-row:hover { border-color: var(--violet); background: rgba(139,92,246,0.06); transform: translateX(4px); }
.export-row .fmt { font-family: "JetBrains Mono", monospace; font-weight: 700; font-size: 13px; color: var(--violet-bright); width: 64px; }
.export-row .desc { color: var(--muted); font-size: 13px; }
.export-row .dl { margin-left: auto; color: var(--faint); }

/* ---------- domains strip ---------- */
.domains { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 44px; }
.domain-chip {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 18px; font-size: 14px; color: var(--text);
  background: var(--panel); transition: border-color 0.25s, background 0.25s, transform 0.25s;
}
.domain-chip:hover { border-color: var(--violet); background: rgba(139,92,246,0.07); transform: translateY(-2px); }
.domain-chip i { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }

/* ---------- local-first ---------- */
.local { position: relative; overflow: hidden; }
.local-glow { position: absolute; left: -160px; bottom: -200px; width: 700px; height: 700px; background: radial-gradient(circle, rgba(34,197,94,0.10), transparent 62%); pointer-events: none; }
.local .wrap { position: relative; z-index: 1; }
.local-grid { margin-top: 52px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.local-card { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); padding: 28px; transition: transform 0.3s var(--ease), border-color 0.3s; }
.local-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.local-card .ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--line-strong); color: var(--violet-bright); margin-bottom: 18px; }
.local-card .ico svg { width: 23px; height: 23px; }
.local-card h3 { font-size: 18px; }
.local-card p { color: var(--muted); font-size: 14px; margin-top: 10px; }

/* ---------- CTA ---------- */
.cta { text-align: center; padding: 120px 0; position: relative; overflow: hidden; }
.cta-glow { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 900px; height: 600px; background: radial-gradient(ellipse, rgba(139,92,246,0.22), transparent 62%); pointer-events: none; }
.cta .wrap { position: relative; z-index: 1; }
.cta h2 { font-size: clamp(32px, 5vw, 56px); }
.cta p { color: var(--muted); font-size: 18px; margin: 22px auto 0; max-width: 560px; }
.cta .hero-cta { justify-content: center; }
.cta .note { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--faint); margin-top: 26px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 56px 0 48px; }
.footer .wrap { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer .brand { margin-bottom: 14px; }
.footer .tagline { color: var(--faint); font-family: "JetBrains Mono", monospace; font-size: 12.5px; max-width: 320px; }
.footer .stack { color: var(--faint); font-size: 12px; margin-top: 16px; font-family: "JetBrains Mono", monospace; }
.footer-col h4 { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); font-family: "JetBrains Mono", monospace; margin: 0 0 14px; }
.footer-col a { display: block; color: var(--muted); font-size: 14px; padding: 5px 0; transition: color 0.2s; }
.footer-col a:hover { color: var(--violet-bright); }
.footer-cols { display: flex; gap: 64px; }
.footer-bottom { flex-basis: 100%; width: 100%; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--faint); font-family: "JetBrains Mono", monospace; font-size: 12px; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: 0.08s; }
.reveal[data-d="2"] { transition-delay: 0.16s; }
.reveal[data-d="3"] { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */
@media (max-width: 940px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .cube-stage { max-width: 460px; margin: 8px auto 0; }
  .hero { padding-top: 130px; }
  .feature { grid-template-columns: 1fr; gap: 30px; }
  .feature:nth-child(even) .feature-visual { order: 0; }
  .axes-grid, .local-grid { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr; }
  .compare-arrow { transform: rotate(90deg); }
  .nav-links { display: none; }
  .footer-cols { gap: 40px; flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .wrap { width: min(100% - 32px, var(--maxw)); }
  .hero h1 { font-size: 36px; }
}
