/* barnabysterling.com — "dusk over the harbour, lamplight indoors"
 *
 * Palette (drawn from the Elderberry Cove cover):
 *   paper      #FBF6EC  lamplit cream — the indoor world
 *   paper-deep #F2E9D8  aged page / cards
 *   ink        #3B3340  elderberry-stained ink
 *   elderberry #5C3A6E  plum accent (links, buttons)
 *   harbor     #2F5D5C  teal secondary
 *   dusk       #16303B  hero night sky
 *   lamplight  #E9A94F  amber windows
 *
 * Type: Young Serif (display) · Lora (body) · Caveat (handwritten notes).
 * Signature: snapshot postcards — white-bordered, gently rotated photos
 * with taped corners and handwritten captions.
 */

:root {
  --paper: #FBF6EC;
  --paper-deep: #F2E9D8;
  --ink: #3B3340;
  --ink-soft: #6E6273;
  --elderberry: #5C3A6E;
  --elderberry-deep: #452A56;
  --harbor: #2F5D5C;
  --dusk: #16303B;
  --dusk-2: #24404E;
  --lamplight: #E9A94F;
  --line: #DCCFB8;
  --serif-display: 'Young Serif', 'Iowan Old Style', Georgia, serif;
  --serif-body: 'Lora', Georgia, 'Times New Roman', serif;
  --hand: 'Caveat', 'Bradley Hand', cursive;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .watch, .watch.seen { opacity: 1; transform: none; transition: none; }
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--elderberry); text-decoration-color: color-mix(in srgb, var(--elderberry) 40%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--elderberry-deep); text-decoration-color: currentColor; }

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

::selection { background: color-mix(in srgb, var(--lamplight) 45%, transparent); }

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }

/* ---------- header ---------- */

.site-head { padding: 1.1rem 0; }
.site-head .wrap { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.wordmark {
  font-family: var(--serif-display);
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.wordmark .berry { color: var(--elderberry); }
.site-nav { display: flex; gap: 1.4rem; font-size: 0.95rem; }
.site-nav a { text-decoration: none; color: var(--ink-soft); }
.site-nav a:hover { color: var(--elderberry-deep); }

/* ---------- hero (dusk) ---------- */

.hero {
  background:
    radial-gradient(60rem 30rem at 78% 110%, rgba(233, 169, 79, 0.16), transparent 60%),
    radial-gradient(50rem 26rem at 15% -20%, rgba(92, 58, 110, 0.5), transparent 65%),
    linear-gradient(175deg, var(--dusk) 55%, var(--dusk-2) 100%);
  color: #F4EDE0;
  overflow: hidden;
}
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(15rem, 0.85fr);
  gap: 3rem;
  align-items: center;
  padding-top: 4.5rem;
  padding-bottom: 5.5rem;
}
.eyebrow {
  font-family: var(--serif-body);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--lamplight);
  margin-bottom: 1.1rem;
}
.hero h1 {
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 4.1rem);
  line-height: 1.06;
  margin-bottom: 1.2rem;
  text-wrap: balance;
}
.hero .hook {
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.6;
  color: #E3D7C4;
  max-width: 30ch;
  margin-bottom: 1.8rem;
}
.hero .meta { font-size: 0.95rem; color: #B9C4C4; margin-bottom: 2rem; }
.hero .meta strong { color: #F4EDE0; font-weight: 600; }

.btn {
  display: inline-block;
  font-family: var(--serif-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--dusk);
  background: var(--lamplight);
  border: none;
  border-radius: 999px;
  padding: 0.8rem 1.7rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3); color: var(--dusk); }
.btn:active { transform: translateY(0); }

.hero-cover { position: relative; justify-self: center; }
.hero-cover img {
  width: min(19rem, 70vw);
  height: auto;
  border-radius: 6px;
  transform: rotate(2.2deg);
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(233, 169, 79, 0.18);
}
.hero-cover .note {
  position: absolute;
  bottom: -1.9rem;
  right: -0.5rem;
  font-family: var(--hand);
  font-size: 1.35rem;
  color: var(--lamplight);
  transform: rotate(-3deg);
  white-space: nowrap;
}

/* scalloped wave — where the dusk meets the paper */
.wave { display: block; width: 100%; height: 3.2rem; margin-top: -1px; }

/* ---------- shared section chrome ---------- */

section { padding: 4.5rem 0; }
.section-head { max-width: 42rem; margin-bottom: 2.5rem; }
.section-head h2 {
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  margin-bottom: 0.6rem;
}
.section-head .sub { color: var(--ink-soft); }

.sprig { display: block; margin: 0 auto; width: 6rem; height: 2.2rem; color: var(--elderberry); opacity: 0.75; }

/* ---------- the book ---------- */

.book .wrap { max-width: 46rem; }
.book .blurb p { margin-bottom: 1.3rem; }
.book .tagline {
  font-family: var(--serif-display);
  font-size: 1.35rem;
  line-height: 1.5;
  color: var(--elderberry-deep);
  margin-bottom: 1.6rem;
  text-wrap: balance;
}
.book .fine { font-size: 0.9rem; color: var(--ink-soft); }

/* ---------- letters (newsletter postcard) ---------- */

.letters { background: var(--paper-deep); }
.postcard {
  position: relative;
  background: #FFFDF7;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(59, 51, 64, 0.12);
  padding: 2.4rem 2.6rem;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(16rem, 0.8fr);
  gap: 2.5rem;
  max-width: 54rem;
  margin: 0 auto;
  transform: rotate(-0.4deg);
}
.postcard::after {
  /* the stamp */
  content: '';
  position: absolute;
  top: 1.1rem;
  right: 1.2rem;
  width: 3rem;
  height: 3.6rem;
  background:
    url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"%3E%3Cg fill="none" stroke="%232F5D5C" stroke-width="1.3" stroke-linecap="round"%3E%3Cpath d="M16 27 L16 18"/%3E%3Cpath d="M16 18 C13 15 11 14 9 12"/%3E%3Cpath d="M16 18 C15 14 14.5 12 14 9"/%3E%3Cpath d="M16 18 C18 14 19 12 20.5 9.5"/%3E%3Cpath d="M16 18 C19 15.5 21 14.5 23.5 13"/%3E%3C/g%3E%3Cg fill="%235C3A6E"%3E%3Ccircle cx="9" cy="11.4" r="2.5"/%3E%3Ccircle cx="13.8" cy="8.4" r="2.5"/%3E%3Ccircle cx="20.7" cy="8.9" r="2.5"/%3E%3Ccircle cx="23.8" cy="12.4" r="2.5"/%3E%3Ccircle cx="17" cy="7.2" r="2.2"/%3E%3C/g%3E%3C/svg%3E') center / 72% no-repeat,
    #FFFDF7;
  border: 1px dashed var(--line);
  border-radius: 2px;
  opacity: 0.9;
}
.postcard h2 {
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2rem);
  margin-bottom: 0.8rem;
  padding-right: 3.6rem; /* clearance for the stamp on narrow screens */
}
.postcard .pitch { margin-bottom: 1rem; }
.postcard .hand-note { font-family: var(--hand); font-size: 1.45rem; color: var(--harbor); transform: rotate(-1deg); display: inline-block; }
.postcard-form { align-self: center; }
.capture { display: grid; gap: 0.7rem; }
.capture input[type="email"] {
  font-family: var(--serif-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  width: 100%;
}
.capture input[type="email"]::placeholder { color: var(--ink-soft); opacity: 0.7; }
.capture .btn { width: 100%; text-align: center; box-shadow: none; background: var(--elderberry); color: #FFFDF7; }
.capture .btn:hover { background: var(--elderberry-deep); color: #FFFDF7; }
.form-fine { font-size: 0.82rem; line-height: 1.6; color: var(--ink-soft); margin-top: 0.8rem; }

/* ---------- about barnaby ---------- */

.about .wrap {
  display: grid;
  grid-template-columns: minmax(14rem, 0.75fr) minmax(0, 1.25fr);
  gap: 3.5rem;
  align-items: center;
  max-width: 60rem;
}
.about .bio p { margin-bottom: 1.2rem; }

/* ---------- snapshot (the signature) ---------- */

.snapshot {
  background: #FFFDF7;
  border: 1px solid var(--line);
  padding: 0.85rem 0.85rem 0.6rem;
  border-radius: 3px;
  box-shadow: 0 8px 24px rgba(59, 51, 64, 0.16);
  transform: rotate(var(--tilt, -1.6deg));
  position: relative;
  max-width: 24rem;
}
.snapshot::before {
  /* washi tape */
  content: '';
  position: absolute;
  top: -0.7rem;
  left: 50%;
  width: 5.5rem;
  height: 1.5rem;
  transform: translateX(-50%) rotate(-2deg);
  background: color-mix(in srgb, var(--lamplight) 55%, transparent);
  opacity: 0.85;
  border-left: 1px dashed rgba(255, 255, 255, 0.6);
  border-right: 1px dashed rgba(255, 255, 255, 0.6);
}
.snapshot img { border-radius: 2px; }
.snapshot figcaption {
  font-family: var(--hand);
  font-size: 1.3rem;
  line-height: 1.3;
  color: var(--ink-soft);
  text-align: center;
  padding: 0.55rem 0.3rem 0.25rem;
}

/* ---------- blog cards ---------- */

.from-blog { background: var(--paper); }
.post-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 2.2rem;
  align-items: start;
}
.post-card { text-decoration: none; color: inherit; display: block; }
.post-card .snapshot { max-width: none; margin-bottom: 1rem; }
.post-card:nth-child(2) .snapshot { --tilt: 1.4deg; }
.post-card:nth-child(3) .snapshot { --tilt: -0.9deg; }
.post-card .snapshot img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.post-card h3 { font-family: var(--serif-display); font-weight: 400; font-size: 1.2rem; line-height: 1.35; margin-bottom: 0.3rem; }
.post-card:hover h3 { color: var(--elderberry-deep); }
.post-card .date { font-family: var(--hand); font-size: 1.2rem; color: var(--harbor); }
.post-card .teaser { font-size: 0.95rem; color: var(--ink-soft); line-height: 1.6; }
.post-card .read-more {
  margin-top: 0.6rem;
  font-size: 0.95rem;
  color: var(--elderberry);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--elderberry) 40%, transparent);
  text-underline-offset: 3px;
}
.post-card:hover .read-more { color: var(--elderberry-deep); text-decoration-color: currentColor; }
.no-posts { color: var(--ink-soft); font-style: italic; }
.all-posts { margin-top: 2.2rem; }

/* ---------- footer ---------- */

.site-foot {
  background: var(--dusk);
  color: #B9C4C4;
  padding: 3rem 0 3.5rem;
  font-size: 0.92rem;
}
.site-foot .wrap { display: grid; gap: 0.9rem; }
.site-foot a { color: #E3D7C4; }
.site-foot .wordmark { color: #F4EDE0; font-size: 1.15rem; }
.site-foot .wordmark .berry { color: #C8A9D8; }
.site-foot .lamplit { color: var(--lamplight); font-family: var(--hand); font-size: 1.25rem; }

/* ---------- blog pages ---------- */

.page-head { padding: 3.5rem 0 1rem; }
.page-head .wrap { max-width: 46rem; }
.page-head h1 {
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
  margin-bottom: 0.6rem;
  text-wrap: balance;
}
.page-head .date { font-family: var(--hand); font-size: 1.4rem; color: var(--harbor); }
.page-head .lede { font-size: 1.15rem; font-style: italic; color: var(--ink-soft); margin-top: 0.6rem; }

.post-body { padding: 1.5rem 0 4rem; }
.post-body .wrap { max-width: 46rem; }
.post-body h2 { font-family: var(--serif-display); font-weight: 400; font-size: 1.6rem; margin: 2.2rem 0 0.8rem; }
.post-body h3 { font-family: var(--serif-display); font-weight: 400; font-size: 1.25rem; margin: 1.8rem 0 0.6rem; }
.post-body p { margin-bottom: 1.2rem; }
.post-body ul, .post-body ol { margin: 0 0 1.2rem 1.4rem; }
.post-body li { margin-bottom: 0.4rem; }
.post-body blockquote {
  border-left: 3px solid var(--elderberry);
  padding-left: 1.2rem;
  font-style: italic;
  color: var(--ink-soft);
  margin: 1.6rem 0;
}
.post-body hr { border: none; border-top: 1px solid var(--line); margin: 2.2rem auto; width: 8rem; }
.post-body .snapshot { margin: 2.2rem auto; max-width: 34rem; }
.post-body .snapshot img { width: 100%; }

.post-list { padding: 1rem 0 4.5rem; }
.post-list .wrap { max-width: 60rem; }

.post-nav { padding: 0 0 4rem; }
.post-nav .wrap { max-width: 46rem; display: flex; justify-content: space-between; gap: 1rem; font-size: 0.95rem; }

/* ---------- scroll reveal ---------- */

.watch { opacity: 0; transform: translateY(14px); transition: opacity 600ms ease, transform 600ms ease; }
.watch.seen { opacity: 1; transform: none; }

/* ---------- small screens ---------- */

@media (max-width: 46rem) {
  .hero .wrap { grid-template-columns: 1fr; gap: 3.5rem; padding-top: 3rem; padding-bottom: 4.5rem; }
  .hero-cover { margin-top: 0.5rem; }
  .hero-cover .note { right: 50%; transform: translateX(50%) rotate(-3deg); }
  .postcard { grid-template-columns: 1fr; padding: 2rem 1.5rem; gap: 1.6rem; }
  .about .wrap { grid-template-columns: 1fr; gap: 3rem; }
  .about .snapshot { margin: 0 auto; }
  section { padding: 3.2rem 0; }
  .post-nav .wrap { flex-direction: column; }
}
