/* ==========================================================================
   noahlieberman.com: site styles
   Colours and fonts live in :root so the whole look can be changed in one place.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --sand: #f7f2ec;
  --ink: #1f1b16;
  --body: #3d362f;
  --muted: #6b6259;
  --line: #ece5dc;
  --accent: #d2603a;
  --accent-dark: #b24c29;
  --accent-soft: #fbece4;

  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 24px;
  --max: 1160px;
}

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

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

h1,
h2,
h3 {
  font-family: var(--serif);
  font-variation-settings: "SOFT" 100;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0 0 0.45em;
}

h1 {
  font-size: clamp(2.6rem, 5.5vw, 4.4rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  font-size: 1.25rem;
}

h1 em,
h2 em {
  font-style: normal;
  color: var(--accent);
}

h1,
h2 {
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
}

.lede {
  font-size: 1.18rem;
  color: var(--muted);
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.center {
  text-align: center;
}

.muted {
  color: var(--muted);
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
}

/* ---------- Buttons & links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.9em 1.5em;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn svg {
  width: 1.05em;
  height: 1.05em;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-quiet {
  background: #fff;
  border-color: var(--line);
}

.btn-quiet:hover {
  border-color: var(--ink);
}

.btn-small {
  padding: 0.65em 1.15em;
  font-size: 0.9rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.center .btn-row {
  justify-content: center;
}

.link-arrow {
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1.5px solid var(--accent);
  padding-bottom: 2px;
}

.link-arrow:hover {
  color: var(--accent);
}

/* ---------- Header ---------- */

.site-header {
  position: relative;
  z-index: 20;
  background: var(--bg);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
  gap: 24px;
}

.wordmark {
  font-family: var(--serif);
  font-variation-settings: "SOFT" 100;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav a {
  text-decoration: none;
  font-weight: 500;
  font-size: 0.96rem;
  color: var(--muted);
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
}

.nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--accent);
}

.nav .btn {
  color: #fff;
  padding: 0.6em 1.15em;
  font-size: 0.9rem;
}

.header-actions {
  display: none;
  align-items: center;
  gap: 12px;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  place-items: center;
}

.nav-toggle svg {
  width: 20px;
  height: 20px;
}

.header-cta {
  display: none;
}

@media (max-width: 900px) {
  .site-header .container {
    height: 68px;
  }

  .wordmark {
    font-size: 1.2rem;
  }

  .header-actions {
    display: flex;
  }

  .nav-toggle {
    display: grid;
  }

  .header-cta {
    display: inline-flex;
    white-space: nowrap;
    font-size: 0.82rem;
    padding: 0.55em 1em;
  }

  .site-header .nav {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 30px rgba(31, 27, 22, 0.08);
    padding: 8px 24px 20px;
  }

  .site-header .nav.open {
    display: flex;
  }

  .site-header .nav a {
    padding: 13px 0;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--line);
  }

  .site-header .nav a[aria-current="page"] {
    box-shadow: none;
    color: var(--accent);
  }

  .site-header .nav .btn {
    display: none;
  }
}

@media (max-width: 380px) {
  .header-cta {
    display: none;
  }
}

/* ---------- Home hero ----------
   The photo is assets/img/hero.jpg (assets/img/noah.jpg on phones). A shot with
   you on the right side of the frame works best, since the intro card sits on the left. */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(500px, 74vh, 780px);
  padding: 48px 0;
}

.hero-photo {
  position: absolute;
  inset: 0;
  background: #8aa4b8 url("../img/hero-v6.jpg") right 30% / cover no-repeat;
}

.hero .container {
  position: relative;
  width: 100%;
}

.hero-card {
  position: relative;
  max-width: 560px;
  background: #fff;
  border-radius: var(--radius);
  padding: 36px 40px 34px;
  box-shadow: 0 24px 60px rgba(31, 27, 22, 0.12);
}

.hero-card h1 {
  margin-bottom: 0.3em;
}

.hero-card .lede {
  margin-bottom: 26px;
}



@media (max-width: 900px) {
  .hero {
    display: block;
    min-height: 0;
    padding: 0;
  }

  .hero-photo {
    position: relative;
    height: 380px;
    /* phones use the portrait photo */
    background-image: url("../img/noah-v2.jpg");
    background-position: 55% 20%;
  }

  .hero-card {
    margin: -72px 0 0;
    padding: 28px 24px;
  }
}

/* ---------- Sections ---------- */

.section {
  padding: 112px 0;
}

.section-flush {
  padding-top: 0;
}

.section-short {
  padding-bottom: 72px;
}

.sand {
  background: var(--sand);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
}

.section-head .lede {
  margin: 12px 0 0;
  max-width: 34em;
}

.page-intro {
  padding: 72px 0 64px;
}

.page-intro h1 {
  max-width: 13em;
}

.page-intro--tight {
  padding-bottom: 32px;
}

.page-intro--tight h1 {
  margin-bottom: 0;
}

/* small orange page title (Bio page) */
.page-intro--label {
  padding: 56px 0 28px;
}

h1.page-label {
  font-family: var(--sans);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

.page-intro .lede {
  max-width: 34em;
  margin: 0;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

@media (max-width: 900px) {
  .section {
    padding: 80px 0;
  }

  .page-intro {
    padding: 48px 0 48px;
  }

  .split {
    grid-template-columns: 1fr;
    gap: 44px;
  }
}

/* ---------- Book covers ----------
   Placeholders styled after the real covers. Swap one for the real image by
   replacing <div class="cover …">…</div> with
   <img class="cover" src="assets/img/your-cover.jpg" alt="…">
   ------------------------------------ */

.cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 18px 34px rgba(31, 27, 22, 0.18);
}

div.cover {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14% 9% 9%;
  overflow: hidden;
  container-type: inline-size;
}

.cover-title {
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1;
  font-size: 1.4rem;
}

.cover-author {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.7rem;
  white-space: nowrap;
}

.cover--europe {
  background: linear-gradient(180deg, #2c3c9e 0 45%, #e7a25a 45%);
  color: #fff;
}

.cover--europe em {
  display: block;
  font-style: normal;
  font-size: 0.62em;
  color: #ffd84a;
  margin-top: 0.15em;
}

.cover--fantasy {
  background: #3f4fae;
  color: #fff;
}

.cover--fantasy em {
  font-style: normal;
  color: #ffd84a;
}

.cover--god {
  background: linear-gradient(180deg, #fbfaf6, #e6ebf2);
  color: var(--ink);
  outline: 5px solid #c9a443;
  outline-offset: -10px;
  text-align: center;
}

.cover--god small {
  display: block;
  font-size: 0.45em;
  letter-spacing: 0.15em;
  color: #a8852b;
}

.cover--god .cover-author {
  color: #8a6d22;
}

.cover--sample {
  background: linear-gradient(180deg, #2c3c9e 0 50%, #e7a25a 50%);
  color: #fff;
}

.logo-slot {
  align-self: flex-start;
  background: #fff;
  color: var(--ink);
  border: 1.5px dashed var(--ink);
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.4em 0.7em;
  font-size: 0.7rem;
}

@supports (font-size: 1cqi) {
  .cover-title {
    font-size: 13cqi;
  }

  .cover--fantasy .cover-title {
    font-size: 11.5cqi;
  }

  .cover--god .cover-title {
    font-size: 17cqi;
  }

  .cover-author {
    font-size: 6.5cqi;
  }

  .logo-slot {
    font-size: 6cqi;
  }
}

/* ---------- Bookshelf (home) ---------- */

.shelf {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px;
}

.shelf a {
  text-decoration: none;
}

.shelf .cover {
  transition: transform 0.25s;
}

.shelf a:hover .cover {
  transform: translateY(-6px);
}

.shelf h3 {
  font-size: 1.08rem;
  line-height: 1.3;
  margin: 22px 0 4px;
}

.shelf p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent-dark);
  padding: 3px 10px;
  border-radius: 999px;
  margin-right: 6px;
}

@media (max-width: 900px) {
  .shelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px 20px;
  }
}

/* ---------- Featured free book (home) ---------- */

.feature {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 80px;
  align-items: center;
}

.feature .cover {
  max-width: 300px;
  margin: 0 auto;
  transform: rotate(-3deg);
}

.sponsor {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 28px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font-size: 0.92rem;
  color: var(--muted);
}

.sponsor b {
  color: var(--ink);
}

@media (max-width: 900px) {
  .feature {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .feature .cover {
    max-width: 220px;
  }
}

/* ---------- About (home) + bio ---------- */

.about {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 80px;
  align-items: center;
}

/* EDIT: swap photo-portrait.svg for your photo in the HTML (img src) */
.portrait {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  background: #efe7dc;
}

.about p {
  font-size: 1.1rem;
  color: var(--body);
}

.bio-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 80px;
  align-items: start;
}

.bio-grid .portrait {
  position: sticky;
  top: 32px;
}

.prose p {
  font-size: 1.12rem;
  color: var(--body);
}

.prose .lede {
  font-family: var(--serif);
  font-variation-settings: "SOFT" 100;
  font-size: 1.55rem;
  line-height: 1.4;
  color: var(--ink);
}

.pull-quote {
  margin: 2.2rem 0;
  padding: 28px 32px;
  background: var(--accent-soft);
  border-radius: var(--radius);
  font-family: var(--serif);
  font-variation-settings: "SOFT" 100;
  font-size: 1.6rem;
  line-height: 1.3;
  color: var(--accent-dark);
}




@media (max-width: 900px) {
  .about,
  .bio-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .about .portrait,
  .bio-grid .portrait {
    max-width: 380px;
    position: static;
  }
}

/* ---------- Advertisers ---------- */

.ads {
  background: var(--accent-soft);
  border-radius: 32px;
  padding: 64px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.steps li {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: #fff;
  border-radius: 18px;
  padding: 20px 22px;
}

.steps .num {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.steps b {
  display: block;
}

.steps small {
  color: var(--muted);
  font-size: 0.92rem;
}

.steps-3 {
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.steps-3 li {
  flex-direction: column;
  padding: 30px 28px;
  border-radius: var(--radius);
}

.steps-3 b {
  font-family: var(--serif);
  font-variation-settings: "SOFT" 100;
  font-weight: 500;
  font-size: 1.35rem;
  margin: 6px 0 6px;
}

.steps-3 small {
  font-size: 0.98rem;
}

.ad-cover {
  max-width: 300px;
  width: 100%;
  margin: 0 auto;
  transform: rotate(3deg);
}

.ticks {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
}

.ticks li {
  position: relative;
  padding: 0 0 18px 38px;
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-soft)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d2603a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
    center / 13px no-repeat;
}

.ticks strong {
  display: block;
}

.ticks span {
  color: var(--muted);
}


/* sample sponsored cover (Advertisers page) */
.sample-cover {
  margin: 0;
  text-align: center;
}

.sample-cover .cover {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  transform: rotate(2deg);
}

.sample-cover figcaption {
  margin-top: 28px;
  font-size: 0.95rem;
  color: var(--muted);
}

.preface-label {
  display: block;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}



.sponsor-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 360px));
  gap: 20px;
}

.sponsor-card {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  text-decoration: none;
}

.sponsor-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.sponsor-name {
  font-family: var(--serif);
  font-variation-settings: "SOFT" 100;
  font-size: 1.6rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.sponsor-card--next {
  background: transparent;
  border: 1.5px dashed #d8cbbb;
  transition: border-color 0.15s;
}

.sponsor-card--next:hover {
  border-color: var(--accent);
}

.sponsor-card--next .sponsor-name {
  color: var(--accent);
}

.faq {
  max-width: 820px;
  border-top: 1px solid var(--line);
}

.faq details {
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
}

.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-weight: 600;
  font-size: 1.08rem;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--sand);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--accent);
}

.faq details[open] summary::after {
  content: "\2212";
  background: var(--accent-soft);
}

.faq details p {
  color: var(--muted);
  margin: 12px 0 0;
  max-width: 44em;
}

@media (max-width: 900px) {
  .ads {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 36px 24px;
    border-radius: var(--radius);
  }

  .steps-3 {
    grid-template-columns: 1fr;
  }

  .ad-cover {
    max-width: 220px;
  }

  .sponsor-row {
    grid-template-columns: 1fr;
  }
}


/* ---------- Books page ---------- */

.book-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.book-card {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 30px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  scroll-margin-top: 24px;
}

.book-card h3 {
  font-size: 1.45rem;
  margin-bottom: 8px;
}

.book-card p {
  color: var(--muted);
  font-size: 0.95rem;
}

.formats {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 18px;
}

@media (max-width: 900px) {
  .book-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .book-card {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .book-card .cover {
    max-width: 150px;
  }
}

/* ---------- Forms ---------- */

.form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form .full {
  grid-column: 1 / -1;
}

.form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.form input,
.form textarea {
  width: 100%;
  font: inherit;
  padding: 13px 15px;
  border: 1.5px solid #eadfd3;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}

.form input:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form textarea {
  min-height: 140px;
  resize: vertical;
}

@media (max-width: 600px) {
  .form {
    grid-template-columns: 1fr;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 56px 0 40px;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  align-items: start;
}

.site-footer .nav {
  flex-wrap: wrap;
  gap: 10px 26px;
}

.socials {
  display: flex;
  gap: 14px;
  margin-top: 14px;
}

.socials a {
  color: var(--muted);
}

.socials a:hover {
  color: var(--accent);
}

.socials svg {
  width: 22px;
  height: 22px;
  display: block;
}

.fine {
  width: 100%;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 24px 0 0;
}

.fine a {
  color: var(--muted);
}

/* ---------- Real cover images ----------
   Covers have slightly different shapes, so each sits at the bottom of a
   same-size box; that keeps titles under the covers lined up. */

.cover-box {
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.cover-box img.cover {
  /* every cover is 3:4 or narrower, so filling the height never overflows */
  width: auto;
  height: 100%;
  max-width: 100%;
  aspect-ratio: auto;
  border-radius: 4px;
}

.feature .cover-box {
  max-width: 320px;
  width: 100%;
  margin: 0 auto;
}

.feature .cover-box .cover {
  max-width: 100%;
  transform: rotate(-3deg);
}

.book-card .cover-box {
  width: 100%;
}
