/* ----- base ----- */
:root {
  --bg: #000;
  --fg: #f4f1ea;
  --muted: #8d877a;
  --accent: #f4f1ea;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: "Courier New", "Courier", ui-monospace, monospace;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

button { font-family: inherit; cursor: pointer; }

.hidden { display: none !important; }

/* ----- floating doodles ----- */
.doodles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.doodle {
  position: absolute;
  width: 320px;
  height: auto;
  opacity: 0;
  /* invert black ink to white, drop the white paper into the page's black */
  filter: invert(1);
  mix-blend-mode: screen;
  will-change: transform, opacity;
}

.doodle.d1 { left: -4%;  top: 4%;   width: 340px; animation: drift1 46s ease-in-out infinite; }
.doodle.d2 { right: -5%; top: 12%;  width: 300px; animation: drift2 53s ease-in-out infinite; }
.doodle.d3 { left: 6%;   bottom: -6%; width: 360px; animation: drift3 60s ease-in-out infinite; }
.doodle.d4 { right: 2%;  bottom: -4%; width: 300px; animation: drift4 50s ease-in-out infinite; }
.doodle.d5 { left: 38%;  top: -8%;  width: 280px; animation: drift5 57s ease-in-out infinite; }
.doodle.d6 { right: 30%; bottom: 8%; width: 320px; animation: drift6 64s ease-in-out infinite; }

@keyframes drift1 {
  0%, 100% { opacity: 0; transform: translate(0, 0) rotate(-4deg); }
  20%      { opacity: 0.14; }
  50%      { opacity: 0.16; transform: translate(40px, 30px) rotate(3deg); }
  80%      { opacity: 0.14; }
}
@keyframes drift2 {
  0%, 100% { opacity: 0; transform: translate(0, 0) rotate(5deg); }
  20%      { opacity: 0.12; }
  50%      { opacity: 0.15; transform: translate(-50px, 40px) rotate(-3deg); }
  80%      { opacity: 0.12; }
}
@keyframes drift3 {
  0%, 100% { opacity: 0; transform: translate(0, 0) rotate(3deg); }
  20%      { opacity: 0.13; }
  50%      { opacity: 0.15; transform: translate(35px, -45px) rotate(-4deg); }
  80%      { opacity: 0.13; }
}
@keyframes drift4 {
  0%, 100% { opacity: 0; transform: translate(0, 0) rotate(-3deg); }
  20%      { opacity: 0.12; }
  50%      { opacity: 0.14; transform: translate(-40px, -35px) rotate(4deg); }
  80%      { opacity: 0.12; }
}
@keyframes drift5 {
  0%, 100% { opacity: 0; transform: translate(0, 0) rotate(2deg); }
  20%      { opacity: 0.11; }
  50%      { opacity: 0.13; transform: translate(30px, 50px) rotate(-3deg); }
  80%      { opacity: 0.11; }
}
@keyframes drift6 {
  0%, 100% { opacity: 0; transform: translate(0, 0) rotate(-5deg); }
  20%      { opacity: 0.12; }
  50%      { opacity: 0.15; transform: translate(45px, -30px) rotate(3deg); }
  80%      { opacity: 0.12; }
}

@media (prefers-reduced-motion: reduce) {
  .doodle { animation-duration: 0s; opacity: 0.1; }
}

/* ----- screens ----- */
.screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ----- intro ----- */
.intro-screen {
  cursor: pointer;
}

.intro-logo {
  width: 220px;
  max-width: 60vw;
  filter: invert(1);
  animation: intro-in 1.4s ease-out forwards;
}

@keyframes intro-in {
  0%   { opacity: 0; transform: scale(0.92); }
  60%  { opacity: 1; transform: scale(1); }
  100% { opacity: 1; transform: scale(1); }
}

.intro-screen.fade-out .intro-logo {
  animation: intro-out 0.6s ease-in forwards;
}

@keyframes intro-out {
  to { opacity: 0; transform: scale(1.04); }
}

/* ----- hub ----- */
.hub-screen {
  flex-direction: column;
  gap: 56px;
  opacity: 0;
  animation: fade-in 0.8s ease-out 0.2s forwards;
}

.hub-logo {
  width: 90px;
  filter: invert(1);
  opacity: 0.85;
}

.cards {
  display: flex;
  gap: 80px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 12px;
  border-radius: 10px;
  transition: transform 0.25s ease, opacity 0.25s ease;
  text-align: center;
  position: relative;
}

.card:not(.card-disabled):hover .book-cover {
  transform: scale(1.04);
}

.card-title {
  height: 120px;
  width: 290px;
  object-fit: cover;
  object-position: center;
  filter: invert(1);
  opacity: 0.95;
}

.card-icon {
  width: 230px;
  height: 310px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  overflow: hidden;
}

.card:not(.card-disabled) .card-icon {
  transition: border-color 0.25s ease, background 0.25s ease;
}

.card:not(.card-disabled):hover .card-icon {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.07);
}

.book-cover {
  width: 230px;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
  transform-origin: center;
}

.coming-soon {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  flex-direction: column;
  gap: 10px;
  padding: 0 18px;
}

.coming-soon-label {
  font-family: "Times New Roman", "Times", serif;
  font-style: italic;
  font-size: 28px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.75);
  animation: soft-pulse 3s ease-in-out infinite;
}

.coming-soon-date {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

@keyframes soft-pulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

.card-disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ----- product page ----- */
.product-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  position: relative;
  z-index: 2;
}

.back {
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--muted);
  transition: color 0.2s ease;
}
.back:hover { color: var(--fg); }

.header-logo {
  width: 48px;
  filter: invert(1);
  opacity: 0.85;
}

.spacer { width: 60px; }

.product {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  max-width: 1000px;
  margin: 40px auto 80px;
  padding: 0 28px;
  align-items: start;
}

.product-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 2px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-info {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-top: 8px;
}

.product-title {
  height: 130px;
  width: 340px;
  object-fit: cover;
  object-position: center;
  filter: invert(1);
}

.subtitle {
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 1px;
}

.blurb {
  font-family: "Times New Roman", "Times", serif;
  font-style: italic;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(244, 241, 234, 0.7);
  max-width: 46ch;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 8px;
}

.price {
  font-size: 32px;
  font-weight: 700;
}

.price-note {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.buy-btn {
  align-self: flex-start;
  display: inline-block;
  background: var(--fg);
  color: #000;
  border: none;
  padding: 14px 32px;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 2px;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.2s ease;
}

.buy-btn:hover {
  background: #fff;
  transform: translateY(-1px);
}

.buy-btn:active { transform: translateY(0); }

.meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.ship {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 14px;
}

.ship summary {
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  list-style: none;
}

.ship summary::-webkit-details-marker { display: none; }
.ship summary::before { content: "+ "; }
.ship[open] summary::before { content: "− "; }

.ship p {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.6;
}

.ship .small { color: var(--muted); font-size: 11px; }

/* ----- dialog ----- */
#order-dialog {
  background: #0a0a0a;
  color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 28px;
  max-width: 420px;
  width: 90%;
}

#order-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
}

.order-form { display: flex; flex-direction: column; gap: 14px; }
.order-form h3 { font-size: 18px; letter-spacing: 2px; text-transform: uppercase; }
.order-form .small { font-size: 11px; color: var(--muted); line-height: 1.5; }
.order-form label { display: flex; flex-direction: column; gap: 6px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.order-form input, .order-form textarea {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--fg);
  font-family: inherit;
  padding: 10px;
  font-size: 14px;
  border-radius: 2px;
}
.order-form input:focus, .order-form textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
}

.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.btn-ghost, .btn-primary {
  border: none;
  padding: 10px 18px;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-radius: 2px;
  font-family: inherit;
}
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid rgba(255, 255, 255, 0.15); }
.btn-primary { background: var(--fg); color: #000; }

/* ----- responsive ----- */
@media (max-width: 720px) {
  .cards { gap: 56px; }
  .card-icon { width: 170px; height: 230px; }
  .book-cover { width: 170px; }
  .card-title { height: 84px; width: 210px; }
  .product-title { height: 96px; width: 240px; }

  .product {
    grid-template-columns: 1fr;
    gap: 36px;
    margin-top: 12px;
  }
  .product-cover { max-width: 360px; margin: 0 auto; }
  .product-title { height: 56px; }
  .price { font-size: 28px; }
  .intro-logo { width: 170px; }

  /* background drawings: smaller + spread apart so they don't overlap on phones */
  .doodle { width: 150px !important; }
  .doodle.d1 { left: -8%;  top: 2%;     right: auto; bottom: auto; }
  .doodle.d2 { right: -10%; top: 26%;   left: auto;  bottom: auto; }
  .doodle.d3 { left: -8%;  top: 52%;    right: auto; bottom: auto; }
  .doodle.d5 { right: -8%; top: 70%;    left: auto;  bottom: auto; }
  .doodle.d4 { left: 28%;  bottom: 2%;  right: auto; top: auto; }
  .doodle.d6 { left: 28%;  bottom: 2%;  right: auto; top: auto; }
}
