:root {
  --ink: #0d0d0d;
  --ink-2: #131313;
  --card: #151515;
  --card-2: #1a1a1a;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --cream: #ebe8e0;
  --on-cream: #101010;
  --on-ink: #f4f2ee;
  --muted: rgba(244, 242, 238, 0.62);
  --muted-2: rgba(244, 242, 238, 0.4);
  --radius-panel: 32px;
  --radius-card: 22px;
  --page: min(1100px, 100% - 48px);
  --doc: min(760px, 100%);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.36, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 110px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--on-ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.glow {
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 120vh;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(42vw 42vw at 18% 12%, rgba(235, 232, 224, 0.09), transparent 62%),
    radial-gradient(38vw 38vw at 82% 30%, rgba(140, 170, 255, 0.06), transparent 64%);
  filter: blur(18px);
  animation: drift 46s var(--ease) infinite alternate;
  will-change: transform;
}

@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(3%, 4%, 0) scale(1.08); }
}

.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  transform: scaleX(var(--p, 0));
  transform-origin: left center;
  background: linear-gradient(90deg, rgba(235, 232, 224, 0.25), var(--cream));
  transition: transform 0.12s linear;
}

.shell { width: var(--page); margin-inline: auto; }

.mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(13, 13, 13, 0.82);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: var(--page);
  margin-inline: auto;
  padding-block: 18px;
}

.brand {
  display: block;
  width: 32px;
  height: 32px;
  color: var(--on-ink);
  background-color: currentColor;
  -webkit-mask: url('/logo-mark.png') no-repeat center / contain;
  mask: url('/logo-mark.png') no-repeat center / contain;
  text-indent: -9999px;
  overflow: hidden;
  flex: none;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--muted);
  transition: color 0.25s var(--ease);
}

.nav-item:hover { color: var(--on-ink); }
.nav-item svg { flex: none; }

.lang { position: relative; display: flex; }

.lang-trigger { padding: 0; transition: opacity 0.3s var(--ease); }
.lang-trigger:hover { opacity: 0.7; }

.lang-panel {
  position: absolute;
  top: calc(100% + 16px);
  right: 0;
  min-width: 188px;
  padding: 7px;
  border-radius: 22px;
  background: rgba(20, 19, 17, 0.92);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.5);
  display: grid;
  gap: 2px;
  transform-origin: top right;
  opacity: 0;
  transform: scale(0.94) translateY(-10px);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.45s var(--spring);
}

.lang.open .lang-panel {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.lang-panel button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 11px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(244, 242, 238, 0.62);
  white-space: nowrap;
  transition: color 0.3s var(--ease), background 0.35s var(--ease);
}

.lang-panel button:hover { color: #f4f2ee; background: rgba(255, 255, 255, 0.07); }
.lang-panel button.active { color: #101010; background: #f4f2ee; }
.lang-panel .tick { opacity: 0; }
.lang-panel button.active .tick { opacity: 1; }

.doc { padding-block: clamp(48px, 7vw, 92px) clamp(56px, 8vw, 104px); }

.doc-head { max-width: var(--doc); }

.doc-head .eyebrow { color: var(--muted-2); margin: 0 0 20px; }

.doc h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.doc-lede {
  margin: 22px 0 0;
  font-size: clamp(16px, 1.7vw, 19px);
  color: var(--muted);
  max-width: 62ch;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.chip {
  padding: 8px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
}

.doc-layout {
  display: grid;
  gap: 48px;
  align-items: start;
  margin-top: 52px;
}

@media (min-width: 1040px) {
  .doc-layout { grid-template-columns: 248px minmax(0, 1fr); gap: 72px; }
  .doc-layout .toc { position: sticky; top: 96px; margin-top: 0; }
  .doc-layout .doc-body { margin-top: 0; }
}

.toc {
  margin-top: 44px;
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--card);
  max-width: var(--doc);
}

.toc h2 { margin: 0 0 16px; color: var(--muted-2); font-size: 11px; font-weight: 500; }

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
  display: grid;
  gap: 2px;
}

.toc li { counter-increment: toc; }

.toc a {
  display: flex;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 11px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted-2);
  transition: color 0.3s var(--ease), background 0.35s var(--ease);
}

.toc a::before {
  content: counter(toc) ".";
  color: rgba(244, 242, 238, 0.28);
  font-variant-numeric: tabular-nums;
  min-width: 18px;
  transition: color 0.3s var(--ease);
}

.toc a:hover { color: var(--on-ink); background: rgba(255, 255, 255, 0.05); }

.toc a.active {
  color: var(--on-ink);
  background: rgba(255, 255, 255, 0.08);
}

.toc a.active::before { color: var(--cream); }

.toc.plain ol { counter-reset: none; }
.toc.plain a::before { content: none; }

.doc-body { max-width: var(--doc); margin-top: 56px; counter-reset: sec; }

.doc-body section + section { margin-top: 46px; }

.doc-body section { counter-increment: sec; }

.doc-body h2 {
  margin: 0 0 18px;
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.doc-body h2::before {
  content: counter(sec) ". ";
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.doc-body.plain { counter-reset: none; }
.doc-body.plain section { counter-increment: none; }
.doc-body.plain h2::before { content: none; }

.doc-body h3 {
  margin: 30px 0 14px;
  font-size: 17px;
  font-weight: 600;
}

.doc-body p { margin: 0 0 14px; color: var(--muted); }
.doc-body p:last-child { margin-bottom: 0; }

.doc-body ul {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.doc-body ul li {
  position: relative;
  padding-left: 20px;
  color: var(--muted);
}

.doc-body ul li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--line-strong);
}

.doc-body a:not(.btn) {
  color: var(--on-ink);
  border-bottom: 1px solid var(--line-strong);
  transition: border-color 0.25s var(--ease);
}

.doc-body a:not(.btn):hover { border-color: var(--on-ink); }

.doc-body strong { color: var(--on-ink); font-weight: 600; }

.note {
  margin: 26px 0 0;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--cream);
  border-radius: 14px;
  background: var(--ink-2);
  color: var(--muted);
  font-size: 15px;
}

.note p { margin: 0 0 10px; }
.note p:last-child { margin-bottom: 0; }

.table-wrap {
  margin: 22px 0 14px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--card);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  min-width: 560px;
}

th, td {
  padding: 16px 20px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

thead th {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

tbody th { font-weight: 600; color: var(--on-ink); white-space: nowrap; }
tbody td { color: var(--muted); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }

.price-cell {
  font-size: 20px;
  font-weight: 700;
  color: var(--on-ink);
  white-space: nowrap;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 44px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px 26px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--card);
  transition: border-color 0.3s var(--ease), transform 0.4s var(--ease);
}

.contact-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }

.contact-card .glyph {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--cream);
  margin-bottom: 4px;
}

.contact-card h3 { margin: 0; font-size: 17px; font-weight: 600; }
.contact-card p { margin: 0; font-size: 14px; color: var(--muted-2); }

.contact-card .handle {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  color: var(--cream);
  word-break: break-all;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  transition: transform 0.4s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.btn:hover { transform: translateY(-2px); }
.btn-light { background: #f4f2ee; color: #101010; }
.btn-light:hover { background: #fff; }

.btn-outline { border: 1px solid var(--line-strong); color: var(--on-ink); }
.btn-outline:hover { border-color: rgba(255, 255, 255, 0.42); }

.doc-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
  max-width: var(--doc);
}

footer { padding-block: 40px 44px; border-top: 1px solid var(--line); }

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.foot-links { display: flex; flex-wrap: wrap; gap: 22px; }
.foot-links a { font-size: 14px; color: var(--muted); transition: color 0.25s var(--ease); }
.foot-links a:hover { color: var(--on-ink); }
.foot-bottom { margin-top: 22px; color: var(--muted-2); font-size: 13px; }

.rise {
  opacity: 0;
  filter: blur(14px);
  transform: translateY(22px);
  transition: opacity 1s var(--ease), filter 1.1s var(--ease), transform 1.1s var(--ease);
  transition-delay: var(--delay, 0ms);
}

.rise.in { opacity: 1; filter: blur(0); transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise { opacity: 1; filter: none; transform: none; transition: none; }
  .glow { animation: none; }
  .progress span { transition: none; }
}

@media (max-width: 720px) {
  :root { --page: min(1100px, 100% - 32px); }
  .nav-item .label { display: none; }
  .toc { padding: 22px 20px; }
  .doc-body { margin-top: 42px; }
}
