/* ============================================================
   UNDERCURRENT — Patricia Reay  ·  Edition Two
   Structure after taylorjenkinsreid.com: full-bleed colour
   blocks, giant knockout name, ruled retailer grid.
   Palette is Undercurrent's own, sampled from the cover art.
   ============================================================ */

:root {
  /* Colour blocks — each section owns a flat field, TJR-style, but drawn
     from the cover instead of TJR's mint/pink/blue. */
  --sand:      #F4E4CE;   /* warm paper — the beach */
  --sand-deep: #E9CFA8;
  --amber:     #ED963D;   /* sunset */
  --teal:      #2C6C7F;   /* shallow water */
  --deep:      #004154;   /* deep petrol */
  --abyss:     #05253C;   /* night water */
  --ink:       #06283C;   /* text on light fields */
  --cream:     #FFF6E6;   /* text on dark fields */

  --display: "Bodoni Moda", "Didot", "Times New Roman", serif;
  --body:    "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --gutter: clamp(1.25rem, 5vw, 5rem);
  --measure: 58ch;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  line-height: 1.65;
  color: var(--ink);
  background: var(--sand);
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
::selection { background: var(--amber); color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--amber); color: var(--ink);
  padding: 0.75rem 1.25rem; z-index: 999; font-weight: 600;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- Newsletter bar ---------- */
.topbar {
  background: var(--teal);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 0.85rem var(--gutter);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
}
.topbar button {
  font: inherit;
  letter-spacing: 0.16em;
  background: var(--sand);
  color: var(--ink);
  border: 0;
  padding: 0.6rem 1.5rem;
  cursor: pointer;
  transition: background 220ms ease, transform 220ms ease;
}
.topbar button:hover { background: var(--amber); transform: translateY(-1px); }

/* ---------- Nav ---------- */
.nav {
  display: flex;
  justify-content: center;
  gap: clamp(1.2rem, 4vw, 3rem);
  padding: 1.7rem var(--gutter) 0;
  flex-wrap: wrap;
}
.nav a {
  color: var(--teal);
  text-decoration: none;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 500;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  transition: color 200ms ease, border-color 200ms ease;
}
.nav a:hover { color: var(--ink); border-color: var(--amber); }

/* ---------- Blocks ---------- */
.block {
  position: relative;
  /* top padding clears the oversized ghost name, which is absolutely
     positioned and so contributes no height of its own */
  padding: clamp(5rem, 12vh, 8.5rem) var(--gutter) clamp(3.5rem, 8vh, 6rem);
  overflow: hidden;
}
.block--sand  { background: var(--sand); color: var(--ink); }
.block--amber { background: var(--amber); color: var(--ink); }
.block--teal  { background: var(--teal);  color: var(--cream); }
.block--deep  { background: var(--deep);  color: var(--cream); }
.block--abyss { background: var(--abyss); color: var(--cream); }

.block__inner {
  max-width: 1240px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  position: relative;
  z-index: 2;
}
.block__inner--flip .block__media { order: -1; }
.block__inner--solo { grid-template-columns: minmax(0, 1fr); max-width: 900px; }

/* The oversized knockout name — TJR's signature graphic device */
.ghost {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: clamp(-0.5rem, -1vh, 0.5rem);
  width: max-content;
  max-width: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(3.5rem, 13vw, 13rem);
  line-height: 0.82;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  opacity: 0.38;
  text-transform: uppercase;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  white-space: nowrap;
  text-align: center;
}
.ghost span { display: block; }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(5rem, 14vh, 9rem); }
.hero .block__inner { align-items: center; }

.hero__eyebrow {
  font-size: 0.74rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 1rem;
  font-weight: 600;
}
.hero__title {
  font-family: var(--display);
  font-weight: 700;
  /* sized to FIT the column — "UNDERCURRENT" is 12 characters of Bodoni
     caps, so an unchecked clamp overruns into the book image */
  font-size: clamp(2rem, 0.4rem + 4.4vw, 4.4rem);
  line-height: 0.94;
  letter-spacing: -0.03em;
  margin: 0 0 1.2rem;
  color: var(--ink);
  text-transform: uppercase;
  white-space: nowrap;
}
.hero__blurb {
  font-size: clamp(1.05rem, 1rem + 0.35vw, 1.3rem);
  max-width: 40ch;
  margin: 0 0 2rem;
  color: #1D3D4E;
}
.hero__blurb a {
  color: var(--teal);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid var(--amber);
  white-space: nowrap;
}
.hero__blurb a:hover { color: var(--ink); }

/* the book image */
.block__media img {
  width: min(420px, 100%);
  margin-inline: auto;
  filter:
    drop-shadow(0 14px 22px rgba(6,40,60,0.22))
    drop-shadow(0 40px 60px rgba(6,40,60,0.18));
  transition: transform 600ms cubic-bezier(.22,.61,.36,1);
}
.block__media img:hover { transform: translateY(-8px) scale(1.02); }

/* The flat cover is 2:3 — constrain by HEIGHT or the aspect ratio forces a
   1500px-tall block. (Same trap as the sister site.) */
.cover-flat {
  height: min(56vh, 460px);
  width: auto !important;
  max-width: 100%;
  object-fit: contain;
  box-shadow: 0 24px 50px -22px rgba(3,22,36,0.65);
}

/* ---------- Retailer grid — TJR's ruled two-column list ---------- */
.retailers {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  gap: 0 clamp(1.5rem, 4vw, 3rem);
  max-width: 640px;
}
.retailers a {
  display: block;
  padding: 1.05rem 0.25rem;
  text-align: center;
  border-bottom: 1px solid currentColor;
  color: inherit;
  text-decoration: none;
  font-size: 0.76rem;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0.75;
  transition: opacity 200ms ease, background 200ms ease, letter-spacing 200ms ease;
}
.retailers a:hover {
  opacity: 1;
  background: rgba(255,255,255,0.28);
  letter-spacing: 0.24em;
}
.block--teal .retailers a:hover,
.block--deep .retailers a:hover { background: rgba(255,255,255,0.12); }

/* ---------- Section headings inside blocks ---------- */
.block__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin: 0 0 1.1rem;
  opacity: 0.72;
  font-weight: 600;
}
.block__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.7rem, 1rem + 2.4vw, 3.2rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin: 0 0 1.2rem;
  text-transform: uppercase;
}
.block p { max-width: var(--measure); }
.block__inner--solo p { margin-inline: auto; }
.block__inner--solo { text-align: center; }

/* ---------- Pull quote ---------- */
.pull {
  font-family: var(--display);
  font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.9rem);
  line-height: 1.24;
  font-style: italic;
  margin: 0 auto 1.4rem;
  max-width: 22ch;
}
.pull + cite {
  font-style: normal;
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.8;
}

/* ---------- Praise strip ---------- */
.quotes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: clamp(1.8rem, 4vw, 3.2rem);
  max-width: 1240px;
  margin: 2.5rem auto 0;
  position: relative;
  z-index: 2;
}
.quotes figure { margin: 0; }
.quotes blockquote {
  font-family: var(--display);
  font-size: 1.18rem;
  line-height: 1.42;
  font-style: italic;
  margin: 0 0 0.9rem;
  padding-top: 1.1rem;
  border-top: 2px solid currentColor;
}
.quotes cite {
  font-style: normal;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.75;
}

/* ---------- Author ---------- */
.portrait {
  aspect-ratio: 4 / 5;
  background: linear-gradient(150deg, #35748A, #06283C);
  display: grid;
  place-items: center;
  max-width: 420px;
  margin-inline: auto;
  width: 100%;
}
.portrait p {
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  line-height: 2;
  color: rgba(255,246,230,0.75);
  padding: 2rem;
  margin: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 1.05rem 2.4rem;
  background: var(--ink);
  color: var(--cream);
  text-decoration: none;
  font-size: 0.76rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  transition: background 220ms ease, transform 220ms ease;
}
.btn:hover { background: var(--teal); transform: translateY(-2px); }
.block--teal .btn, .block--deep .btn, .block--abyss .btn {
  background: var(--sand); color: var(--ink);
}
.block--teal .btn:hover, .block--deep .btn:hover, .block--abyss .btn:hover {
  background: var(--amber);
}

/* ---------- Extract ---------- */
.extract {
  background: #FBF3E4;
  color: #2A2118;
  max-width: 720px;
  margin-inline: auto;
  padding: clamp(2.2rem, 5vw, 4.5rem);
  font-family: var(--display);
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.28rem);
  line-height: 1.75;
  text-align: left;
  box-shadow: 0 30px 60px -30px rgba(6,40,60,0.5);
  position: relative;
  z-index: 2;
}
.extract p { max-width: none; }
.extract__label {
  font-family: var(--body);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-align: center;
  color: #A0704A;
  margin: 0 0 1.6rem;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--abyss);
  color: var(--cream);
  padding: clamp(3.5rem, 9vh, 6rem) var(--gutter) 2.5rem;
}
.footer__grid {
  max-width: 1240px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 2.5rem;
}
.footer h3 {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  margin: 0 0 0.9rem;
}
.footer p { font-size: 0.95rem; opacity: 0.85; }
.newsletter { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
.newsletter input {
  flex: 1 1 190px;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255,246,230,0.35);
  background: transparent;
  color: var(--cream);
  font-family: var(--body);
  font-size: 0.9rem;
}
.newsletter input::placeholder { color: rgba(255,246,230,0.5); }
.newsletter input:focus { border-color: var(--amber); outline: none; }

.socials { list-style: none; padding: 0; margin: 0; display: flex; gap: 1.4rem; flex-wrap: wrap; }
.socials a {
  color: var(--cream);
  text-decoration: none;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, color 200ms ease;
}
.socials a:hover { border-color: var(--amber); color: var(--amber); }

.footer__base {
  max-width: 1240px;
  margin: 3rem auto 0;
  padding-top: 1.6rem;
  border-top: 1px solid rgba(255,246,230,0.18);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  opacity: 0.7;
}

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 800ms cubic-bezier(.22,.61,.36,1),
              transform 800ms cubic-bezier(.22,.61,.36,1);
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: 110ms; }
.reveal[data-d="2"] { transition-delay: 220ms; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  /* minmax(0, 1fr), NOT 1fr — a bare `1fr` refuses to shrink below its
     content's intrinsic width, so the column blows out past the viewport
     and everything shifts sideways. */
  .block__inner { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .block__inner--flip .block__media { order: 0; }
  .hero .block__media { order: -1; }
  .hero__blurb, .block p { margin-inline: auto; }
  .retailers { margin-inline: auto; }
  .block__media img { width: min(280px, 70vw); }
  .cover-flat { height: auto; width: min(240px, 60vw); }
  .ghost { font-size: clamp(2.6rem, 16vw, 5rem); opacity: 0.32; }
  .quotes blockquote { font-size: 1.06rem; }
  /* "UNDERCURRENT" is too long to sit on one line at phone widths —
     shrink it to fit rather than letting nowrap clip it */
  .hero__title { font-size: clamp(1.55rem, 8.1vw, 2.6rem); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
