/* 8-битный шрифт заголовков разделов — Pixel Code (OFL, лицензия в assets/fonts) */
@font-face { font-family: "Pixel Code"; src: url("assets/fonts/pixel-code-bold.woff2") format("woff2"); font-display: swap; }

/* ============================================================
   RIVERWORLD — многостраничный сайт, стиль Crayon (scrapbook)
   Чистые плоские плашки: без обводок и скруглений, мягкие тени.
   ============================================================ */

:root {
  --surface: #f6f0e2;
  --surface-2: #efe7d3;
  --paper: #fffdf7;
  --ink: #191510;
  --ink-soft: rgba(25, 21, 16, 0.72);

  --yellow: #ffd23f;
  --yellow-soft: #fbe79a;
  --blue: #4271dc;
  --green: #3f9d65;
  --brown: #7a4b2d;
  --orange: #ff8a3d;
  --magenta: #e85d9e;
  --purple: #b18cff;
  --cyan: #6fd6d6;
  --mint: #a8e6cf;

  /* единая система мягких теней */
  --shadow-sm: 0 1px 2px rgba(25, 21, 16, 0.06), 0 4px 14px rgba(25, 21, 16, 0.08);
  --shadow-md: 0 2px 4px rgba(25, 21, 16, 0.05), 0 12px 28px rgba(25, 21, 16, 0.10);
  --shadow-lg: 0 4px 10px rgba(25, 21, 16, 0.06), 0 22px 44px rgba(25, 21, 16, 0.14);
  /* та же тень, но по силуэту (для папки с язычком) */
  --drop-md: drop-shadow(0 2px 3px rgba(25, 21, 16, 0.06)) drop-shadow(0 12px 20px rgba(25, 21, 16, 0.11));
  --drop-lg: drop-shadow(0 4px 6px rgba(25, 21, 16, 0.07)) drop-shadow(0 22px 30px rgba(25, 21, 16, 0.15));

  --gutter: 5%;

  /* фон страницы и текст поверх него */
  --page-bg: var(--surface);
  --bg-ink: var(--ink);
  --bg-ink-soft: var(--ink-soft);
  --bg-line: rgba(25, 21, 16, 0.18);
  --header-bg: #e8e0cd;

  --font-display: "Russo One", sans-serif;
  --font-hand: "Caveat", cursive;
  --font-mono: "JetBrains Mono", monospace;
  --font-body: "Rubik", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--bg-ink);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.mono { font-family: var(--font-mono); }
.hand { font-family: var(--font-hand); }

/* ---------- зерно ---------- */
.ca-grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
}

/* ---------- заставка ---------- */
.ca-splash {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: var(--surface);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.ca-splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }

.ca-splash-b1,
.ca-splash-b2 {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: calc(100vw - 32px);
  padding: 0.8rem 1.6rem;
  background: var(--yellow);
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4.5vw, 2.7rem);
  line-height: 1.15;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.ca-splash-b1 { animation: splashOut1 3.2s forwards; }
.ca-splash-b2 { animation: splashOut2 3.2s forwards; }

.ca-splash-word { display: inline-block; white-space: nowrap; }
.ca-splash-char { display: inline-block; opacity: 0; animation: popIn 0.3s forwards; }

@keyframes popIn { to { opacity: 1; } }
@keyframes splashOut1 { 0%, 37% { opacity: 1; transform: translate(-50%, -50%) rotate(0); } 45%, 100% { opacity: 0; transform: translate(-50%, -62%) rotate(-6deg); } }
@keyframes splashOut2 { 0%, 41% { opacity: 0; transform: translate(-50%, -40%); } 47%, 90% { opacity: 1; transform: translate(-50%, -50%) rotate(0); } 100% { opacity: 0; transform: translate(-50%, -58%) rotate(4deg); } }

/* ---------- шапка ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.12)) drop-shadow(0 10px 18px rgba(0, 0, 0, 0.16));
}
.header-inner {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 1.6rem;
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 1.15rem 4.4rem 1.05rem;
  background: var(--header-bg);
  clip-path: polygon(0 0, 100% 0, calc(100% - 46px) 100%, 46px 100%);
}
.logo { display: inline-flex; align-items: center; gap: 0.7rem; justify-self: center; }
.logo-badge {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  filter: drop-shadow(0 2px 4px rgba(25, 21, 16, 0.18));
}
.logo-badge svg { width: 100%; height: 100%; }
.logo-text { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: 0.01em; line-height: 1; }
.logo-text .sep, .display-name .sep { color: var(--orange); }

.nav-side { display: flex; align-items: center; gap: 0.8rem; }
.nav-left { justify-self: end; }
.nav-right { justify-self: start; }

/* стикеры-разделы: одинаковый размер, одинаковая мягкая тень */
.sticker {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 8.8rem;
  height: 3.3rem;
  line-height: 1.05;
  position: relative;
  box-shadow: 0 2px 4px rgba(25, 21, 16, 0.10), 0 8px 18px rgba(25, 21, 16, 0.14);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.sticker:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.sticker .s-main { font-family: var(--font-display); font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.02em; }
.sticker .s-sub { font-family: var(--font-hand); font-size: 0.95rem; opacity: 0.8; margin-top: 0.1rem; }
.sticker.active .s-main { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }

.st-yellow { background: var(--yellow); color: var(--ink); }
.st-blue { background: var(--blue); color: #fff; }
.st-green { background: var(--green); color: #fff; }
.st-orange { background: var(--orange); color: var(--ink); }

/* ---------- hero (главная) ---------- */
.hero {
  position: relative;
  min-height: calc(100svh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 16px 5rem;
  text-align: center;
  overflow: hidden;
}
.hero-inner { max-width: 960px; }

.hero-squiggle { display: block; margin: 0.2rem auto 0; width: 6rem; height: 0.9rem; }

.hero-notes {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem;
  margin: 0 0 2.6rem;
}
.note {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  padding: 0.5rem 1rem;
  box-shadow: var(--shadow-sm);
}
.n-purple { background: var(--purple); rotate: -3deg; }
.n-yellow-soft { background: var(--yellow-soft); rotate: 2.5deg; }

.hero-name { position: relative; display: inline-block; padding: 1.4rem 0; }

.doodle-box {
  display: inline-block;
  padding: 0.4rem 1.6rem 0.55rem;
  border: 4px solid var(--orange);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
}
.display-name {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 8.6vw, 6.4rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.display-name .nm {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.6em) rotate(-4deg);
  animation: nameUp 0.5s forwards;
  animation-delay: calc(0.15s + var(--i) * 0.045s);
}
html.splash-on .display-name .nm { animation-delay: calc(3.1s + var(--i) * 0.045s); }
@keyframes nameUp { to { opacity: 1; transform: none; } }

/* подписи вынесены за рамку и не перекрывают буквы */
.hero-float { position: absolute; z-index: 2; }
.float-role { top: -0.6rem; left: 0; translate: -30% 0; rotate: -6deg; }
.float-loc { bottom: -0.6rem; right: 0; translate: 25% 0; rotate: 4deg; }

.tag {
  color: var(--ink);
  display: inline-block;
  padding: 0.3rem 0.9rem;
  font-size: 1.35rem;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.tag-yellow { background: var(--yellow); }
.tag-mint { background: var(--mint); }

.hero-status {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  margin: 2rem 0 0;
  font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.16em;
}
.hero-status .dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--green); flex-shrink: 0; }

.hero-title {
  margin: 1.8rem auto 0;
  max-width: 760px;
  font-size: clamp(1.5rem, 4.6vw, 3rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.01em;
}

.spin-slow {
  display: inline-block;
  width: 0.85em; height: 0.85em;
  vertical-align: -0.06em;
  animation: spin 14s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.cta {
  display: inline-flex; align-items: center; gap: 0.7rem;
  margin-top: 2.4rem;
  padding: 0.6rem 1.3rem 0.6rem 0.6rem;
  background: var(--ink);
  color: #fff;
  font-size: 0.85rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.14em;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cta:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.cta-icon {
  display: grid; place-items: center;
  width: 2.2rem; height: 2.2rem;
  background: var(--blue); color: #fff;
}

/* ---------- страницы-разделы ---------- */
.page { padding: 3.5rem var(--gutter) 6rem; }
.page--tall { min-height: calc(100svh - 80px); }

.section-head { text-align: center; margin-bottom: 3.2rem; }
.section-label { font-size: clamp(1.4rem, 3.5vw, 2rem); margin: 0; }
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 9vw, 5rem);
  line-height: 0.95;
  margin: 0.6rem 0 1.2rem;
}

.tape {
  display: inline-block;
  padding: 0.4rem 1.4rem;
  background: var(--yellow-soft);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  clip-path: polygon(1.5% 0, 100% 8%, 98.5% 100%, 0 92%);
  font-size: 1rem;
  line-height: 1.35;
}
.tape-desc { rotate: -1.5deg; margin-top: 0.4rem; }
.tape-corner {
  position: absolute;
  top: -0.8rem; left: 1.4rem;
  height: 1.7rem; width: 6rem;
  background: color-mix(in srgb, var(--cyan) 55%, transparent);
  clip-path: polygon(0 0, 100% 0, 94% 100%, 5% 100%);
  transform: rotate(-4deg);
}
.tape-top {
  position: absolute; top: -0.8rem; left: 50%; transform: translateX(-50%) rotate(-3deg);
  width: 5rem; height: 1.6rem;
  background: color-mix(in srgb, var(--cyan) 55%, transparent);
}

/* ---------- новости ---------- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.4rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}
.news-card {
  position: relative;
  display: flex; flex-direction: column;
  padding: 2.2rem 2rem 1.8rem;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  transition: translate 0.25s ease, box-shadow 0.25s ease;
}
.news-card:hover { translate: 0 -6px; box-shadow: var(--shadow-lg); }

.news-meta { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-soft); }
.news-meta .dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; flex-shrink: 0; }
.news-title { font-family: var(--font-display); font-size: clamp(1.25rem, 2.2vw, 1.5rem); line-height: 1.12; margin: 0.8rem 0 0.6rem; }
.news-text { margin: 0 0 1.4rem; color: var(--ink-soft); }
.news-link { margin-top: auto; align-self: flex-start; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; border-bottom: 2px solid currentColor; padding-bottom: 0.15rem; }

/* ---------- статья ---------- */
.article { max-width: 760px; margin: 0 auto; }
.article-meta { display: inline-flex; align-items: center; gap: 0.55rem; font-family: var(--font-mono); font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--bg-ink-soft); }
.article-meta .dot { width: 0.65rem; height: 0.65rem; border-radius: 50%; }
.article h1 { font-family: var(--font-display); font-size: clamp(2rem, 5.5vw, 3.4rem); line-height: 1.02; margin: 0.8rem 0 1.2rem; }
.article .lead { font-size: clamp(1.1rem, 2.4vw, 1.3rem); line-height: 1.5; margin: 0 0 2rem; }
.article h2 { font-family: var(--font-display); font-size: clamp(1.3rem, 3vw, 1.7rem); line-height: 1.15; margin: 2.6rem 0 0.8rem; }
.article p { margin: 0 0 1.1rem; font-size: 1.06rem; line-height: 1.65; }
.article ul { margin: 0 0 1.2rem; padding-left: 1.2rem; }
.article li { margin: 0 0 0.5rem; font-size: 1.06rem; line-height: 1.6; }
.article-shots { display: flex; gap: 1.2rem; justify-content: center; margin: 2rem 0; }
.article-shots img { width: calc((100% - 2.4rem) / 3); height: auto; box-shadow: var(--shadow-md); cursor: zoom-in; }
.article-cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  margin-top: 3rem; padding: 1.6rem 1.8rem;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-md);
}
.article-cta b { font-family: var(--font-display); font-size: 1.15rem; font-weight: 400; }

/* ---------- папки проектов ---------- */
.folders {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3.6rem 2rem;
}
a.folder { display: block; color: inherit; min-width: 0; }

/* карточка поднимается целиком — язычок и тело с общей тенью по силуэту */
.folder-card {
  filter: var(--drop-md);
  transition: transform 0.3s ease, filter 0.3s ease;
}
.folder:hover .folder-card,
.folder:focus-visible .folder-card { transform: translateY(-8px); filter: var(--drop-lg); }
.folder:focus-visible { outline: none; }

/* язычок-таб */
.folder-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 2.6rem 0.55rem 1.4rem;
  clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 100%, 0 100%);
  margin-bottom: -1px;
  font-family: var(--font-mono);
  font-size: 0.74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.16em;
}
.folder-tab .star { width: 0.9rem; height: 0.9rem; flex-shrink: 0; }

/* тело папки: текст слева, скриншот справа на всю высоту */
.folder-body {
  display: flex;
  height: clamp(440px, 36vw, 620px);
}
.folder-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex; flex-direction: column;
  padding: clamp(1.5rem, 2.4vw, 2.4rem);
  container-type: inline-size;
}
.folder-date { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; }
.folder-date .dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.folder-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.6rem, 11cqi, 2.9rem);
  line-height: 1;
  margin: 1rem 0 0.8rem;
  overflow-wrap: break-word;
}
.folder-desc { margin: 0; line-height: 1.45; font-size: clamp(0.95rem, 4.4cqi, 1.08rem); }
.folder-link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  align-self: flex-start;
  margin-top: 1.3rem;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid currentColor;
  font-family: var(--font-mono);
  font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
}
.folder-link svg { width: 0.95rem; height: 0.95rem; flex-shrink: 0; transition: transform 0.25s ease; }
.folder:hover .folder-link svg { transform: translate(2px, -2px); }
.folder-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: auto; padding-top: 1.4rem; }
.chip {
  padding: 0.34rem 0.75rem 0.38rem;
  font-family: var(--font-mono);
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  clip-path: polygon(0 28%, 12% 0, 100% 0, 100% 100%, 0 100%);
}

/* скриншот: высота = высоте папки, ширина по пропорциям — без обрезки */
.folder-shot {
  position: relative;
  flex: none;
  height: 100%;
  overflow: hidden;
}
.folder-shot img {
  display: block;
  height: 100%;
  width: auto;
  max-width: none;
}

/* цвета папок */
.f-blue   { --fc: var(--blue);   --fc-ink: #fff;       --chip-bg: #fff;       --chip-ink: var(--blue); }
.f-green  { --fc: var(--green);  --fc-ink: #fff;       --chip-bg: #fff;       --chip-ink: var(--green); }
.f-black  { --fc: var(--ink);    --fc-ink: #fff;       --chip-bg: #fff;       --chip-ink: var(--ink); }
.f-brown  { --fc: var(--brown);  --fc-ink: #fff;       --chip-bg: #fff;       --chip-ink: var(--brown); }
.f-orange { --fc: var(--orange); --fc-ink: var(--ink); --chip-bg: var(--ink); --chip-ink: #fff; }
.f-yellow { --fc: var(--yellow); --fc-ink: var(--ink); --chip-bg: var(--ink); --chip-ink: #fff; }

.folder-tab, .folder-body { background: var(--fc); color: var(--fc-ink); }
.folder .chip, .p-hero .chip { background: var(--chip-bg); color: var(--chip-ink); }

/* NDA: размытая заглушка той же ширины, что и телефонные скриншоты */
.f-nda .folder-shot { aspect-ratio: 640 / 1391; }
.f-nda .folder-shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(14px) brightness(0.55) saturate(0.8);
  transform: scale(1.15);
}
.nda-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2;
}
.nda-stamp {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  padding: 0.9rem 1.3rem;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1.1;
  transform: rotate(-7deg);
  border: 3px solid rgba(255, 255, 255, 0.85);
  text-align: center;
}
.nda-stamp b { font-family: var(--font-display); font-weight: 400; font-size: 1.7rem; letter-spacing: 0.12em; }
.nda-stamp small { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; opacity: 0.85; text-transform: uppercase; }

/* ---------- страница проекта ---------- */
.back-link {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid currentColor;
  margin-bottom: 2.4rem;
}
.back-link:hover { opacity: 0.7; }

/* шапка проекта — большая папка того же цвета */
.p-hero .folder-body { height: clamp(460px, 40vw, 640px); }
.p-hero .folder-copy { padding: clamp(1.6rem, 3.4vw, 3.4rem); }
.p-hero .folder-title { font-size: clamp(2rem, 9cqi, 4.6rem); margin: 1rem 0 1rem; }
.p-hero .folder-desc { font-size: clamp(1rem, 2.6cqi, 1.3rem); max-width: 40em; }

.p-links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: auto; padding-top: 1.6rem; }
.p-link {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.65rem 1.1rem;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.p-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.p-link svg { width: 1.05rem; height: 1.05rem; flex-shrink: 0; }
.p-link small { font-weight: 500; opacity: 0.6; text-transform: none; letter-spacing: 0; }
.p-link.is-disabled { opacity: 0.7; cursor: default; pointer-events: none; }

.p-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 3rem;
  margin-top: 3.6rem;
  align-items: start;
}
.p-sec { font-family: var(--font-hand); font-weight: 700; font-size: clamp(1.7rem, 3vw, 2.2rem); line-height: 1; margin: 0 0 1.2rem; }
.p-main > section + section { margin-top: 3.4rem; }
.p-about p { margin: 0 0 1rem; font-size: 1.06rem; line-height: 1.65; max-width: 46em; }

/* паспорт проекта */
.p-card {
  position: sticky;
  top: 110px;
  padding: 1.6rem 1.6rem 1.4rem;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-md);
}
.p-card dl { margin: 0; }
.p-card dt { font-family: var(--font-mono); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-soft); }
.p-card dd { margin: 0.25rem 0 1.1rem; font-weight: 500; }
.p-card dd:last-child { margin-bottom: 0; }
.p-card .status { display: inline-flex; align-items: center; gap: 0.5rem; }
.p-card .status .dot { width: 0.65rem; height: 0.65rem; border-radius: 50%; flex-shrink: 0; }
.p-card .stack { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.p-card .stack .chip { background: var(--surface-2); color: var(--ink); }
.p-card .socials { display: flex; flex-direction: column; gap: 0.35rem; }
.p-card .socials a { border-bottom: 1.5px solid currentColor; align-self: flex-start; }
.dot-green { background: var(--green); }
.dot-orange { background: var(--orange); }
.dot-yellow { background: var(--yellow); }
.dot-blue { background: var(--blue); }

/* галерея: все скриншоты целиком */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1.4rem;
  align-items: start;
}
.gallery--wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-top: 1.4rem; }
.gallery figure { margin: 0; }
.gallery img {
  display: block;
  width: 100%;
  height: auto;
  box-shadow: var(--shadow-md);
  cursor: zoom-in;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.gallery img:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.gallery figcaption { font-family: var(--font-hand); font-size: 1.2rem; margin-top: 0.5rem; text-align: center; color: var(--bg-ink-soft); }
.gallery .is-nda { filter: blur(12px) brightness(0.6) saturate(0.8); cursor: default; }
.gallery .nda-wrap { position: relative; overflow: hidden; box-shadow: var(--shadow-md); }
.gallery .nda-wrap img { box-shadow: none; transform: scale(1.1); }
.gallery .nda-wrap img:hover { transform: scale(1.1); }
.gallery .nda-wrap .nda-overlay .nda-stamp { font-size: 1.1rem; padding: 0.6rem 0.9rem; }
.gallery .nda-wrap .nda-overlay .nda-stamp b { font-size: 1.2rem; }

/* история обновлений */
.timeline { list-style: none; margin: 0; padding: 0; max-width: 760px; }
.timeline li { position: relative; padding: 0 0 1.6rem 1.8rem; border-left: 2px solid var(--bg-line); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -0.42rem; top: 0.3rem;
  width: 0.72rem; height: 0.72rem; border-radius: 50%;
  background: var(--fc, var(--ink));
  box-shadow: 0 0 0 3px var(--page-bg);
}
.timeline .t-date { display: block; font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--bg-ink-soft); }
.timeline .t-title { display: block; font-weight: 600; margin-top: 0.2rem; }
.timeline .t-text { margin: 0.2rem 0 0; color: var(--bg-ink-soft); }

/* соседние проекты */
.p-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; margin-top: 4.5rem; }
.p-nav a {
  display: flex; flex-direction: column; gap: 0.3rem;
  padding: 1.3rem 1.5rem;
  background: var(--fc);
  color: var(--fc-ink);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.p-nav a:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.p-nav a:last-child { text-align: right; }
.p-nav small { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; opacity: 0.85; }
.p-nav b { font-family: var(--font-display); font-weight: 400; font-size: 1.35rem; }

/* ---------- об авторе ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) 1.15fr;
  gap: 3.5rem;
  max-width: 1040px;
  margin: 0 auto;
  align-items: start;
}
.polaroids { display: flex; flex-direction: column; gap: 2.2rem; }
.polaroid {
  display: block;
  position: relative;
  margin: 0;
  padding: 0.7rem 0.7rem 0.5rem;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-md);
  transition: rotate 0.25s ease, scale 0.25s ease, opacity 0.6s ease, transform 0.6s ease;
}
.polaroid:hover { rotate: 0deg; scale: 1.03; }
.p1 { rotate: -3deg; }
.p2 { rotate: 3deg; align-self: flex-end; }
.polaroid-photo {
  aspect-ratio: 4 / 5;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--surface-2), var(--mint));
  font-size: 4rem;
  overflow: hidden;
}
.polaroid-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.p2 .polaroid-photo { background: linear-gradient(150deg, var(--surface-2), var(--yellow-soft)); }
.polaroid-cap { display: block;  text-align: center; font-size: 1.35rem; padding-top: 0.35rem; color: var(--ink-soft); }

.doodle-box--small { padding: 0.25rem 1rem 0.35rem; border-width: 3px; border-color: currentColor; }
.about-badge { font-size: 1.4rem; font-weight: 600; }
.about-text { font-family: var(--font-body); font-size: clamp(1.05rem, 1.8vw, 1.22rem); line-height: 1.65; margin: 1.4rem 0 1.8rem; }

.skills { display: flex; flex-direction: column; gap: 0.8rem; }
.skill-row { display: flex; align-items: center; gap: 0.6rem; }
.skill {
  display: inline-flex; align-items: center;
  min-height: 3rem;
  padding: 0.4rem 1.3rem;
  font-size: 1.2rem; font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.skill-emoji {
  display: grid; place-items: center;
  width: 3rem; height: 3rem;
  font-size: 1.4rem;
  box-shadow: var(--shadow-sm);
}
.bg-yellow { background: var(--yellow); }
.bg-green { background: var(--green); color: #fff; }
.bg-blue { background: var(--blue); color: #fff; }
.bg-orange { background: var(--orange); }

/* ---------- контакты ---------- */
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.6rem;
  max-width: 820px;
  margin: 0 auto;
}
.contact-card {
  display: flex; align-items: center; gap: 1.1rem;
  padding: 1.4rem 1.5rem;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  transition: translate 0.25s ease, box-shadow 0.25s ease;
}
.contact-card:hover { translate: 0 -5px; box-shadow: var(--shadow-lg); }
.contact-icon {
  width: 3.2rem; height: 3.2rem;
  display: grid; place-items: center;
  flex-shrink: 0;
  color: #fff;
}
.contact-icon svg { width: 1.5rem; height: 1.5rem; }
.contact-meta { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.contact-meta b { font-family: var(--font-display); font-weight: 400; font-size: 1.1rem; }
.contact-meta small { font-size: 0.82rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.contact-arrow { margin-left: auto; font-size: 1.4rem; }
.contacts-note { text-align: center; font-size: 1.7rem; margin: 2.8rem 0 0; }

.contacts-projects { max-width: 820px; margin: 3.4rem auto 0; }
.contacts-projects h2 { font-family: var(--font-hand); font-size: 1.8rem; margin: 0 0 1rem; text-align: center; }
.contacts-projects ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem 1.6rem; }
.contacts-projects li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px dashed var(--bg-line); }
.contacts-projects li span { color: var(--bg-ink-soft); }
.contacts-projects li a { font-family: var(--font-mono); font-size: 0.85rem; font-weight: 700; }

/* ---------- футер ---------- */
.footer {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin: 0 var(--gutter);
  padding: 1.6rem 0 2.2rem;
  border-top: 2px dashed var(--bg-line);
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--bg-ink-soft);
}
.footer-up { font-weight: 700; }

/* ---------- всплывающая подсказка ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  transform: translate(-50%, 200%);
  padding: 0.75rem 1.2rem;
  background: var(--ink);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  z-index: 90;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s ease;
  text-align: center;
}
.toast.show { transform: translate(-50%, 0); }

/* ---------- просмотр скриншота ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 3rem 16px;
  background: rgba(25, 21, 16, 0.86);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  cursor: zoom-out;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox img { max-width: min(100%, 1400px); max-height: 100%; object-fit: contain; box-shadow: var(--shadow-lg); }
.lightbox-close {
  position: absolute; top: 14px; right: 16px;
  width: 44px; height: 44px;
  border: 0; background: var(--paper); color: var(--ink);
  font-size: 1.4rem; cursor: pointer;
}

/* ---------- reveal (только когда JS активен) ---------- */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.6s ease, transform 0.6s ease,
    translate 0.25s ease, rotate 0.25s ease, scale 0.25s ease, box-shadow 0.25s ease;
}
html.js [data-reveal].in { opacity: 1; transform: none; }

/* ============================================================
   адаптив
   ============================================================ */
@media (max-width: 1180px) {
  .folders { grid-template-columns: 1fr; }
  .folder-body { height: clamp(460px, 52vw, 600px); }
  .folder-title { font-size: clamp(1.8rem, 8cqi, 3rem); }
}

@media (max-width: 1100px) {
  .header-inner { gap: 0.8rem; }
  .sticker { width: 7.6rem; }
  .sticker .s-main { font-size: 0.85rem; }
}

@media (max-width: 960px) {
  .p-grid { grid-template-columns: 1fr; }
  .p-card { position: static; }
}

@media (max-width: 900px) {
  .site-header { position: relative; }
  .header-inner {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 0.9rem 16px 1rem;
    row-gap: 0.9rem;
  }
  .logo { grid-column: 1 / -1; grid-row: 1; }
  .nav-side { display: contents; }
  .sticker { width: 100%; height: 3rem; }
  .sticker .s-main { font-size: 0.78rem; }
  .sticker .s-sub { font-size: 0.85rem; }
  .page { padding: 2.6rem 16px 5rem; }
  .footer { margin: 0 16px; }
}

@media (max-width: 720px) {
  .news-grid, .contacts-grid, .contacts-projects ul { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 2.4rem; }
  .polaroids { flex-direction: row; gap: 1rem; }
  .polaroid { flex: 1; }
  .p-nav { grid-template-columns: 1fr; }
  .article-shots { flex-wrap: wrap; }
  .float-role { translate: -8% 0; }
  .float-loc { translate: 6% 0; }
  .tag { font-size: 1.1rem; }
}

/* узкие экраны: скриншот уходит под текст, наложения нет */
@media (max-width: 640px) {
  .folder-body, .p-hero .folder-body { flex-direction: column; height: auto; }
  .folder-copy, .p-hero .folder-copy { padding: 1.6rem 1.4rem 0.4rem; }
  .folder-shot {
    height: auto;
    display: flex;
    justify-content: center;
    padding: 1.2rem 1.4rem 1.4rem;
  }
  .folder-shot img { height: min(460px, 110vw); width: auto; max-width: 100%; object-fit: contain; }
  .f-nda .folder-shot { aspect-ratio: 16 / 10; padding: 0; }
  .f-nda .folder-shot img { height: 100%; }
  .folder-title, .p-hero .folder-title { font-size: clamp(1.8rem, 9vw, 2.6rem); }
  .folder-desc, .p-hero .folder-desc { font-size: 1rem; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  .gallery--wide { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .header-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer { flex-direction: column; align-items: flex-start; }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
  html.js [data-reveal] { opacity: 1; transform: none; }
}

/* шапка проекта: на широком экране два скриншота рядом */
.p-hero .folder-shot { display: flex; }
@media (max-width: 1000px) { .p-hero .shot-extra { display: none; } }
.article .back-link { display: flex; width: fit-content; }
.article code { font-family: var(--font-mono); font-size: 0.9em; background: var(--surface-2); padding: 0.1em 0.35em; }
@media (max-width: 480px) {
  .float-role, .float-loc { translate: 0 0; }
  .tag { font-size: 1rem; padding: 0.25rem 0.7rem; }
}

/* ============================================================
   НАБОР ПАПОК: слитные папки с язычками «лесенкой»
   ============================================================ */
.folders {
  --tab-h: 2.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding-top: var(--tab-h);
}
.folders .folder { position: relative; }
.folders .folder:nth-child(1) { z-index: 1; --tab-x: 0%; }
.folders .folder:nth-child(2) { z-index: 2; --tab-x: 14%; }
.folders .folder:nth-child(3) { z-index: 3; --tab-x: 9%; }
.folders .folder:nth-child(4) { z-index: 4; --tab-x: 30%; }
.folders .folder:nth-child(5) { z-index: 5; --tab-x: 56%; }
.folders .folder:nth-child(6) { z-index: 6; --tab-x: 20%; }
.folders .folder:last-child:nth-child(odd) { grid-column: 1 / -1; }

.folders .folder-card { position: relative; }
.folders .folder:hover .folder-card,
.folders .folder:focus-visible .folder-card { transform: translateY(-6px); }

.folders .folder-tab {
  position: absolute;
  bottom: 100%;
  left: var(--tab-x);
  height: var(--tab-h);
  margin: 0;
  padding: 0 2.7rem;
  clip-path: polygon(24px 0, calc(100% - 24px) 0, 100% 100%, 0 100%);
}
.folders .folder:nth-child(1) .folder-tab {
  padding-left: 1.4rem;
  clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 100%, 0 100%);
}

.folders .folder-body { height: clamp(320px, 25vw, 440px); }
.folders .folder-copy {
  flex: 1 1 50%;
  padding: clamp(1.3rem, 2vw, 2.1rem) clamp(1.3rem, 2vw, 2.1rem) calc(var(--tab-h) + 1rem);
}
.folders .folder-title { font-size: clamp(1.5rem, 9cqi, 2.6rem); margin: 0.7rem 0 0.55rem; }
.folders .folder-desc { font-size: clamp(0.92rem, 3.9cqi, 1.04rem); }
.folders .folder-link { margin-top: auto; }

/* пометка «Собственная разработка / Проект на заказ» */
.folder-kind {
  align-self: flex-start;
  margin-bottom: 0.75rem;
  padding: 0.3rem 0.6rem 0.28rem;
  background: var(--chip-bg);
  color: var(--chip-ink);
  font-family: var(--font-mono);
  font-size: 0.64rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
}

/* скриншот в рамке со скотчем — всегда целиком */
.folders .folder-shot {
  flex: 0 0 50%;
  height: 100%;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1.6rem calc(var(--tab-h) + 1rem) 0.4rem;
  container-type: size;
}
.folders .f-nda .folder-shot { aspect-ratio: auto; }
.shot-frame {
  position: relative;
  display: block;
  width: min(100cqw, 125cqh);
  aspect-ratio: 5 / 4;
  padding: 5px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}
.shot-clip { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; }
.folders .shot-frame img {
  position: static;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  transform: none;
}
.folders .f-nda .shot-frame img { filter: blur(9px) brightness(0.6) saturate(0.8); transform: scale(1.08); }
.folders .f-nda .nda-stamp { font-size: 1.15rem; padding: 0.6rem 1rem; }
.folders .f-nda .nda-stamp b { font-size: 1.35rem; }
.shot-frame::before,
.shot-frame::after {
  content: "";
  position: absolute;
  top: -9px;
  width: 64px;
  height: 20px;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  z-index: 2;
}
.shot-frame::before { left: -20px; rotate: -32deg; }
.shot-frame::after { right: -20px; rotate: 32deg; }

@media (max-width: 1180px) {
  .folders { grid-template-columns: 1fr; }
  .folders .folder:nth-child(1) { --tab-x: 0%; }
  .folders .folder:nth-child(2) { --tab-x: 18%; }
  .folders .folder:nth-child(3) { --tab-x: 36%; }
  .folders .folder:nth-child(4) { --tab-x: 54%; }
  .folders .folder:nth-child(5) { --tab-x: 10%; }
  .folders .folder-body { height: clamp(300px, 38vw, 420px); }
}

@media (max-width: 640px) {
  .folders { --tab-h: 2.3rem; }
  .folders .folder:nth-child(2) { --tab-x: 12%; }
  .folders .folder:nth-child(3) { --tab-x: 24%; }
  .folders .folder:nth-child(4) { --tab-x: 6%; }
  .folders .folder:nth-child(5) { --tab-x: 18%; }
  .folders .folder-tab { padding: 0 2.1rem; }
  .folders .folder-body { height: auto; }
  .folders .folder-copy { padding: 1.4rem 1.3rem 1.2rem; }
  .folders .folder-shot {
    container-type: normal;
    height: auto;
    padding: 0.4rem 1.6rem calc(var(--tab-h) + 1.1rem);
  }
  .folders .f-nda .folder-shot { aspect-ratio: auto; padding: 0.4rem 1.6rem calc(var(--tab-h) + 1.1rem); }
  .shot-frame { width: 100%; }
  .folders .folder-shot img { height: 100%; }
}

/* ============================================================
   ФОНЫ — три варианта на выбор (html[data-bg])
   ============================================================ */
main, .footer { position: relative; z-index: 2; }

/* 1 · Тетрадь: линейка и поля{ --page-bg: #f8f5ee; --header-bg: #ebe5d7; --bg-line: rgba(25, 21, 16, 0.2); }

/* 3 · Звёздная карта: бумага в точку, созвездия и изгиб реки */
html[data-bg="starmap"] { --page-bg: #f4efe3; --header-bg: #e4dccb; }
html[data-bg="starmap"] body {
  background-color: #f4efe3;
  background-image: radial-gradient(rgba(25, 21, 16, 0.11) 1px, transparent 1.5px);
  background-size: 24px 24px;
}

/* временный переключатель фона */
.bg-switch {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.5rem 0.45rem 0.8rem;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-mono);
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.bg-switch button {
  border: 0;
  padding: 0.45rem 0.65rem;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.bg-switch button[aria-pressed="true"] { background: var(--ink); color: #fff; }
@media (max-width: 520px) { .bg-switch span { display: none; } .bg-switch { left: 8px; right: 8px; justify-content: center; } }

/* холст космоса */
.space-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; display: none; }
html[data-bg="starmap"] .space-canvas { display: block; }

/* «скотч»: одна или две заплатки */
.taped, .taped-2 { position: relative; }
.taped::before,
.taped-2::before,
.taped-2::after {
  content: "";
  position: absolute;
  z-index: 3;
  height: 15px;
  background: rgba(232, 224, 202, 0.82);
  box-shadow: 0 1px 2px rgba(25, 21, 16, 0.18);
  clip-path: polygon(0 12%, 5% 0, 12% 10%, 22% 0, 80% 4%, 90% 0, 100% 10%, 97% 50%, 100% 92%, 92% 100%, 82% 90%, 10% 100%, 3% 90%, 1% 50%);
  pointer-events: none;
}
.taped::before { top: -8px; left: 50%; width: 46px; translate: -50% 0; rotate: -4deg; }
.taped-2::before { top: -6px; left: -11px; width: 34px; rotate: -38deg; }
.taped-2::after { top: -6px; right: -11px; width: 34px; rotate: 36deg; }
.st-blue.taped-2::after { rotate: 30deg; right: -9px; }
.note.taped::before { rotate: 5deg; }
.tag.taped::before { width: 40px; }

/* ============================================================
   ЛОГОТИП-ТЕРМИНАЛ (по мотивам logo/09-terminal/09c-window.svg)
   ============================================================ */
.term {
  --t-bg: #0f1419; --t-bar: #151a21; --t-line: #2a313c;
  --t-text: #e6edf3; --t-muted: #8b949e; --t-green: #39ff88; --t-dim: #5b6675;
  display: inline-flex;
  flex-direction: column;
  background: var(--t-bg);
  border: 1px solid var(--t-line);
  border-radius: 8px;
  overflow: hidden;
  font-family: var(--font-mono);
  color: var(--t-text);
  text-align: left;
  background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px);
}
.term-bar { display: flex; align-items: center; gap: 0.35em; padding: 0.45em 0.6em; background: var(--t-bar); position: relative; }
.term-bar i { width: 0.62em; height: 0.62em; border-radius: 50%; background: #ff5f57; flex-shrink: 0; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }
.term-title { position: absolute; left: 0; right: 0; text-align: center; color: var(--t-muted); font-size: 0.42em; pointer-events: none; }
.term-body { padding: 0.5em 0.9em 0.6em; }
.term-line { margin: 0; white-space: nowrap; font-weight: 700; }
.t-prompt { color: var(--t-green); }
.t-muted { color: var(--t-muted); }
.t-sep { color: var(--t-green); }
.t-ch { display: inline-block; white-space: pre; }
.t-ch.flick { animation: chFlick 0.6s steps(1) 1; }
@keyframes chFlick { 0%, 40%, 80% { opacity: 0.15; } 20%, 60%, 100% { opacity: 1; } }
.t-cursor {
  display: inline-block;
  width: 0.55em; height: 1.05em;
  margin-left: 0.08em;
  vertical-align: -0.17em;
  background: var(--t-green);
  animation: curRare 7s steps(1) infinite;
}
.term:not(.is-typed) .t-cursor { animation: curType 0.5s steps(1) infinite; }
@keyframes curType { 50% { opacity: 0; } }
@keyframes curRare { 0%, 84% { opacity: 1; } 86% { opacity: 0; } 88% { opacity: 1; } 90% { opacity: 0; } 92%, 100% { opacity: 1; } }
.term [data-after] { opacity: 0; transform: translateY(4px); transition: opacity 0.4s ease, transform 0.4s ease; }
.term [data-after].show { opacity: 1; transform: none; }
.t-ok { color: var(--t-green); font-weight: 500; }
.t-comment { color: var(--t-dim); font-weight: 400; }

/* мини — в шапке */
.term--mini { font-size: 15px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }
.term--mini .term-bar { padding: 0.32em 0.55em; gap: 0.3em; }
.term--mini .term-bar i { width: 0.5em; height: 0.5em; }
.term--mini .term-body { padding: 0.28em 0.75em 0.4em; min-width: 11.6em; }
.term--mini .t-cursor { height: 1em; }

/* большой — на главной */
.term--hero {
  font-size: clamp(1.15rem, 4.2vw, 3rem);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.term--hero .term-bar { padding: 0.5em 0.7em; }
.term--hero .term-body { padding: 0.8em 1.1em 0.9em; min-width: 13.2em; }
.term--hero .term-title { font-size: 0.36em; }
.term--hero .t-ok { font-size: 0.42em; margin-top: 0.9em; }
.term--hero .t-comment { font-size: 0.38em; margin-top: 0.7em; }
.hero-name .term { position: relative; z-index: 1; }

@media (max-width: 900px) {
  .header-inner {
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 1rem 1.6rem 1.1rem;
    clip-path: polygon(0 0, 100% 0, calc(100% - 18px) 100%, 18px 100%);
  }
}
@media (max-width: 420px) {
  .header-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.term .term-cmd { font-size: 1em; }
.term--hero { font-size: clamp(1.05rem, 3.6vw, 2.6rem); }

/* терминал без окна: только набор текста, акцент — оранжевый */
.term--plain {
  display: inline-block;
  background: none;
  background-image: none;
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  overflow: visible;
  color: inherit;
  --t-green: var(--orange);
  --t-muted: currentColor;
}
.term--plain .t-muted { opacity: 0.55; }
.term--plain.doodle-box {
  border: 4px solid var(--orange);
  padding: 0.55em 0.9em 0.5em;
  font-size: clamp(1.15rem, 4.6vw, 3.3rem);
  text-align: left;
}
.term--plain .term-cmd { font-size: 1em; }
.term--plain .t-ok { font-size: max(0.4em, 0.82rem); margin-top: 0.7em; color: var(--orange); font-weight: 600; }
.term--plain.term--mini {
  border: 0; border-radius: 0; box-shadow: none;
  font-family: var(--font-mono); font-size: 1.3rem; font-weight: 700;
  min-width: 9.6em;
  color: var(--header-ink, var(--ink));
}
.term--plain.term--mini .t-cursor { height: 0.95em; }

/* рамка с бумажной подложкой */
.term--plain.doodle-box {
  color: var(--ink);
  border: 3px solid var(--orange);
  border-radius: 10px 7px 11px 8px / 8px 11px 7px 10px;
  background-color: #fbf7ee;
  background-image:
    radial-gradient(rgba(120, 95, 60, 0.06) 1px, transparent 1.2px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(236, 226, 205, 0.35));
  background-size: 5px 5px, 100% 100%;
  box-shadow: 0 2px 4px rgba(25, 21, 16, 0.08), 0 14px 32px rgba(25, 21, 16, 0.16);
}

/* слоган — две строки, мельче */
.hero-title { max-width: none; font-size: clamp(1.15rem, 2.6vw, 1.9rem); line-height: 1.3; }

/* кнопка растёт при наведении */
.cta { transition: transform 0.25s ease, box-shadow 0.25s ease; }
.cta:hover { transform: scale(1.07); box-shadow: var(--shadow-lg); }

/* форма обратной связи */
.feedback {
  position: relative;
  max-width: 820px;
  margin: 3.4rem auto 0;
  padding: 2.4rem 2.2rem 2rem;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-md);
}
.feedback-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.5rem, 3vw, 2rem); margin: 0; }
.feedback-sub { margin: 0.4rem 0 1.6rem; color: var(--ink-soft); }
.feedback-form { display: flex; flex-direction: column; gap: 1.1rem; }
.ff-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.ff-field { display: flex; flex-direction: column; gap: 0.4rem; }
.ff-field span { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-soft); }
.ff-field input, .ff-field textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 0;
  border-bottom: 2px solid rgba(25, 21, 16, 0.25);
  background: #f3ede0;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  resize: vertical;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.ff-field input:focus, .ff-field textarea:focus { outline: none; border-bottom-color: var(--orange); background: #efe7d6; }
.ff-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.4rem; }
.ff-actions .cta { margin: 0; border: 0; cursor: pointer; font-family: var(--font-mono); }
.ff-actions .cta:disabled { opacity: 0.6; cursor: wait; transform: none; }
.ff-status { margin: 0; font-weight: 500; }
.ff-status.ok { color: var(--green); }
.ff-status.err { color: #c0392b; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
@media (max-width: 640px) { .ff-row { grid-template-columns: 1fr; } .feedback { padding: 2rem 1.3rem 1.6rem; } }

/* «>» вместо круглого значка */
.logo { gap: 0.45rem; }
.logo-prompt { font-family: var(--font-mono); font-weight: 700; font-size: 1.5rem; line-height: 1; color: var(--orange); }

/* заголовок открытого раздела — 8-битный шрифт */
.section-title {
  font-family: "Pixel Code", var(--font-mono);
  font-weight: 400;
  font-size: clamp(2.2rem, 7vw, 5rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  margin: 0.9rem 0 1.4rem;
}

/* кнопка растёт при наведении (scale не конфликтует с анимацией появления) */
.cta:hover { transform: none; scale: 1.07; }

/* папки появляются по очереди */
html.js .folders .folder[data-reveal] { transform: translateY(46px); transition-duration: 0.7s, 0.7s, 0.25s, 0.25s, 0.25s, 0.25s; }
html.js .folders .folder[data-reveal].in { transform: none; }
.folders .folder:nth-child(1) { transition-delay: 0.05s; }
.folders .folder:nth-child(2) { transition-delay: 0.22s; }
.folders .folder:nth-child(3) { transition-delay: 0.39s; }
.folders .folder:nth-child(4) { transition-delay: 0.56s; }
.folders .folder:nth-child(5) { transition-delay: 0.73s; }
.folders .folder:nth-child(6) { transition-delay: 0.9s; }

/* шапка проекта с горизонтальным кадром */
.p-hero .folder-shot--wide {
  flex: 0 0 50%;
  height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 1.8rem 2rem;
  container-type: size;
  overflow: visible;
}
.p-hero .folder-shot--wide img { width: 100%; height: 100%; max-width: 100%; object-fit: contain; }
@media (max-width: 640px) {
  .p-hero .folder-shot--wide { container-type: normal; height: auto; padding: 0.6rem 1.4rem 1.6rem; }
  .p-hero .folder-shot--wide .shot-frame { width: 100%; }
}

/* узкая полоса главного меню бота — на всю ширину галереи */
.gallery--wide figure:has(img[src*="riverwork-menu"]) { grid-column: 1 / -1; }

/* ============================================================
   ПЛАШКИ: тип проекта + статус
   ============================================================ */
.folder-plaques { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.75rem; }
.folder-plaques .folder-kind { margin-bottom: 0; }
.status-tag {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.3rem 0.65rem 0.28rem;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.64rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  box-shadow: 0 1px 3px rgba(25, 21, 16, 0.12);
}
.status-tag i { width: 0.55rem; height: 0.55rem; border-radius: 50%; flex-shrink: 0; }
.status-release i { background: #1fa35a; box-shadow: 0 0 0 3px rgba(31, 163, 90, 0.2); }
.status-dev i { background: #f08a24; box-shadow: 0 0 0 3px rgba(240, 138, 36, 0.22); }
.status-testing i { background: #7b5cf0; box-shadow: 0 0 0 3px rgba(123, 92, 240, 0.22); }
/* строка платформ — читабельнее */
.folder-date { font-size: 0.74rem; letter-spacing: 0.08em; opacity: 1; }

/* ============================================================
   ФИРМЕННЫЕ КНОПКИ: магазины, сайт, Telegram, лист ожидания
   ============================================================ */
.p-links { gap: 0.7rem; align-items: center; }
.store-badge {
  display: inline-flex; align-items: center; gap: 0.65rem;
  height: 50px;
  padding: 0 1.05rem 0 0.85rem;
  border: 0;
  border-radius: 9px;
  background: #000;
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.store-badge:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25); }
.store-badge svg { width: 26px; height: 26px; flex-shrink: 0; }
.store-badge span { display: flex; flex-direction: column; line-height: 1.05; }
.store-badge small { font-size: 0.7rem; opacity: 0.85; letter-spacing: 0.01em; }
.store-badge b { font-family: var(--font-body); font-size: 1.08rem; font-weight: 600; letter-spacing: -0.005em; }
.store-badge--img { padding: 0; background: none; box-shadow: none; border-radius: 9px; }
.store-badge--img img { display: block; height: 50px; width: auto; border-radius: 9px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18); }
.store-badge--img:hover { box-shadow: none; }
.store-badge--telegram { background: #229ed9; }
.store-badge--wait { background: var(--paper); color: var(--ink); }
.store-badge--wait svg { color: var(--orange); }

/* ============================================================
   ЛИСТ ОЖИДАНИЯ — модальное окно
   ============================================================ */
.wl {
  position: fixed; inset: 0; z-index: 120;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(25, 21, 16, 0.55);
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.wl.open { opacity: 1; visibility: visible; }
.wl-box {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 2rem 1.8rem 1.6rem;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.wl-box h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; margin: 0; }
.wl-box .wl-sub { margin: 0.4rem 0 1.3rem; color: var(--ink-soft); }
.wl-close { position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; border: 0; background: none; font-size: 1.3rem; cursor: pointer; color: var(--ink); }
.wl-form { display: flex; flex-direction: column; gap: 0.9rem; }
.wl-note { font-size: 0.8rem; color: var(--ink-soft); margin: -0.3rem 0 0; }
.wl-consent { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.85rem; color: var(--ink-soft); }
.wl-consent input { margin-top: 0.2rem; accent-color: var(--orange); }
.wl-consent a, .ff-consent a { border-bottom: 1.5px solid currentColor; }
.ff-consent { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.85rem; color: var(--ink-soft); }
.ff-consent input { margin-top: 0.2rem; accent-color: var(--orange); }

/* плашки на папке — в одну строку */
.folders .folder-plaques { gap: 0.35rem; flex-wrap: nowrap; }
.folders .folder-plaques > span { font-size: 0.6rem; letter-spacing: 0.06em; padding: 0.28rem 0.5rem 0.26rem; white-space: nowrap; }
