/* Code, Create and Care — link page styles */

:root {
  --cream: #F2ECE6;
  --paper: #FBF8F4;
  --sand: #EDE4DA;
  --sand-soft: #F7F2EC;
  --sand-line: #E2D6C8;
  --clay-grey: #B0B2B5;
  --clay-grey-soft: #C8CACD;
  --mist: #DFE0E2;
  --charcoal: #232427;
  --ink-soft: #4A4D52;
  --slate: #5F646B;
  --brown: #765E4A;

  --shadow-warm: inset 0 1px 0 rgba(255,255,255,.9), 0 6px 14px rgba(110,90,70,.14), 0 2px 3px rgba(110,90,70,.10);
  --shadow-warm-hover: inset 0 1px 0 rgba(255,255,255,.9), 0 10px 22px rgba(110,90,70,.18), 0 2px 4px rgba(110,90,70,.12);
  --shadow-cool: inset 0 1px 0 rgba(255,255,255,.6), 0 8px 18px rgba(80,85,95,.22), 0 2px 3px rgba(80,85,95,.14);

  --font-main: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-caps: 'Montserrat', system-ui, sans-serif;
}

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

html, body { margin: 0; }

body {
  background: var(--cream);
  color: var(--charcoal);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--charcoal); text-decoration: none; }

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

/* ---------- decorative clay blobs ---------- */
.blob {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.blob--sand { background: #E9DFD3; box-shadow: inset 0 2px 0 rgba(255,255,255,.7), 0 8px 20px rgba(110,90,70,.10); }
.blob--grey { background: var(--mist); box-shadow: inset 0 2px 0 rgba(255,255,255,.6), 0 6px 14px rgba(80,85,95,.10); }
.blob--1 { left: -80px; top: -70px; width: 240px; height: 180px; }
.blob--2 { left: -50px; top: 80px; width: 160px; height: 120px; }
.blob--3 { right: -70px; bottom: 110px; width: 210px; height: 170px; }
.blob--4 { right: -50px; bottom: -50px; width: 260px; height: 200px; }

/* ---------- layout ---------- */
.page {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.banner {
  border-radius: 28px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 10px 26px rgba(110,90,70,.14);
}
.banner picture { display: block; }
.banner img { width: 100%; height: auto; aspect-ratio: 1983 / 793; object-fit: cover; }

/* ---------- share button (top-right corner) ---------- */
.share-btn {
  position: absolute;
  top: 54px;
  right: 30px;
  z-index: 2;
  width: 46px; height: 46px;
  border: 0;
  border-radius: 50%;
  background: rgba(251,248,244,.92);
  color: var(--charcoal);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-warm);
  backdrop-filter: blur(6px);
  transition: transform .15s ease, box-shadow .15s ease;
}
.share-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-warm-hover); }
.share-btn:focus-visible { outline: 3px solid var(--brown); outline-offset: 3px; }

.share-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 10;
  margin: 0;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--charcoal);
  color: var(--cream);
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(35,36,39,.3);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .2s ease, transform .2s ease;
}
.share-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- hero: signup + video joined into one card at the very top ---------- */
.hero {
  display: flex;
  flex-direction: column;
  border-radius: 28px;
  background: var(--paper);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 10px 26px rgba(110,90,70,.14);
}
/* Signup is the card's top half: no separate background or shadow */
.hero .signup { background: transparent; box-shadow: none; border-radius: 0; padding-bottom: 6px; }
/* Video is nested inside as a lighter inset panel */
.hero .video-card {
  margin: 0 16px 16px;
  border-radius: 20px;
  background: var(--sand-soft);
  box-shadow: inset 0 0 0 2px var(--sand-line);
}
.hero .video-card:hover { box-shadow: inset 0 0 0 2px var(--sand-line), 0 8px 18px rgba(110,90,70,.14); }
/* Larger thumbnail at YouTube's 16:9 so the whole picture shows (it also trims the
   black bars YouTube adds to 4:3 hqdefault images) */
.hero .video-card__image { flex: 5 1 400px; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.hero .video-card__body { flex: 4 1 300px; padding: 22px 26px; }
.hero .video-card__title { font-size: 22px; }
/* The share button sits in the card's top-right corner; keep text clear of it */
.hero .signup__text { padding-right: 56px; }
@media (min-width: 900px) {
  .hero .signup {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    column-gap: 32px;
    padding: 30px 84px 18px 32px;
  }
  .hero .signup__text { padding-right: 0; }
  .hero .signup__title { font-size: 24px; }
  .hero .signup__form { padding-top: 22px; }   /* balances the message line under the form */
}
@media (max-width: 640px) {
  .hero .video-card { margin: 0 12px 12px; }
  .hero .video-card__image { flex-basis: 100%; }
  .hero .video-card__body { padding: 14px 16px; }
  .hero .video-card__title { font-size: 17px; }
}

.columns {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: flex-start;
}

.profile {
  flex: 1 1 320px;
  padding: 32px 28px;
  border-radius: 28px;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 8px 20px rgba(110,90,70,.12);
}
.profile > picture, .profile__title picture { display: contents; }
.profile__badge { width: 200px; height: auto; filter: drop-shadow(0 8px 14px rgba(110,90,70,.16)); }
.profile__title { margin: 0; line-height: 0; width: 100%; }
.profile__title img { width: 100%; max-width: 300px; height: auto; margin: 0 auto; }
.profile__tagline {
  margin: 0;
  font-family: var(--font-caps);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  line-height: 1.7;
  color: var(--ink-soft);
}
.profile__bio { margin: 0; font-size: 16px; line-height: 1.55; color: var(--ink-soft); max-width: 320px; }

/* ---------- social icon row ---------- */
.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.social {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--sand);
  color: var(--charcoal);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-warm);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.social svg { width: 20px; height: 20px; }
.social:hover { transform: translateY(-2px); background: var(--charcoal); color: var(--cream); box-shadow: var(--shadow-warm-hover); }
.social:focus-visible { outline: 3px solid var(--brown); outline-offset: 3px; }

.links {
  flex: 999 1 520px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- latest video card ---------- */
.video-card {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  border-radius: 26px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow-warm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.video-card__image { flex: 1 1 220px; min-width: 0; height: 170px; object-fit: cover; }
.video-card__body { flex: 2 1 280px; padding: 20px 22px; display: flex; align-items: center; gap: 16px; }
.video-card__text { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.video-card__kicker { font-family: var(--font-caps); font-size: 11px; font-weight: 600; letter-spacing: .16em; color: var(--brown); }
.video-card__title { font-size: 20px; font-weight: 700; line-height: 1.25; }
.video-card__desc { font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
.video-card__meta { font-size: 13px; font-weight: 600; color: var(--slate); }
/* Embedded player that replaces the thumbnail once the card is clicked: full width, 16:9 */
.video-card__player { flex: 1 1 100%; aspect-ratio: 16 / 9; background: #000; }
.video-card__player iframe { display: block; width: 100%; height: 100%; border: 0; }
.video-card.is-playing:hover { transform: none; }
.video-card__play {
  flex: none;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--charcoal);
  display: flex; align-items: center; justify-content: center;
}

/* ---------- link buttons ---------- */
.btn {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 68px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--sand);
  font-size: 18px;
  font-weight: 600;
  color: var(--charcoal);
  box-shadow: var(--shadow-warm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn__icon {
  flex: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--sand-soft);
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 2px rgba(110,90,70,.12);
}
.btn__label { flex: 1; }
.btn svg { stroke: var(--slate); }
.btn__arrow { stroke: var(--brown) !important; }

.btn--work {
  min-height: 72px;
  background: var(--clay-grey);
  font-size: 19px;
  font-weight: 700;
  box-shadow: var(--shadow-cool);
}
.btn--work .btn__icon { width: 42px; height: 42px; background: var(--clay-grey-soft); box-shadow: inset 0 1px 2px rgba(80,85,95,.15); }
.btn--work svg, .btn--work .btn__arrow { stroke: var(--charcoal) !important; }

.btn:hover, .video-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-warm-hover); }
.btn--work:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 12px 24px rgba(80,85,95,.26), 0 2px 4px rgba(80,85,95,.16); }
.btn:focus-visible, .video-card:focus-visible, .email:focus-visible { outline: 3px solid var(--brown); outline-offset: 3px; }

/* ---------- featured link: a light sweep and a gentle nudge every few seconds ---------- */
.btn--featured {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  animation: featured-nudge 6s ease-in-out 1.2s infinite;
}
.btn--featured::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: featured-shine 6s ease-in-out 1.2s infinite;
}
.btn--featured:hover { animation-play-state: paused; }
@keyframes featured-shine {
  0%, 70% { transform: translateX(-120%); }
  90%, 100% { transform: translateX(120%); }
}
@keyframes featured-nudge {
  0%, 72%, 100% { transform: scale(1); }
  80% { transform: scale(1.025); }
  88% { transform: scale(1); }
}

/* ---------- books dropdown (cards styled after josephrichardauthor.com) ---------- */
.books {
  --jr-white: #FFFDF8;
  --jr-line: #DDD5C4;
  --jr-pine: #2E4B3C;
  --jr-pine-deep: #223A2E;
  --jr-bark: #2B2419;
  --jr-bark-soft: #5C5344;
  --jr-moss: #7E8B6E;
}
.books__toggle { list-style: none; cursor: pointer; user-select: none; }
.books__toggle::-webkit-details-marker { display: none; }
.books__chevron { transition: transform .2s ease; }
.books[open] .books__chevron { transform: rotate(180deg); }
.books__toggle:focus-visible { outline: 3px solid var(--brown); outline-offset: 3px; }

.books__list {
  list-style: none;
  margin: 12px 0 0;
  padding: 8px;
  border: 1px solid var(--jr-line);
  border-radius: 22px;
  background: var(--jr-white);
  box-shadow: var(--shadow-warm);
  animation: books-drop .25s ease-out;
}
@keyframes books-drop {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.books__list li + li { border-top: 1px solid var(--jr-line); }

/* One stacked row per book: [cover] title + description [arrow] */
.book-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  font-family: 'Alegreya Sans', 'Segoe UI', sans-serif;
  color: var(--jr-bark);
  transition: background-color .15s ease;
}
.book-item:hover { background: #F4EFE4; }
.book-item:focus-visible { outline: 3px solid var(--brown); outline-offset: 2px; }
.book-item__cover {
  flex: none;
  width: 56px;
  height: 72px;
  object-fit: cover;
  border-radius: 3px 6px 6px 3px;
  box-shadow: 0 10px 14px -10px rgba(43,36,25,.5), 0 1px 4px rgba(43,36,25,.14);
  transition: transform .2s ease;
}
.book-item:hover .book-item__cover { transform: translateY(-3px); }
.book-item__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.book-item__title { font-family: 'Fraunces', Georgia, serif; font-size: 19px; font-weight: 600; line-height: 1.2; }
.book-item__desc { font-size: 16px; line-height: 1.4; color: var(--jr-bark-soft); }
.book-item__arrow { flex: none; color: var(--jr-pine); transition: transform .15s ease; }
.book-item:hover .book-item__arrow { transform: translate(2px, -2px); }

.email {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  font-size: 16px;
  font-weight: 600;
  color: var(--brown);
  text-decoration: underline;
  text-underline-offset: 4px;
  word-break: break-all;
}
.email:hover { color: var(--charcoal); }

/* ---------- email signup ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.signup {
  padding: 22px 24px 18px;
  border-radius: 26px;
  background: var(--paper);
  box-shadow: var(--shadow-warm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.signup__text { display: flex; flex-direction: column; gap: 6px; }
.signup__kicker { font-family: var(--font-caps); font-size: 11px; font-weight: 600; letter-spacing: .16em; color: var(--brown); }
.signup__title { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.25; }
.signup__desc { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
.signup__row { display: flex; gap: 10px; }
.signup__input {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 0 20px;
  border: 2px solid var(--sand-line);
  border-radius: 999px;
  background: #fff;
  font: inherit;
  font-size: 16px;            /* 16px stops iOS zooming in on focus */
  color: var(--charcoal);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.signup__input::placeholder { color: var(--clay-grey); }
.signup__input:focus { outline: none; border-color: var(--brown); box-shadow: 0 0 0 4px rgba(118,94,74,.15); }
.signup__btn {
  flex: none;
  min-height: 52px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  background: var(--charcoal);
  color: var(--cream);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(35,36,39,.22);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.signup__btn:hover { transform: translateY(-2px); background: #34363a; box-shadow: 0 10px 20px rgba(35,36,39,.26); }
.signup__btn:focus-visible { outline: 3px solid var(--brown); outline-offset: 3px; }
.signup__btn:disabled { opacity: .7; cursor: wait; transform: none; }
.signup__msg { margin: 0; min-height: 1.3em; font-size: 14px; font-weight: 600; }
.signup__msg.is-success { color: #3f6b4a; }
.signup__msg.is-error { color: #a1452f; }

/* Download button: hidden until signup succeeds, then revealed under Subscribe */
.signup__download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  background: #5A4636;            /* a little darker than --brown */
  color: var(--cream);
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(90,70,54,.28);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  animation: download-reveal .35s cubic-bezier(.2,.8,.3,1.2);
}
.signup__download[hidden] { display: none; }
.signup__row[hidden] { display: none; }
/* Success message under the download button, with room before the video panel */
.signup__download:not([hidden]) + .signup__msg { margin: 10px 0 12px; }
.signup__download:hover { transform: translateY(-2px); background: #4A392C; box-shadow: 0 10px 20px rgba(90,70,54,.32); }
.signup__download:focus-visible { outline: 3px solid var(--brown); outline-offset: 3px; }
@keyframes download-reveal {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- pillars ---------- */
.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  padding-top: 8px;
}
.pillar {
  padding: 20px 18px;
  border-radius: 22px;
  background: var(--sand);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 4px 12px rgba(110,90,70,.10);
}
.pillar--grey { background: var(--mist); box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 4px 12px rgba(80,85,95,.12); }
.pillar svg { stroke: var(--slate); }
.pillar__name { font-family: var(--font-caps); font-size: 12px; font-weight: 600; letter-spacing: .16em; }
.pillar__text { font-size: 15px; line-height: 1.45; color: var(--ink-soft); }

/* ---------- footer ---------- */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  border-top: 2px solid var(--sand-line);
}
.footer__tagline { font-family: var(--font-caps); font-size: 11px; font-weight: 600; letter-spacing: .16em; color: var(--ink-soft); }
.footer__copy { font-size: 13px; color: var(--slate); }
.footer__link { color: var(--slate); text-decoration: underline; text-underline-offset: 3px; }
.footer__link:hover { color: var(--charcoal); }
.footer__link:focus-visible { outline: 3px solid var(--brown); outline-offset: 2px; border-radius: 4px; }

/* ---------- QR code ---------- */
.qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.qr__thumb {
  width: calc(100% / 3);       /* one third of a button's width */
  min-width: 96px;
  aspect-ratio: 1;
  padding: 8px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  cursor: zoom-in;
  box-shadow: var(--shadow-warm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.qr__thumb img { width: 100%; height: 100%; }
.qr__thumb:hover { transform: translateY(-2px); box-shadow: var(--shadow-warm-hover); }
.qr__thumb:focus-visible { outline: 3px solid var(--brown); outline-offset: 3px; }
.qr__hint { font-size: 13px; font-weight: 600; color: var(--slate); }

/* Columns sit side by side at >= 900px: QR goes under the logo; otherwise under the email link. */
.qr--profile { display: none; }
.qr--profile .qr__thumb { width: 200px; }   /* matches the badge width */
@media (min-width: 900px) {
  .qr--profile { display: flex; }
  .qr--links { display: none; }
}

.qr-dialog {
  border: 0;
  padding: 20px 20px 14px;
  border-radius: 24px;
  background: #fff;
  max-width: none;
  max-height: none;
  cursor: zoom-out;
  box-shadow: 0 24px 60px rgba(35,36,39,.35);
}
.qr-dialog[open] { animation: qr-zoom .22s cubic-bezier(.2,.8,.3,1.2); }
.qr-dialog::backdrop { background: rgba(35,36,39,.6); backdrop-filter: blur(4px); }
.qr-dialog__img {
  width: min(60vw, 60vh);      /* about three fifths of the screen */
  height: min(60vw, 60vh);
}
.qr-dialog__hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--slate);
}
@keyframes qr-zoom {
  from { transform: scale(.4); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}

/* ---------- phone ---------- */
@media (max-width: 640px) {
  .page { padding: 24px 16px 40px; gap: 22px; }
  .banner { display: none; }
  .share-btn { top: 34px; right: 26px; width: 42px; height: 42px; }
  .profile { background: transparent; box-shadow: none; padding: 16px 4px 0; }
  .profile__badge { width: 220px; }
  .btn { min-height: 60px; font-size: 17px; padding: 0 18px; gap: 14px; }
  .btn__icon { width: 36px; height: 36px; }
  .btn--work { min-height: 64px; font-size: 18px; }
  .video-card__image { height: 150px; flex-basis: 100%; }
  .video-card__body { padding: 14px 16px; }
  .video-card__title { font-size: 17px; }
  .signup { padding: 18px 16px 14px; }
  .signup__title { font-size: 17px; }
  .signup__row { flex-direction: column; }
  .footer { justify-content: center; text-align: center; }
  .book-item { gap: 12px; padding: 12px 10px; }
  .book-item__cover { width: 46px; height: 60px; }
  .book-item__title { font-size: 17px; }
  .book-item__desc { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .video-card, .qr__thumb, .signup__btn, .social, .share-btn, .share-toast { transition: none; }
  .btn:hover, .video-card:hover, .qr__thumb:hover, .signup__btn:hover, .social:hover, .share-btn:hover { transform: none; }
  .btn--featured, .btn--featured::after, .signup__download { animation: none; }
  .signup__download { transition: none; }
  .signup__download:hover { transform: none; }
  .qr-dialog[open] { animation: none; }
  .books__list { animation: none; }
  .books__chevron, .book-item, .book-item__cover, .book-item__arrow { transition: none; }
  .book-item:hover .book-item__cover, .book-item:hover .book-item__arrow { transform: none; }
}
