/* AI Tutor — стиль «Рабочая тетрадь»: общий для лендинга (index.html) и гайда (guide.html).
   Бумага в клетку, чернила, промпты как вклейки из терминала, пометки карандашом на полях.
   Только светлая тема — намеренно (решено 2026-10-02): на тёмном фоне теряется ощущение тетради. */
:root {
  --paper: #f5f7f3;
  --grid: #dfe6e4;
  --ink: #1c2a4a;
  --muted: #56627a;
  --pencil: #b8322a;
  --rule: #b9c3c9;
  --card: #fffefb;
  --tape: #e9e2c4;
  --term: #1d2430;
  --term-fg: #dfe5ee;
  --term-muted: #a6b0c0;
  --serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, Menlo, monospace;
  --hand: "Caveat", "Segoe Print", cursive;
  --gut: clamp(16px, 4vw, 44px);
  color-scheme: light only;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
}
a { color: inherit; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--pencil); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; text-wrap: balance; margin: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
code { font-family: var(--mono); font-size: .88em; }

.in { max-width: 1040px; margin-inline: auto; padding-inline: var(--gut); }

/* навигация */
header nav { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding-block: 18px; border-bottom: 2px solid var(--ink); }
header nav a { text-decoration: none; font-size: .95rem; color: var(--muted); }
header nav a:hover { color: var(--ink); }
header nav .brand { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; color: var(--ink); margin-right: auto; display: inline-flex; align-items: center; gap: 9px; }
header nav .brand img { width: 1.35em; height: 1.35em; }
header nav a[aria-current="page"] { color: var(--ink); border-bottom: 2px solid var(--pencil); }

/* первый экран */
.hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 44px; align-items: end; padding-block: 56px 48px; }
.eyebrow { font-size: .8rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin-bottom: 14px; }
h1 { font-size: clamp(2rem, 4.6vw, 3rem); line-height: 1.12; letter-spacing: -.01em; }
h1 .nb { white-space: nowrap; }
.sub { margin-top: 18px; max-width: 54ch; }

/* вклейка из терминала */
#start { scroll-margin-top: 24px; }
.clip { background: var(--term); color: var(--term-fg); border-radius: 4px; padding: 22px 18px 16px; position: relative; transform: rotate(-1.2deg); box-shadow: 0 8px 22px rgba(20, 30, 50, .2); display: grid; gap: 12px; }
.clip::before { content: ""; position: absolute; top: -10px; left: 38%; width: 84px; height: 20px; background: var(--tape); opacity: .9; transform: rotate(3deg); }
.clip code { display: block; font-size: .86rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.copy { justify-self: start; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; background: #f5f7f3; color: #1c2a4a; border: 0; border-radius: 3px; padding: 9px 16px; }
.copy:hover { background: #ffffff; }
.clip-hint { font-size: .82rem; color: var(--term-muted); }
.hand { font-family: var(--hand); color: var(--pencil); font-size: 1.4rem; line-height: 1.2; }
.clip + .hand { margin-top: 16px; transform: rotate(-1deg); }

/* секции */
.sec { padding-block: 48px; border-top: 1px dashed var(--rule); position: relative; }
h2 { font-size: 1.5rem; margin-bottom: 20px; }
.side { position: absolute; right: var(--gut); top: 48px; transform: rotate(3deg); max-width: 18ch; text-align: right; }

.pains { display: grid; gap: 12px; max-width: 64ch; }
.pains li { display: flex; gap: 12px; align-items: baseline; }
.pains li::before {
  content: ""; flex: none; width: 15px; height: 15px; border: 1.6px solid var(--ink); border-radius: 2px; transform: translateY(2px);
  background:
    linear-gradient(45deg, transparent 44%, var(--pencil) 44% 56%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, var(--pencil) 44% 56%, transparent 56%);
}
.bridge { margin-top: 22px; max-width: 60ch; font-family: var(--serif); font-size: 1.1rem; }

.steps { display: grid; gap: 20px; border-left: 2px solid var(--pencil); padding-left: 22px; max-width: 70ch; }
.steps li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: baseline; }
.steps .n { font-family: var(--hand); font-size: 1.8rem; color: var(--pencil); line-height: 1; min-width: 1.2ch; }
.steps b { font-family: var(--serif); font-size: 1.08rem; font-weight: 600; }
.steps span:not(.n) { display: block; color: var(--muted); }
.steps span.note { color: var(--pencil); margin-top: 8px; }
@media (min-width: 1000px) {
  .steps li { position: relative; }
  .steps span.note { position: absolute; left: calc(100% + 28px); top: 4px; width: 190px; margin-top: 0; transform: rotate(2deg); }
}

.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }
.two > * { min-width: 0; }
.list { display: grid; gap: 10px; }
.list li { padding-left: 20px; position: relative; }
.list li::before { content: "—"; position: absolute; left: 0; color: var(--muted); }
.small { margin-top: 16px; font-size: .9rem; color: var(--muted); }
.go-wrap { margin-top: 14px; }
.go { color: var(--pencil); font-weight: 600; font-size: 1.05rem; }

.author { background: var(--card); border: 1px solid var(--rule); padding: 22px 24px; box-shadow: 4px 4px 0 var(--grid); display: grid; gap: 12px; align-content: start; }
.author h2 { margin-bottom: 0; font-size: 1.2rem; }
.author-name { font-family: var(--serif); font-weight: 600; font-size: 1.08rem; }

.result { margin-top: 28px; max-width: 70ch; background: var(--card); border: 1px solid var(--rule); padding: 16px 20px; box-shadow: 4px 4px 0 var(--grid); }
.work { max-width: 70ch; }
.work + .shot { margin-top: 20px; }
.need-lead { margin-bottom: 20px; }
.paths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.path { background: var(--card); border: 1px solid var(--rule); padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.path .go-wrap { margin-top: auto; padding-top: 4px; }
.path h3 { font-size: 1.1rem; }
.setup { display: grid; gap: 10px; counter-reset: s; }
.setup li > div { min-width: 0; }
.setup li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: baseline; counter-increment: s; }
.setup li::before { content: counter(s); font-family: var(--hand); font-size: 1.45rem; color: var(--pencil); line-height: 1; min-width: 1.1ch; }
#need > .small { max-width: 70ch; }
.trust { max-width: 70ch; }

footer { display: flex; gap: 20px; flex-wrap: wrap; padding-block: 24px 40px; border-top: 2px solid var(--ink); font-size: .9rem; color: var(--muted); }

/* гайд */
.page-head { padding-block: 48px 8px; display: grid; gap: 14px; max-width: 760px; }
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
.page-head p { color: var(--muted); max-width: 62ch; }
.recipe { max-width: 760px; }
.recipe ol { display: grid; gap: 18px; counter-reset: r; }
.recipe ol > li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: baseline; counter-increment: r; }
.recipe ol > li::before { content: counter(r); font-family: var(--hand); font-size: 1.6rem; color: var(--pencil); line-height: 1; min-width: 1.2ch; }
.recipe ol > li > div { min-width: 0; display: grid; gap: 10px; }
.recipe ol .small { margin-top: 0; }
.snippet { min-width: 0; background: var(--term); color: var(--term-fg); border-radius: 4px; padding: 14px 16px; display: grid; gap: 10px; }
.snippet pre { margin: 0; min-width: 0; }
.snippet code { font-size: .84rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.snippet .copy { font-size: .82rem; padding: 6px 12px; }
.tap code { cursor: pointer; }
.back { max-width: 760px; display: grid; gap: 12px; }

/* скриншоты */
.shot { margin: 0; max-width: 70ch; display: grid; gap: 10px; }
.shot a { display: block; }
.shot img { display: block; width: 100%; height: auto; border-radius: 4px; box-shadow: 0 8px 22px rgba(20, 30, 50, .2); }
.shot figcaption { font-size: .9rem; color: var(--muted); }
.recipe .shot { max-width: none; }
.zoom { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; background: rgba(20, 30, 50, .82); cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 4px; box-shadow: 0 8px 22px rgba(0, 0, 0, .4); }

@media (max-width: 760px) {
  .hero, .two, .paths { grid-template-columns: 1fr; gap: 32px; }
  .paths { gap: 16px; }
  .hero { padding-block: 36px 36px; }
  .side { display: none; }
  .hide-s { display: none; }
  .sec { padding-block: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .clip, .clip + .hand, .side, .steps span.note { transform: none; }
}
