/* =========================================================
   Crowe's Nest Productions — Thomas Anthony, author site
   Theme: a lookout's crow's nest over a sea of clouds.
   ========================================================= */

:root {
  /* sky / twilight */
  --sky-deep:   #0b2233;
  --sky-mid:    #163b54;
  --sky-soft:   #2c6079;
  --horizon:    #e7a86b;
  --horizon-2:  #f2c79a;

  /* clouds / paper */
  --cloud:      #fbf6ec;
  --cloud-2:    #f3e9d6;
  --cloud-shadow:#e3d6bd;
  --paper:      #fdfaf3;

  /* wood + rope + lantern */
  --wood:       #a06b3c;
  --wood-dark:  #6e482a;
  --rope:       #d9bd8e;
  --gold:       #e7b04a;
  --gold-deep:  #c8923a;

  /* ink + teal */
  --ink:        #15242f;
  --ink-soft:   #41535f;
  --teal:       #2f6f7e;
  --teal-deep:  #1d5260;

  --maxw: 1140px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 2px 10px rgba(11,34,51,.08);
  --shadow-md: 0 14px 40px rgba(11,34,51,.16);
  --shadow-lg: 0 26px 70px rgba(11,34,51,.28);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-script: "Sacramento", "Brush Script MT", cursive;

  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- reset ---------- */
*,*::before,*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { margin: 0; line-height: 1.1; font-weight: 600; }
p { margin: 0 0 1rem; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- buttons ---------- */
.btn {
  --b: var(--gold);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--font-body); font-weight: 700; font-size: 1rem; letter-spacing: .01em;
  padding: .85em 1.6em; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s, color .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--gold); color: var(--ink); box-shadow: 0 8px 22px rgba(231,176,74,.4); }
.btn-primary:hover { background: var(--gold-deep); box-shadow: 0 12px 30px rgba(200,146,58,.5); transform: translateY(-2px); }
.btn-ghost { background: rgba(253,250,243,.12); color: var(--cloud); border-color: rgba(253,250,243,.6); backdrop-filter: blur(2px); }
.btn-ghost:hover { background: rgba(253,250,243,.95); color: var(--ink); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--teal-deep); border-color: var(--teal); }
.btn-outline:hover { background: var(--teal); color: #fff; transform: translateY(-2px); }
.btn-block { width: 100%; }

/* ---------- header / nav ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  padding: 18px 0; transition: padding .3s var(--ease), background .3s, box-shadow .3s;
}
.site-header.scrolled {
  padding: 10px 0;
  background: rgba(11,34,51,.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 24px rgba(11,34,51,.28);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: flex; align-items: center; gap: 12px; color: var(--cloud); }
.brand-mark {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(150deg, var(--gold), var(--gold-deep));
  color: var(--ink); box-shadow: var(--shadow-sm); flex: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 1.18rem; letter-spacing: .01em; }
.brand-sub { font-size: .68rem; letter-spacing: .32em; text-transform: uppercase; opacity: .82; margin-top: 3px; }

.nav-menu { list-style: none; display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; }
.nav-menu a {
  color: var(--cloud); font-weight: 600; font-size: .98rem; padding: .5em .85em; border-radius: 999px;
  transition: background .2s, color .2s; opacity: .92;
}
.nav-menu a:hover { background: rgba(253,250,243,.14); opacity: 1; }
.nav-cta { background: var(--gold); color: var(--ink) !important; }
.nav-cta:hover { background: var(--gold-deep) !important; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 26px; height: 2.5px; background: var(--cloud); border-radius: 2px; transition: transform .3s var(--ease), opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 120px 0 60px; overflow: hidden; color: var(--cloud);
  background:
    radial-gradient(120% 90% at 50% 8%, rgba(247,199,154,.16), transparent 46%),
    linear-gradient(180deg, var(--sky-deep) 0%, var(--sky-mid) 46%, var(--sky-soft) 72%, var(--horizon) 100%);
}
.hero-sky { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.moon {
  position: absolute; top: 14%; left: 50%; width: 168px; height: 168px; transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #fff7e6, #f4dca5 60%, #e7c489 100%);
  box-shadow: 0 0 90px 30px rgba(247,221,160,.32);
  opacity: .9;
}
.stars { position: absolute; inset: 0; }
.star { position: absolute; background: #fff; border-radius: 50%; opacity: .85; animation: twinkle var(--dur,4s) ease-in-out infinite; }
@keyframes twinkle { 0%,100% { opacity: .2; } 50% { opacity: .95; } }

.hero-scene { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: min(70vh, 560px); z-index: 1; }
.hero-scene .cloud-far { fill: rgba(251,246,236,.45); }
.hero-scene .cloud-near { fill: var(--cloud); }
.hero-scene .mast { fill: var(--wood-dark); }
.hero-scene .rigging line { stroke: var(--rope); stroke-width: 2.4; opacity: .8; }
.hero-scene .nest-body { fill: var(--wood); }
.hero-scene .nest-rim { fill: var(--wood-dark); }
.hero-scene .weave { stroke: rgba(110,72,42,.55); stroke-width: 2; fill: none; stroke-linecap: round; }
.hero-scene .crow-body { fill: #182832; }
.hero-scene .crow-beak { fill: var(--gold); }
.hero-scene .crow-eye { fill: var(--gold); }
.hero-scene .crow { transform-origin: 724px 262px; animation: bob 6s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-1.5deg); } }

.hero-content { position: relative; z-index: 3; }
.hero-kicker { font-weight: 700; letter-spacing: .28em; text-transform: uppercase; font-size: .72rem; opacity: .85; margin-bottom: .4rem; }
.hero-name {
  font-family: var(--font-script); font-weight: 400;
  font-size: clamp(4rem, 13vw, 9.5rem); line-height: .9; color: #fff;
  text-shadow: 0 8px 36px rgba(11,34,51,.5); margin: 0;
}
.hero-tagline { font-family: var(--font-display); font-size: clamp(1.05rem, 2.4vw, 1.5rem); font-weight: 400; max-width: 32ch; margin: .6rem auto 1.8rem; opacity: .96; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.scroll-cue { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 4; width: 26px; height: 42px; border: 2px solid rgba(253,250,243,.7); border-radius: 14px; display: grid; place-items: start center; padding-top: 7px; }
.scroll-cue span { width: 4px; height: 8px; border-radius: 2px; background: var(--cloud); animation: drop 1.6s var(--ease) infinite; }
@keyframes drop { 0% { transform: translateY(0); opacity: 0; } 30% { opacity: 1; } 70% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }

/* ---------- generic section ---------- */
.section { padding: clamp(64px, 9vw, 128px) 0; position: relative; }
.section-head { max-width: 720px; margin: 0 auto clamp(40px,6vw,68px); text-align: center; }
.eyebrow { font-weight: 800; letter-spacing: .22em; text-transform: uppercase; font-size: .74rem; color: var(--gold-deep); margin-bottom: .6rem; }
.section-title { font-family: var(--font-display); font-size: clamp(2rem, 4.6vw, 3.1rem); color: var(--ink); }
.section-lead { font-size: 1.12rem; color: var(--ink-soft); margin-top: .9rem; }

/* ---------- books ---------- */
.books { background:
  linear-gradient(180deg, var(--paper), #fff 30%, var(--paper));
}
.age-band { margin-bottom: clamp(48px, 7vw, 86px); }
.age-band:last-child { margin-bottom: 0; }
.age-band-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; padding-bottom: 18px; margin-bottom: 34px; border-bottom: 2px dashed var(--cloud-shadow); }
.age-title { font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2.1rem); color: var(--teal-deep); }
.age-note { font-weight: 700; color: var(--ink-soft); font-size: .95rem; }

.book-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(24px, 4vw, 44px); }
.book-card {
  flex: 1 1 300px; max-width: 340px;
  display: flex; flex-direction: column; gap: 18px;
  background: #fff; border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow-sm); border: 1px solid rgba(227,214,189,.7);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.book-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-md); }

.book-cover {
  position: relative; display: block; aspect-ratio: 2/3; border-radius: var(--radius-sm);
  overflow: hidden; background: linear-gradient(150deg, var(--sky-mid), var(--teal-deep));
  box-shadow: var(--shadow-md); transition: transform .35s var(--ease);
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.book-card:hover .book-cover img { transform: scale(1.04); }
.book-cover::after { /* shine */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, rgba(255,255,255,.28), transparent 38%);
  opacity: 0; transition: opacity .35s; pointer-events: none;
}
.book-card:hover .book-cover::after { opacity: 1; }

/* placeholder cover when image is missing (JS adds .is-fallback) */
.book-cover.is-fallback img { display: none; }
.book-cover.is-fallback::before {
  content: attr(data-title);
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  padding: 18px; color: var(--cloud); font-family: var(--font-display); font-weight: 600;
  font-size: 1.25rem; line-height: 1.2;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(231,176,74,.35), transparent 60%),
    linear-gradient(160deg, var(--sky-mid), var(--teal-deep));
}
.book-cover[data-accent="amber"].is-fallback::before { background: radial-gradient(120% 60% at 50% 0%, rgba(231,176,74,.5), transparent 60%), linear-gradient(160deg, #b3792d, #6e482a); }
.book-cover[data-accent="coral"].is-fallback::before { background: radial-gradient(120% 60% at 50% 0%, rgba(216,90,48,.4), transparent 60%), linear-gradient(160deg, #c2542f, #5d2414); }
.book-cover[data-accent="teal"].is-fallback::before { background: radial-gradient(120% 60% at 50% 0%, rgba(47,111,126,.5), transparent 60%), linear-gradient(160deg, #2f6f7e, #143b54); }

.book-body { display: flex; flex-direction: column; gap: 8px; }
.book-title { font-family: var(--font-display); font-size: 1.32rem; color: var(--ink); }
.book-age-pill { align-self: flex-start; font-size: .76rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--teal-deep); background: rgba(47,111,126,.12); padding: 4px 12px; border-radius: 999px; margin: 0; }
.book-blurb { color: var(--ink-soft); font-size: 1rem; margin: 4px 0 6px; }
.book-blurb em { color: var(--gold-deep); font-style: normal; font-size: .9em; }
.cover-ribbon {
  position: absolute; top: 16px; left: -34px; transform: rotate(-45deg);
  background: var(--gold); color: var(--ink); font-weight: 800; font-size: .72rem;
  letter-spacing: .08em; text-transform: uppercase; text-align: center;
  width: 140px; padding: 6px 0; box-shadow: 0 4px 12px rgba(11,34,51,.28); z-index: 3;
}
.book-cover.coming { cursor: default; }
.book-cover.coming img { filter: saturate(.9) brightness(.97); }
.book-soon {
  margin-top: auto; align-self: flex-start; font-weight: 800; font-size: .82rem;
  letter-spacing: .04em; text-transform: uppercase; color: var(--gold-deep);
  display: inline-flex; align-items: center; gap: 7px;
}
.book-soon::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(231,176,74,.22); }
.book-link { font-weight: 800; color: var(--teal-deep); display: inline-flex; gap: 6px; align-items: center; margin-top: auto; }
.book-link span { transition: transform .2s var(--ease); }
.book-link:hover span { transform: translateX(5px); }

/* ---------- about ---------- */
.about { background: linear-gradient(180deg, var(--sky-deep), var(--sky-mid)); color: var(--cloud); }
.about .section-title { color: #fff; }
.about-grid { display: grid; grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr); gap: clamp(36px, 6vw, 76px); align-items: center; }
.about-portrait { position: relative; max-width: 360px; margin: 0 auto; width: 100%; }
.about-portrait-inner { position: relative; aspect-ratio: 4/5; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); z-index: 2; }
.about-portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; }
.about-portrait-fallback {
  position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  background:
    radial-gradient(120% 70% at 50% 12%, rgba(231,176,74,.22), transparent 60%),
    linear-gradient(160deg, var(--sky-mid), var(--teal-deep));
}
.about-portrait-fallback .monogram { font-family: var(--font-display); font-weight: 600; font-size: 4.2rem; color: var(--gold); line-height: 1; }
.about-portrait-fallback .monogram-sub { font-family: var(--font-script); font-size: 1.6rem; color: rgba(251,246,236,.92); }
.about-portrait-frame { position: absolute; inset: 18px -18px -18px 18px; border: 2px solid var(--gold); border-radius: var(--radius); z-index: 1; }
.about .eyebrow { color: var(--gold); }
.about-lead { font-family: var(--font-display); font-size: 1.32rem; line-height: 1.5; color: #fff; margin-top: 1rem; }
.about-lead em { color: var(--gold); font-style: italic; }
.about-text p { color: rgba(251,246,236,.86); }
.about-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 14px 30px; padding: 0; margin: 1.4rem 0 1.8rem; }
.about-facts li { font-size: .98rem; color: rgba(251,246,236,.82); border-left: 2px solid var(--gold); padding-left: 12px; }
.about-facts strong { display: block; font-family: var(--font-display); font-size: 1.5rem; color: #fff; }

/* ---------- contact ---------- */
.contact { background: var(--paper); }
.contact-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.05fr); gap: clamp(36px, 6vw, 70px); align-items: start; }
.contact-intro { position: sticky; top: 110px; }
.contact-email { display: inline-flex; align-items: center; gap: 12px; margin-top: 8px; font-weight: 800; color: var(--teal-deep); font-size: 1.04rem; word-break: break-word; }
.contact-email-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(47,111,126,.12); color: var(--teal-deep); font-size: 1.1rem; flex: none; }
.contact-email:hover { color: var(--gold-deep); }

.contact-form { background: #fff; border-radius: var(--radius); padding: clamp(24px, 4vw, 40px); box-shadow: var(--shadow-md); border: 1px solid rgba(227,214,189,.7); }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 7px; color: var(--ink); }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--ink); padding: 13px 15px;
  border: 1.5px solid var(--cloud-shadow); border-radius: var(--radius-sm); background: var(--paper);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--teal); background: #fff; box-shadow: 0 0 0 4px rgba(47,111,126,.14); }
.field textarea { resize: vertical; min-height: 120px; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
.form-status { margin: 14px 0 0; font-weight: 700; font-size: .95rem; min-height: 1.2em; }
.form-status.ok { color: var(--teal-deep); }
.form-status.err { color: #b23b2e; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: rgba(251,246,236,.78); padding: 56px 0 40px; }
.footer-inner { display: grid; gap: 22px; }
.footer-brand .brand-name { color: #fff; font-size: 1.3rem; font-family: var(--font-display); }
.footer-brand p { margin: 6px 0 0; font-size: .95rem; }
.footer-publisher { display: flex; align-items: center; gap: 9px; margin-top: 14px !important; font-size: .85rem; opacity: .78; letter-spacing: .01em; }
.footer-publisher strong { color: var(--gold); font-weight: 700; }
.footer-crow { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(231,176,74,.14); color: var(--gold); flex: none; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-nav a { font-weight: 600; opacity: .85; transition: opacity .2s, color .2s; }
.footer-nav a:hover { opacity: 1; color: var(--gold); }
.footer-copy { font-size: .85rem; opacity: .6; margin: 0; }
@media (min-width: 760px) {
  .footer-inner { grid-template-columns: 1fr auto; align-items: center; }
  .footer-copy { grid-column: 1 / -1; border-top: 1px solid rgba(251,246,236,.12); padding-top: 22px; }
}

/* ---------- reveal animation ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .crow, .scroll-cue span, .star { animation: none !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .contact-intro { position: static; }
  .about-portrait-frame { inset: 14px -14px -14px 14px; }
}
@media (max-width: 720px) {
  /* backdrop-filter would trap the fixed drawer inside the header's box */
  .site-header, .site-header.scrolled { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .site-header.scrolled { background: rgba(11,34,51,.96); }
  .nav-toggle { display: flex; z-index: 110; }
  .nav-menu {
    position: fixed; inset: 0 0 0 auto; width: min(78vw, 320px);
    flex-direction: column; align-items: flex-start; justify-content: center; gap: 10px;
    background: rgba(11,34,51,.98); backdrop-filter: blur(8px);
    padding: 80px 32px; transform: translateX(100%); transition: transform .35s var(--ease);
    box-shadow: -20px 0 60px rgba(0,0,0,.4);
  }
  .nav-menu.open { transform: none; }
  .nav-menu a { font-size: 1.15rem; width: 100%; }
  .nav-cta { margin-top: 8px; }
  body.nav-open { overflow: hidden; }
}
