/* ===== Стиль «Тетрадь»: бумага, зерно, градиенты, рукописные заметки =====
   Работает, когда у <html> есть класс .nb */

.nb-only{display:none}
html.nb .nb-only{display:block}

/* бумага в клетку */
html.nb body{
  background-color:#FBFAF6;
  background-image:
    linear-gradient(rgba(30,59,214,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30,59,214,.055) 1px, transparent 1px);
  background-size:26px 26px;
}
html.nb .top{background:rgba(251,250,246,.88)}

/* зерно поверх всей страницы */
html.nb body:after{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:60;opacity:.16;mix-blend-mode:multiply;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* мягкие синие градиенты с зерном на всех синих блоках */
html.nb .band, html.nb .contact, html.nb .ap.plus, html.nb .fcard.accent, html.nb .btn.main, html.nb .top .cta{
  background:
    radial-gradient(120% 90% at 10% 0%, #5C78FF 0%, rgba(92,120,255,0) 55%),
    radial-gradient(90% 80% at 100% 100%, #0E1C86 0%, rgba(14,28,134,0) 60%),
    #1E3BD6;
}
html.nb .band, html.nb .contact{position:relative;overflow:hidden}
html.nb .band:before, html.nb .contact:before{
  content:"";position:absolute;inset:0;pointer-events:none;opacity:.35;mix-blend-mode:soft-light;
  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='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
html.nb .band > *, html.nb .contact > *{position:relative}

/* светлые карточки — как листочки бумаги */
html.nb .intro-box, html.nb .ap:not(.plus), html.nb .fcard:not(.accent), html.nb .extra-grid > div, html.nb .note > div, html.nb .not li{
  background:#fff;border:1px solid #ECEAE2;box-shadow:0 1px 0 rgba(20,22,58,.04), 0 8px 24px -14px rgba(20,22,58,.18);
}
html.nb .intro-box{background:linear-gradient(180deg,#fff 0%,#F6F8FF 100%)}

/* мягкое синее свечение за фото */
html.nb .hero .photo-frame:after{
  content:"";position:absolute;inset:-40px -50px -50px -40px;z-index:-1;border-radius:50%;
  background:radial-gradient(closest-side, rgba(92,120,255,.28), rgba(92,120,255,0));filter:blur(8px);
}
html.nb .photo-frame:before{border-style:dashed;border-width:2px;opacity:.75}

/* рукописные заметки */
.hn{font-family:Caveat,cursive;font-weight:500;color:#2340CF;line-height:1.1;position:absolute;z-index:3;pointer-events:none}
.hn svg{display:block;stroke:#2340CF;fill:none;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.hn-photo{left:-92px;top:-10px;font-size:30px;transform:rotate(-8deg);display:flex;align-items:flex-start;gap:2px}
.hn-photo svg{margin-top:14px}
.hn-first{left:0;bottom:-72px;font-size:25px;transform:rotate(-2deg);display:flex;align-items:flex-start;gap:6px;white-space:nowrap}
.hero .facts{position:relative}

/* стикер-записка */
.sticky{position:relative;background:#FFFDF2;color:#2B2A33;font-family:Caveat,cursive;font-weight:500;font-size:27px;line-height:1.2;padding:26px 26px 22px;border-radius:4px;box-shadow:0 10px 24px -12px rgba(20,22,58,.35);transform:rotate(-2.2deg);max-width:340px}
.sticky:before{content:"";position:absolute;top:-12px;left:50%;width:96px;height:26px;transform:translateX(-50%) rotate(3deg);background:rgba(160,180,255,.55);border-radius:2px}
.sticky.r{transform:rotate(1.8deg)}
.band .sticky{margin:30px 0 0 auto}

/* маркерное выделение и подчёркивание от руки */
html.nb .hl{background:linear-gradient(transparent 58%, rgba(120,145,255,.35) 58%, rgba(120,145,255,.35) 92%, transparent 92%);padding:0 .08em}
html.nb .scribble{position:relative;white-space:nowrap}
html.nb .scribble:after{content:"";position:absolute;left:-2%;right:-2%;bottom:-.18em;height:.42em;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath d='M3 13 C 40 5, 80 16, 120 9 S 180 6, 197 11' fill='none' stroke='%235C78FF' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E") center/100% 100% no-repeat}

.hn-contact{font-size:28px;color:#fff!important;transform:rotate(-3deg);margin-top:26px;position:static;display:flex;align-items:center;gap:8px}
.hn-contact svg{stroke:#fff}

@media(max-width:900px){
  .hero .photo-frame{margin-top:52px}
  .hn-photo{left:auto;right:56px;top:-54px;font-size:26px}
  .hn-first{position:static;margin-top:16px;white-space:normal}
  .band .sticky{margin:26px auto 0}
}
html.nb .hn-photo.nb-only, html.nb .hn-first.nb-only, html.nb .hn-contact.nb-only{display:flex}
@media(max-width:900px){html.nb .hn-first.nb-only{display:flex}}
