:root {
  --paper: #f4ebdd;
  --paper-light: #fbf6ee;
  --paper-edge: #dfcfb8;
  --ink: #1f2822;
  --ink-soft: #566058;
  --vermilion: #a6402d;
  --brass: #d6a85a;
  --sage: #6b765b;
  --display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, serif;
  --reading: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --utility: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --shadow: 0 24px 60px rgb(61 45 28 / 12%);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 49.85%, rgb(91 71 45 / 3%) 50%, transparent 50.15%),
    var(--paper);
  font-family: var(--reading);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.65rem 1rem;
  color: var(--paper-light);
  background: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

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

.site-header {
  width: min(1440px, calc(100% - 6rem));
  min-height: 108px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgb(31 40 34 / 22%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-seal {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--paper-light);
  background: var(--vermilion);
  font-family: var(--display);
  font-size: 1.3rem;
  box-shadow: inset 0 0 0 3px rgb(255 255 255 / 15%);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: var(--display);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
}

.brand small,
.eyebrow,
.shelf-note,
.footer-meta {
  font-family: var(--utility);
  font-size: 0.69rem;
  letter-spacing: 0.16em;
}

.brand small {
  margin-top: -0.25rem;
  color: var(--ink-soft);
}

.site-header nav {
  display: flex;
  gap: 2rem;
}

.site-header nav a {
  padding: 0.55rem 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  background-image: linear-gradient(var(--vermilion), var(--vermilion));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 2px;
  transition: color 180ms ease, background-size 180ms ease;
}

.site-header nav a:hover {
  color: var(--ink);
  background-size: 100% 2px;
}

.hero {
  width: min(1440px, calc(100% - 6rem));
  min-height: 740px;
  margin: 0 auto;
  padding: clamp(5rem, 9vw, 8.5rem) 0 5rem;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(520px, 1.1fr);
  gap: clamp(3rem, 8vw, 8rem);
  align-items: center;
}

.eyebrow {
  margin: 0 0 1.5rem;
  color: var(--vermilion);
  font-weight: 700;
  text-transform: uppercase;
}

.hero .eyebrow {
  display: flex;
  gap: 2rem;
}

.hero .eyebrow span + span {
  position: relative;
}

.hero .eyebrow span + span::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -1.3rem;
  width: 0.55rem;
  height: 1px;
  background: currentColor;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
}

h1 {
  max-width: 700px;
  margin-bottom: 2rem;
  font-size: clamp(3.9rem, 6.9vw, 7.6rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

h1 em {
  position: relative;
  color: var(--vermilion);
  font-style: normal;
  white-space: nowrap;
}

h1 em::after {
  content: "";
  position: absolute;
  right: -0.06em;
  bottom: -0.08em;
  width: 0.16em;
  height: 0.16em;
  border-radius: 50%;
  background: var(--brass);
}

.hero-lede {
  max-width: 34rem;
  margin-bottom: 2.4rem;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.4vw, 1.24rem);
  line-height: 1.9;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  gap: 2.7rem;
  min-width: 180px;
  padding: 0.85rem 0 0.7rem;
  border-bottom: 2px solid var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.primary-link span {
  color: var(--vermilion);
  font-size: 1.25rem;
  transition: transform 180ms ease;
}

.primary-link:hover span {
  transform: translateY(4px);
}

.hero-notes {
  margin: clamp(3.8rem, 7vw, 6.4rem) 0 0;
  display: flex;
  gap: clamp(1.5rem, 4vw, 4rem);
}

.hero-notes div {
  min-width: 88px;
}

.hero-notes dt {
  color: var(--ink-soft);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.hero-notes dd {
  margin: 0.15rem 0 0;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
}

.shelf-scene {
  position: relative;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: 2rem;
}

.shelf-scene::before {
  content: "";
  position: absolute;
  inset: -3.5rem -2rem 2rem 7%;
  z-index: -1;
  border: 1px solid rgb(31 40 34 / 15%);
  background: rgb(255 255 255 / 18%);
  transform: rotate(1.5deg);
}

.shelf-note {
  align-self: flex-end;
  margin: 0 2rem 1.2rem 0;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.book-spines {
  height: 530px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(4px, 0.55vw, 9px);
}

.spine {
  position: relative;
  display: flex;
  width: clamp(54px, 5.4vw, 78px);
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 0.72rem;
  color: var(--paper-light);
  border: 1px solid rgb(31 40 34 / 26%);
  box-shadow: inset 5px 0 12px rgb(255 255 255 / 10%), 7px 9px 18px rgb(41 30 20 / 18%);
  font-family: var(--display);
  text-decoration: none;
  transform-origin: bottom center;
  transition: transform 220ms ease, filter 220ms ease;
}

.spine::after {
  content: "";
  position: absolute;
  inset: 10px 7px;
  border: 1px solid rgb(255 255 255 / 25%);
  pointer-events: none;
}

.spine span,
.spine small {
  position: relative;
  z-index: 1;
  writing-mode: vertical-rl;
}

.spine span {
  font-size: clamp(0.8rem, 1vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.spine small {
  opacity: 0.76;
  font-family: var(--utility);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
}

.spine:hover,
.spine:focus-visible {
  z-index: 2;
  filter: saturate(1.08);
  transform: translateY(-20px) rotate(-1deg);
}

.spine-elon { height: 474px; background: #26372f; }
.spine-claude { height: 510px; background: #a6402d; }
.spine-agent { height: 448px; background: #344d55; }
.spine-hello { height: 495px; color: var(--ink); background: #d6a85a; }
.spine-llm { height: 524px; background: #584c68; }
.spine-hours { height: 430px; background: #6b765b; }
.spine-pg { height: 485px; color: var(--ink); background: #d9c3a4; }

.spine-hello::after,
.spine-pg::after {
  border-color: rgb(31 40 34 / 28%);
}

.shelf {
  position: relative;
  height: 25px;
  margin: 0 -2rem;
  background: #3d3027;
  border-top: 4px solid #5d4939;
  box-shadow: 0 18px 28px rgb(51 36 22 / 25%);
}

.shelf span {
  position: absolute;
  right: 8%;
  bottom: -43px;
  left: 8%;
  height: 42px;
  border-right: 18px solid transparent;
  border-left: 18px solid transparent;
  background: #2b231f;
  clip-path: polygon(0 0, 100% 0, 94% 100%, 6% 100%);
}

.catalogue {
  margin-top: clamp(3rem, 7vw, 7rem);
  padding: clamp(5rem, 9vw, 9rem) max(3rem, calc((100vw - 1440px) / 2));
  color: var(--paper-light);
  background: var(--ink);
}

.section-heading {
  max-width: 1440px;
  margin: 0 auto clamp(4rem, 7vw, 7rem);
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 5rem;
  align-items: end;
  border-bottom: 1px solid rgb(244 235 221 / 23%);
}

.section-heading h2 {
  max-width: 900px;
  margin-bottom: 2.7rem;
  font-size: clamp(2.5rem, 5.4vw, 5.5rem);
  line-height: 1.14;
  letter-spacing: -0.04em;
}

.section-heading > p {
  max-width: 31rem;
  margin-bottom: 2.9rem;
  color: rgb(244 235 221 / 66%);
  line-height: 1.9;
}

.book-grid {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: rgb(244 235 221 / 18%);
  border: 1px solid rgb(244 235 221 / 18%);
}

.book-card {
  min-width: 0;
  background: var(--ink);
}

.book-card > a {
  min-height: 650px;
  padding: clamp(1.5rem, 2.4vw, 2.4rem);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: background-color 220ms ease;
}

.book-card > a:hover {
  background: #28332c;
}

.book-card > a:focus-visible {
  outline-color: var(--brass);
  outline-offset: -6px;
}

.book-cover {
  position: relative;
  min-height: 345px;
  padding: 2rem;
  overflow: hidden;
  color: var(--paper-light);
  border-radius: 2px 9px 9px 2px;
  box-shadow: inset 7px 0 18px rgb(0 0 0 / 18%), var(--shadow);
  transform: perspective(900px) rotateY(0);
  transition: transform 260ms ease, box-shadow 260ms ease;
}

.book-card > a:hover .book-cover {
  box-shadow: inset 7px 0 18px rgb(0 0 0 / 12%), 0 32px 65px rgb(0 0 0 / 25%);
  transform: perspective(900px) rotateY(-4deg) translateY(-5px);
}

.book-cover::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgb(255 255 255 / 26%);
}

.cover-kicker,
.book-meta {
  font-family: var(--utility);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
}

.cover-kicker {
  position: relative;
  z-index: 2;
}

.book-cover strong {
  position: relative;
  z-index: 2;
  display: block;
  margin-top: 2rem;
  font-family: var(--display);
  font-size: clamp(2rem, 3vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.cover-elon { background: #26372f; }
.cover-claude { background: var(--vermilion); }
.cover-agent { background: #344d55; }
.cover-hello { color: var(--ink); background: var(--brass); }
.cover-llm { background: #584c68; }
.cover-hours { background: var(--sage); }
.cover-pg { color: var(--ink); background: #d9c3a4; }

.cover-hello::before,
.cover-pg::before {
  border-color: rgb(31 40 34 / 28%);
}

.cover-orbit {
  position: absolute;
  right: -4rem;
  bottom: -7rem;
  width: 17rem;
  height: 17rem;
  border: 1px solid var(--brass);
  border-radius: 50%;
  box-shadow: 0 0 0 1.9rem rgb(214 168 90 / 13%), 0 0 0 4.2rem rgb(214 168 90 / 8%);
}

.cover-code {
  position: absolute;
  right: 2rem;
  bottom: 1.5rem;
  font-family: var(--utility);
  font-size: 5.5rem;
  font-weight: 700;
  opacity: 0.16;
}

.cover-nodes {
  position: absolute;
  right: -1rem;
  bottom: -2rem;
  width: 13rem;
  height: 13rem;
  background:
    radial-gradient(circle at 20% 30%, var(--brass) 0 5px, transparent 6px),
    radial-gradient(circle at 70% 15%, var(--brass) 0 7px, transparent 8px),
    radial-gradient(circle at 48% 65%, var(--brass) 0 10px, transparent 11px),
    radial-gradient(circle at 90% 78%, var(--brass) 0 5px, transparent 6px),
    linear-gradient(32deg, transparent 48%, rgb(214 168 90 / 65%) 49% 50%, transparent 51%);
  opacity: 0.7;
}

.cover-eye {
  position: absolute;
  right: -2.5rem;
  bottom: -1rem;
  width: 15rem;
  height: 9rem;
  border: 4px solid var(--ink);
  border-radius: 80% 12% 80% 12%;
  opacity: 0.42;
  transform: rotate(24deg);
}

.cover-eye::after {
  content: "";
  position: absolute;
  inset: 2rem 4.6rem;
  border-radius: 50%;
  background: var(--ink);
}

.cover-bars {
  position: absolute;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 8rem;
  height: 7rem;
  background: repeating-linear-gradient(90deg, var(--brass) 0 8px, transparent 8px 17px);
  clip-path: polygon(0 70%, 13% 52%, 26% 64%, 39% 10%, 52% 36%, 65% 0, 78% 48%, 91% 20%, 100% 80%, 100% 100%, 0 100%);
  opacity: 0.75;
}

.cover-hours strong i {
  color: var(--paper-light);
  font-size: 0.48em;
  font-style: normal;
  letter-spacing: 0.2em;
}

.cover-clock {
  position: absolute;
  right: -1rem;
  bottom: -2rem;
  width: 12rem;
  height: 12rem;
  border: 2px solid rgb(244 235 221 / 48%);
  border-radius: 50%;
}

.cover-clock::before,
.cover-clock::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1px;
  height: 38%;
  background: var(--paper-light);
  transform-origin: top;
}

.cover-clock::before { transform: rotate(25deg); }
.cover-clock::after { transform: rotate(118deg); }

.cover-pencil {
  position: absolute;
  right: 3rem;
  bottom: -2rem;
  width: 1.2rem;
  height: 15rem;
  background: var(--vermilion);
  box-shadow: inset 5px 0 rgb(255 255 255 / 16%);
  transform: rotate(36deg);
}

.book-info {
  flex: 1;
  padding: 2.2rem 0 0;
  display: flex;
  flex-direction: column;
}

.book-meta {
  margin-bottom: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--brass);
}

.book-meta span + span::before {
  content: "·";
  margin-right: 0.5rem;
}

.book-info h3 {
  margin-bottom: 0.8rem;
  font-size: clamp(1.45rem, 2.2vw, 2.1rem);
  line-height: 1.25;
}

.book-info > p {
  max-width: 35rem;
  margin-bottom: 1.8rem;
  color: rgb(244 235 221 / 62%);
  font-size: 0.91rem;
  line-height: 1.85;
}

.read-link {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid rgb(244 235 221 / 18%);
  font-size: 0.88rem;
  font-weight: 700;
}

.read-link b {
  color: var(--brass);
  font-size: 1.2rem;
  transition: transform 180ms ease;
}

.book-card > a:hover .read-link b {
  transform: translate(4px, -4px);
}

.about {
  width: min(1180px, calc(100% - 6rem));
  margin: 0 auto;
  padding: clamp(7rem, 13vw, 13rem) 0;
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: clamp(4rem, 9vw, 9rem);
  align-items: center;
}

.about-mark {
  position: relative;
  min-height: 350px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  place-items: center;
  border: 1px solid rgb(31 40 34 / 24%);
  box-shadow: 24px 24px 0 rgb(166 64 45 / 10%);
  transform: rotate(-2deg);
}

.about-mark::before {
  content: "";
  position: absolute;
  inset: 1rem;
  border: 1px solid rgb(31 40 34 / 12%);
}

.about-mark span {
  font-family: var(--display);
  font-size: clamp(2.5rem, 5vw, 5rem);
}

.about-mark span:nth-child(2) {
  color: var(--vermilion);
  transform: translateY(2.4rem);
}

.about-copy h2 {
  max-width: 740px;
  margin-bottom: 2rem;
  font-size: clamp(2.5rem, 5vw, 5.3rem);
  line-height: 1.16;
  letter-spacing: -0.045em;
}

.about-copy > p:not(.eyebrow) {
  max-width: 42rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 2;
}

.about-copy > a {
  display: inline-flex;
  gap: 1.5rem;
  margin-top: 1.2rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid currentColor;
  font-weight: 700;
  text-decoration: none;
}

.site-footer {
  width: min(1440px, calc(100% - 6rem));
  margin: 0 auto;
  padding: 2.8rem 0 3.6rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid rgb(31 40 34 / 22%);
}

.site-footer p {
  margin: 0;
}

.site-footer strong,
.site-footer span {
  display: block;
}

.site-footer strong {
  font-family: var(--display);
  font-size: 1.15rem;
}

.site-footer span {
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.footer-meta {
  color: var(--ink-soft);
}

@media (min-width: 1051px) {
  .card-wide {
    grid-column: span 2;
  }

  .card-wide > a {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: clamp(2rem, 4vw, 4rem);
  }

  .card-wide .book-info {
    padding-top: 0;
  }
}

@media (min-width: 1181px) {
  .card-last {
    grid-column: span 2;
  }

  .card-last > a {
    display: grid;
    grid-template-columns: 0.82fr 1.18fr;
    gap: clamp(2rem, 4vw, 4rem);
  }

  .card-last .book-info {
    padding-top: 0;
  }
}

@media (max-width: 1180px) {
  .site-header,
  .hero,
  .site-footer {
    width: min(100% - 3rem, 1000px);
  }

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

  .hero-copy {
    max-width: 800px;
  }

  .shelf-scene {
    min-height: 610px;
  }

  .book-spines {
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
  }

  .spine {
    width: clamp(58px, 8vw, 88px);
  }

  .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 4rem;
  }

  body {
    background: var(--paper);
  }

  .site-header {
    min-height: 82px;
  }

  .brand small,
  .site-header nav a:first-child {
    display: none;
  }

  .site-header nav {
    gap: 0;
  }

  .hero {
    width: min(100% - 2rem, 560px);
    padding: 4.5rem 0 3rem;
    gap: 4rem;
  }

  h1 {
    font-size: clamp(2.65rem, 12.5vw, 4.4rem);
  }

  .hero-lede {
    font-size: 1rem;
  }

  .hero-notes {
    margin-top: 3.6rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  .hero-notes div {
    min-width: 0;
  }

  .hero-notes dd {
    font-size: 0.84rem;
  }

  .shelf-scene {
    min-height: 460px;
    margin: 0 -0.25rem;
  }

  .shelf-scene::before {
    inset: -1.5rem -0.25rem 2rem 4%;
  }

  .book-spines {
    height: 390px;
    gap: 3px;
  }

  .spine {
    width: calc((100% - 18px) / 7);
    min-width: 0;
    padding: 0.75rem 0.25rem;
  }

  .spine::after {
    inset: 6px 4px;
  }

  .spine span {
    font-size: 0.64rem;
  }

  .spine small {
    display: none;
  }

  .spine-elon { height: 350px; }
  .spine-claude { height: 380px; }
  .spine-agent { height: 330px; }
  .spine-hello { height: 368px; }
  .spine-llm { height: 390px; }
  .spine-hours { height: 316px; }
  .spine-pg { height: 360px; }

  .shelf {
    margin: 0 -0.65rem;
  }

  .catalogue {
    margin-top: 2rem;
    padding: 5.5rem 1rem;
  }

  .section-heading {
    margin-bottom: 3.5rem;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .section-heading h2 {
    margin-bottom: 1.8rem;
    font-size: clamp(2.45rem, 12vw, 4rem);
  }

  .section-heading > p {
    margin-bottom: 2.2rem;
  }

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

  .book-card > a {
    min-height: 0;
    padding: 1rem 1rem 2rem;
  }

  .book-cover {
    min-height: 330px;
  }

  .book-info {
    padding-top: 1.8rem;
  }

  .book-info > p {
    font-size: 0.94rem;
  }

  .about {
    width: min(100% - 2rem, 560px);
    padding: 7rem 0;
    grid-template-columns: 1fr;
    gap: 4.5rem;
  }

  .about-mark {
    min-height: 280px;
  }

  .about-copy h2 {
    font-size: clamp(2.45rem, 12vw, 4rem);
  }

  .site-footer {
    width: calc(100% - 2rem);
    flex-direction: column;
    align-items: flex-start;
    gap: 1.7rem;
  }
}

@media (max-width: 390px) {
  .site-header nav {
    display: none;
  }

  .hero .eyebrow span + span {
    display: none;
  }

  .hero-notes {
    grid-template-columns: 1fr 1fr;
  }

  .hero-notes div:last-child {
    grid-column: span 2;
  }
}

@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;
  }
}
