:root {
  --bg: #F2FAF6;
  --surface: #FFFFFF;
  --sheet: #E5F4EC;
  --ink: #134034;
  --muted: #2A5648;
  --line: rgba(19, 64, 52, 0.14);
  --accent: #1F7A62;
  --accent-ink: #F4FBF7;
  --shadow: 0 12px 28px rgba(19, 64, 52, 0.08);
  --serif: "Literata", "Iowan Old Style", Palatino, "Palatino Linotype", serif;
  --sans: "Manrope", "Segoe UI", sans-serif;
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

button, input { font: inherit; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--ink);
  color: var(--accent-ink);
  padding: 8px 12px;
  z-index: 40;
}

.skip:focus { top: 12px; }

.wrap {
  width: min(var(--max), calc(100% - 2 * clamp(18px, 3vw, 32px)));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.bar {
  width: min(var(--max), calc(100% - 2 * clamp(18px, 3vw, 32px)));
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 680;
  font-size: 1.12rem;
  line-height: 1.1;
}

.mark { flex: 0 0 auto; display: block; }

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 8px 0;
}

.nav a:hover { color: var(--ink); }

.nav a[aria-current="page"] {
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.nav-toggle {
  display: none;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 40px;
  padding: 0 14px;
  font-weight: 650;
  cursor: pointer;
}

.mast { padding: 28px 0 8px; }

.mast-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
  gap: 48px;
  align-items: end;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 680; letter-spacing: -0.02em; }

h1 {
  margin: 10px 0 0;
  font-size: clamp(2.4rem, 4.5vw, 3.9rem);
  line-height: 1.08;
  max-width: 12ch;
}

.nowrap { white-space: nowrap; }

.kicker {
  margin: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.98rem;
}

.lede {
  margin: 18px 0 0;
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.12rem;
}

.cta-stack { margin-top: 26px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 22px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.02rem;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(31, 122, 98, 0.22);
  transition: transform 240ms ease, box-shadow 240ms ease;
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(31, 122, 98, 0.28);
}

.fine { margin: 0; color: var(--muted); font-size: 0.92rem; max-width: 36rem; }

.contents {
  margin: 0;
  padding: 18px 0 6px 22px;
  border-left: 2px solid var(--accent);
}

.contents p {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 0.92rem;
}

.contents ol { margin: 0; padding: 0 0 0 1.1rem; color: var(--muted); }

.contents a { color: var(--ink); }

.trust { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 36px; }

.trust-inner {
  display: grid;
  grid-template-columns: 1fr;
}

.trust-item { position: relative; padding: 16px 22px 16px 0; }

.trust-item strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 680;
  margin-bottom: 6px;
}

.trust-item span { color: var(--muted); font-size: 0.96rem; }

@media (min-width: 768px) {
  .trust-inner { grid-template-columns: 1fr 1fr; }
  .trust-item { padding-right: 28px; }
}

@media (min-width: 980px) {
  .trust-inner { grid-template-columns: repeat(4, 1fr); }
  .trust-item:not(:last-child)::after {
    content: "";
    position: absolute;
    right: 16px;
    top: 18px;
    bottom: 18px;
    width: 1px;
    background: var(--line);
  }
}

#shagi, #razbor, #dalee { scroll-margin-top: 88px; }

.block { padding: 64px 0; }

.section-head { max-width: 40rem; margin-bottom: 8px; }

.section-head h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.15; }

.section-head p { margin: 14px 0 0; color: var(--muted); }

.steps { list-style: none; margin: 18px 0 0; padding: 0; }

.step {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px 18px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  align-items: start;
}

.step-num {
  font-family: var(--serif);
  font-weight: 680;
  font-size: 2.1rem;
  line-height: 1;
  color: var(--accent);
  padding-top: 4px;
}

.step h2, .step h3 { margin: 0; font-size: 1.35rem; line-height: 1.25; }

.step p { margin: 8px 0 0; color: var(--muted); max-width: 62ch; }

.bench { background: var(--sheet); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.bench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

.scheme {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 18px 14px;
  box-shadow: var(--shadow);
}

.scheme-top, .scheme figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.scheme figcaption { margin-top: 10px; display: block; }

.frame {
  position: relative;
  margin-top: 12px;
  background: #F7FBFA;
  border-radius: 10px;
  overflow: hidden;
}

.scan {
  position: absolute;
  left: 14%;
  right: 14%;
  height: 2px;
  background: var(--accent);
  opacity: 0.75;
  animation: sweep 3.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes sweep {
  0%, 100% { top: 16%; }
  50% { top: 80%; }
}

.zone {
  background:
    linear-gradient(transparent 31px, rgba(19, 64, 52, 0.08) 32px) 0 8px / 100% 32px,
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  min-height: 240px;
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform 240ms ease, border-color 240ms ease;
}

.zone.is-drag { border-color: var(--accent); transform: translateY(-3px); }

.zone p { margin: 0 0 14px; color: var(--muted); }

.preview {
  margin-top: 14px;
  border-radius: 8px;
  max-height: 280px;
  width: auto;
  object-fit: contain;
  background: #fff;
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.result {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px 18px;
}

.status { margin: 0; font-weight: 650; }

.out {
  margin: 12px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.45;
  max-height: 220px;
  overflow: auto;
}

.link-wrap { margin: 12px 0 0; color: var(--muted); font-size: 0.95rem; }

.link-wrap a { color: var(--accent); word-break: break-all; }

.btn-quiet {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 42px;
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 240ms ease, color 240ms ease, transform 240ms ease;
}

.btn-quiet:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.fail-hint { margin: 10px 0 0; }

.more-list { display: grid; gap: 14px; margin-top: 22px; }

.guide-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 1px 0 rgba(19, 64, 52, 0.04);
  transition: transform 250ms ease, box-shadow 250ms ease;
}

.guide-row:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.guide-row b { font-family: var(--serif); font-size: 1.2rem; font-weight: 680; color: var(--ink); }

.guide-row span { color: var(--muted); }

.guide-kicker { color: var(--accent); font-weight: 700; font-size: 0.92rem; }

.page { padding: 48px 0 28px; }

.prose { max-width: 68ch; }

.prose h1 { font-size: clamp(2.1rem, 4vw, 3.15rem); line-height: 1.12; margin: 8px 0 0; max-width: 22ch; }

.prose h2 { font-size: 1.5rem; margin: 1.7em 0 0.45em; }

.prose p, .prose li { color: var(--muted); }

.prose ul, .prose ol { padding-left: 1.2rem; }

.prose a { color: var(--accent); }

.prose .cta { margin-top: 8px; }

.req {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 36px 0 48px;
}

.foot {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px 40px;
}

.foot-brand {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 680;
  font-size: 1.25rem;
}

.foot nav { display: flex; flex-wrap: wrap; gap: 10px 18px; align-content: start; }

.foot nav a { color: var(--ink); font-weight: 650; text-decoration: none; }

.foot nav a:hover { color: var(--accent); }

.legal {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.legal a { color: var(--accent); }

.cookie {
  position: fixed;
  z-index: 30;
  left: auto;
  right: 20px;
  bottom: 16px;
  width: min(440px, calc(100% - 32px));
  margin: 0;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  background: var(--ink);
  color: var(--accent-ink);
  border-radius: 12px;
  padding: 12px 12px 12px 18px;
  box-shadow: 0 12px 30px rgba(19, 64, 52, 0.22);
}

.cookie[hidden] { display: none; }

html.has-cookie body { padding-bottom: 96px; }

.cookie p { margin: 0; font-size: 0.92rem; }

.cookie a { color: #D7EFE4; }

.cookie button {
  flex: 0 0 auto;
  background: var(--accent-ink);
  color: var(--ink);
  border: 0;
  border-radius: 8px;
  min-height: 38px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}

.noscript {
  margin: 0 0 12px;
  color: var(--muted);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (max-width: 979px) {
  .mast-grid, .bench-grid, .foot { grid-template-columns: 1fr; }
  .contents { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 18px; }
  .guide-row { grid-template-columns: 1fr; gap: 6px; }
}

@media (max-width: 767px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 8px 0 14px;
  }
  .nav.is-open { display: flex; }
  .step { grid-template-columns: 48px minmax(0, 1fr); }
  h1 { max-width: none; }
  .cookie { left: 16px; right: 16px; width: auto; flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
