:root {
  --ink: #030303;
  --ink-soft: rgba(3, 3, 3, 0.56);
  --ink-faint: rgba(3, 3, 3, 0.4);
  --paper: #ffffff;
  --paper-warm: #f3f2ee;
  --paper-card: #ecebe6;
  --line: rgba(3, 3, 3, 0.12);
  --accent: #22d3ee;
  --success: #34d399;
  --nav-h: 88px;
  --gutter: 40px;
  --max: 1440px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Instrument Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Instrument Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --bg: var(--paper);
  --bg-elevated: var(--paper-card);
  --bg-input: #ffffff;
  --border: var(--line);
  --text: var(--ink);
  --text-muted: var(--ink-soft);
  --accent-dim: rgba(34, 211, 238, 0.16);
  --danger: #ef4444;
  --radius: 2px;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --shadow: 0 12px 32px rgba(3, 3, 3, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  overflow-x: hidden;
}

body.is-nav-open,
body.is-lang-open {
  overflow: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

ul {
  list-style: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ---------- chrome ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 80;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  color: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
}

.site-header * {
  pointer-events: auto;
}

.logo-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.logo-mark svg {
  width: 100%;
  height: 100%;
}

.nav-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-brand {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-links a {
  font-size: 15px;
  font-weight: 450;
  letter-spacing: 0.01em;
  opacity: 0.88;
  transition: opacity 0.25s var(--ease);
}

.nav-links a:hover,
.nav-links a.is-active {
  opacity: 1;
}

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

.lang-toggle,
.menu-toggle {
  min-height: 40px;
  padding: 0 4px;
  font-size: 14px;
  letter-spacing: 0.04em;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lang-toggle svg,
.menu-toggle svg {
  width: 12px;
  height: 12px;
}

.menu-toggle {
  display: none;
}

.site-header .cta-btn {
  background: transparent;
  color: inherit;
  box-shadow: inset 0 0 0 1px currentColor;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  min-height: 64px;
  padding: 0 24px 0 32px;
  background: #000;
  color: #fff;
  border-radius: 2px;
  font-size: 16px;
  transition: transform 0.35s var(--ease), background 0.25s ease;
}

.cta-btn .arrow {
  width: 42px;
  height: 1px;
  background: currentColor;
  position: relative;
}

.cta-btn .arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 1px solid currentColor;
  border-top: 1px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}

.cta-btn:hover {
  transform: translateX(3px);
}

.cta-btn.light {
  background: transparent;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

/* language panel */
.lang-panel {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
}

.lang-panel.is-open {
  display: block;
}

.lang-panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 3, 0.28);
}

.lang-panel-sheet {
  position: absolute;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100%;
  background: var(--paper-warm);
  color: var(--ink);
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.45s var(--ease);
}

@keyframes slideIn {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.lang-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 36px;
}

.lang-panel-head h2 {
  font-size: 36px;
  font-weight: 550;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.lang-close {
  width: 40px;
  height: 40px;
  font-size: 22px;
}

.lang-list {
  display: grid;
  gap: 0;
}

.lang-list button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: 18px;
  text-align: left;
}

.lang-list button.is-current {
  font-weight: 600;
}

.lang-list button span {
  color: var(--ink-faint);
  font-size: 13px;
}

/* mobile menu */
.mobile-menu {
  display: none;
}

/* ---------- shared section helpers ---------- */
.section {
  position: relative;
  padding: 120px var(--gutter) 100px;
}

.section-dark {
  background: #000;
  color: #fff;
}

.section-warm {
  background: var(--paper-warm);
}

.section-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  max-width: var(--max);
  margin: 0 auto;
}

.section-label {
  font-size: 15px;
  color: var(--ink-soft);
  padding-top: 8px;
}

.section-dark .section-label {
  color: rgba(255, 255, 255, 0.5);
}

.section-copy {
  max-width: 920px;
}

.display {
  font-family: var(--font-display);
  font-size: clamp(32px, 3.4vw, 52px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.lede {
  margin-top: 28px;
  max-width: 640px;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.section-dark .lede,
.page-hero .lede {
  color: #fff;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

/* ---------- footer ---------- */
.site-footer {
  background: #000;
  color: #fff;
  padding: 56px var(--gutter) 40px;
}

.footer-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-brand {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.footer-brand p {
  margin-top: 14px;
  max-width: 32ch;
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
}

.footer-col h4 {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  padding: 5px 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
}

.footer-col a:hover {
  color: #fff;
}

.footer-base {
  max-width: var(--max);
  margin: 48px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
}

/* ---------- inner pages ---------- */
.page-hero {
  padding: 160px var(--gutter) 80px;
  background: #000;
  color: #fff;
}

.page-hero .section-grid {
  align-items: end;
}

.page-hero .display {
  max-width: 16ch;
}

.page-body {
  padding: 80px var(--gutter) 120px;
}

.page-panel {
  max-width: 860px;
  margin: 0 auto;
  background: var(--paper-warm);
  padding: 40px;
}

.page-panel p + p {
  margin-top: 16px;
}

.page-panel .hero-cta-row {
  margin-top: 28px;
}

.page-panel .faq-quote,
.page-panel .tech-list {
  margin-top: 8px;
}

.faq-quote {
  margin-top: 72px;
}

.faq-item + .faq-item {
  margin-top: 8px;
}

.faq-q {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 20px;
  align-items: start;
  text-align: left;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 550;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.faq-marks {
  font-size: 28px;
  line-height: 0.8;
}

.faq-num {
  color: var(--ink-faint);
  font-size: 14px;
  padding-top: 6px;
}

.faq-a {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding-left: 48px;
  max-width: 720px;
  color: var(--ink-soft);
  transition: max-height 0.4s var(--ease), opacity 0.3s ease, padding 0.3s ease;
}

.faq-item.is-open .faq-a {
  max-height: 200px;
  opacity: 1;
  padding-bottom: 22px;
}

.tech-list {
  margin-top: 20px;
  border-top: 1px solid var(--line);
}

.tech-row {
  width: 100%;
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.tech-row strong {
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tech-row span {
  font-size: 18px;
  font-weight: 500;
}

.tech-row b {
  display: inline-block;
  transition: transform 0.4s var(--ease);
}

.tech-item.is-open .tech-row b {
  transform: rotate(180deg);
}

.tech-detail {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0 0 0 184px;
  color: var(--ink-soft);
  max-width: 760px;
  transition: max-height 0.4s var(--ease), opacity 0.3s ease, padding 0.3s ease;
}

.tech-item.is-open .tech-detail {
  max-height: 200px;
  opacity: 1;
  padding: 22px 0 22px 184px;
}

@media (max-width: 1100px) {
  .nav-links { display: none; }
  .menu-toggle { display: inline-flex; align-items: center; }
  .cta-btn { min-height: 48px; padding: 0 16px 0 18px; gap: 16px; font-size: 14px; }
  .section-grid { grid-template-columns: 1fr; gap: 16px; }
  .section-label { padding-top: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .tech-row { grid-template-columns: 1fr auto; }
  .tech-detail,
  .tech-item.is-open .tech-detail { padding-left: 0; }
}

@media (max-width: 720px) {
  :root { --gutter: 20px; --nav-h: 72px; }
  .nav-center { display: none; }
  .section { padding: 80px var(--gutter) 72px; }
  .cta-btn { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 85;
    background: #000;
    color: #fff;
    padding: 100px 28px 40px;
  }
  .mobile-menu.is-open { display: flex; flex-direction: column; gap: 22px; }
  .mobile-menu a {
    font-size: 32px;
    font-weight: 550;
    letter-spacing: -0.03em;
  }
  .faq-q { grid-template-columns: 20px 1fr auto; font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- tool forms (shared; page CSS extends these) ---------- */
.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;
}

.is-hidden { display: none !important; }

.mode-switch {
  display: flex;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  border: none;
}

.mode-option {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  cursor: pointer;
}

.mode-option input { position: absolute; opacity: 0; pointer-events: none; }

.mode-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  padding: 10px 12px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.mode-option input:checked + span {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.config-block {
  padding: 20px;
  margin-bottom: 20px;
  background: #fff;
  border: 1px solid var(--line);
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.field-row:last-child { margin-bottom: 0; }

.field-row label {
  min-width: 88px;
  font-size: 14px;
  color: var(--ink-soft);
}

.field-inline {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
}

.field-inline input[type="range"] {
  flex: 1;
  accent-color: var(--ink);
}

.input-num,
.input-text,
select.input-text,
textarea.input-text {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.input-num { width: 72px; }
.input-text { flex: 1; min-width: 120px; }
.input-short { max-width: 80px; }

.input-num:focus,
.input-text:focus,
select.input-text:focus,
textarea.input-text:focus {
  outline: none;
  border-color: var(--ink);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: #000;
  color: #fff;
}

.btn-outline,
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-block { width: 100%; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.hint {
  margin: 0 0 16px;
  font-size: 13px;
  color: #b45309;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  padding: 10px 20px;
  background: #000;
  color: #fff;
  border-radius: var(--radius);
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.page-seo-wrap {
  padding: 0 var(--gutter) 100px;
  max-width: var(--max);
  margin: 0 auto;
}

.page-seo {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.page-seo-block { padding: 40px 0 4px; }

.page-seo-block h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.page-seo-block > p,
.page-seo-lead {
  margin: 14px 0 0;
  max-width: 720px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.7;
}

.page-seo-block p + p { margin-top: 12px; }

.page-seo-block > ul {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.page-seo-block > ul li {
  position: relative;
  margin: 0;
  padding: 12px 16px 12px 36px;
  border: 1px solid var(--line);
  background: var(--paper-warm);
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.65;
}

.page-seo-block > ul li::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 1.2em;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  background: var(--ink);
}

.page-seo-block > p a,
.page-seo-block > ul a,
.page-seo-lead a,
.page-faq-item a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-seo-related {
  margin: 18px 0 0;
  display: grid;
  gap: 10px;
}

.page-seo-related a {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: var(--paper-warm);
}

.page-seo-related strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.page-seo-related span {
  color: var(--ink-soft);
  font-size: 14px;
}

.page-faq-list {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.page-faq-item {
  border: 1px solid var(--line);
  background: #fff;
}

.page-faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  font-weight: 600;
}

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

.page-faq-item summary::after {
  content: "+";
  float: right;
  color: var(--ink-faint);
}

.page-faq-item[open] summary::after { content: "–"; }

.page-faq-item p {
  margin: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0 16px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.65;
  transition: max-height 0.4s var(--ease), opacity 0.3s ease, padding 0.3s ease;
}

.page-faq-item[open] p {
  max-height: 240px;
  opacity: 1;
  padding-bottom: 16px;
}

.field-col { display: flex; flex-direction: column; align-items: stretch; gap: 4px; width: 100%; }
.field-col label { min-width: unset; margin-bottom: 4px; }
.field-secret { position: relative; }
.field-secret .input-text { padding-right: 44px; }

.crypto-hint {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--ink-soft);
}

.crypto-hint.is-hidden { display: none; }

.crypto-io {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.crypto-io-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.crypto-io-col label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--ink-soft);
}

.crypto-textarea {
  display: block;
  width: 100%;
  min-height: 260px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
  resize: vertical;
}

.crypto-textarea:focus {
  outline: none;
  border-color: var(--ink);
}

.page-panel.tool-panel {
  max-width: 920px;
}

@media (max-width: 720px) {
  .page-seo-wrap { padding-bottom: 72px; }
  .page-seo-block { padding: 28px 0 4px; }
  .crypto-io { grid-template-columns: 1fr; }
}
