:root {
  --ivory: #f4f0ea;
  --paper: #fcfaf7;
  --greige: #e7ded5;
  --ink: #211b1f;
  --muted: #655b60;
  --wine: #743047;
  --rose: #cbb0ba;
  --copper: #a77359;
  --plum: #2b1d24;
  --line: rgb(167 115 89 / 42%);
  --page: min(1240px, calc(100% - 64px));
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

.site-shell {
  min-width: 0;
  overflow: hidden;
}

.site-header {
  width: var(--page);
  min-height: 88px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.wordmark,
.footer-mark {
  display: block;
  flex: 0 0 auto;
}

.wordmark {
  width: 62px;
  height: 62px;
}

.wordmark img,
.footer-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.main-nav,
.site-footer nav {
  display: flex;
  align-items: center;
  gap: clamp(1.35rem, 3vw, 3.25rem);
}

.main-nav a,
.site-footer nav a {
  position: relative;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.main-nav a::after,
.site-footer nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -0.45rem;
  left: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after,
.site-footer nav a:hover::after,
.site-footer nav a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.hero {
  width: var(--page);
  min-height: 660px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  align-items: stretch;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(5rem, 9vw, 8.5rem) 2rem clamp(5rem, 9vw, 8.5rem) 0;
}

.eyebrow,
.work-meta {
  margin: 0 0 1.1rem;
  color: var(--wine);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.hero h1,
.section-heading h2,
.latest h2,
.author h2,
.contact h2,
.novel-feature h3,
.story-feature h3 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.055em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(4.7rem, 8vw, 8.25rem);
  line-height: 0.82;
}

.hero-lead {
  max-width: 36rem;
  margin: clamp(2.5rem, 5vw, 4rem) 0 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1.75vw, 1.45rem);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.75rem;
  margin-top: 2.75rem;
}

.text-link {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid currentColor;
  color: var(--wine);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  line-height: 1.8;
}

.text-link span {
  transition: transform 180ms ease;
}

.text-link:hover span,
.text-link:focus-visible span {
  transform: translateX(0.25rem);
}

.hero-figure {
  position: relative;
  min-width: 0;
  margin: 0;
}

.hero-figure::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--ivory) 0, transparent 23%);
  pointer-events: none;
}

.hero-figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% center;
}

.section {
  width: var(--page);
  margin: 0 auto;
  padding: clamp(6rem, 10vw, 10rem) 0;
}

.section-heading {
  margin-bottom: clamp(3.5rem, 7vw, 6rem);
}

.section-heading--line {
  position: relative;
}

.section-heading--line::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0.65rem;
  left: min(18rem, 34vw);
  height: 1px;
  background: var(--line);
}

.section-heading h2,
.latest h2,
.author h2,
.contact h2,
.contact h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.4rem, 6vw, 6.2rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.93;
}

.novel-feature {
  min-width: 0;
}

.novel-feature--primary {
  display: grid;
  grid-template-columns: minmax(15rem, 21rem) minmax(0, 1fr);
  gap: clamp(3rem, 8vw, 8rem);
  align-items: center;
  max-width: 68rem;
  margin: 0 auto clamp(6rem, 11vw, 10rem);
}

.book-cover-link,
.story-cover {
  display: block;
  border: 1px solid rgb(33 27 31 / 13%);
  background: var(--paper);
  box-shadow: 0 1.35rem 3.5rem rgb(43 29 36 / 12%);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.book-cover-link:hover,
.book-cover-link:focus-visible,
.story-cover:hover,
.story-cover:focus-visible {
  transform: translateY(-0.25rem);
  box-shadow: 0 1.75rem 4.5rem rgb(43 29 36 / 17%);
}

.book-cover-link img,
.story-cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.novel-feature h3,
.story-feature h3 {
  margin: 0;
  font-size: clamp(2.7rem, 4.7vw, 5rem);
  line-height: 0.95;
}

.novel-feature-copy > p:not(.work-meta),
.story-feature > div > p:not(.work-meta) {
  max-width: 38rem;
  margin: 1.75rem 0 2rem;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.7;
}

.novel-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(4rem, 8vw, 8rem);
}

.novel-feature--secondary {
  display: grid;
  grid-template-columns: minmax(10rem, 14.5rem) minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
}

.novel-feature--secondary h3 {
  font-size: clamp(2.5rem, 3.6vw, 4rem);
}

.novel-feature--secondary .novel-feature-copy > p:not(.work-meta) {
  font-size: 1rem;
}

.latest {
  background: var(--plum);
  color: var(--paper);
  scroll-margin-top: 4rem;
}

.latest-inner {
  width: var(--page);
  margin: 0 auto;
  padding: clamp(4.5rem, 7vw, 7rem) 0;
  display: grid;
  grid-template-columns: minmax(15rem, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(3rem, 8vw, 8rem);
  align-items: end;
}

.latest .eyebrow {
  color: var(--rose);
}

.latest h2 {
  color: var(--paper);
  font-size: clamp(3.2rem, 5vw, 5.4rem);
}

.latest-list {
  border-top: 1px solid rgb(167 115 89 / 68%);
}

.latest-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7rem 5rem auto;
  gap: 1rem;
  align-items: center;
  min-height: 4.15rem;
  border-bottom: 1px solid rgb(167 115 89 / 68%);
  color: var(--paper);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  transition: background 180ms ease, padding 180ms ease;
}

.latest-list a:hover,
.latest-list a:focus-visible {
  background: rgb(255 255 255 / 4%);
  padding-inline: 0.75rem;
}

.latest-list a span:nth-child(3) {
  color: var(--rose);
  text-align: right;
}

.selected-stories {
  position: relative;
}

.selected-stories::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 calc(50% - 50vw);
  background: var(--greige);
}

.story-feature {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) minmax(0, 42rem);
  gap: clamp(3rem, 7vw, 7rem);
  align-items: center;
}

.author {
  display: grid;
  grid-template-columns: minmax(17rem, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(4rem, 10vw, 10rem);
  align-items: center;
}

.author-portrait {
  border: 1px solid rgb(33 27 31 / 13%);
  background: var(--paper);
  overflow: hidden;
}

.author-portrait img {
  display: block;
  width: 100%;
  height: auto;
  filter: saturate(0.76) contrast(1.02);
}

.author-copy > p:not(.eyebrow) {
  max-width: 44rem;
  margin: 2rem 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.75;
}

.contact {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(24rem, 1.3fr);
  gap: clamp(4rem, 10vw, 10rem);
  align-items: start;
}

.contact-page {
  min-height: calc(100vh - 220px);
  align-content: center;
}

.contact-copy > p:last-child {
  max-width: 33rem;
  margin: 2rem 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.08rem;
}

.contact-form {
  position: relative;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.form-field + .form-field,
.form-row + .form-field {
  margin-top: 1.5rem;
}

.form-row .form-field + .form-field {
  margin-top: 0;
}

.form-field label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.55rem;
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.form-field label span {
  color: var(--muted);
  font-size: 0.6rem;
}

.form-field input,
.form-field textarea {
  width: 100%;
  border: 1px solid rgb(101 91 96 / 40%);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  outline: 0;
  padding: 0.9rem 1rem;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.form-field textarea {
  min-height: 10rem;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgb(116 48 71 / 12%);
}

.form-submit-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.button {
  border: 1px solid var(--wine);
  border-radius: 0;
  background: var(--wine);
  color: var(--paper);
  cursor: pointer;
  padding: 0.85rem 1.25rem;
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.button:hover,
.button:focus-visible {
  background: var(--plum);
  border-color: var(--plum);
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.form-submit-row p,
.form-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
}

.form-status {
  min-height: 1.5rem;
  margin-top: 1rem;
}

.form-status.is-error {
  color: #9b2f3f;
}

.contact-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.site-footer {
  min-height: 132px;
  background: var(--plum);
  color: var(--paper);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 3rem;
  align-items: center;
  padding: 1.5rem max(32px, calc((100vw - 1240px) / 2));
}

.footer-mark {
  width: 66px;
  height: 66px;
}

.site-footer nav {
  justify-content: center;
}

.site-footer p {
  margin: 0;
  color: var(--rose);
  font-size: 0.67rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Romaanien teossivut */
.book-main-v5 {
  width: var(--page);
  margin: 0 auto;
}

.book-hero-v5 {
  display: grid;
  grid-template-columns: minmax(16rem, 23rem) minmax(0, 1fr);
  gap: clamp(4rem, 9vw, 9rem);
  align-items: start;
  padding: clamp(5rem, 9vw, 9rem) 0;
}

.book-cover-v5 {
  margin: 0;
  border: 1px solid rgb(33 27 31 / 13%);
  background: var(--paper);
  box-shadow: 0 1.5rem 4rem rgb(43 29 36 / 14%);
}

.book-cover-v5 img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.book-copy-v5 {
  padding-top: clamp(1rem, 4vw, 4rem);
}

.book-copy-v5 h1 {
  max-width: 100%;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(4.5rem, 9vw, 9rem);
  font-weight: 400;
  letter-spacing: -0.07em;
  line-height: 0.84;
  overflow-wrap: anywhere;
}

.book-blurb-v5 {
  max-width: 46rem;
  margin-top: clamp(3rem, 6vw, 5rem);
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.8;
}

.book-blurb-v5 p {
  margin: 0;
}

.book-blurb-v5 p + p {
  margin-top: 1.5em;
}

.book-tagline-v5 {
  max-width: 42rem;
  margin: 2.5rem 0 0;
  color: var(--wine);
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.55;
}

.book-tagline-v5 + .book-blurb-v5 {
  margin-top: 2.5rem;
}

.book-reading-v5 {
  position: relative;
  display: grid;
  grid-template-columns: minmax(16rem, 0.78fr) minmax(0, 1.22fr);
  gap: clamp(4rem, 9vw, 9rem);
  margin: 0 calc(50% - 50vw);
  padding: clamp(5rem, 9vw, 9rem) max(32px, calc((100vw - 1240px) / 2));
  background: var(--plum);
  color: var(--paper);
}

.book-reading-heading-v5 h2 {
  margin: 0;
  color: var(--paper);
  font-family: var(--serif);
  font-size: clamp(3.3rem, 6vw, 6.2rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.92;
}

.book-reading-v5 .eyebrow {
  color: var(--rose);
}

.chapter-list-v5 {
  border-top: 1px solid rgb(167 115 89 / 68%);
}

.chapter-list-v5 a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 1.5rem;
  align-items: center;
  min-height: 4.5rem;
  border-bottom: 1px solid rgb(167 115 89 / 68%);
  color: var(--paper);
  text-decoration: none;
  transition: background 180ms ease, padding 180ms ease;
}

.chapter-list-v5 a:hover,
.chapter-list-v5 a:focus-visible {
  background: rgb(255 255 255 / 4%);
  padding-inline: 0.75rem;
}

.chapter-list-v5 a span:nth-child(2) {
  color: var(--rose);
  font-size: 0.76rem;
}

.world-materials {
  position: relative;
  margin: 0 calc(50% - 50vw);
  padding: clamp(5rem, 9vw, 9rem) max(32px, calc((100vw - 1240px) / 2));
  background: var(--greige);
}

.world-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 3rem;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2rem;
}

.world-heading .eyebrow {
  margin: 0;
}

.world-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.3rem, 6vw, 6.5rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.9;
}

.world-materials > p {
  max-width: 48rem;
  margin: 2.5rem 0 3.5rem auto;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.12rem;
}

.world-material-types {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.world-material-types span {
  padding: 1.35rem 1rem;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.world-material-types span + span {
  border-left: 1px solid var(--line);
}

:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 4px;
}

@media (max-width: 1080px) {
  .novel-feature--secondary {
    grid-template-columns: minmax(9rem, 12rem) minmax(0, 1fr);
  }

  .latest-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 880px) {
  :root {
    --page: min(100% - 40px, 1240px);
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding: 5rem 0 3.5rem;
  }

  .hero-figure {
    height: min(66vw, 32rem);
  }

  .hero-figure::after {
    background: linear-gradient(180deg, var(--ivory), transparent 28%);
  }

  .novel-feature--primary {
    grid-template-columns: minmax(13rem, 18rem) minmax(0, 1fr);
    gap: 3.5rem;
  }

  .novel-pair {
    grid-template-columns: 1fr;
    gap: 5rem;
  }

  .novel-feature--secondary {
    grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr);
  }

  .author,
  .contact {
    grid-template-columns: 1fr;
    gap: 3.5rem;
  }

  .author-portrait {
    width: min(28rem, 75vw);
  }

  .contact {
    grid-template-columns: 1fr;
  }

  .book-hero-v5 {
    grid-template-columns: minmax(14rem, 19rem) minmax(0, 1fr);
    gap: 3.5rem;
  }

  .world-heading {
    grid-template-columns: 1fr;
  }

  .book-reading-v5 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  :root {
    --page: calc(100% - 36px);
  }

  html {
    scroll-padding-top: 7rem;
  }

  .site-header {
    min-height: 108px;
    align-items: flex-start;
    padding-block: 1rem;
  }

  .wordmark {
    width: 54px;
    height: 54px;
  }

  .main-nav {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 0.75rem 1.25rem;
    justify-items: end;
    padding-top: 0.35rem;
  }

  .main-nav a {
    font-size: 0.64rem;
  }

  .hero h1 {
    font-size: clamp(4.05rem, 20vw, 6rem);
  }

  .hero-lead {
    font-size: 1.08rem;
  }

  .hero-actions {
    display: grid;
    justify-items: start;
    gap: 1rem;
  }

  .section-heading--line::after {
    display: none;
  }

  .section-heading h2,
  .latest h2,
  .author h2,
  .contact h2,
  .contact h1 {
    font-size: clamp(3rem, 15vw, 4.5rem);
  }

  .novel-feature--primary,
  .novel-feature--secondary,
  .story-feature {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .novel-feature--primary {
    margin-bottom: 6rem;
  }

  .book-cover-link {
    width: min(100%, 22rem);
    margin-inline: auto;
  }

  .novel-feature--secondary .book-cover-link {
    width: min(86%, 19rem);
  }

  .novel-feature h3,
  .story-feature h3 {
    font-size: clamp(3rem, 15vw, 4.5rem);
  }

  .latest-list a {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .latest-list a span:nth-child(3) {
    text-align: left;
  }

  .latest-list a span:last-child {
    display: none;
  }

  .story-cover {
    width: min(55%, 13rem);
  }

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

  .form-row .form-field + .form-field {
    margin-top: 1.5rem;
  }

  .form-submit-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer {
    grid-template-columns: auto 1fr;
    gap: 1.25rem;
    padding-block: 2rem;
  }

  .site-footer nav {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 0.85rem 1.5rem;
    justify-content: end;
  }

  .site-footer p {
    grid-column: 1 / -1;
  }

  .book-hero-v5 {
    grid-template-columns: 1fr;
    gap: 3.5rem;
    padding: 4rem 0 5rem;
  }

  .book-cover-v5 {
    width: min(82%, 22rem);
    margin-inline: auto;
  }

  .book-copy-v5 h1 {
    font-size: clamp(4.25rem, 22vw, 6.5rem);
  }

  .book-blurb-v5 {
    font-size: 1.05rem;
  }

  .world-materials {
    padding-inline: 18px;
  }

  .world-material-types {
    grid-template-columns: 1fr;
  }

  .world-material-types span + span {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .book-reading-v5 {
    padding-inline: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
