/* FieldKit Labs 3D Tools — Swiss-Industrial Dark Tech Editorial Stylesheet */
:root {
  --bg: #0A0C10;
  --surface: #11151C;
  --surface-2: #0D1017;
  --surface-hover: #161B24;
  --border: rgba(255, 255, 255, 0.12);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.22);
  --ink: #F4F6F9;
  --ink-secondary: #A8B4C4;
  --ink-muted: #7C8B9E;
  --accent-quest: #10B981;
  --accent-mesh: #F59E0B;
  --accent-splat: #06B6D4;
  --font-sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Menlo", "Consolas", ui-monospace, monospace;
  --max-w: 1160px;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-width: 0;
  font-family: var(--font-sans);
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.024) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

code,
pre,
.mono {
  font-family: var(--font-mono);
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Container */
.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

@media (max-width: 400px) {
  .wrap {
    padding: 0 14px;
  }
}

/* Top Accent Rule */
.site-top-bar {
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--accent-quest) 0 33.33%, var(--accent-mesh) 33.33% 66.66%, var(--accent-splat) 66.66% 100%);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10, 12, 16, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  flex-shrink: 1;
}

.brand-name {
  font-weight: 800;
  font-size: 0.98rem;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  white-space: nowrap;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  white-space: nowrap;
}

@media (max-width: 420px) {
  .brand-sub {
    display: none;
  }
}

.nav-links {
  display: none;
  align-items: center;
  gap: 24px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-secondary);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: #FFFFFF;
}

@media (min-width: 820px) {
  .nav-links {
    display: flex;
  }
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
}

.lang-btn {
  border: 0;
  background: transparent;
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-btn[aria-pressed="true"] {
  background: #F4F6F9;
  color: #07090D;
}

.lang-btn:focus-visible,
.btn:focus-visible,
.filter-tab:focus-visible,
.rank-btn:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent-quest);
  outline-offset: 2px;
}

/* Hero */
.hero {
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
  .hero {
    padding: 72px 0 56px;
  }
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-quest);
  margin: 0 0 14px;
  overflow-wrap: anywhere;
}

.hero-title {
  margin: 0 0 18px;
  font-size: clamp(1.7rem, 4.4vw, 2.95rem);
  font-weight: 900;
  line-height: 1.22;
  letter-spacing: -0.025em;
  color: #FFFFFF;
  max-width: 24ch;
}

.hero-lead {
  margin: 0 0 28px;
  font-size: clamp(0.95rem, 1.5vw, 1.08rem);
  color: var(--ink-secondary);
  max-width: 66ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
  text-align: center;
  max-width: 100%;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: #F4F6F9;
  color: #07090D;
  border-color: #F4F6F9;
}

.btn-primary:hover {
  background: #FFFFFF;
}

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.36);
}

.btn-quest {
  background: var(--accent-quest);
  color: #06100C;
  border-color: var(--accent-quest);
}

.btn-quest:hover {
  filter: brightness(1.08);
}

.btn-mesh {
  background: var(--accent-mesh);
  color: #140D02;
  border-color: var(--accent-mesh);
}

.btn-mesh:hover {
  filter: brightness(1.08);
}

.btn-splat {
  background: var(--accent-splat);
  color: #041217;
  border-color: var(--accent-splat);
}

.btn-splat:hover {
  filter: brightness(1.08);
}

.btn-full {
  width: 100%;
}

@media (max-width: 480px) {
  .hero-actions .btn {
    width: 100%;
  }
}

/* Spec Strip */
.spec-strip {
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid var(--border);
  background: var(--surface);
}

@media (min-width: 720px) {
  .spec-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.spec-cell {
  padding: 16px 18px;
  min-width: 0;
  border-bottom: 1px solid var(--border-subtle);
}

.spec-cell:last-child {
  border-bottom: 0;
}

@media (min-width: 720px) {
  .spec-cell {
    border-bottom: 0;
    border-right: 1px solid var(--border-subtle);
  }
  .spec-cell:last-child {
    border-right: 0;
  }
}

.spec-k {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex-shrink: 0;
}

.dot-quest { background: var(--accent-quest); }
.dot-mesh { background: var(--accent-mesh); }
.dot-splat { background: var(--accent-splat); }

.spec-v {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-secondary);
}

/* Sections */
.section {
  padding: 52px 0;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
  .section {
    padding: 72px 0;
  }
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 32px;
}

.section-code {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.section-title {
  margin: 0;
  font-size: clamp(1.35rem, 2.6vw, 1.95rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  line-height: 1.25;
}

.section-desc {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.94rem;
  max-width: 66ch;
}

/* Tool Catalog Grid */
.catalog-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.tool-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top-width: 3px;
  display: grid;
  grid-template-columns: 1fr;
  min-width: 0;
}

.tool-card[data-accent="quest"] { border-top-color: var(--accent-quest); }
.tool-card[data-accent="mesh"] { border-top-color: var(--accent-mesh); }
.tool-card[data-accent="splat"] { border-top-color: var(--accent-splat); }

@media (min-width: 860px) {
  .tool-card {
    grid-template-columns: minmax(290px, 370px) minmax(0, 1fr);
  }
}

.tool-media {
  background: #080A0E;
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

@media (min-width: 860px) {
  .tool-media {
    border-bottom: 0;
    border-right: 1px solid var(--border-subtle);
    padding: 20px;
  }
}

.tool-cover {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
}

.tool-body {
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}

@media (min-width: 768px) {
  .tool-body {
    padding: 26px 28px;
  }
}

.tool-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.tool-index {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-secondary);
}

.tool-card[data-accent="quest"] .tool-index { color: var(--accent-quest); }
.tool-card[data-accent="mesh"] .tool-index { color: var(--accent-mesh); }
.tool-card[data-accent="splat"] .tool-index { color: var(--accent-splat); }

.price-block {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.price-jpy {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 900;
  color: #FFFFFF;
  line-height: 1;
}

.price-usd {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.tool-name {
  margin: 0 0 6px;
  font-size: clamp(1.25rem, 2.3vw, 1.6rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  line-height: 1.2;
}

.tool-headline {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.5;
}

.tool-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.tool-features li {
  position: relative;
  padding-left: 16px;
  font-size: 0.89rem;
  color: var(--ink-secondary);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.tool-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 6px;
  height: 6px;
  background: var(--ink-muted);
}

.tool-card[data-accent="quest"] .tool-features li::before { background: var(--accent-quest); }
.tool-card[data-accent="mesh"] .tool-features li::before { background: var(--accent-mesh); }
.tool-card[data-accent="splat"] .tool-features li::before { background: var(--accent-splat); }

.manifest-details {
  border: 1px solid var(--border-subtle);
  background: var(--surface-2);
}

.manifest-details summary {
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-secondary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.manifest-details summary::-webkit-details-marker {
  display: none;
}

.manifest-details summary::after {
  content: "+";
  font-weight: 800;
  color: var(--ink-muted);
}

.manifest-details[open] summary::after {
  content: "−";
}

.manifest-list {
  margin: 0;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border-subtle);
  list-style: none;
  display: grid;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-muted);
  overflow-wrap: anywhere;
}

.tool-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
}

.tool-compat-note {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-muted);
}

@media (max-width: 560px) {
  .tool-footer .btn {
    width: 100%;
  }
}

/* Bundle Panel */
.bundle-box {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  position: relative;
  overflow: hidden;
}

.bundle-bar {
  height: 4px;
  width: 100%;
  background: linear-gradient(90deg, var(--accent-quest) 0 33.33%, var(--accent-mesh) 33.33% 66.66%, var(--accent-splat) 66.66% 100%);
}

.bundle-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 24px 20px;
}

@media (min-width: 820px) {
  .bundle-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.85fr);
    padding: 34px 32px;
    align-items: center;
  }
}

.bundle-thumbs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.bundle-thumbs img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border);
}

.bundle-title {
  margin: 0 0 8px;
  font-size: clamp(1.3rem, 2.4vw, 1.85rem);
  font-weight: 900;
  color: #FFFFFF;
  line-height: 1.25;
}

.bundle-desc {
  margin: 0 0 18px;
  font-size: 0.94rem;
  color: var(--ink-secondary);
}

.bundle-includes {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--ink);
}

.bundle-includes li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.bundle-cta-panel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.bundle-compare {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.bundle-compare s {
  color: var(--ink-muted);
}

.bundle-save {
  color: var(--accent-quest);
  font-weight: 800;
  margin-left: 6px;
}

.bundle-price-main {
  font-family: var(--font-mono);
  font-size: 2.1rem;
  font-weight: 900;
  color: #FFFFFF;
  line-height: 1.05;
}

.bundle-price-sub {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-secondary);
  margin-top: 4px;
}

.bundle-payment-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink-muted);
  line-height: 1.55;
}

/* Interactive Specs Matrix & Quest Threshold Inspector */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.filter-tab {
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--ink-secondary);
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.filter-tab[aria-pressed="true"] {
  background: #F4F6F9;
  color: #07090D;
  border-color: #F4F6F9;
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  background: var(--surface);
}

.specs-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.specs-table th,
.specs-table td {
  text-align: left;
  padding: 13px 15px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.specs-table thead th {
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--border);
}

.specs-table tbody tr:last-child td {
  border-bottom: 0;
}

.specs-table tbody tr.is-hidden {
  display: none;
}

.specs-table td:last-child,
.specs-table th:last-child {
  white-space: nowrap;
}

.tool-tag {
  font-weight: 800;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

/* Quest Rank Reference Bar */
.quest-ref-box {
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
}

.quest-ref-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.quest-ref-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: #FFFFFF;
}

.rank-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rank-btn {
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--ink-secondary);
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
}

.rank-btn[aria-pressed="true"] {
  background: var(--accent-quest);
  color: #06100C;
  border-color: var(--accent-quest);
}

.quest-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 720px) {
  .quest-metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.q-metric {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  padding: 12px 14px;
  min-width: 0;
}

.q-metric-k {
  font-size: 0.74rem;
  font-family: var(--font-mono);
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.q-metric-v {
  font-size: 1.05rem;
  font-family: var(--font-mono);
  font-weight: 800;
  color: #FFFFFF;
}

.cli-snippet {
  margin-top: 16px;
  background: #07090D;
  border: 1px solid var(--border-subtle);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-splat);
  overflow-x: auto;
  white-space: pre;
  max-width: 100%;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
}

.faq-item summary {
  padding: 16px 18px;
  font-weight: 800;
  font-size: 0.95rem;
  color: #FFFFFF;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "−";
  color: var(--accent-quest);
}

.faq-answer {
  padding: 0 18px 18px;
  font-size: 0.9rem;
  color: var(--ink-secondary);
  line-height: 1.7;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
}

/* Footer */
.site-footer {
  padding: 36px 0 48px;
  background: #07090D;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.footer-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 720px) {
  .footer-grid {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
}

.footer-brand {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--ink);
  margin-bottom: 6px;
}

.footer-note {
  margin: 0;
  max-width: 58ch;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.footer-links a {
  color: var(--ink-secondary);
  border-bottom: 1px solid transparent;
}

.footer-links a:hover {
  color: #FFFFFF;
  border-bottom-color: var(--ink-secondary);
}

/* Checkout Drawer / Modal (when Whop URL is staging/unwired) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(5, 7, 10, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 24px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 900;
  color: #FFFFFF;
}

.modal-close {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink-secondary);
  width: 32px;
  height: 32px;
  font-family: var(--font-mono);
  font-weight: 700;
  flex-shrink: 0;
}

.modal-meta {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-quest);
  margin-bottom: 12px;
}

.modal-body {
  font-size: 0.88rem;
  color: var(--ink-secondary);
  margin: 0 0 18px;
  line-height: 1.65;
}

/* Language Visibility Rules */
html[lang="ja"] [data-lang="en"] {
  display: none !important;
}

html[lang="en"] [data-lang="ja"] {
  display: none !important;
}
