@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@500;700&family=Nunito:wght@400;600;700&display=swap");

:root {
  --ink: #1a1510;
  --paper: #f7f0e4;
  --dojo-red: #c62828;
  --night-teal: #0d4f5c;
  --soft-gold: #d4a017;
  --max: 68rem;
  --font-display: "Fredoka", "Trebuchet MS", sans-serif;
  --font-body: "Nunito", "Trebuchet MS", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(rgba(26, 21, 16, 0.04) 1px, transparent 1px),
    linear-gradient(165deg, #f7f0e4 0%, #efe4d2 45%, #f7f0e4 100%);
  background-size: 12px 12px, auto;
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: var(--night-teal);
}

a:hover {
  color: var(--dojo-red);
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 20;
  background: var(--paper);
  padding: 0.5rem 0.75rem;
}

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

.site-header {
  padding: 1rem 0;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-weight: 700;
}

.brand-hero {
  min-height: calc(100vh - 5rem);
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 1.25rem;
  padding: 2rem 0 3rem;
  position: relative;
}

.brand-hero .logo {
  width: min(100%, 22rem);
  height: auto;
}

.brand-hero h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.brand-hero .tagline {
  margin: 0;
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  max-width: 28rem;
}

.seal {
  width: 5.5rem;
  height: 5.5rem;
  transform: rotate(-8deg);
}

.seal.stamp-in {
  animation: stamp-in 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

@keyframes stamp-in {
  from {
    opacity: 0;
    transform: rotate(-8deg) scale(1.35);
  }
  to {
    opacity: 1;
    transform: rotate(-8deg) scale(1);
  }
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  text-decoration: none;
  padding: 0.7rem 1.15rem;
  border-radius: 0.4rem;
  border: 3px solid var(--ink);
}

.btn-primary {
  background: var(--dojo-red);
  color: var(--paper);
}

.btn-primary:hover {
  background: var(--night-teal);
  color: var(--paper);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--soft-gold);
  color: var(--ink);
}

.gallery-section {
  padding: 2rem 0 4rem;
}

.gallery-section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0 0 1.25rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1.25rem;
}

.tile {
  display: block;
  margin: 0;
  border: 3px solid var(--ink);
  background: #fffdf8;
  padding: 0.6rem;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.tile figure {
  margin: 0;
}

.tile:hover,
.tile:focus-within {
  transform: translateY(-4px) rotate(-1deg);
  box-shadow: 4px 6px 0 var(--night-teal);
  color: inherit;
}

.tile img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--paper);
}

.tile-story img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.tile figcaption {
  margin-top: 0.55rem;
  font-weight: 700;
  font-family: var(--font-display);
}

.tile-title {
  display: block;
}

.tile-blurb {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--night-teal);
}

.gallery-error {
  color: var(--dojo-red);
  font-weight: 700;
}

.story-reader {
  padding: 1.5rem 0 4rem;
  max-width: 40rem;
}

.story-back {
  margin: 0 0 1rem;
  font-weight: 700;
}

.story-back a {
  text-decoration: none;
}

.story-reader h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 0.35rem;
}

.story-blurb {
  margin: 0 0 1.75rem;
  font-weight: 600;
  color: var(--night-teal);
}

.story-pages {
  display: grid;
  gap: 1.75rem;
}

.story-page {
  margin: 0;
  border: 3px solid var(--ink);
  background: #fffdf8;
  padding: 0.5rem;
}

.story-page img {
  display: block;
  width: 100%;
  height: auto;
}

.story-page figcaption {
  margin-top: 0.45rem;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}

.about-main {
  padding: 2rem 0 4rem;
  max-width: 36rem;
}

.about-main h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.about-seal {
  width: 7rem;
  margin: 1rem 0 1.5rem;
}

.about-seal.stamp-in {
  animation: stamp-in 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.site-footer {
  border-top: 3px solid var(--ink);
  padding: 1.25rem 0 2rem;
  font-size: 0.95rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(26, 21, 16, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 40;
}

.lightbox.is-open {
  display: flex;
}

.lightbox-panel {
  background: var(--paper);
  border: 4px solid var(--ink);
  max-width: min(92vw, 48rem);
  max-height: 90vh;
  overflow: auto;
  padding: 1rem;
}

.lightbox-panel img {
  display: block;
  max-width: 100%;
  height: auto;
}

.lightbox-panel p {
  margin: 0.75rem 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
}

.lightbox-close {
  float: right;
  font: inherit;
  font-weight: 700;
  border: 3px solid var(--ink);
  background: var(--dojo-red);
  color: var(--paper);
  cursor: pointer;
  padding: 0.25rem 0.55rem;
}
