/* Smudge website: sketchbook paper, charcoal ink, red pencil. */

@font-face {
  font-family: "Cabin Sketch";
  src: url("../fonts/CabinSketch-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Patrick Hand";
  src: url("../fonts/PatrickHand-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --paper: #ECE6D9;
  --paper-light: #F6F1E6;
  --paper-shade: #DDD4C2;
  --rule: #D6CDBC;
  --ink: #1F1D1A;
  --charcoal: #2B2825;
  --pencil: #4A4640;
  --red: #A8322A;
  --red-ink: #8A2620;
  --tape: rgba(224, 217, 168, 0.85);
  --star: #E0B04B;
  --sleeve: #3F5A74;
  --book1: #ECE6D9;
  --book2: #C9D3D8;
  --book3: #E9DDC4;
  --book4: #2B2825;
  --radius: 10px;
  --shadow: 6px 7px 0 var(--ink);
  --title: "Cabin Sketch", "Chalkboard SE", "Comic Sans MS", cursive;
  --body: "Patrick Hand", "Segoe Print", "Chalkboard SE", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  color: var(--ink);
  font: 21px/1.5 var(--body);
  background-color: var(--paper);
  /* Ruled sketchbook lines. */
  background-image: repeating-linear-gradient(to bottom, transparent 0 39px, var(--rule) 39px 40px);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
html { overflow-x: clip; }
/* Red margin line, on wide screens. */
body::before {
  content: "";
  position: fixed;
  inset: 0 auto 0 56px;
  width: 2px;
  background: rgba(168, 50, 42, 0.32);
  pointer-events: none;
  z-index: 0;
}
@media (max-width: 760px) { body::before { display: none; } }

img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--red); }
a:hover { color: var(--red-ink); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; position: relative; z-index: 1; }
.wrap--narrow { width: min(820px, 100% - 32px); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; z-index: 50; border-radius: 6px; }
.skip:focus { left: 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 10px 24px;
  font: 22px/1 var(--body); text-decoration: none; cursor: pointer;
  border: 2.5px solid var(--ink); border-radius: 8px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn--ink { background: var(--ink); color: var(--paper); box-shadow: 4px 4px 0 rgba(31, 29, 26, 0.25); }
.btn--ink:hover { color: var(--paper); transform: translate(-1px, -2px); box-shadow: 6px 7px 0 rgba(31, 29, 26, 0.25); }
.btn--line { background: transparent; color: var(--ink); }
.btn--line:hover { color: var(--ink); background: var(--paper-light); }
.btn:active { transform: scale(0.97); }
.btn--small { min-height: 42px; padding: 8px 16px; font-size: 19px; }
.btn--play { padding-inline: 26px; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(236, 230, 217, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 2px solid var(--ink);
}
.top__row { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.top__brand img { height: 46px; width: auto; }
.top__nav { display: flex; gap: 22px; margin-left: auto; }
.top__nav a { color: var(--ink); text-decoration: none; font-size: 21px; position: relative; }
.top__nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2.5px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform 0.2s; border-radius: 2px; }
.top__nav a:hover::after { transform: scaleX(1); }
@media (max-width: 900px) { .top__nav { display: none; } .top__row .btn { margin-left: auto; } }

/* Hero */
.hero { padding: 56px 0 72px; position: relative; }
.hero::after {
  /* A smudge of charcoal behind the screenshot. */
  content: ""; position: absolute; right: 0; top: 18%; width: 52%; height: 60%;
  background: radial-gradient(closest-side, rgba(43, 40, 37, 0.16), transparent);
  filter: blur(10px); z-index: 0; pointer-events: none;
}
.hero__grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero__logo { width: min(520px, 100%); margin: -12px 0 0 -10px; }
.hero__tag { font: 700 46px/1.1 var(--title); margin: 6px 0 14px; -webkit-text-stroke: 1.2px var(--ink); }
.scribble { position: relative; white-space: nowrap; }
.scribble::after {
  content: ""; position: absolute; left: -4px; right: -6px; bottom: -6px; height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 10' preserveAspectRatio='none'%3E%3Cpath d='M2 6 C40 2 80 9 120 5 S180 3 198 6' fill='none' stroke='%23A8322A' stroke-width='3.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}
.hero__lead { font-size: 23px; color: var(--pencil); max-width: 34ch; margin: 0 0 24px; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 14px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 24px 0 0; }
.chips li { border: 1.8px dashed var(--pencil); border-radius: 999px; padding: 4px 14px; font-size: 18px; color: var(--pencil); background: rgba(246, 241, 230, 0.7); }
.hero__shot { margin: 0; transform: rotate(1.6deg); position: relative; z-index: 1; }
.hero__shot img { border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--paper); }
.hero__shot figcaption { margin-top: 14px; font-size: 18px; color: var(--pencil); text-align: center; transform: rotate(-1deg); }
@media (max-width: 960px) {
  .hero { padding-top: 28px; }
  .hero__grid { grid-template-columns: 1fr; gap: 34px; }
  .hero__tag { font-size: 38px; }
  .hero__shot { transform: rotate(0.8deg); }
}

/* Tape strips on taped-down pictures. */
.taped { position: relative; }
.taped::before, .taped::after {
  content: ""; position: absolute; width: 96px; height: 28px; background: var(--tape);
  border: 1px solid rgba(185, 174, 120, 0.8); z-index: 2; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.taped::before { top: -13px; left: 18px; transform: rotate(-7deg); }
.taped::after { top: -12px; right: 18px; transform: rotate(6deg); }
.taped--wide::before { left: 8%; } .taped--wide::after { right: 8%; }

/* Sections */
.section { padding: 76px 0; position: relative; }
.section--shade { background: rgba(221, 212, 194, 0.45); border-block: 2px dashed rgba(74, 70, 64, 0.35); }
.section__title { font: 700 clamp(34px, 4.2vw, 50px)/1.1 var(--title); margin: 0 0 10px; -webkit-text-stroke: 1.2px var(--ink); paint-order: stroke fill; }
.section__lead { color: var(--pencil); font-size: 22px; margin: 0 0 36px; max-width: 60ch; }

/* Features */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.feature {
  background: var(--paper-light); border: 2.5px solid var(--ink); border-radius: var(--radius);
  padding: 22px 20px 20px; box-shadow: 4px 5px 0 rgba(31, 29, 26, 0.85);
}
.feature:nth-child(odd) { transform: rotate(-0.6deg); } .feature:nth-child(even) { transform: rotate(0.6deg); }
.feature__icon { width: 58px; height: 58px; fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.feature:nth-child(4) .feature__icon { fill: var(--star); }
.feature h3 { font: 400 27px/1.15 var(--body); margin: 10px 0 6px; }
.feature p { margin: 0; color: var(--pencil); font-size: 19px; }
@media (max-width: 1000px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } .feature { transform: none !important; } }

/* Video */
.video { border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--ink); }
.video video { width: 100%; border-radius: calc(var(--radius) - 3px); aspect-ratio: 16 / 9; background: var(--ink); }

/* Sketchbooks */
.books { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.book {
  border: 2.5px solid var(--ink); border-radius: 4px 14px 14px 4px; overflow: hidden;
  box-shadow: 5px 6px 0 var(--ink); display: flex; flex-direction: column;
  border-left-width: 10px;
}
.book img { width: 100%; aspect-ratio: 800 / 360; object-fit: cover; border-bottom: 2.5px solid var(--ink); }
.book__body { padding: 18px 22px 22px; }
.book__meta { margin: 0; font-size: 17px; opacity: 0.8; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.book h3 { font: 700 32px/1.1 var(--title); margin: 4px 0 8px; -webkit-text-stroke: 1px currentColor; }
.book p:last-child { margin: 0; font-size: 19px; }
.book--1 { background: var(--book1); }
.book--2 { background: var(--book2); }
.book--3 { background: var(--book3); }
.book--4 { background: var(--book4); color: var(--paper); border-color: var(--ink); }
.book--4 .badge { border-color: var(--paper); color: var(--paper); }
.badge { border: 1.6px solid currentColor; border-radius: 999px; padding: 0 10px; font-size: 15px; line-height: 1.6; }
.badge--free { background: var(--red); color: var(--paper); border-color: var(--red); }
@media (max-width: 760px) { .books { grid-template-columns: 1fr; } }

/* Gallery */
.gallery { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.gallery button {
  display: block; width: 100%; padding: 0; border: 2.5px solid var(--ink); border-radius: 8px;
  background: var(--paper); cursor: zoom-in; overflow: hidden; box-shadow: 3px 4px 0 rgba(31, 29, 26, 0.8);
  transition: transform 0.15s ease;
}
.gallery li:nth-child(3n+1) button { transform: rotate(-0.8deg); }
.gallery li:nth-child(3n+2) button { transform: rotate(0.6deg); }
.gallery button:hover { transform: rotate(0deg) scale(1.03); }
.gallery img { width: 100%; aspect-ratio: 800 / 360; object-fit: cover; }
@media (max-width: 1000px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .gallery { grid-template-columns: 1fr; } }

.lightbox { border: 3px solid var(--ink); border-radius: 12px; padding: 14px; background: var(--paper); max-width: min(1280px, 96vw); width: 100%; box-shadow: var(--shadow); }
.lightbox::backdrop { background: rgba(31, 29, 26, 0.78); }
.lightbox figure { margin: 0; }
.lightbox img { width: 100%; border-radius: 6px; border: 2px solid var(--ink); }
.lightbox figcaption { font: 400 26px/1.2 var(--body); text-align: center; margin: 12px 0 4px; }
.lightbox__bar { display: flex; justify-content: center; gap: 12px; margin-top: 8px; }

/* Fair to play */
.fair { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 40px; align-items: start; }
.checklist {
  list-style: none; margin: 0; padding: 24px 28px; background: var(--paper-light);
  border: 2.5px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow);
}
.checklist li { position: relative; padding: 10px 0 10px 44px; border-bottom: 1.5px solid var(--rule); font-size: 20px; }
.checklist li:last-child { border-bottom: 0; }
.checklist li::before {
  content: ""; position: absolute; left: 4px; top: 14px; width: 26px; height: 26px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Cpath d='M4 14l6 6L22 5' fill='none' stroke='%23A8322A' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
}
@media (max-width: 860px) { .fair { grid-template-columns: 1fr; gap: 6px; } }

/* FAQ */
.faq { background: var(--paper-light); border: 2.2px solid var(--ink); border-radius: 8px; margin: 0 0 14px; padding: 0 20px; }
.faq summary { cursor: pointer; font: 400 24px/1.3 var(--body); padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--body); font-size: 30px; line-height: 1; color: var(--red); transition: transform 0.2s; }
.faq[open] summary::after { transform: rotate(45deg); }
.faq p { margin: 0 0 18px; color: var(--pencil); font-size: 20px; }

/* Final call to action */
.cta { padding: 90px 0 96px; }
.cta__box {
  text-align: center; background: var(--paper-light); border: 3px solid var(--ink); border-radius: 14px;
  box-shadow: var(--shadow); padding: 44px 24px 48px; width: min(780px, 100% - 32px);
}
.cta__box img { width: min(330px, 80%); margin: 0 auto 6px; }
.cta__box h2 { font: 700 clamp(30px, 4vw, 42px)/1.15 var(--title); margin: 0 0 6px; -webkit-text-stroke: 1.2px var(--ink); }
.cta__box p { color: var(--pencil); margin: 0 0 22px; }

/* Footer */
.foot { border-top: 2px solid var(--ink); background: var(--charcoal); color: var(--paper); padding: 26px 0; position: relative; z-index: 1; }
.foot__row { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.foot p { margin: 0; font-size: 18px; opacity: 0.85; }
.foot nav { display: flex; gap: 20px; }
.foot a { color: var(--paper); }
.foot a:hover { color: var(--star); }

/* Gentle entrance as sections scroll into view (added by site.js). */
.js .reveal { opacity: 0; translate: 0 18px; transition: opacity 0.5s ease, translate 0.5s ease; }
.js .reveal.is-in { opacity: 1; translate: 0 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; translate: none; }
}
