/* SoiPanic – landing, support, privacy */

:root {
  --paper: #eef1f1;
  --paper-2: #e2e7e8;
  --ink: #0e1726;
  --ink-2: #465264;
  --ink-3: #6b7686;
  --rule: #c8d0d3;
  --fault: #c93434;
  --signal: #0a7a89;

  /* the bench = the app's own navy */
  --bench: #0e1726;
  --bench-2: #132036;
  --bench-line: #24344f;
  --bench-text: #d9e2ee;
  --bench-dim: #8a99ae;
  --bench-fault: #ff7070;
  --bench-signal: #4fd5e5;

  --sans: "Be Vietnam Pro", "Hiragino Sans", "Apple SD Gothic Neo", "Noto Sans JP", "Noto Sans KR", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
b, strong { font-weight: 600; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--paper-2); padding: 0.1em 0.35em; border-radius: 3px; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 2px; }

.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;
}
.skip { position: absolute; left: 16px; top: -48px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 50; text-decoration: none; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

h1, h2, h3 { font-weight: 700; line-height: 1.15; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.05rem); margin-bottom: 32px; }
h3 { font-size: 1.0625rem; font-weight: 600; letter-spacing: 0; line-height: 1.35; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  border-bottom: 1px solid var(--rule);
}
.bar { display: flex; align-items: center; gap: 32px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.brand img { border-radius: 8px; }
.nav { display: flex; gap: 26px; font-size: 0.94rem; }
.nav a { text-decoration: none; color: var(--ink-2); padding: 4px 0; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.bar-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.lang select {
  font: inherit; font-size: 0.9rem; color: var(--ink);
  background: transparent; border: 1px solid var(--rule); border-radius: 6px;
  padding: 6px 28px 6px 10px; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23465264' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.nav-toggle { display: none; background: none; border: 0; color: var(--ink); padding: 6px; cursor: pointer; }

/* ---------- buttons ---------- */
.btn {
  font: inherit; font-weight: 600; font-size: 0.95rem;
  background: var(--bench-signal); color: var(--bench);
  border: 0; border-radius: 8px; padding: 10px 18px; cursor: pointer;
}
.btn:hover { background: #7ae3ef; }

.store {
  display: inline-flex; align-items: center; gap: 10px;
  background: #000; color: #fff; text-decoration: none;
  border-radius: 10px; padding: 9px 18px 9px 14px;
  font-weight: 600; font-size: 1.2rem; line-height: 1.05; letter-spacing: -0.01em;
}
.store svg { width: 26px; height: 26px; fill: currentColor; }
.store small { display: block; font-size: 0.68rem; font-weight: 500; letter-spacing: 0; opacity: 0.85; }
.store:hover { background: #1c1c1e; }

/* ---------- hero ---------- */
.hero { padding: 72px 0 96px; }
.hero-grid {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px;
  align-items: end; margin-bottom: 48px;
}
.hero h1 { font-size: clamp(2.3rem, 4.8vw, 3.55rem); line-height: 1.06; letter-spacing: -0.028em; max-width: 15ch; }
.hero-side { display: grid; gap: 22px; justify-items: start; }
.lede { color: var(--ink-2); max-width: 46ch; }
.fine { font-size: 0.88rem; color: var(--ink-3); max-width: 46ch; }

/* ---------- bench (demo) ---------- */
.bench { background: var(--bench); color: var(--bench-text); border-radius: 14px; overflow: hidden; }

.bench-tabs { display: flex; gap: 4px; padding: 0 16px; border-bottom: 1px solid var(--bench-line); overflow-x: auto; scrollbar-width: none; }
.bench-tabs button {
  font: inherit; font-size: 0.9rem; color: var(--bench-dim); white-space: nowrap;
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 14px 12px 12px; cursor: pointer;
}
.bench-tabs button span { font-family: var(--mono); font-size: 0.8rem; margin-left: 4px; }
.bench-tabs button:hover { color: var(--bench-text); }
.bench-tabs button[aria-selected="true"] { color: #fff; border-bottom-color: var(--bench-signal); }
.bench-tabs button[data-sample="custom"] { margin-left: auto; }

.bench-body { display: grid; grid-template-columns: 1.2fr 1fr; min-height: 420px; }

.log-pane { display: flex; flex-direction: column; min-width: 0; }
.log-head { padding: 14px 20px 0; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.log-edit-btn { font: inherit; font-size: 0.82rem; color: var(--bench-signal); background: none; border: 0; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.log-file { font-family: var(--mono); font-size: 0.78rem; color: var(--bench-dim); }

.log-view {
  list-style: none; padding: 12px 0 20px; counter-reset: ln;
  font-family: var(--mono); font-size: 0.8rem; line-height: 1.7;
  overflow: auto; max-height: 460px; position: relative;
}
.log-view li {
  counter-increment: ln;
  display: grid; grid-template-columns: 3.2em 1fr;
  padding-right: 20px;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.log-view li::before { content: counter(ln); color: #4c5d78; text-align: right; padding-right: 1.1em; user-select: none; }
.log-view li.is-fault { background: rgba(255, 112, 112, 0.11); box-shadow: inset 3px 0 0 var(--bench-fault); color: #ffd0d0; }
.log-view li.is-fault::before { color: var(--bench-fault); }
.log-view li.is-fault.flash { animation: mark 0.9s ease-out; }
@keyframes mark { from { background: rgba(255, 112, 112, 0.42); } to { background: rgba(255, 112, 112, 0.11); } }

.log-edit { display: flex; flex-direction: column; gap: 12px; padding: 12px 20px 20px; flex: 1; }
.log-edit textarea {
  flex: 1; min-height: 300px; resize: vertical;
  font-family: var(--mono); font-size: 0.8rem; line-height: 1.6;
  color: var(--bench-text); background: var(--bench-2);
  border: 1px solid var(--bench-line); border-radius: 8px; padding: 12px 14px;
}
.log-edit textarea::placeholder { color: var(--bench-dim); }
.log-edit .btn { align-self: flex-start; }

.diag-pane { border-left: 1px solid var(--bench-line); padding: 28px 28px 32px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.diag-src { font-size: 0.82rem; color: var(--bench-dim); }
.diag-src b { color: var(--bench-fault); font-weight: 600; }
.diag-pane h3 { font-size: 1.3rem; line-height: 1.3; color: #fff; letter-spacing: -0.01em; }
.diag-model { font-size: 0.85rem; color: var(--bench-dim); margin-top: 6px; }
.diag-tag {
  display: inline-block; font-size: 0.78rem; font-weight: 500;
  color: var(--bench-signal); border: 1px solid rgba(79, 213, 229, 0.4);
  border-radius: 999px; padding: 2px 10px; margin-top: 10px;
}
.diag-reason { font-size: 0.95rem; color: var(--bench-text); }
.nets { display: flex; flex-wrap: wrap; gap: 6px; }
.nets span {
  font-family: var(--mono); font-size: 0.76rem; color: var(--bench-signal);
  background: #0a1220; border: 1px solid var(--bench-line); border-radius: 4px; padding: 2px 8px;
}
.diag-steps h4 { font-size: 0.9rem; font-weight: 600; color: #fff; margin-bottom: 8px; }
.diag-steps ol { list-style: none; padding: 0; counter-reset: st; display: grid; gap: 8px; }
.diag-steps li { counter-increment: st; position: relative; padding-left: 1.6em; font-size: 0.9rem; color: var(--bench-text); }
.diag-steps li::before { content: counter(st) "."; position: absolute; left: 0; color: var(--bench-signal); font-weight: 600; }
.diag-empty { color: var(--bench-dim); font-size: 0.95rem; margin: auto 0; max-width: 34ch; }
.diag-empty a { color: var(--bench-signal); }

.bench-foot { font-size: 0.82rem; color: var(--bench-dim); padding: 14px 20px; border-top: 1px solid var(--bench-line); }

/* ---------- sections ---------- */
.section { padding: 88px 0; border-top: 1px solid var(--rule); }

.screens { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.screens figure { display: grid; gap: 18px; align-content: start; }
.screens img { border-radius: 26px; border: 1px solid rgba(14, 23, 38, 0.18); background: var(--bench); }
.screens figcaption p { font-size: 0.93rem; color: var(--ink-2); margin-top: 4px; }

.notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px 40px; }
.notes > div { border-top: 1px solid var(--ink); padding-top: 14px; }
.notes p { font-size: 0.95rem; color: var(--ink-2); margin-top: 6px; max-width: 40ch; }

.split { display: grid; grid-template-columns: 1fr 1.25fr; gap: 56px; }
.split h2 { margin-bottom: 14px; }
.split > div p { color: var(--ink-2); max-width: 38ch; }
.steps { list-style: none; padding: 0; counter-reset: st; }
.steps li {
  counter-increment: st; position: relative;
  padding: 14px 0 14px 2.4em; border-bottom: 1px solid var(--rule);
}
.steps li:first-child { border-top: 1px solid var(--rule); }
.steps li::before { content: counter(st); position: absolute; left: 0; font-weight: 700; color: var(--signal); font-variant-numeric: tabular-nums; }

.closing { background: var(--paper-2); padding: 48px 0; }
.closing-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.closing-row img { border-radius: 14px; }
.closing-row p { font-size: 1.2rem; font-weight: 600; margin-right: auto; }

/* ---------- footer ---------- */
.site-footer { padding: 28px 0 40px; font-size: 0.88rem; color: var(--ink-3); }
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- support / privacy ---------- */
.doc { max-width: 72ch; padding: 64px 24px 96px; margin: 0 auto; }
.doc h1 { font-size: clamp(2rem, 4vw, 2.6rem); letter-spacing: -0.025em; margin-bottom: 12px; }
.doc .lede { margin-bottom: 40px; }
.doc h2 { font-size: 1.3rem; margin: 44px 0 12px; letter-spacing: -0.01em; }
.doc h3 { margin: 24px 0 8px; }
.doc p, .doc li { color: var(--ink-2); }
.doc p + p { margin-top: 12px; }
.doc ul, .doc ol { padding-left: 1.3em; margin: 10px 0; display: grid; gap: 6px; }
.doc a { color: var(--signal); }
.doc strong { color: var(--ink); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin-bottom: 28px; flex-wrap: wrap; }
.tabs button {
  font: inherit; font-size: 0.92rem; color: var(--ink-2); background: none; cursor: pointer;
  border: 0; border-bottom: 2px solid transparent; padding: 10px 12px;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--signal); font-weight: 600; }
.policy[hidden] { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero-grid, .split { grid-template-columns: 1fr; gap: 28px; }
  .hero h1 { max-width: 18ch; }
  .bench-body { grid-template-columns: 1fr; }
  .diag-pane { border-left: 0; border-top: 1px solid var(--bench-line); }
  .log-view { max-height: 320px; }
  .notes { grid-template-columns: 1fr 1fr; }
  .screens { grid-template-columns: repeat(4, 62%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; }
  .screens figure { scroll-snap-align: start; }
}

@media (max-width: 720px) {
  .bar { gap: 12px; }
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px 24px 16px;
    background: var(--paper); border-bottom: 1px solid var(--rule);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 1rem; }
  .hero { padding: 44px 0 64px; }
  .section { padding: 64px 0; }
  .notes { grid-template-columns: 1fr; gap: 28px; }
  .screens { grid-template-columns: repeat(4, 74%); }
  .bench-tabs button[data-sample="custom"] { margin-left: 0; }
  .diag-pane { padding: 22px 20px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .log-view li.is-fault.flash { animation: none; }
}
