/* ==========================================================================
   Follow The Moon Art — design system v2 "Gallery Wall"
   An art-portfolio treatment: warm linen ground, ink text, and a palette
   sampled from the paintings themselves — spruce green (mermaid seagrass),
   barn red (Trimming the Tree), ochre (Golden Kitten, sunflowers), slate
   blue (mermaid water). Artwork is framed and matted, never cropped.
   Type: Fraunces (display serif), Karla (body), Caveat (hand notes).
   ========================================================================== */

/* Self-hosted fonts */
@font-face {
  font-family: "Fraunces Variable";
  src: url("/assets/fonts/fraunces-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces Variable";
  src: url("/assets/fonts/fraunces-latin-wght-italic.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Karla";
  src: url("/assets/fonts/karla-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Karla";
  src: url("/assets/fonts/karla-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Karla";
  src: url("/assets/fonts/karla-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Caveat Variable";
  src: url("/assets/fonts/caveat-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Palette — sampled from the artwork */
  --linen: #f6f1e5;          /* warm linen wall */
  --linen-deep: #ede5d2;     /* deeper linen for bands */
  --ink: #2e2a24;            /* warm near-black */
  --ink-soft: #6b6254;       /* secondary text */

  --spruce: #3e5a48;         /* deep seagrass green — brand ground */
  --spruce-deep: #2c4335;
  --barn: #a5402e;           /* barn red — action color */
  --barn-deep: #86301f;
  --ochre: #d9a13b;          /* mustard/ochre — highlight motif */
  --slate: #4f748f;          /* mermaid-water blue — links */
  --frame: #8a6a48;          /* frame wood */

  /* Roles */
  --bg: var(--linen);
  --surface: #fffdf7;
  --accent: var(--barn);
  --accent-hover: var(--barn-deep);
  --link: var(--slate);
  --border: #d9cfb8;

  /* Typography */
  --font-display: "Fraunces Variable", "Hoefler Text", Georgia, serif;
  --font-body: "Karla", "Segoe UI", system-ui, sans-serif;
  --font-hand: "Caveat Variable", "Segoe Script", cursive;

  /* Scale */
  --step-0: 1.02rem;
  --step-1: 1.2rem;
  --step-2: 1.45rem;
  --step-3: clamp(1.6rem, 1.2rem + 1.6vw, 2.1rem);
  --step-4: clamp(2rem, 1.4rem + 2.6vw, 3.1rem);
  --step-5: clamp(2.7rem, 1.6rem + 4.4vw, 4.6rem);

  /* Space */
  --space-xs: 0.5rem;
  --space-sm: 0.85rem;
  --space-md: 1.4rem;
  --space-lg: 2.4rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  /* Shape — squared, print-like */
  --radius: 3px;
  --radius-lg: 6px;
  --shadow-sm: 0 2px 8px rgba(46, 42, 36, 0.10);
  --shadow-md: 0 12px 28px rgba(46, 42, 36, 0.16);

  --container: 1200px;
  --container-narrow: 760px;
}

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background-color: var(--bg);
  /* Faint linen weave */
  background-image:
    repeating-linear-gradient(0deg, rgba(46, 42, 36, 0.016) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(46, 42, 36, 0.016) 0 1px, transparent 1px 3px);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 560;
  line-height: 1.12;
  color: var(--ink);
  margin: 0 0 var(--space-sm);
  letter-spacing: -0.015em;
}
h1 { font-size: var(--step-5); font-weight: 500; }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }

/* Ochre brush-stroke underline for major section headings */
.brushline {
  position: relative;
  display: inline-block;
  padding-bottom: 0.18em;
  /* keep the z-index:-1 stroke inside this span's stacking context,
     otherwise it disappears behind tinted section backgrounds */
  isolation: isolate;
}
.brushline::after {
  content: "";
  position: absolute;
  left: 2%;
  bottom: 0;
  width: 96%;
  height: 0.42em;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 14" preserveAspectRatio="none"><path d="M3 9 C 40 4, 75 11, 110 7 S 175 5, 197 8" fill="none" stroke="%23d9a13b" stroke-width="5" stroke-linecap="round" opacity="0.85"/></svg>') no-repeat center / 100% 100%;
  z-index: -1;
}

p { margin: 0 0 var(--space-md); }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }

:focus-visible {
  outline: 3px solid var(--slate);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--surface);
  color: var(--ink);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  z-index: 1000;
}
.skip-link:focus { left: var(--space-sm); top: var(--space-sm); }

/* --------------------------------------------------------------------------
   Layout helpers
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-md);
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--space-2xl); }
.section--tight { padding-block: var(--space-xl); }

/* Hand-lettered eyebrow, like a pencil note above a hung frame */
.eyebrow {
  font-family: var(--font-hand);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--barn);
  margin: 0 0 var(--space-xs);
}

.lede { font-size: var(--step-1); color: var(--ink-soft); }

.text-center { text-align: center; }

/* --------------------------------------------------------------------------
   Buttons — squared, block-print feel with a hard offset shadow
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  padding: 0.9em 1.5em;
  border-radius: var(--radius);
  border: 2px solid var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--barn-deep);
  box-shadow: 3px 3px 0 var(--ochre);
}
.btn--primary:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ochre);
}
.btn--ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--spruce);
  box-shadow: 3px 3px 0 rgba(62, 90, 72, 0.35);
}
.btn--ghost:hover {
  background: var(--spruce);
  color: #fff;
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 rgba(62, 90, 72, 0.35);
}

/* --------------------------------------------------------------------------
   Header / nav
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 241, 229, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--spruce);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--ink); }
.brand__moon {
  width: 30px; height: 30px;
  flex: none;
  color: var(--ochre);
}

.nav__toggle {
  display: none;
  background: transparent;
  border: 2px solid var(--spruce);
  border-radius: var(--radius);
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__link {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  padding: 0.35rem 0.1rem;
  border-bottom: 3px solid transparent;
}
.nav__link:hover { color: var(--barn); }
.nav__link[aria-current="page"] {
  color: var(--barn);
  border-bottom-color: var(--ochre);
}

@media (max-width: 720px) {
  .nav__toggle { display: inline-flex; align-items: center; gap: 0.45rem; }
  .nav__list {
    display: none;
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--linen);
    border-bottom: 2px solid var(--spruce);
    padding: var(--space-sm) var(--space-md) var(--space-md);
  }
  .nav[data-open="true"] .nav__list { display: flex; }
  .nav__link {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
  }
  .nav__link[aria-current="page"] { border-bottom-color: var(--border); }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  padding-block: var(--space-2xl) var(--space-xl);
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--space-xl);
  align-items: center;
}
.hero__title { margin-bottom: var(--space-md); }
.hero__tagline {
  font-family: var(--font-hand);
  color: var(--spruce);
  font-size: 1.7rem;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}
.hero__art {
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 10px solid var(--surface);
  outline: 2px solid var(--frame);
  rotate: 1.4deg;
}
.hero__art img { width: 100%; }

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; gap: var(--space-lg); }
  .hero__art { rotate: 0deg; order: -1; }
}

/* Video hero — the animated painting is the wall; the intro sits on a
   pinned sheet of paper in the scene's negative space. */
.hero--video {
  position: relative;
  padding-block: 0;
  min-height: min(82vh, 720px);
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 2px solid var(--spruce);
}
.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    rgba(246, 241, 229, 0.55) 0%,
    rgba(246, 241, 229, 0.30) 34%,
    rgba(246, 241, 229, 0.05) 62%,
    rgba(246, 241, 229, 0) 82%
  );
}
.hero__content { position: relative; }
.hero__panel {
  max-width: 34rem;
  margin-block: var(--space-2xl);
  background: var(--surface);
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  rotate: -0.5deg;
  /* Slightly uneven corners, like a cut sheet of watercolor paper */
  border-radius: 8px 3px 10px 4px;
}
.hero__panel > :last-child { margin-bottom: var(--space-sm); }

@media (max-width: 720px) {
  .hero--video { min-height: 0; }
  .hero__scrim { background: rgba(246, 241, 229, 0.35); }
  .hero__panel {
    margin-block: var(--space-xl);
    rotate: 0deg;
    padding: var(--space-md);
  }
}

/* --------------------------------------------------------------------------
   Gallery wall — framed, matted, never cropped
   -------------------------------------------------------------------------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: var(--space-xl) var(--space-lg);
  align-items: start;
}
.art-card {
  margin: 0;
  transition: rotate 0.2s ease, transform 0.2s ease;
}
.art-card[hidden] { display: none; }
/* A hung gallery wall is never perfectly straight */
.art-card:nth-child(4n+1) { rotate: -0.7deg; }
.art-card:nth-child(4n+2) { rotate: 0.5deg; }
.art-card:nth-child(4n+3) { rotate: 0.9deg; }
.art-card:nth-child(4n)   { rotate: -0.4deg; }
.art-card:hover { rotate: 0deg; transform: translateY(-4px); }

.art-card__frame {
  /* mat + frame */
  background: var(--surface);
  padding: clamp(0.7rem, 2.2vw, 1.1rem);
  border: 2px solid var(--frame);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(138, 106, 72, 0.25);
}
.art-card:hover .art-card__frame { box-shadow: var(--shadow-md), inset 0 0 0 1px rgba(138, 106, 72, 0.25); }
.art-card__frame img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  background: var(--surface);
}
/* Placard under the frame, like a little gallery label */
.art-card__body {
  padding: 0.7rem 0.25rem 0;
  text-align: center;
}
.art-card__title {
  font-size: var(--step-1);
  font-weight: 600;
  margin-bottom: 0.05rem;
}
.art-card__meta {
  font-family: var(--font-hand);
  color: var(--ink-soft);
  font-size: 1.25rem;
  margin: 0;
}

/* Full-bleed strip of artwork, edge to edge, drifting slowly left to right.
   The track holds the image set twice; sliding from -50% to 0 moves exactly
   one set width, so the loop is seamless. */
.art-strip {
  overflow: hidden;
  border-block: 2px solid var(--spruce);
  background: var(--spruce-deep);
}
.art-strip__track {
  display: flex;
  width: max-content;
  animation: strip-drift 90s linear infinite;
}
.art-strip:hover .art-strip__track,
.art-strip:focus-within .art-strip__track { animation-play-state: paused; }
.art-strip a { display: block; flex: 0 0 auto; line-height: 0; }
.art-strip img {
  width: clamp(160px, 20vw, 260px);
  height: clamp(120px, 18vw, 220px);
  object-fit: cover;
  opacity: 0.96;
}
.art-strip a:hover img { opacity: 1; }
@keyframes strip-drift {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .art-strip__track { animation: none; }
}

/* Zoom button wrapping each framed piece on the gallery page */
.art-card__zoom {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  font: inherit;
  text-align: inherit;
}
.art-card__zoom .art-card__frame { display: block; }

/* Lightbox dialog — the piece on a linen sheet, placard below */
.lightbox {
  padding: clamp(0.9rem, 3vw, 1.6rem);
  border: 2px solid var(--frame);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  max-width: min(92vw, 1000px);
}
.lightbox::backdrop {
  background: rgba(46, 42, 36, 0.78);
}
.lightbox__img {
  max-width: 100%;
  max-height: min(74vh, 780px);
  width: auto;
  height: auto;
  margin-inline: auto;
  object-fit: contain;
}
.lightbox__caption {
  text-align: center;
  padding-top: 0.7rem;
}
.lightbox__title {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  margin: 0;
}
.lightbox__medium {
  font-family: var(--font-hand);
  font-size: 1.25rem;
  color: var(--ink-soft);
  margin: 0;
}
.lightbox__close {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 44px;
  height: 44px;
  border: 2px solid var(--spruce);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox__close:hover { background: var(--barn); border-color: var(--barn-deep); color: #fff; }

/* Category filter chips — square tags */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  justify-content: center;
  margin-bottom: var(--space-lg);
}
.filter-chip {
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: 2px solid var(--spruce);
  background: var(--surface);
  color: var(--spruce-deep);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.filter-chip:hover { background: var(--linen-deep); color: var(--ink); }
.filter-chip[aria-pressed="true"] {
  background: var(--spruce);
  color: #fff;
  box-shadow: 2px 2px 0 var(--ochre);
}

/* Numbered theme index, set in display type like a catalog page */
.theme-index {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: var(--space-xl);
}
.theme-index li { break-inside: avoid; }
.theme-index a {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.55rem 0.2rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--step-2);
}
.theme-index a:hover { color: var(--barn); }
.theme-index a:hover .theme-index__num { color: var(--ochre); }
.theme-index__num {
  font-family: var(--font-hand);
  font-size: 1.3rem;
  color: var(--barn);
  min-width: 1.6em;
}
@media (max-width: 640px) {
  .theme-index { columns: 1; }
}

/* --------------------------------------------------------------------------
   Panels / feature bands
   -------------------------------------------------------------------------- */
.band {
  background: var(--linen-deep);
  border-block: 1px solid var(--border);
}
.band--spruce {
  background: var(--spruce);
  border-block: 2px solid var(--spruce-deep);
  color: #f0ece0;
}
.band--spruce h2 { color: #fffdf7; }
.band--spruce .lede { color: #d9d3c0; }
.band--spruce .eyebrow { color: var(--ochre); }
.cta-band { text-align: center; }
.cta-band .btn { margin-top: var(--space-md); }

.prose { max-width: 65ch; }
.prose h2 { margin-top: var(--space-lg); }

/* Note / TODO callout used for pre-launch placeholders */
.note {
  background: #fdf7e8;
  border: 1px dashed var(--ochre);
  border-radius: var(--radius);
  padding: var(--space-md);
  color: var(--ink-soft);
  font-size: 0.92rem;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form { display: grid; gap: var(--space-md); }
.form__row { display: grid; gap: 0.4rem; }
.form label { font-weight: 700; }
.form input,
.form select,
.form textarea {
  font: inherit;
  padding: 0.7rem 0.85rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  width: 100%;
}
.form input:focus,
.form select:focus,
.form textarea:focus { border-color: var(--spruce); outline: none; }
.form textarea { min-height: 150px; resize: vertical; }
.form__hint { color: var(--ink-soft); font-size: 0.88rem; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--spruce-deep);
  color: #ece7d8;
  margin-top: var(--space-2xl);
}
.site-footer a { color: #fff; }
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  justify-content: space-between;
  align-items: flex-start;
  padding-block: var(--space-xl);
}
.site-footer__brand { max-width: 34ch; }
.site-footer__brand p { color: #cfc9b6; margin-top: 0.4rem; }
.site-footer__since {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--step-3);
  color: var(--ochre);
  margin: 0;
}
.footer-nav { display: grid; gap: 0.4rem; }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }
.site-footer__legal {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-block: var(--space-md);
  font-size: 0.82rem;
  color: #c5bfab;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Artwork protection — deters casual right-click save, drag-out, and
   long-press save. This is a deterrent, not DRM: nothing shown in a browser
   is truly un-savable. pointer-events: none keeps "Save image as" out of
   the context menu entirely; nav.js backstops contextmenu and dragstart.
   -------------------------------------------------------------------------- */
.art-card img,
.art-strip img,
.hero__art img,
.lightbox__img {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.stack-lg > * + * { margin-top: var(--space-lg); }
.mt-lg { margin-top: var(--space-lg); }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
