@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;600;700&family=Patrick+Hand&family=Libre+Baskerville:wght@400;700&display=swap');
:root {
  --ink: #30271e;
  --ink2: #5b4835;
  --paper: #f1e3c3;
  --paper2: #dfcda9;
  --red: #a44936;
  --green: #56664a;
  --gold: #a37d43;
  --bg: #322b23;
  --shadow: 0 15px 45px #1b160f77;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Patrick Hand', 'Comic Sans MS', cursive;
  font-size: 19px;
}
body:before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.13;
  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='.48' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px dashed var(--red);
  outline-offset: 4px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2,
h3,
.script {
  font-family: 'Caveat', 'Comic Sans MS', cursive;
  font-weight: 700;
}
h1 {
  font-size: clamp(4.4rem, 11vw, 9.5rem);
  line-height: 0.82;
  letter-spacing: -0.045em;
}
h2 {
  font-size: clamp(3.3rem, 7vw, 6.3rem);
  line-height: 0.95;
}
h3 {
  font-size: 2.5rem;
  line-height: 1;
}
p {
  line-height: 1.5;
}
.small {
  font-size: 0.86rem;
}
.muted {
  opacity: 0.72;
}
.eyebrow {
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--red);
}
.hand {
  font-family: 'Caveat', cursive;
  font-size: 1.7rem;
}
.paper {
  background: var(--paper);
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 37px, #8e7b5e18 38px),
    linear-gradient(125deg, #fff8e5a6, transparent 48%, #9b704321);
  box-shadow: var(--shadow);
  position: relative;
}
.torn {
  clip-path: polygon(
    0 1.3%,
    4% 0.2%,
    8% 1.5%,
    13% 0.1%,
    19% 1.4%,
    25% 0.2%,
    31% 1.2%,
    37% 0.3%,
    43% 1.3%,
    49% 0.2%,
    55% 1.4%,
    61% 0.2%,
    67% 1.3%,
    73% 0.2%,
    79% 1.2%,
    85% 0.2%,
    91% 1.4%,
    96% 0.2%,
    100% 1.1%,
    99.2% 12%,
    100% 23%,
    99.3% 34%,
    100% 45%,
    99.3% 56%,
    100% 67%,
    99.3% 78%,
    100% 89%,
    99.2% 98.7%,
    94% 99.8%,
    88% 98.8%,
    82% 99.9%,
    76% 98.6%,
    70% 99.8%,
    64% 98.8%,
    58% 99.9%,
    52% 98.8%,
    46% 99.8%,
    40% 98.7%,
    34% 99.9%,
    28% 98.8%,
    22% 99.8%,
    16% 98.7%,
    10% 99.9%,
    4% 98.8%,
    0 99%,
    0.7% 89%,
    0 78%,
    0.7% 67%,
    0 56%,
    0.7% 45%,
    0 34%,
    0.7% 23%,
    0 12%
  );
}
.tape:before {
  content: '';
  position: absolute;
  width: 100px;
  height: 30px;
  top: -11px;
  left: calc(50% - 50px);
  background: #e4c98dbb;
  transform: rotate(-5deg);
  z-index: 2;
  box-shadow: 0 2px 5px #5e492329;
}
.scribble {
  display: inline-block;
  position: relative;
}
.scribble:after {
  content: '';
  position: absolute;
  left: -2%;
  right: -3%;
  bottom: -0.13em;
  height: 13px;
  border-bottom: 4px solid var(--red);
  border-radius: 50%;
  transform: rotate(-2deg);
}
.sticker {
  display: inline-block;
  border: 2px dashed var(--ink2);
  padding: 7px 16px;
  transform: rotate(-3deg);
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.doodle {
  font-family: 'Caveat', cursive;
  color: var(--red);
  font-size: 2rem;
  transform: rotate(-7deg);
}
.btn {
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  padding: 11px 20px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transform: rotate(-1deg);
  transition: 0.2s;
  box-shadow: 4px 4px 0 var(--ink);
}
.btn:hover {
  transform: rotate(1deg) translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}
.btn.dark {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 4px 4px 0 var(--red);
}
.btn.dark:hover {
  box-shadow: 6px 6px 0 var(--red);
}
.nav {
  position: sticky;
  top: 0;
  z-index: 35;
  background: #ead7afed;
  border-bottom: 3px dashed #8c7350;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px clamp(18px, 5vw, 70px);
  gap: 15px;
}
.logo {
  font:
    700 2rem 'Caveat',
    cursive;
  white-space: nowrap;
}
.logo span {
  color: var(--red);
}
.links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
}
.links a {
  font-size: 1rem;
  border-bottom: 2px solid transparent;
}
.links a:hover {
  border-color: var(--red);
}
.nav-toggle {
  display: none;
  border: 2px solid var(--ink);
  background: transparent;
  padding: 5px 10px;
}
.page {
  display: none;
}
.page.active {
  display: block;
}
.home-hero {
  min-height: 88svh;
  display: flex;
  align-items: center;
  position: relative;
  padding: 75px max(5vw, 22px);
  overflow: hidden;
  background:
    radial-gradient(circle at 85% 22%, #927957, transparent 37%),
    repeating-linear-gradient(35deg, #3a3027, #3a3027 60px, #3e342a 61px);
}
.home-hero .sheet {
  width: min(830px, 95%);
  padding: clamp(35px, 6vw, 90px);
  transform: rotate(-2deg);
  z-index: 2;
}
.home-hero .sheet h1 {
  margin: 14px 0 30px;
}
.hero-desc {
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  max-width: 600px;
}
.hero-note {
  position: absolute;
  right: 5%;
  top: 19%;
  width: 220px;
  padding: 28px;
  transform: rotate(9deg);
  background: #d6bc87;
  box-shadow: var(--shadow);
}
.hero-note:after {
  content: '✷';
  font: 5rem 'Caveat';
  position: absolute;
  right: 8px;
  bottom: -30px;
  color: var(--red);
}
.stamp {
  border: 4px double var(--red);
  color: var(--red);
  border-radius: 50%;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font: 700 1.6rem 'Caveat';
  transform: rotate(13deg);
}
.section {
  padding: clamp(70px, 9vw, 130px) max(5vw, 22px);
  position: relative;
}
.section.paper-area {
  background: #d7c19b;
  background-image: radial-gradient(#9b815038 1px, transparent 1px);
  background-size: 22px 22px;
}
.section.dark-area {
  background: #393026;
  color: var(--paper);
}
.section-title {
  display: flex;
  gap: 20px;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.section-title .num {
  font: 2.2rem 'Caveat';
  color: var(--red);
}
.section.dark-area .num {
  color: #e5b88d;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(25px, 5vw, 90px);
  align-items: center;
  max-width: 1250px;
  margin: auto;
}
.sheet-pad {
  padding: clamp(24px, 4vw, 55px);
}
.polaroid {
  background: #f9efda;
  padding: 14px 14px 50px;
  box-shadow: var(--shadow);
  transform: rotate(4deg);
  position: relative;
}
.polaroid .art {
  height: 330px;
  background: #aa9270;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.polaroid .art svg {
  width: 100%;
  height: 100%;
}
.polaroid figcaption {
  font: 2rem 'Caveat';
  text-align: center;
  padding-top: 15px;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  max-width: 1250px;
  margin: auto;
}
.card-paper {
  background: var(--paper);
  padding: 15px 15px 28px;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
  position: relative;
  transform: rotate(var(--tilt, 0deg));
  color: var(--ink);
  border: 0;
  text-align: left;
  width: 100%;
}
.card-paper:hover {
  transform: rotate(0deg) translateY(-8px);
}
.card-paper:nth-child(3n + 1) {
  --tilt: -2deg;
}
.card-paper:nth-child(3n + 2) {
  --tilt: 2deg;
}
.card-paper:nth-child(3n) {
  --tilt: -1deg;
}
.cover {
  height: 200px;
  background: var(--cover, #726349);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 1px solid #4b3a2c55;
}
.cover:before {
  content: '';
  position: absolute;
  inset: 15px;
  border: 1px solid #f7e8c46b;
}
.cover:after {
  content: '✦';
  font: 6rem 'Caveat';
  color: #f3dfbca3;
  position: absolute;
  right: 8px;
  top: -25px;
  transform: rotate(25deg);
}
.cover strong {
  font: 700 clamp(2rem, 4vw, 3.8rem) 'Caveat';
  color: #f8ebd1;
  text-align: center;
  z-index: 1;
  padding: 20px;
  line-height: 0.95;
  text-shadow: 2px 3px 0 #271e18;
}
.card-paper h3 {
  margin: 16px 5px 2px;
}
.card-paper p {
  margin: 0 5px;
}
.tag {
  display: inline-block;
  background: #c8a56c;
  padding: 4px 12px;
  transform: rotate(-3deg);
  margin-top: 12px;
  font-size: 0.9rem;
}
.note-card {
  background: #e9d9b8;
  padding: 30px;
  transform: rotate(-2deg);
  box-shadow: var(--shadow);
  position: relative;
  color: var(--ink);
}
.note-card:before {
  content: '✕';
  position: absolute;
  right: 18px;
  top: 8px;
  font-size: 1.5rem;
  color: var(--red);
}
.foot {
  background: #251f1a;
  color: #e9d6b3;
  padding: 35px 5vw;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.inner-hero {
  padding: 70px max(5vw, 22px);
  background: #43372a;
  min-height: 300px;
  display: flex;
  align-items: center;
}
.inner-hero .paper {
  padding: 35px clamp(30px, 5vw, 70px);
  max-width: 900px;
  transform: rotate(-1deg);
}
.inner-hero h1 {
  font-size: clamp(3.7rem, 8vw, 6.5rem);
  margin: 5px 0 10px;
}
.inner {
  background: #d5c19f;
  min-height: 55vh;
  padding: 70px max(5vw, 22px) 110px;
}
.inner-wrap {
  max-width: 1200px;
  margin: auto;
}
.back {
  display: inline-block;
  margin-bottom: 28px;
  border-bottom: 2px dashed var(--red);
}
.book {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1040px;
  margin: 20px auto;
  box-shadow: var(--shadow);
  background: #ead6af;
  min-height: 450px;
}
.book .leaf {
  padding: clamp(25px, 4vw, 55px);
  background: var(--paper);
  position: relative;
}
.book .leaf:first-child {
  border-right: 3px solid #bda47b;
  background-image: linear-gradient(90deg, transparent 93%, #846b4336);
}
.book .leaf:last-child {
  background-image: linear-gradient(90deg, #846b4336, transparent 8%);
}
.chapter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 25px auto;
}
.chapter-buttons button,
.filter button {
  border: 2px solid var(--ink);
  background: #f0dfbe;
  padding: 8px 14px;
}
.chapter-buttons button[aria-pressed='true'],
.filter button[aria-pressed='true'] {
  background: var(--ink);
  color: var(--paper);
}
.skill-viewport {
  height: 540px;
  overflow: hidden;
  border: 5px double #695037;
  background: radial-gradient(circle, #ddc79e, #c2a477);
  position: relative;
  touch-action: none;
  cursor: grab;
}
.skill-viewport:active {
  cursor: grabbing;
}
.skill-world {
  width: 1150px;
  height: 700px;
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}
.skill-world svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.skill-node {
  position: absolute;
  transform: translate(-50%, -50%);
  background: #f3e3c0;
  border: 3px solid #654f38;
  border-radius: 50%;
  width: 138px;
  height: 138px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  box-shadow: 5px 7px 0 #876c48;
  line-height: 1.1;
}
.skill-node:hover,
.skill-node:focus-visible {
  background: #fff3d7;
}
.skill-node.main {
  background: #a64f39;
  color: white;
  border-color: #5d3024;
}
.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}
.detail {
  padding: 22px 26px;
  margin-top: 16px;
  min-height: 110px;
}
.detail h3 {
  margin: 0 0 7px;
}
.detail p {
  margin: 0;
}
.map {
  position: relative;
  min-height: 520px;
  background: #e2cca4;
  border: 8px solid #8b6f48;
  overflow: hidden;
}
.map svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 2px solid #654831;
  border-radius: 50%;
  width: 92px;
  height: 92px;
  background: #f5e4bc;
  box-shadow: 4px 4px 0 #7d6444;
  z-index: 2;
  font: 1.3rem 'Caveat';
  line-height: 1.1;
}
.map-pin:hover {
  background: #fff7dd;
}
.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
}
.entry {
  padding: 28px;
  min-height: 260px;
  transform: rotate(var(--r, 1deg));
}
.entry:nth-child(even) {
  --r: -2deg;
}
.entry .scribble {
  font-size: 2rem;
}
.tavern {
  min-height: 65vh;
  background: #4b3a2a;
  padding: 65px max(5vw, 22px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.desk {
  max-width: 1050px;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.desk button {
  border: 0;
  text-align: left;
  min-height: 250px;
  padding: 35px 22px;
  transform: rotate(var(--rot, -3deg));
  box-shadow: var(--shadow);
  background: #ecd7ac;
  color: var(--ink);
}
.desk button:nth-child(2) {
  --rot: 3deg;
  background: #d2b37c;
}
.desk button:nth-child(3) {
  --rot: -1deg;
  background: #c4a98b;
}
.desk button:hover {
  transform: rotate(0deg) translateY(-7px);
}
.desk .symbol {
  font-size: 4rem;
  display: block;
}
.overlay {
  position: fixed;
  inset: 0;
  background: #201a15d9;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.overlay.open {
  display: flex;
}
.dialog {
  width: min(600px, 100%);
  padding: 45px;
  max-height: 90vh;
  overflow: auto;
}
.dialog h2 {
  font-size: 3.8rem;
}
.close {
  float: right;
  border: 2px solid var(--ink);
  background: transparent;
  padding: 4px 12px;
}
.form-field {
  display: block;
  margin: 15px 0;
}
.form-field input,
.form-field textarea {
  display: block;
  width: 100%;
  background: #fff7e4;
  border: 2px solid #81694b;
  padding: 10px;
  margin-top: 5px;
}
.case-cover {
  height: clamp(250px, 45vw, 520px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--case, #625244);
  color: #fff2d5;
  overflow: hidden;
}
.case-cover:before {
  content: '';
  position: absolute;
  inset: 6%;
  border: 3px dashed #f6e8c678;
  transform: rotate(-2deg);
}
.case-cover strong {
  font: 700 clamp(4rem, 10vw, 10rem) 'Caveat';
  text-align: center;
  line-height: 0.85;
  position: relative;
  text-shadow: 4px 5px #1d160e;
}
.case-content {
  max-width: 960px;
  margin: auto;
}
.case-content .paper {
  padding: clamp(25px, 5vw, 65px);
  margin: 35px 0;
}
.case-content .artifact {
  padding: 55px 30px;
  background: #eee9de;
  border: 2px solid #b2aa9c;
  text-align: center;
  font: 3rem 'Caveat';
  color: #443a32;
}
.case-content .artifact.dark-art {
  background: #332c2b;
  color: #eee0c3;
}
.route {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 30px 0;
}
.hidden {
  display: none !important;
}
@media (max-width: 850px) {
  .gallery,
  .entry-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .split {
    grid-template-columns: 1fr;
  }
  .hero-note {
    display: none;
  }
  .home-hero .sheet {
    width: 100%;
  }
  .desk {
    grid-template-columns: 1fr;
  }
  .desk button {
    min-height: 170px;
  }
  .book {
    grid-template-columns: 1fr;
  }
  .book .leaf:first-child {
    border-right: 0;
    border-bottom: 3px solid #bda47b;
  }
  .links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #e9d6b0;
    padding: 18px;
    box-shadow: var(--shadow);
  }
  .links.open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  .nav-toggle {
    display: block;
  }
}
@media (max-width: 550px) {
  .gallery,
  .entry-grid {
    grid-template-columns: 1fr;
  }
  .section {
    padding: 65px 22px;
  }
  .home-hero {
    padding: 45px 14px;
  }
  .home-hero .sheet {
    padding: 34px 25px;
  }
  .home-hero h1 {
    font-size: 4.8rem;
  }
  .polaroid .art {
    height: 260px;
  }
  .skill-viewport {
    height: 420px;
  }
  .map {
    min-height: 420px;
  }
  .map-pin {
    width: 75px;
    height: 75px;
    font-size: 1.1rem;
  }
  .inner {
    padding: 45px 18px;
  }
  .dialog {
    padding: 26px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *:before,
  *:after {
    transition: none !important;
    animation: none !important;
  }
}
