/* Spenser's handmade title font */
@font-face {
  font-family: "Spenser Title";
  src: url("/fonts/spenser-title.ttf?v=3") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  size-adjust: 160%; /* the hand-drawn letters are small, so scale them up */
}

:root {
  /* Brand colors (the admin panel's Site settings override these) */
  --orange: #f3842e;
  --orange-dark: #c45e14;
  --brown: #1e0503;
  --cream: #fefee3;

  /* Derived from the brand colors */
  --orange-soft: color-mix(in srgb, var(--orange) 22%, var(--cream));
  --paper: var(--cream);
  --text: var(--brown);
  --muted: color-mix(in srgb, var(--brown) 62%, var(--cream));
  --radius: 14px;
  --shadow: 0 6px 24px color-mix(in srgb, var(--brown) 14%, transparent);
  --shadow-lift: 0 10px 30px color-mix(in srgb, var(--brown) 22%, transparent);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font-family: "Cardo", Georgia, serif;
  font-size: 1.06rem;
  line-height: 1.7;
}

/* The handmade font has lowercase a-z, numbers and : ( ) , ? . ! — so titles are shown in lowercase.
   Any other character (like ' or -) comes from Shadows Into Light, a similar thin handwritten pen. */
h1, h2, h3, .logo { font-family: "Spenser Title", "Shadows Into Light", "Cardo", Georgia, serif; font-weight: 400; color: var(--brown); line-height: 1.15; text-transform: lowercase; }
a { color: var(--orange-dark); }
img { max-width: 100%; display: block; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header {
  /* Very mild, hazy blend of the dark brown (#1e0503) and a deeper brown haze (about #48332d) */
  --haze: color-mix(in srgb, var(--brown) 50%, var(--muted));
  position: relative; isolation: isolate; overflow: hidden;
  background: linear-gradient(180deg, var(--brown) 0%, color-mix(in srgb, var(--brown) 88%, var(--haze)) 100%);
  background-color: var(--brown);
  border-bottom: 4px solid var(--orange);
}
/* The hazy glows live on their own layer so they can slowly pulse (breathe brighter and dimmer) */
.site-header::before {
  content: ""; position: absolute; inset: -10%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 140% at 88% -10%, color-mix(in srgb, var(--haze) 60%, transparent), transparent 70%),
    radial-gradient(ellipse 55% 120% at 8% 115%, color-mix(in srgb, var(--haze) 40%, transparent), transparent 70%);
  animation: haze-pulse 7s ease-in-out infinite alternate;
}
@keyframes haze-pulse {
  from { opacity: .45; transform: scale(1); }
  to { opacity: 1; transform: scale(1.08); }
}
@media (prefers-reduced-motion: reduce) { .site-header::before { animation: none; opacity: .8; } }
.header-inner {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
  padding-top: 22px; padding-bottom: 18px;
}
/* Live clock in the top-right, in the handmade font */
.clock-now {
  position: absolute; top: 18px; right: 16px;
  color: var(--cream);
  font-family: "Spenser Title", "Shadows Into Light", "Cardo", serif;
  font-size: 1.9rem; line-height: 1.35; text-transform: lowercase; white-space: nowrap;
}
@media (max-width: 600px) { .clock-now { font-size: 1.5rem; top: 14px; } }

.logo { color: var(--cream); font-size: 1.6rem; font-weight: 700; text-decoration: none; display: block; }
.logo span { color: var(--orange); }
.logo img { height: 110px; width: auto; }
@media (max-width: 600px) { .logo img { height: 80px; } }

/* Handwritten menu buttons (each also has its own class: .nav-all, .nav-writes, .nav-movers). */
.nav { align-self: stretch; display: flex; justify-content: flex-start; align-items: flex-end; gap: clamp(36px, 9vw, 80px); flex-wrap: wrap; }
.nav-btn {
  position: relative; display: block; padding: 6px 4px 12px;
  opacity: .8; transition: opacity .2s, transform .2s;
}
.nav-btn img { height: 34px; width: auto; }
.nav-all img { height: 30px; }
@media (max-width: 600px) { .nav-btn img { height: 28px; } .nav-all img { height: 25px; } }
/* Spenser's hand-drawn orange underline: appears on hover/click and under the current section,
   and "wiggles" by swapping between three drawings, like the original GIF. */
.squiggle {
  position: absolute; left: -4%; width: 108%; bottom: 0; height: auto;
  aspect-ratio: 1091 / 101; /* keep the drawing's proportions at any button width */
  overflow: visible; pointer-events: none;
  opacity: 0; transition: opacity .12s ease;
}
.squiggle path {
  fill: none; stroke: var(--orange); stroke-width: 3px; stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  opacity: 0; animation: squiggle-wiggle 1.05s steps(1, end) infinite paused;
}
.squiggle .squiggle-2 { animation-delay: -.7s; }
.squiggle .squiggle-3 { animation-delay: -.35s; }
@keyframes squiggle-wiggle { 0% { opacity: 1; } 33.333% { opacity: 0; } 100% { opacity: 0; } }

.nav-btn:hover, .nav-btn:focus-visible { opacity: 1; transform: translateY(-2px); }
.nav-btn:hover .squiggle, .nav-btn:focus-visible .squiggle, .nav-btn:active .squiggle, .nav-btn.active .squiggle { opacity: 1; }
.nav-btn:hover .squiggle path, .nav-btn:focus-visible .squiggle path, .nav-btn:active .squiggle path, .nav-btn.active .squiggle path { animation-play-state: running; }
.nav-btn.active { opacity: 1; }
.nav-btn:focus-visible { outline: 2px dashed var(--orange); outline-offset: 4px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  .nav-btn, .squiggle { transition: none; }
  .squiggle path { animation: none; }
  .squiggle .squiggle-1 { opacity: 1; } /* hold still on one drawing */
}

/* Hand-drawn animation for the selected category, tucked in the header's bottom-right corner.
   The GIF's dark backdrop blends away into the header. */
.section-anim {
  /* the drawings fill about 70% of each 170px GIF, so a 48px box draws them roughly button-sized */
  position: absolute; right: 12px; bottom: 12px;
  width: 48px; height: 48px; pointer-events: none;
  mix-blend-mode: lighten;
  opacity: 0; transition: opacity .25s ease;
}
.section-anim.show { opacity: .95; }
.section-anim img { width: 100%; height: 100%; }
@media (max-width: 600px) { .section-anim { width: 40px; height: 40px; bottom: 10px; } }
@media (prefers-reduced-motion: reduce) { .section-anim { display: none; } }

/* Hero */
.hero {
  margin: 40px 0 32px;
  padding: 48px 40px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%);
  color: var(--brown);
  box-shadow: var(--shadow);
  text-align: center;
}
.hero h1 { color: var(--brown); font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 8px; }
.hero p { margin: 0 auto; font-size: 1.1rem; opacity: .95; max-width: 560px; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 8px 0 20px; }
.section-title h2 { margin: 0; font-size: 1.6rem; }
.section-title span { color: var(--muted); font-size: .9rem; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; margin-bottom: 56px; }
.card {
  background: var(--paper); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); text-decoration: none; color: inherit;
  display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.card-img { aspect-ratio: 16/9; object-fit: cover; width: 100%; background: var(--orange-soft); }
.card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { margin: 0; font-size: 1.25rem; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
.meta { display: flex; align-items: center; gap: 10px; font-size: .82rem; color: var(--muted); }

.badge {
  display: inline-block; white-space: nowrap; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px;
}
.badge.weekly { background: var(--orange-soft); color: var(--orange-dark); }
.badge.monthly { background: var(--brown); color: var(--cream); }
.badge.blog { background: var(--orange); color: var(--brown); }
.has-video { color: var(--orange-dark); font-weight: 600; }

/* Featured */
.featured { display: grid; grid-template-columns: 1.3fr 1fr; margin-bottom: 40px; }
.featured .card-img { aspect-ratio: auto; height: 100%; min-height: 280px; }
.featured .card-body { padding: 32px; justify-content: center; }
.featured h3 { font-size: 1.9rem; }
@media (max-width: 760px) {
  .featured { grid-template-columns: 1fr; }
  .featured .card-img { min-height: 0; aspect-ratio: 16/9; }
  .hero { padding: 32px 22px; }
}

/* Post page */
.post { max-width: 760px; margin: 40px auto 64px; }
.back { display: inline-block; margin-bottom: 20px; text-decoration: none; font-weight: 500; }
.post h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin: 12px 0 10px; }
.post .cover { border-radius: var(--radius); margin: 24px 0 32px; box-shadow: var(--shadow); width: 100%; }
.post > .video { margin: 24px auto 32px; }
.post-content { font-size: 1.08rem; }
.post-content h2 { margin-top: 2em; border-left: 5px solid var(--orange); padding-left: 12px; }
.post-content img { border-radius: 10px; margin: 24px auto; box-shadow: var(--shadow); }
.post-content blockquote {
  margin: 24px 0; padding: 12px 20px; background: var(--orange-soft);
  border-left: 5px solid var(--orange); border-radius: 0 10px 10px 0; color: var(--brown);
}
.post-content figure { margin: 28px 0; }
.post-content figcaption { text-align: center; color: var(--muted); font-size: .9rem; margin-top: -12px; }

.video {
  position: relative; aspect-ratio: 16/9; margin: 28px 0; border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); background: var(--brown);
}
.video.vertical { aspect-ratio: 9/16; max-width: 360px; margin-left: auto; margin-right: auto; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 28px 0; }
.gallery img { margin: 0; aspect-ratio: 1; object-fit: cover; width: 100%; cursor: zoom-in; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; background: color-mix(in srgb, var(--brown) 92%, transparent); display: none;
  align-items: center; justify-content: center; z-index: 50; padding: 16px; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-height: 90vh; border-radius: 8px; }

.about { max-width: 720px; margin: 48px auto 64px; background: var(--paper); padding: 36px; border-radius: var(--radius); box-shadow: var(--shadow); }
.empty { color: var(--muted); padding: 40px 0; }

/* Footer */
.site-footer { background: var(--brown); color: var(--cream); padding: 24px 0; font-size: .9rem; border-top: 4px solid var(--orange); }
.site-footer { text-align: center; }
.site-footer p { margin: 0; }
.site-footer p + p { margin-top: 6px; }
.footer-link { color: var(--orange); font-weight: 600; text-decoration: none; }
.footer-link:hover { text-decoration: underline; }
