:root {
  --paper: #fff5d9;
  --paper-2: #ffeec0;
  --ink: #2f2219;
  --soft: #7a6553;
  --cherry: #c8324b;
  --mint: #bfe0dc;
  --hand: "Caveat", "Bradley Hand", "Segoe Print", cursive;
  --serif: "Lora", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 18px/1.65 var(--serif);
  background-image: radial-gradient(rgba(47, 34, 25, .07) 1px, transparent 1.2px);
  background-size: 22px 22px;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--cherry); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { text-decoration-style: wavy; }
:focus-visible { outline: 3px dashed var(--cherry); outline-offset: 4px; }
h1, h2, h3 { font-family: var(--hand); font-weight: 700; line-height: 1; margin: 0; }
.wrap { width: min(1080px, 100% - 40px); margin: 0 auto; }

/* шапка */
.head { padding: 26px 0 0; }
.head__row { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.head__brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font: 700 30px var(--hand); }
.head__brand img { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--ink); object-fit: cover; }
.head nav { display: flex; gap: 22px; font: 600 24px var(--hand); }
.head nav a { color: var(--ink); text-decoration: none; }
.head nav a:hover { color: var(--cherry); }

.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; padding: 60px 0 70px; }
.hero h1 { font-size: clamp(56px, 8.5vw, 112px); letter-spacing: -.01em; }
.hero h1 em { font-style: normal; color: var(--cherry); position: relative; }
.hero h1 em::after {
  content: ""; position: absolute; left: -4%; right: -4%; bottom: .02em; height: .2em; z-index: -1;
  background: var(--mint); transform: rotate(-1.5deg); border-radius: 4px;
}
.hero__lead { margin: 24px 0 0; font-size: 20px; max-width: 30em; }
.hero__pic { position: relative; justify-self: center; width: min(360px, 80%); }
.hero__pic img { border-radius: 50%; border: 3px solid var(--ink); aspect-ratio: 1; object-fit: cover; width: 100%; }
.sticker {
  position: absolute; font: 700 26px/1 var(--hand); background: #fff; border: 2px solid var(--ink);
  padding: 8px 14px; border-radius: 30px; transform: rotate(-8deg); white-space: nowrap;
  box-shadow: 3px 3px 0 var(--ink);
}
.sticker--a { left: -24px; top: 12%; }
.sticker--b { right: -16px; bottom: 10%; transform: rotate(6deg); background: var(--cherry); color: #fff; }
.hero__pic:hover .sticker--a { transform: rotate(-14deg) scale(1.05); }
.sticker { transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }

.section-title { font-size: clamp(44px, 6vw, 68px); margin-bottom: 26px; }
.section-title small { font: italic 400 17px var(--serif); color: var(--soft); margin-left: 12px; letter-spacing: 0; }

/* обо мне */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 40px 0 80px; border-top: 2px dashed rgba(47, 34, 25, .25); }
.about p { margin: 0 0 16px; }
.facts ul { list-style: none; margin: 0; padding: 0; }
.facts { margin: 0; padding: 26px 28px; background: #fff; border: 2px solid var(--ink); border-radius: 6px; transform: rotate(1deg); box-shadow: 6px 6px 0 var(--mint); }
.facts h3 { font-size: 34px; margin-bottom: 10px; }
.facts li { padding: 8px 0 8px 30px; position: relative; border-bottom: 1px dashed rgba(47, 34, 25, .2); font-size: 17px; }
.facts li:last-child { border: 0; }
.facts li::before { content: "✓"; position: absolute; left: 2px; top: 6px; color: var(--cherry); font-weight: 700; }

/* записи */
.posts { padding: 40px 0 80px; border-top: 2px dashed rgba(47, 34, 25, .25); }
.post-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
.post-card {
  position: relative; display: block; padding: 26px 28px 24px; background: #fffdf6; color: var(--ink); text-decoration: none;
  border: 2px solid var(--ink); border-radius: 4px; transition: transform .25s, box-shadow .25s;
}
.post-card:hover { transform: translate(-3px, -3px) rotate(-.4deg); box-shadow: 6px 6px 0 var(--ink); text-decoration: none; }
.post-card time { font: italic 400 15px var(--serif); color: var(--soft); }
.post-card h3 { font-size: 38px; margin: 6px 0 10px; color: var(--cherry); }
.post-card p { margin: 0; font-size: 16.5px; }
.post-card .more { display: inline-block; margin-top: 14px; font: 700 22px var(--hand); }
.post-card .tape {
  position: absolute; top: -12px; left: 50%; width: 90px; height: 24px; transform: translateX(-50%) rotate(-3deg);
  background: rgba(191, 224, 220, .85); border: 1px solid rgba(47, 34, 25, .15);
}
.post-list li:nth-child(even) .tape { background: rgba(246, 201, 184, .9); transform: translateX(-50%) rotate(4deg); }

/* галерея */
.gallery { padding: 40px 0 90px; border-top: 2px dashed rgba(47, 34, 25, .25); }
.snaps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 34px 26px; margin: 0; padding: 10px 0 0; }
.snap { margin: 0; background: #fff; padding: 12px 12px 14px; border: 1px solid rgba(47, 34, 25, .2); box-shadow: 0 10px 18px -12px rgba(47, 34, 25, .45); transition: transform .3s cubic-bezier(.3, 1.4, .5, 1); }
.snap:nth-child(4n+1) { transform: rotate(-2.5deg); }
.snap:nth-child(4n+2) { transform: rotate(1.8deg) translateY(14px); }
.snap:nth-child(4n+3) { transform: rotate(-1deg); }
.snap:nth-child(4n+4) { transform: rotate(2.6deg) translateY(8px); }
.snap:hover, .snap:focus-within { transform: rotate(0) scale(1.04); z-index: 2; position: relative; }
.snap button { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.snap img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.snap figcaption { font: 600 21px/1.1 var(--hand); margin-top: 10px; text-align: center; }

/* лайтбокс */
.lightbox { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-columns: 70px 1fr 70px; align-items: center; background: rgba(36, 25, 18, .9); padding: 20px; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; justify-self: center; text-align: center; background: #fff; padding: 14px 14px 18px; max-width: min(640px, 100%); animation: lb-in .3s cubic-bezier(.3, 1.4, .5, 1); }
.lightbox img { max-height: calc(100vh - 160px); width: auto; margin: 0 auto; }
.lightbox figcaption { font: 600 26px/1.15 var(--hand); color: var(--ink); margin-top: 10px; }
.lightbox .count { font: italic 14px var(--serif); color: var(--soft); display: block; margin-top: 4px; }
.lb-btn { width: 54px; height: 54px; border-radius: 50%; border: 2px solid #fff; background: transparent; color: #fff; font-size: 24px; cursor: pointer; justify-self: center; }
.lb-btn:hover { background: #fff; color: var(--ink); }
.lb-close { position: absolute; top: 18px; right: 18px; }
@keyframes lb-in { from { transform: scale(.92) rotate(-2deg); opacity: 0; } }

/* подвал */
.foot { padding: 30px 0 40px; border-top: 2px solid var(--ink); font-size: 15px; color: var(--soft); }
.foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot b { font: 700 22px var(--hand); color: var(--ink); }

/* страница записи */
.article { width: min(720px, 100% - 40px); margin: 0 auto; padding: 50px 0 80px; }
.article .back { font: 700 24px var(--hand); text-decoration: none; }
.article time { display: block; margin-top: 30px; font: italic 16px var(--serif); color: var(--soft); }
.article h1 { font-size: clamp(48px, 8vw, 84px); color: var(--cherry); margin: 8px 0 30px; }
.article p { margin: 0 0 20px; }
.article h2 { font-size: 40px; margin: 40px 0 14px; }
.article ol, .article ul { padding-left: 24px; margin: 0 0 22px; }
.article li { margin-bottom: 8px; }
.article blockquote { margin: 30px 0; padding: 14px 24px; border-left: 4px solid var(--cherry); background: #fff; font: 600 28px/1.2 var(--hand); }
.article .pic { margin: 30px 0; background: #fff; padding: 12px 12px 14px; border: 1px solid rgba(47, 34, 25, .2); transform: rotate(-1deg); }
.article .pic figcaption { font: 600 22px var(--hand); text-align: center; margin-top: 8px; }
.next { margin-top: 50px; padding-top: 20px; border-top: 2px dashed rgba(47, 34, 25, .25); display: flex; justify-content: space-between; gap: 16px; font: 700 24px var(--hand); flex-wrap: wrap; }
.next a { text-decoration: none; }

@media (max-width: 900px) {
  .snaps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  body { font-size: 17px; }
  .hero { grid-template-columns: 1fr; padding: 34px 0 50px; }
  .hero__pic { width: 70%; order: -1; }
  .about { grid-template-columns: 1fr; }
  .post-list { grid-template-columns: 1fr; }
  .head nav { font-size: 21px; gap: 16px; }
  .lightbox { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto; padding: 14px; gap: 14px; }
  .lightbox figure { grid-column: 1 / -1; grid-row: 1; }
  .lb-prev { grid-row: 2; } .lb-next { grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
