/* ============================================================
   The Star 55th Anniversary · Reader Book Giveaway
   Direction: "Lacquer & Jade" — ivory ground, jade structure,
   lacquer red reserved for scarcity, gold for hairlines only.
   Single screen: the hero stage flexes to whatever height is left.
   ============================================================ */

:root {
  /* colour */
  --ground:   #F5F1E8;   /* page ground — identical on desktop and mobile */
  --ink:      #17211E;
  --ink-soft: #5C6862;
  --jade:     #1B584C;
  --jade-mist:#C9AE6C;
  --lacquer:  #9E2B2B;
  --gold:     #A98A42;
  --cream:    #F7F4EC;

  /* type */
  --display: "Newsreader", Georgia, "Times New Roman", serif;
  --body:    "Instrument Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
  --util:    "Space Mono", ui-monospace, "SFMono-Regular", monospace;

  /* metrics */
  --col:    420px;
  --gutter: 24px;
  --dock-h: 100px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background-color: var(--ground);   /* desktop field === content field */
}

body {
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
}

img { max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, ol, figure, figcaption { margin: 0; }

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

/* ── the column: one screen tall, everything centred ─────── */

.shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--col);
  min-height: 100vh;
  min-height: min(100svh, 900px);   /* on tall desktops the column stays composed */
  margin: auto;
  padding: 22px var(--gutter) calc(var(--dock-h) + env(safe-area-inset-bottom, 0px));
  text-align: center;
}

/* On desktop the column keeps the same ground; only a pair of
   gold hairlines mark it, like the ruled margin of a book page. */
@media (min-width: 760px) {
  .shell::before,
  .shell::after {
    content: "";
    position: absolute;
    top: 34px;
    bottom: calc(var(--dock-h) - 10px);
    width: 1px;
    background: linear-gradient(180deg,
      rgba(169, 138, 66, 0) 0%,
      rgba(169, 138, 66, .34) 12%,
      rgba(169, 138, 66, .34) 88%,
      rgba(169, 138, 66, 0) 100%);
  }
  .shell::before { left: -30px; }
  .shell::after  { right: -30px; }
}

/* ── shared atoms ───────────────────────────────────────── */

.eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--util);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow i { font-size: 10px; }
.eyebrow--onjade { color: var(--jade-mist); }

/* ============================================================
   1 · Hero — flexes to fill the screen
   ============================================================ */

.hero {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
}

.hero__title {
  margin-top: 14px;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(30px, 8.4vw, 36px);
  line-height: 1.06;
  letter-spacing: -.022em;
}
.hero__title em {
  font-style: italic;
  font-weight: 400;
  color: var(--jade);
}

.hero__deck {
  margin: 10px auto 0;
  max-width: 30ch;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* ── the signature: floating lacquer book ── */

/* A definite height here is what lets the book scale itself to the
   space left over — percentages below all resolve against it. */
.stage {
  position: relative;
  flex: 0 0 auto;
  height: clamp(152px, 25svh, 264px);
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
}

/* aspect-ratio matches book.png — update both together if the cover changes */
.book {
  position: relative;
  height: 100%;
  aspect-ratio: 661 / 1000;
  transform-style: preserve-3d;
  animation: float 4.4s ease-in-out infinite;
}

.book__tilt {
  position: relative;
  height: 100%;
  width: 100%;
  border-radius: 2px 5px 5px 2px;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .28s cubic-bezier(.2, .7, .3, 1);
  box-shadow:
    0 1px 2px rgba(40, 26, 10, .20),
    -3px 12px 16px -7px rgba(40, 26, 10, .30),
    -8px 28px 38px -16px rgba(40, 26, 10, .42);
}

.book__img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: inherit;
  object-fit: cover;
}

/* spine shading — turns a flat cover scan into a physical object */
.book__tilt::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(90deg,
    rgba(18, 8, 4, .44)      0%,
    rgba(18, 8, 4, .17)      2.2%,
    rgba(255, 244, 225, .17) 4.6%,
    rgba(255, 244, 225, 0)   9%,
    rgba(18, 8, 4, 0)        88%,
    rgba(18, 8, 4, .18)      100%);
}

/* specular sweep across the laminated cover */
.book__sheen {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  background-image: linear-gradient(102deg,
    rgba(255, 252, 240, 0)   40%,
    rgba(255, 250, 224, .50) 49%,
    rgba(255, 255, 255, .68) 51%,
    rgba(255, 250, 224, .50) 53%,
    rgba(255, 252, 240, 0)   62%);
  background-size: 300% 100%;
  background-repeat: no-repeat;
  animation: sheen 3.6s cubic-bezier(.5, 0, .4, 1) infinite;
}

.stage__shadow {
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 148px;
  height: 16px;
  margin-left: -74px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(58, 44, 24, .24) 0%, rgba(58, 44, 24, 0) 70%);
  animation: contact 4.4s ease-in-out infinite;
}

/* wax-seal scarcity mark */
.seal {
  position: absolute;
  right: -30px;
  bottom: -20px;
  width: 92px;
  height: 92px;
  overflow: visible;
}
.seal__ring {
  fill: var(--ground);
  stroke: var(--lacquer);
  stroke-width: 1.1;
}
.seal__ring--inner { fill: var(--lacquer); stroke: none; }
.seal__spin {
  transform-origin: 60px 60px;
  transform-box: view-box;
  animation: spin 14s linear infinite;
}
.seal__arc {
  fill: var(--lacquer);
  font-family: var(--util);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
}
.seal__count {
  fill: var(--cream);
  font-family: var(--display);
  font-size: 25px;
  font-weight: 500;
  text-anchor: middle;
}
.seal__label {
  fill: rgba(247, 244, 236, .72);
  font-family: var(--util);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .2em;
  text-anchor: middle;
}

/* ── price line ── */

.pricebar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.pricebar__rule {
  flex: 1;
  height: 1px;
  background: rgba(169, 138, 66, .4);
}
.pricebar__text {
  font-family: var(--util);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}
.pricebar__text b { color: var(--lacquer); font-weight: 700; }

/* ============================================================
   2 · What you're getting — three columns, no boxes
   ============================================================ */

.trio {
  flex: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.trio__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.trio__item img {
  display: block;
  width: 62px;
  height: 62px;
}
.trio__item figcaption {
  font-family: var(--display);
  font-weight: 500;
  font-size: 13.5px;
  line-height: 1.24;
  letter-spacing: -.01em;
  color: var(--jade);
}

/* ============================================================
   3 · How to claim
   ============================================================ */

.claim {
  flex: none;
  margin-top: 20px;
  padding: 15px 16px 16px;
  border-radius: 8px;
  background: var(--jade);
  color: var(--cream);
}

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 12px;
  padding: 0;
}
.steps__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 0 6px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 13px;
  line-height: 1.25;
  color: var(--cream);
}
.steps__item + .steps__item {
  border-left: 1px solid rgba(201, 174, 108, .3);
}
.steps__num {
  font-family: var(--util);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--jade-mist);
}

/* ============================================================
   4 · Closing
   ============================================================ */

.closer {
  flex: none;
  margin-top: 16px;
}

.closer__scarcity {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--display);
  font-style: italic;
  font-size: 14.5px;
  color: var(--lacquer);
}
.closer__scarcity i { font-size: 12px; }

.closer__print {
  margin-top: 7px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ============================================================
   Always-on dock — centred on mobile and desktop alike
   ============================================================ */

.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--ground);
  pointer-events: none;
}
.dock::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 22px;
  background: linear-gradient(180deg, rgba(245, 241, 232, 0), var(--ground));
}

.dock__inner {
  position: relative;
  max-width: var(--col);
  margin: 0 auto;
  padding: 15px var(--gutter);
  pointer-events: auto;
}
.dock__inner::before {
  content: "";
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  top: 0;
  height: 1px;
  background: linear-gradient(90deg,
    rgba(169, 138, 66, 0), rgba(169, 138, 66, .45), rgba(169, 138, 66, 0));
}

.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  width: 100%;
  min-height: 58px;
  padding: 0 18px;
  border-radius: 6px;
  background: var(--jade);
  color: var(--cream);
  font: 600 15.5px/1.2 var(--body);
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .14),
    0 12px 24px -14px rgba(18, 58, 50, .8);
  transition: transform .25s cubic-bezier(.2, .7, .3, 1), box-shadow .25s ease, background-color .25s ease;
}
.cta:hover {
  background: #1F6657;
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .18),
    0 18px 30px -14px rgba(18, 58, 50, .85);
}
.cta:active { transform: translateY(0); }

.cta__icon {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 6px;
}

.cta > span { white-space: nowrap; }

.cta__chip {
  font: 700 9.5px/1 var(--util);
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 4px 7px;
  border-radius: 3px;
  background: rgba(247, 244, 236, .16);
  color: #EADFC2;
}

/* ============================================================
   Motion
   ============================================================ */

@keyframes float {
  0%, 100% { transform: translateY(0)     rotate(0deg); }
  50%      { transform: translateY(-12px) rotate(-.7deg); }
}
@keyframes contact {
  0%, 100% { transform: scaleX(1);   opacity: .95; }
  50%      { transform: scaleX(.88); opacity: .6; }
}
@keyframes sheen {
  0%        { background-position: 150% 0; }
  55%, 100% { background-position: -80% 0; }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* page-load lift */
.hero > *,
.trio,
.claim,
.closer {
  animation: lift .55s cubic-bezier(.2, .7, .3, 1) backwards;
}
.hero > .eyebrow { animation-delay: .03s; }
.hero__title     { animation-delay: .08s; }
.hero__deck      { animation-delay: .13s; }
.stage           { animation-delay: .18s; }
.pricebar        { animation-delay: .24s; }
.trio            { animation-delay: .29s; }
.claim           { animation-delay: .34s; }
.closer          { animation-delay: .39s; }

@keyframes lift {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .book,
  .stage__shadow,
  .book__sheen,
  .seal__spin,
  .hero > *,
  .trio, .claim, .closer { animation: none !important; }
  .book__tilt { transition: none; }
  .cta { transition: none; }
}

/* ── the page keeps to one screen: three tiers of tightening ── */

@media (max-height: 819px) {
  :root { --dock-h: 88px; }
  .shell { padding-top: 16px; }
  .hero__title { font-size: clamp(27px, 7.8vw, 32px); margin-top: 11px; }
  .hero__deck  { font-size: 12.5px; margin-top: 8px; }
  .stage       { height: clamp(140px, 22svh, 214px); margin-top: 11px; }
  .pricebar    { margin-top: 10px; }
  .trio        { margin-top: 14px; }
  .trio__item img { width: 54px; height: 54px; }
  .trio__item figcaption { font-size: 12.5px; }
  .claim  { margin-top: 14px; padding: 12px 13px 13px; }
  .steps  { margin-top: 10px; }
  .steps__item { font-size: 12.5px; }
  .closer { margin-top: 12px; }
  .closer__scarcity { font-size: 13.5px; }
  .closer__print { font-size: 10px; }
  .seal { width: 78px; height: 78px; right: -26px; bottom: -16px; }
  .cta { min-height: 54px; }
  .dock__inner { padding: 13px var(--gutter); }
}

@media (max-height: 720px) {
  :root { --dock-h: 84px; }
  .shell { padding-top: 13px; }
  .hero__title { font-size: 27px; margin-top: 9px; }
  .hero__deck  { font-size: 12px; margin-top: 7px; }
  .stage       { height: clamp(128px, 20svh, 176px); margin-top: 9px; }
  .trio__item img { width: 48px; height: 48px; }
  .trio__item figcaption { font-size: 12px; }
  .claim  { margin-top: 12px; padding: 11px 12px 12px; }
  .steps  { margin-top: 8px; }
  .steps__item { font-size: 12px; }
  .closer { margin-top: 10px; }
  .closer__scarcity { font-size: 13px; }
  .closer__print { font-size: 9.5px; }
  .seal { width: 72px; height: 72px; right: -24px; bottom: -14px; }
  .cta { min-height: 52px; }
  .dock__inner { padding: 12px var(--gutter); }
}

/* the deck is the one line the smallest screens can spare */
@media (max-height: 680px) {
  .hero__deck { display: none; }
  .stage      { height: clamp(130px, 26svh, 180px); }
  .trio       { margin-top: 12px; }
}

/* ── narrow phones: keep the dock button on one line ── */
@media (max-width: 384px) {
  :root { --gutter: 18px; }
  .cta { font-size: 14.5px; gap: 9px; padding: 0 12px; }
  .cta__chip { font-size: 9px; padding: 4px 6px; }
}
