/* rosscorwin.com. Direction A, "The Wrap": the home page is the paperback wrap unfolded.
   Palette and type from the cover brief. The orange is a flat field only: never type, never a
   gradient, glow or shadow. Nothing on the site moves. Rules in CLAUDE.md. */

@font-face { font-family: 'League Gothic'; src: url('fonts/LeagueGothic-Regular.woff') format('woff'); font-weight: 400; font-display: block; }
@font-face { font-family: 'Libre Caslon Text'; src: url('fonts/LibreCaslonText-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Libre Caslon Text'; src: url('fonts/LibreCaslonText-Italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'EB Garamond'; src: url('fonts/EBGaramond-Regular.woff') format('woff'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'EB Garamond'; src: url('fonts/EBGaramond-Italic.woff') format('woff'); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --orange: #F26522;
  --slate: #1E2731;
  --paper: #F1EFEA;
  --rule: #A9B6C0;
  --ink: #24324D;
  --display: 'League Gothic', 'Arial Narrow', sans-serif;
  --caslon: 'Libre Caslon Text', Georgia, serif;
  --text: 'EB Garamond', Garamond, Georgia, serif;
  --pad: clamp(22px, 7vw, 112px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; color: var(--slate); background: var(--orange); font-family: var(--text);
  font-size: 1.1875rem; line-height: 1.55; font-kerning: normal; font-variant-ligatures: common-ligatures; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:focus-visible { outline: 3px solid var(--slate); outline-offset: 3px; }
p { margin: 0 0 0.9em; }
h1, h2 { font-weight: 400; }

/* Buttons: slate, square corners, no shadow. */
.btn { display: inline-block; font-family: var(--text); font-size: 1.1rem; letter-spacing: 0.02em; line-height: 1.2;
  text-decoration: none; background: var(--slate); color: var(--paper); padding: 0.75em 1.25em 0.7em; border: 2px solid var(--slate); }
.btn:hover { background: var(--paper); color: var(--slate); }
.btn.ghost { background: transparent; color: var(--slate); }
.btn.ghost:hover { background: var(--slate); color: var(--paper); }

.nav { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px clamp(14px, 2.4vw, 34px);
  font-size: clamp(15px, 1.25vw, 18px); }
.nav a { text-decoration: none; border-bottom: 1px solid transparent; }
.nav a:hover { border-bottom-color: var(--slate); }

/* ---------- Home: the front cover ---------- */
.front { position: relative; overflow: hidden; min-height: 100vh; min-height: 100svh;
  --t: min(28vw, 17.5vh); display: flex; flex-direction: column; padding: 0 var(--pad) clamp(22px, 4vh, 48px); }
@supports (height: 1svh) { .front { --t: min(28vw, 17.5svh); } }
.front .nav { padding-top: 20px; position: relative; z-index: 3; }
.title { margin: clamp(10px, 2vh, 28px) 0 0; font-family: var(--display); text-transform: uppercase;
  font-size: var(--t); line-height: 0.806; letter-spacing: 0.01em; position: relative; z-index: 2; }
.title span { display: block; white-space: nowrap; }
.novel { margin: calc(var(--t) * 0.16) 0 0; font-family: var(--caslon); font-style: italic; font-size: calc(var(--t) * 0.3);
  line-height: 1; position: relative; z-index: 2; }
.buy-inline { margin-top: clamp(18px, 3.5vh, 40px); display: flex; flex-wrap: wrap; gap: 12px; position: relative; z-index: 2; }
.author { margin: auto 0 0; padding-top: 28px; font-family: var(--caslon); text-transform: uppercase; letter-spacing: 0.1em;
  font-size: calc(var(--t) * 0.21); line-height: 1.23; position: relative; z-index: 2; }

/* The notebook page, as on the cover: from the lower right, cut by the edges, rotated 3.5°, one soft shadow. */
.page { position: absolute; z-index: 1; margin: 0; left: 54vw; top: 31vh; top: 31svh; width: 44vw; max-width: 820px;
  transform: rotate(-3.5deg); }
.page img { width: 100%; box-shadow: 0 6px 18px rgba(30, 39, 49, 0.22); background: var(--paper); }
.page figcaption { position: absolute; left: -2.2em; bottom: 34%; transform: rotate(-90deg); transform-origin: 0 100%;
  white-space: nowrap; font-size: 14px; }
.page figcaption a, .credit-under a { text-decoration: underline; }

@media (min-width: 761px) and (max-width: 1150px) { .page { left: 52vw; width: 50vw; top: 36vh; top: 36svh; } }

/* Phones and portrait tablets: the hero is the eBook cover in its own proportions (positions from cover.html, in vw). */
@media (max-width: 760px), (orientation: portrait) and (max-width: 1100px) {
  .front { --t: 24.5vw; --top: 46px; min-height: 0; height: calc(var(--top) + 156vw); padding: 0; display: block; }
  .front .nav { position: absolute; top: 0; right: 5vw; left: 7vw; padding-top: 14px; }
  .title { margin: 0; position: absolute; top: var(--top); left: 7vw; }
  .novel { position: absolute; margin: 0; top: calc(var(--top) + 82.5vw); left: 7.25vw; font-size: 7.4vw; }
  .buy-inline { display: none; }
  .author { position: absolute; margin: 0; padding: 0; top: calc(var(--top) + 133vw); left: 7.25vw; font-size: 5.9vw; line-height: 7.25vw; }
  .page { left: 40.6vw; top: calc(var(--top) + 81vw); width: 61.25vw; max-width: none; }
  .page figcaption { display: none; }
}

/* ---------- Home: the back cover ---------- */
.back { padding: clamp(28px, 10vw, 128px) var(--pad) clamp(56px, 10vw, 128px); }
.headline { text-wrap: balance; font-family: var(--display); font-size: clamp(42px, 6.4vw, 92px); line-height: 1.0; letter-spacing: 0.005em;
  max-width: 13.5em; margin: 0 0 clamp(36px, 5vw, 64px); }
.panel { background: var(--paper); max-width: 42rem; padding: clamp(26px, 5vw, 60px) clamp(22px, 5vw, 64px); }
.panel p:last-child { margin-bottom: 0; }
.panel .lede { font-size: 1.32em; line-height: 1.4; }
.buy-mobile, .credit-under { display: none; }
@media (max-width: 760px), (orientation: portrait) and (max-width: 1100px) {
  .buy-mobile { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 40px; }
  .credit-under { display: block; text-align: right; margin: -14px 0 22px; font-size: 0.9rem; }
}
@media (min-width: 1100px) and (orientation: landscape) {
  .back { display: grid; grid-template-columns: minmax(0, 1fr) 42rem; gap: 64px; align-items: start; }
  .headline { position: sticky; top: 64px; margin: 0; font-size: clamp(56px, 5.2vw, 92px); }
}

/* ---------- Home: the opening line ---------- */
.opening { background: var(--paper); padding: clamp(64px, 10vw, 128px) 22px; }
.opening .inner { max-width: 33rem; margin: 0 auto; }
.chapter { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.04em; font-size: 2.1rem;
  line-height: 1.1; text-align: center; margin: 0 0 1.4em; }
.opening p { font-size: 1.32rem; line-height: 1.6; }
.opening p.first::first-line, .excerpt p.first::first-line { font-variant: small-caps; letter-spacing: 0.03em; }
.opening .more { text-align: center; margin: 2.2em 0 0; }

/* ---------- Home: formats ---------- */
.formats { padding: clamp(56px, 9vw, 112px) var(--pad); display: grid; gap: 40px 64px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); max-width: 1100px; }
.formats h2 { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.03em;
  font-size: clamp(40px, 4.6vw, 64px); line-height: 1; margin: 0 0 14px; }
.formats p { font-size: 1.15rem; }
.stores { font-size: 1.02rem !important; }
.stores a { white-space: nowrap; }

/* ---------- Reading page ---------- */
body.read { background: var(--paper); }
.readhead { background: var(--orange); padding: 18px var(--pad) 20px; display: flex; flex-wrap: wrap;
  justify-content: space-between; align-items: baseline; gap: 10px 24px; }
.readhead .home { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.02em; line-height: 1;
  font-size: clamp(28px, 3.4vw, 40px); text-decoration: none; }
.excerpt { max-width: 34rem; margin: 0 auto; padding: clamp(48px, 9vw, 112px) 22px clamp(40px, 6vw, 72px); }
.excerpt .kicker { text-align: center; font-size: 0.85rem; letter-spacing: 0.2em; text-transform: uppercase; margin: 0 0 1.4em; }
.excerpt .chapter { margin-bottom: 1.6em; }
.excerpt p { font-size: 1.25rem; line-height: 1.62; text-indent: 1.15em; margin: 0; text-align: justify;
  -webkit-hyphens: auto; hyphens: auto; }
.excerpt p.first { text-indent: 0; }
.excerpt p.break { text-indent: 0; text-align: center; letter-spacing: 0.6em; margin: 1.4em 0 0; }
@media (max-width: 520px) { .excerpt p { text-align: left; font-size: 1.16rem; } }
.continue { background: var(--orange); padding: clamp(48px, 8vw, 96px) var(--pad); text-align: center; }
.continue .lead { text-wrap: balance; font-family: var(--display); font-size: clamp(32px, 4.4vw, 56px); line-height: 1.02;
  max-width: 14em; margin: 0 auto 0.7em; }
.continue .buttons { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ---------- 404 ---------- */
.lost { min-height: 72vh; padding: clamp(40px, 10vh, 120px) var(--pad); }
.lost .code { font-family: var(--caslon); letter-spacing: 0.1em; margin: 0 0 0.6em; }
.lost h1 { font-family: var(--display); text-transform: uppercase; font-size: clamp(64px, 14vw, 180px); line-height: 0.85; margin: 0 0 0.25em; }
.lost .novel { font-size: clamp(22px, 2.6vw, 34px); margin: 0 0 1.6em; }

/* ---------- Footer, every page ---------- */
.site-footer { background: var(--paper); border-top: 1px solid var(--rule); padding: 44px var(--pad) 72px;
  display: grid; gap: 22px 60px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); font-size: 1.05rem; }
.site-footer .bio { max-width: 30em; }
.site-footer p { margin: 0 0 0.35em; }
.site-footer .small { font-size: 0.95rem; }
.site-footer .credit a { text-decoration: underline; }
