/* ============================================================
   Filebench — a workbench, not a website.
   Paper, ink, one signal colour, hairline rules.
   ============================================================ */

@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f4f1ea;
  --paper-2: #fbf9f4;
  --paper-3: #efe9dd;
  --ink: #17160f;
  --ink-2: #5c5749;
  --ink-3: #8d8778;
  --line: rgba(23, 22, 15, 0.14);
  --line-strong: rgba(23, 22, 15, 0.42);
  --accent: #d9491c;
  --accent-soft: #f6e2d6;
  --ok: #2c6349;
  --grid: rgba(23, 22, 15, 0.035);

  --font-display: "Instrument Serif", "Noto Serif SC", "Source Han Serif SC",
    "Songti SC", "STSong", "SimSun", serif;
  --font-body: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei",
    "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas,
    "Liberation Mono", monospace;

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

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.42'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.07em;
}

[hidden] {
  display: none !important;
}

/* ---------------- header ---------------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  padding: 0 24px;
  background: rgba(244, 241, 234, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ink);
  animation: rise 0.5s var(--ease) both;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--ink);
  border: 1px solid var(--ink);
  background: var(--paper-2);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
}

.brand:hover .brand-mark {
  transform: rotate(-90deg);
  background: var(--accent);
  color: var(--paper-2);
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.brand-name {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.16em;
}

.brand-sub {
  font-size: 11.5px;
  color: var(--ink-2);
  letter-spacing: 0.04em;
}

.head-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.badge-local {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  font-size: 10px;
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
}

.badge-local i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(44, 99, 73, 0.14);
}

.lang-toggle {
  padding: 6px 11px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.lang-toggle:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ---------------- layout ---------------- */

.layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  max-width: 1280px;
  margin: 0 auto;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-height: min(720px, calc(100vh - 64px));
}

.index {
  position: sticky;
  top: 64px;
  align-self: start;
  height: calc(100vh - 64px);
  padding: 30px 18px 24px 20px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(251, 249, 244, 0.5), transparent 40%);
}

.index-label {
  margin: 0 0 16px;
  font-size: 9.5px;
  color: var(--ink-3);
  text-transform: uppercase;
}

.tool-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tool-link {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: baseline;
  gap: 6px;
  padding: 10px 10px 10px 8px;
  color: var(--ink-2);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.2s var(--ease), background 0.2s var(--ease),
    border-color 0.2s var(--ease), transform 0.2s var(--ease);
  animation: rise 0.5s var(--ease) both;
  animation-delay: calc(var(--i) * 45ms + 120ms);
}

.tool-link .num {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

.tool-link .name {
  font-size: 14px;
  line-height: 1.35;
}

.tool-link:hover {
  color: var(--ink);
  background: rgba(251, 249, 244, 0.8);
  transform: translateX(2px);
}

.tool-link.is-active {
  color: var(--ink);
  border-left-color: var(--accent);
  background: var(--paper-2);
}

.tool-link.is-active .num {
  color: var(--accent);
}

.tool-link.is-active .name {
  font-weight: 600;
}

.index-foot {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
}

.index-foot p {
  margin: 0 0 5px;
  font-size: 9px;
  text-transform: uppercase;
}

/* ---------------- workbench ---------------- */

.workbench {
  padding: 44px clamp(20px, 4vw, 54px) 72px;
  min-width: 0;
  animation: rise 0.55s var(--ease) both;
}

.panel-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 30px;
}

.panel-num {
  padding-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(36px, 4.4vw, 54px);
  line-height: 0.98;
  letter-spacing: -0.015em;
}

.panel-desc {
  max-width: 50ch;
  margin: 10px 0 0;
  color: var(--ink-2);
  font-size: 14px;
}

.panel-tag {
  justify-self: start;
  margin-top: 14px;
  padding: 4px 8px;
  font-size: 9px;
  text-transform: uppercase;
  color: var(--ink-2);
  border: 1px solid var(--line);
}

/* dropzone */

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 216px;
  padding: 34px 22px;
  text-align: center;
  border: 1.5px dashed var(--line-strong);
  background: rgba(251, 249, 244, 0.55);
  cursor: pointer;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease),
    transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.stage:hover,
.stage:focus-visible {
  border-color: var(--ink);
  background: var(--paper-2);
  box-shadow: 4px 4px 0 rgba(217, 73, 28, 0.14);
  transform: translateY(-2px);
  outline: none;
}

.stage.is-over {
  border-color: var(--accent);
  border-style: solid;
  background: var(--accent-soft);
  transform: scale(0.994);
  box-shadow: none;
}

.stage-icon {
  color: var(--ink);
  opacity: 0.9;
  transition: transform 0.3s var(--ease);
}

.stage:hover .stage-icon {
  transform: translateY(3px);
}

.stage-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 25px;
  line-height: 1.15;
}

.stage-sub {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.corner {
  position: absolute;
  width: 11px;
  height: 11px;
  border-color: var(--ink);
  border-style: solid;
  border-width: 0;
  opacity: 0.55;
}.corner.tl { top: 9px; left: 9px; border-top-width: 1px; border-left-width: 1px; }
.corner.tr { top: 9px; right: 9px; border-top-width: 1px; border-right-width: 1px; }
.corner.bl { bottom: 9px; left: 9px; border-bottom-width: 1px; border-left-width: 1px; }
.corner.br { bottom: 9px; right: 9px; border-bottom-width: 1px; border-right-width: 1px; }

/* once files are on the bench the dropzone shrinks to a slim strip */
.stage.is-compact {
  min-height: 0;
  flex-direction: row;
  justify-content: flex-start;
  gap: 14px;
  padding: 16px 20px;
  text-align: left;
  border-style: dashed;
}

.stage.is-compact .stage-icon {
  transform: none;
  opacity: 0.7;
}

.stage.is-compact .stage-title {
  font-size: 15px;
}

.stage.is-compact .stage-sub {
  font-size: 9px;
}

.stage.is-compact .corner {
  display: none;
}

/* options */

.opts {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 30px;
  margin-top: 22px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 132px;
}

.field > label,
.field > .field-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

select,
input[type="text"],
input[type="number"] {
  padding: 8px 10px;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

select:focus,
input[type="text"]:focus,
input[type="number"]:focus {
  border-color: var(--accent);
  box-shadow: 2px 2px 0 rgba(217, 73, 28, 0.18);
}

input[type="range"] {
  width: 150px;
  accent-color: var(--accent);
  cursor: pointer;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.range-val {
  min-width: 42px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
}

.pos-grid {
  display: grid;
  grid-template-columns: repeat(3, 22px);
  gap: 3px;
}

.pos-grid button {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
  cursor: pointer;
  transition: background 0.15s var(--ease);
}

.pos-grid button:hover {
  background: var(--paper-3);
}

.pos-grid button.is-active {
  background: var(--accent);
  border-color: var(--accent);
}

/* actions */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}

.btn {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid var(--ink);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
    background 0.18s var(--ease), color 0.18s var(--ease);
}

.btn-primary {
  padding: 13px 26px;
  color: var(--paper);
  background: var(--ink);
  box-shadow: 4px 4px 0 var(--accent);
}

.btn-primary:hover:not(:disabled) {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--accent);
}

.btn-primary:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--accent);
}

.btn-primary:disabled {
  color: var(--ink-3);
  background: var(--paper-3);
  border-color: var(--line-strong);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-wide {
  width: 100%;
  margin-top: 22px;
}

.btn-ghost {
  padding: 9px 14px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line-strong);
  cursor: pointer;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease),
    background 0.18s var(--ease);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--paper-2);
}

.btn-ghost:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.limit-hint {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.limit-hint button {
  padding: 0;
  font: inherit;
  color: var(--accent);
  background: none;
  border: 0;
  border-bottom: 1px solid currentColor;
  cursor: pointer;
}

/* file list */

.filelist {
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.file-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 13px 2px;
  border-bottom: 1px solid var(--line);
  animation: rise 0.35s var(--ease) both;
}

.file-idx {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--ink-3);
}

.file-main {
  min-width: 0;
}

.file-name {
  overflow: hidden;
  font-size: 13.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
}

.file-meta .delta {
  color: var(--ok);
}

.file-size {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
  white-space: nowrap;
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease),
    background 0.15s var(--ease);
}

.icon-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--paper-2);
}

.tag-status {
  padding: 3px 7px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--ink-3);
}

.tag-status[data-status="working"] {
  color: var(--accent);
  border-color: var(--accent);
}

.tag-status[data-status="done"] {
  color: var(--ok);
  border-color: rgba(44, 99, 73, 0.4);
}

.tag-status[data-status="error"] {
  color: #a13a1a;
  border-color: rgba(161, 58, 26, 0.4);
}

.spinner {
  width: 11px;
  height: 11px;
  border: 1.5px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* empty + errors */

.empty-note {
  margin: 26px 0 0;
  padding: 18px;
  font-size: 12.5px;
  color: var(--ink-3);
  border: 1px dashed var(--line);
}

/* ---------------- notes ---------------- */

.notes {
  border-top: 1px solid var(--ink);
  background: var(--paper-2);
}

.notes-inner {
  display: grid;
  grid-template-columns: 1.05fr 1.2fr;
  gap: clamp(30px, 5vw, 72px);
  max-width: 1280px;
  margin: 0 auto;
  padding: 72px clamp(20px, 4vw, 54px);
}

.kicker {
  margin: 0 0 14px;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.notes-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.04;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.notes-lede {
  max-width: 46ch;
  margin: 18px 0 0;
  color: var(--ink-2);
  font-size: 14px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.steps li {
  padding-top: 14px;
  border-top: 1px solid var(--ink);
}

.step-num {
  display: block;
  margin-bottom: 10px;
  font-size: 9.5px;
  color: var(--accent);
}

.steps h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
}

.steps p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

/* ---------------- footer ---------------- */

.site-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px clamp(20px, 4vw, 54px);
  border-top: 1px solid var(--line);
  color: var(--ink-3);
}

.site-foot p {
  margin: 0;
  font-size: 9px;
  letter-spacing: 0.12em;
}

/* ---------------- modal ---------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(244, 241, 234, 0.78);
  backdrop-filter: blur(7px);
  animation: fade 0.2s var(--ease) both;
}

.modal-card {
  position: relative;
  width: min(430px, 100%);
  padding: 34px 32px 26px;
  background: var(--paper-2);
  border: 1px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  animation: rise 0.3s var(--ease) both;
}

.modal-x {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  font-size: 20px;
  line-height: 1;
  color: var(--ink-2);
  background: none;
  border: 0;
  cursor: pointer;
}

.modal-card h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.05;
}

.modal-body {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-2);
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.price {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1;
}

.price-note {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.modal-card .btn-ghost {
  display: block;
  width: 100%;
  margin-top: 10px;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------- unlock code block ---------------- */

.key-block {
  margin-top: 18px;
}

.key-toggle {
  display: inline-block;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.key-toggle:hover {
  color: var(--ink);
}

.key-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.key-form[hidden] {
  display: none !important;
}

.key-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 0;
}

.key-input:focus {
  outline: none;
  border-color: var(--ink);
}

.key-form .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.key-msg {
  margin: 8px 0 0;
  min-height: 1em;
  font-size: 12px;
  color: var(--ink-3);
}

.key-msg.is-ok {
  color: var(--ink);
}

.key-msg.is-bad {
  color: var(--accent);
}

/* ---------------- toast ---------------- */

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  z-index: 300;
  max-width: min(90vw, 460px);
  padding: 11px 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--paper);
  background: var(--ink);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------- animation ---------------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* tool pages carry their own hero, so the bench does not need to fill the fold */
body[data-hide-head="1"] .layout {
  min-height: 0;
}

/* ---------------- landing hero + content (tool pages) ---------------- */

.hero {
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(38px, 5vw, 68px) clamp(20px, 4vw, 54px) clamp(30px, 4vw, 46px);
}

.hero-title {
  max-width: 22ch;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 5.2vw, 62px);
  line-height: 1.02;
  text-wrap: balance;
  letter-spacing: -0.015em;
}

.hero-lede {
  max-width: 58ch;
  margin: 18px 0 0;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.65;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.hero-points li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.hero-points li::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--accent);
  transform: translateY(-2px);
}

.content {
  border-top: 1px solid var(--line);
  background: var(--paper-2);
}

.content-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(30px, 5vw, 72px);
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(44px, 5vw, 76px) clamp(20px, 4vw, 54px);
}

.content h2 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.1;
}

.content h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
}

.content p {
  margin: 0 0 12px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.7;
}

.how-steps {
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
}

.how-steps li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-areas:
    "num title"
    ".   body";
  column-gap: 12px;
  row-gap: 4px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.how-steps li > h3 {
  grid-area: title;
  margin: 0;
}

.how-steps li > p {
  grid-area: body;
  margin: 0;
}

.how-steps li:first-child {
  border-top: 1px solid var(--ink);
}

.how-steps .step-num {
  grid-area: num;
  margin: 2px 0 0;
}

.faq {
  margin: 0;
}

.faq details {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.faq details:first-of-type {
  border-top: 1px solid var(--ink);
}

.faq summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

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

.faq summary::after {
  content: "+";
  font-family: var(--font-mono);
  color: var(--accent);
}

.faq details[open] summary::after {
  content: "–";
}

.faq details p {
  margin: 10px 0 0;
  font-size: 13.5px;
}

.tool-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tool-links a {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
}

.tool-links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.site-foot .foot-links {
  display: flex;
  gap: 16px;
}

.site-foot a {
  color: inherit;
  border-bottom: 1px solid var(--line-strong);
}

/* ---------------- responsive ---------------- */

@media (max-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    border-left: 0;
    border-right: 0;
  }

  .index {
    position: sticky;
    top: 64px;
    z-index: 30;
    width: 100%;
    min-width: 0;
    max-width: 100vw;
    height: auto;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(244, 241, 234, 0.95);
    backdrop-filter: blur(8px);
  }

  .index-label,
  .index-foot {
    display: none;
  }

  .tool-nav {
    flex-direction: row;
    gap: 6px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .tool-nav::-webkit-scrollbar {
    display: none;
  }

  .tool-link {
    grid-template-columns: auto auto;
    gap: 7px;
    padding: 8px 11px;
    white-space: nowrap;
    border-left: 0;
    border-bottom: 2px solid transparent;
  }

  .tool-link:hover {
    transform: none;
  }

  .tool-link.is-active {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
  }

  .workbench {
    padding: 32px 18px 56px;
  }

  .notes-inner {
    grid-template-columns: 1fr;
    padding: 52px 20px;
  }

  .content-inner {
    grid-template-columns: 1fr;
    padding: 44px 20px;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

@media (max-width: 620px) {
  .brand-sub,
  .badge-local span {
    display: none;
  }

  .panel-head {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .panel-num {
    padding-top: 0;
  }

  .panel-title {
    font-size: 36px;
  }

  .stage {
    min-height: 180px;
    padding: 26px 14px;
  }

  .file-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .file-idx,
  .file-size {
    display: none;
  }

  .limit-hint {
    width: 100%;
    margin-left: 0;
  }

  .btn-primary {
    flex: 1;
    padding: 13px 16px;
  }
}
