:root {
  --paper: #f4f1ea;
  --card: #fffdf8;
  --ink: #16130f;
  --muted: #5d564b;
  --line: #d9d2c3;
  --sun: #ffd23f;
  --sun-deep: #e9b800;
  --error: #a3261a;
  --radius: 14px;
  --wrap: 760px;
  --font: ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 var(--font);
}

a { color: inherit; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

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

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

/* Header */
.top {
  max-width: 1040px; margin: 0 auto; padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 19px; letter-spacing: -0.01em; text-decoration: none;
}
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; background: var(--ink) url('/favicon.svg') center/cover;
}
.top nav { display: flex; gap: 18px; font-size: 15px; }
.top nav a { text-decoration: none; color: var(--muted); font-weight: 600; }
.top nav a:hover, .top nav a[aria-current='page'] { color: var(--ink); }
.top nav a[aria-current='page'] { box-shadow: 0 2px 0 var(--ink); }

/* Hero */
.hero {
  max-width: 880px; margin: 0 auto; padding: 44px 20px 56px; text-align: center;
}
h1 {
  margin: 0; font-size: clamp(34px, 7vw, 62px); line-height: 1.04;
  letter-spacing: -0.035em; font-weight: 800; text-wrap: balance;
}
.lead {
  max-width: 560px; margin: 16px auto 30px; color: var(--muted); font-size: 18px; text-wrap: pretty;
}

.bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 2px solid var(--ink); border-radius: 18px;
  padding: 8px; box-shadow: 6px 6px 0 var(--ink);
  transition: box-shadow 0.15s, transform 0.15s;
}
.bar:focus-within { box-shadow: 8px 8px 0 var(--sun-deep); transform: translate(-1px, -1px); }
.bar input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 17px; padding: 12px 10px 12px 12px;
}
.bar input:focus { outline: none; }
.bar input::placeholder { color: #8c8474; }

button { font: inherit; cursor: pointer; }
.ghost {
  border: 0; background: transparent; color: var(--muted); font-weight: 700;
  padding: 10px 12px; border-radius: 10px;
}
.ghost:hover { background: #ece7da; color: var(--ink); }
.go {
  border: 2px solid var(--ink); background: var(--sun); color: var(--ink);
  font-weight: 800; padding: 12px 22px; border-radius: 12px; white-space: nowrap;
}
.go:hover { background: var(--sun-deep); }
.go:disabled { cursor: progress; opacity: 0.7; }

.status { min-height: 26px; margin-top: 16px; font-size: 15px; color: var(--muted); }
.status.is-error { color: var(--error); font-weight: 600; }

.result {
  margin-top: 8px; display: flex; gap: 18px; text-align: left; align-items: flex-start;
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); padding: 16px;
}
.result[hidden] { display: none; }
.result-thumb {
  width: 132px; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--line); flex: none;
}
.result-body { flex: 1; min-width: 0; }
.result-title { margin: 0 0 12px; font-weight: 700; overflow-wrap: anywhere; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.result-note { margin: 12px 0 0; font-size: 14px; color: var(--muted); }

.btn {
  display: inline-block; padding: 11px 18px; border-radius: 12px; border: 2px solid var(--ink);
  background: var(--card); font-weight: 800; text-decoration: none;
}
.btn:hover { background: #ece7da; }
.btn-primary { background: var(--sun); }
.btn-primary:hover { background: var(--sun-deep); }

/* Content */
.block { max-width: var(--wrap); margin: 0 auto; padding: 34px 20px; }
.block + .block { border-top: 1px solid var(--line); }
h2 { margin: 0 0 18px; font-size: clamp(24px, 4vw, 30px); line-height: 1.2; letter-spacing: -0.02em; }
h3 { margin: 0 0 4px; font-size: 18px; }
.prose p { margin: 0 0 14px; }
.prose p:last-child { margin-bottom: 0; }
.prose ul { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
code {
  font-family: var(--mono); font-size: 0.88em; background: #ece7da; padding: 2px 6px; border-radius: 6px;
  overflow-wrap: anywhere;
}

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 18px; }
.steps li { counter-increment: step; position: relative; padding-left: 58px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--sun); font-weight: 800; font-size: 18px;
}
.steps p { margin: 0; color: var(--muted); }

.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary {
  cursor: pointer; padding: 16px 34px 16px 0; font-weight: 700; list-style: none; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+'; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 24px; font-weight: 400; line-height: 1;
}
.faq details[open] summary::after { content: '–'; }
.faq p { margin: 0 0 18px; color: var(--muted); }

.more { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.more a {
  display: inline-block; padding: 10px 16px; border: 2px solid var(--ink); border-radius: 999px;
  text-decoration: none; font-weight: 700; background: var(--card);
}
.more a:hover { background: var(--sun); }

.doc { padding-top: 30px; }
.doc h1 { font-size: clamp(30px, 6vw, 44px); margin-bottom: 22px; }
.doc h2 { font-size: 22px; margin: 30px 0 10px; }

/* Footer */
.foot { margin-top: 40px; background: var(--ink); color: #e9e3d4; padding: 40px 20px 34px; }
.foot-cols { max-width: var(--wrap); margin: 0 auto; display: flex; gap: 64px; flex-wrap: wrap; }
.foot-cols a { display: block; text-decoration: none; padding: 4px 0; color: #e9e3d4; }
.foot-cols a:hover { color: var(--sun); }
.foot-title {
  margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: #a39b88; font-weight: 700;
}
.fine { max-width: var(--wrap); margin: 28px auto 0; font-size: 13.5px; color: #a39b88; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .top nav { display: none; }
  .hero { padding: 26px 16px 40px; }
  .bar { flex-wrap: wrap; box-shadow: 4px 4px 0 var(--ink); }
  .bar input { flex-basis: 100%; }
  .ghost { flex: none; }
  .go { flex: 1; }
  .result { flex-direction: column; }
  .result-thumb { width: 100%; aspect-ratio: 16 / 9; }
  .btn { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
