/* ========== Pillow Path — Global Styles (no external libs) ========== */

/* Local fonts (положи TTF в /fonts/) */
@font-face {
  font-family: "ManropePP";
  src: url("../fonts/Manrope-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ManropePP";
  src: url("../fonts/Manrope-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "MerriweatherPP";
  src: url("../fonts/Merriweather-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Ahşap + tekstil paleti */
  --pp-bg-cloth: #f6f2ee;
  --pp-bg-weave: #f0ebe6;
  --pp-wood-300: #b78e63;
  --pp-wood-500: #8a6440;
  --pp-wood-700: #5e3e24;

  --pp-ink: #2b2926;
  --pp-ink-soft: #57524b;
  --pp-cream: #fffaf5;

  --pp-accent: #8a6440; /* wood */
  --pp-accent-2: #9f846a; /* thread */

  --pp-radius: 16px;
  --pp-radius-lg: 24px;
  --pp-shadow: 0 10px 25px rgba(0,0,0,.08);
  --pp-stitch: repeating-linear-gradient(90deg,#0000 0 8px, rgba(138,100,64,.6) 8px 10px);

  /* типоразмеры */
  --pp-fs-1: clamp(2rem, 2.5vw + 1rem, 3rem);
  --pp-fs-2: clamp(1.25rem, 1.2vw + .9rem, 1.8rem);
  --pp-fs-3: clamp(1rem, .7vw + .8rem, 1.2rem);

  /* прочее */
  --pp-maxw: 1200px;
}

/* Reset + base */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "ManropePP", system-ui, -apple-system, Segoe UI, Roboto, Arial, "Helvetica Neue", sans-serif;
  color: var(--pp-ink);
  background:
    repeating-linear-gradient(0deg, var(--pp-bg-cloth) 0 24px, var(--pp-bg-weave) 24px 48px);
  background-attachment: fixed;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; height: auto; max-width: 350px; border-radius: 12px; }
figure { margin: 0; }
a { color: var(--pp-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
abbr[title] { text-decoration: none; border-bottom: 1px dotted currentColor; }

.pp-wrap { width: min(100% - 2rem, var(--pp-maxw)); margin-inline: auto; }

/* Headings */
.pp-h2 {
  font-family: "MerriweatherPP", serif;
  font-size: var(--pp-fs-1);
  line-height: 1.15;
  letter-spacing: .2px;
  margin: 0 0 .75rem;
}
.pp-h3 { font-size: var(--pp-fs-2); margin: 0 0 .5rem; }
.pp-lead { font-size: clamp(1.05rem, .6vw + .9rem, 1.25rem); color: var(--pp-ink-soft); }

/* Header */
.pp-header {
  position: sticky; top: 0; z-index: 60;
  background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,255,255,.74));
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(138,100,64,.18);
}
.pp-header__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 0;
}
.pp-logo {
  font-family: "MerriweatherPP", serif;
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--pp-ink);
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .25rem .5rem;
  border-radius: 10px;
  position: relative;
}
.pp-logo span { color: var(--pp-accent); }
.pp-logo::after {
  /* stitched underline */
  content: ""; position: absolute; left: .5rem; right: .5rem; bottom: 0;
  height: 2px; background: var(--pp-stitch); opacity: .6;
}

/* Nav + burger */
.pp-nav { position: relative; }
.pp-burger {
  display: none; background: transparent; border: 0; padding: .25rem; cursor: pointer;
}
.pp-burger__bar { display: block; width: 26px; height: 2px; background: var(--pp-ink); margin: 6px 0; transition: transform .3s ease, opacity .3s ease; }

.pp-menu {
  display: flex; align-items: center; gap: 1rem; list-style: none; margin: 0; padding: 0;
}
.pp-menu a {
  display: inline-block; padding: .5rem .75rem; border-radius: 999px; position: relative;
}
.pp-menu a::after {
  content: ""; position: absolute; inset: auto 0 -2px 0; height: 2px; background: var(--pp-stitch); opacity: 0; transition: opacity .3s ease, transform .3s ease; transform: scaleX(.6);
}
.pp-menu a:hover::after { opacity: .9; transform: scaleX(1); }
.pp-menu__sep { width: 1px; height: 22px; background: rgba(0,0,0,.12); }

.pp-woodbar { height: 6px; background:
  linear-gradient(90deg, rgba(138,100,64,.35), rgba(94,62,36,.35)),
  repeating-linear-gradient(90deg, #caa882 0 12px, #a77f57 12px 24px, #caa882 24px 36px);
  box-shadow: inset 0 1px rgba(255,255,255,.35), 0 1px 0 rgba(0,0,0,.06);
}

/* Main + sections */
.pp-main { padding-top: .5rem; }
.pp-section { padding: clamp(2rem, 3vw + 1rem, 4rem) 0; position: relative; }
.pp-anchor { height: 1px; }

/* Footer */
.pp-footer { background: #fff; border-top: 1px solid rgba(0,0,0,.08); }
.pp-footer__grid {
  display: grid; gap: 1.25rem; grid-template-columns: 1.2fr .8fr; padding: 1.5rem 0;
}
.pp-footer__nav ul { margin: 0; padding: 0; list-style: none; }
.pp-footer__nav a { padding: .25rem 0; display: inline-block; }
.pp-footer__legal { grid-column: 1/-1; color: var(--pp-ink-soft); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-inview { opacity: 1; transform: none; }

/* Focus */
:focus-visible { outline: 2px dashed var(--pp-accent); outline-offset: 2px; }

/* Media queries */
@media (max-width: 1024px) {
  .pp-menu { gap: .5rem; }
}
@media (max-width: 880px) {
  .pp-burger { display: inline-block; }
  .pp-menu {
    position: absolute; right: 0; top: calc(100% + 8px);
    flex-direction: column; align-items: flex-start;
    padding: .75rem; border-radius: 12px;
    background: rgba(255,255,255,.95);
    box-shadow: var(--pp-shadow);
    transform-origin: top right;
    transform: scale(.98); opacity: 0; pointer-events: none;
    min-width: 220px;
  }
  .pp-menu.is-open { opacity: 1; transform: scale(1); pointer-events: auto; }
}
@media (max-width: 640px) {
  .pp-footer__grid { grid-template-columns: 1fr; }
}
/* H1 не прилипает к краю и центрируется как контент в .pp-wrap */
.pp-main > h1:not(.pp-visually-hidden) {
  display: block;
  width: min(100% - 2rem, var(--pp-maxw));
  margin: .75rem auto 0;   /* центрируем и даём отступ сверху */
  padding: 0;
  font-family: "MerriweatherPP", serif;
  font-weight: 400;
  font-size: clamp(1.6rem, 1.6vw + 1rem, 2.2rem);
  line-height: 1.15;
}
/* H1 как внутри .pp-wrap — не прилипает к краю */
.pp-main > h1 {
  display: block;
  max-width: var(--pp-maxw);
  margin: 1rem auto .5rem;   /* центрируем блок */
  padding: 0 1rem;           /* такие же поля, как у .pp-wrap (2rem суммарно) */
  box-sizing: border-box;
  text-wrap: balance;
}
/* --- Fixed header --- */
:root { --pp-header-h: 72px; } /* базовая высота; точную зададим из JS */

.pp-header {
  position: fixed; /* было: sticky */
  top: 0; left: 0; right: 0;
  z-index: 1000;
  overflow: visible;
}

/* контент уезжает ниже фикс-хедера */
.pp-main { 
  padding-top: calc(var(--pp-header-h) + 6px); /* + деревянная полоска */
}

/* при клике по якорям не перекрывать заголовки хедером */
.pp-anchor,
.pp-section[id] {
  scroll-margin-top: calc(var(--pp-header-h) + 10px);
}

/* на маленьких экранах хедер обычно выше — слегка увеличим запас */
@media (max-width: 880px) {
  :root { --pp-header-h: 84px; }
}
/* ===== Unique Footer — Loom & Stitch ===== */
.pp-footer--loom{
  position: relative;
  color: var(--pp-ink);
  background: #fff;
  border-top: 1px solid rgba(0,0,0,.08);
}
.pp-footer__topbar{
  height: 12px; position: relative;
  background:
    linear-gradient(90deg, rgba(138,100,64,.35), rgba(94,62,36,.35)),
    repeating-linear-gradient(90deg,#caa882 0 12px,#a77f57 12px 24px,#caa882 24px 36px);
  box-shadow: inset 0 1px rgba(255,255,255,.45), 0 1px 0 rgba(0,0,0,.06);
}
.pp-footer__topbar i{
  position:absolute; left:0; right:0; height:2px; opacity:.35; pointer-events:none;
  background: linear-gradient(90deg, var(--pp-accent-2), transparent 55%, var(--pp-accent-2));
  animation: pp-footer-loom 11s linear infinite;
}
.pp-footer__topbar i:nth-child(1){ top:-6px; animation-duration: 13s; }
.pp-footer__topbar i:nth-child(2){ top:-3px; animation-duration: 11s; }
.pp-footer__topbar i:nth-child(3){ top: 0;   animation-duration: 9s; }
@keyframes pp-footer-loom{ from{ background-position-x:-40%; } to{ background-position-x:140%; } }

.pp-footer__grid{
  display:grid; gap: 1rem;
  grid-template-columns: 1.1fr .7fr .7fr .9fr;
  padding: 1.25rem 0;
  position: relative;
}
.pp-footer__grid::after{
  content:""; position:absolute; inset: 8px 0 auto 0; height:2px; opacity:.5;
  background: var(--pp-stitch);
}

.pp-logo--footer{ font-size: 1.35rem; display:inline-block; margin-bottom:.3rem; }
.pp-h4{ font-size: clamp(1rem,.6vw + .85rem,1.1rem); margin: 0 0 .35rem; }

.pp-footer__nav ul,
.pp-footer__legal ul{ margin:0; padding:0; list-style:none; }
.pp-footer__nav a, .pp-footer__legal a{ display:inline-block; padding:.25rem 0; }

.pp-footer__contact p{ margin:.2rem 0; }
.pp-toplink{
  display:inline-block; margin-top:.35rem; padding:.35rem .6rem; border-radius:999px;
  border:1px solid rgba(0,0,0,.12); box-shadow: var(--pp-shadow); background:#fff;
  text-decoration:none;
}
.pp-toplink:hover{ transform: translateY(-2px); }

@media (max-width: 1024px){
  .pp-footer__grid{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px){
  .pp-footer__grid{ grid-template-columns: 1fr; }
}
