/* 1. Variables */
:root {
  /* Colors */
  --ink-black: #121312;
  --press-charcoal: #1D1E1B;
  --binding-green: #293029;
  --leather-olive: #3B4034;
  --printer-vermilion: #C75A3C;
  --botanical-teal: #3E8178;
  --brass-ochre: #C69A4B;
  --celestial-blue: #587D9A;
  --handmade-paper: #DED2B5;
  --warm-vellum: #C8B994;
  --paper-ivory: #F3EDDF;
  --binding-linen: #C8C0AE;
  --typesetter-grey: #8E9188;
  --border-color: #474A40;
  
  /* Gradients */
  --grad-primary: linear-gradient(135deg, #C75A3C, #C69A4B);
  --grad-secondary: linear-gradient(135deg, #3E8178, #587D9A);
  
  /* Fonts */
  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Space Mono', monospace;
  
  /* Layout */
  --max-width: 1440px;
  --transition: 0.3s ease;
}

/* 2. Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  background-color: var(--ink-black);
  color: var(--paper-ivory);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}
img {
  display: block;
  max-width: 100%;
}
button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* 3. Typography */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.1;
  color: var(--paper-ivory);
}
.text-mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--typesetter-grey);
}
.text-light {
  color: var(--ink-black);
}
.text-light h1, .text-light h2, .text-light h3 {
  color: var(--ink-black);
}

/* Link utilities */
.text-link {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--brass-ochre);
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
}
.text-link:hover {
  color: var(--printer-vermilion);
  border-bottom-color: var(--printer-vermilion);
}

/* 4. Global Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 4%;
}
section {
  padding: 6rem 0;
  position: relative;
}
.border-top { border-top: 1px solid var(--border-color); }
.border-bottom { border-bottom: 1px solid var(--border-color); }

/* 5. Press Status Ribbon */
.status-ribbon {
  background-color: var(--printer-vermilion);
  color: var(--ink-black);
  padding: 0.5rem 4%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: bold;
}
.status-ribbon span { display: block; }
@media(max-width: 768px) {
  .status-ribbon .center-text { display: none; }
}

/* 6. Bindery Header & Logo */
.site-header {
  border-bottom: 1px solid var(--border-color);
  background-color: var(--ink-black);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-grid {
  display: grid;
  grid-template-columns: 26% 54% 20%;
  align-items: stretch;
  min-height: 80px;
}
.header-zone {
  display: flex;
  align-items: center;
  padding: 1rem 4%;
}
.header-left {
  border-right: 1px solid var(--border-color);
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

/* Logo Styles */
.brand-logo-link {
  display: inline-block;
  max-width: 260px;
  width: 100%;
  transition: transform var(--transition), opacity var(--transition);
}
.brand-logo-link:hover {
  transform: scale(1.02);
  opacity: 0.95;
}
.brand-logo {
  width: 100%;
  height: auto;
  display: block;
}

.header-center {
  border-right: 1px solid var(--border-color);
  justify-content: space-evenly;
}
.nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--binding-linen);
  position: relative;
}
.nav-link .nav-num {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--typesetter-grey);
  margin-bottom: 0.2rem;
}
.nav-link:hover, .nav-link.active {
  color: var(--printer-vermilion);
}
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 1px;
  background-color: var(--printer-vermilion);
}
.header-right {
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 0.5rem;
}
.header-right .text-mono {
  display: flex;
  gap: 1rem;
}
.btn-solid {
  display: inline-block;
  background-color: var(--ink-black);
  color: var(--paper-ivory);
  border: 1px solid var(--border-color);
  border-bottom: 2px solid var(--brass-ochre);
  padding: 0.6rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  width: 100%;
  text-align: center;
  border-radius: 0;
  transition: var(--transition);
}
.btn-solid:hover {
  background-color: var(--press-charcoal);
  border-bottom-color: var(--printer-vermilion);
}

.mobile-menu-trigger { display: none; }

/* 7. Opening Folio */
.folio-hero {
  padding-top: 4rem;
  padding-bottom: 4rem;
}
.folio-grid {
  display: grid;
  grid-template-columns: 2fr 8fr 2fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.folio-left, .folio-right {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.folio-title-area {
  display: flex;
  flex-direction: column;
}
.folio-title-area h1 {
  font-size: clamp(3rem, 6vw, 6rem);
  margin: 1rem 0;
}
.hero-image-band {
  width: 88%;
  margin-left: auto;
  aspect-ratio: 17/7;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.hero-image-band img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.caption-line {
  width: 88%;
  margin-left: auto;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}
.hero-intro-row {
  display: flex;
  width: 88%;
  margin-left: auto;
  margin-top: 2rem;
  gap: 4rem;
}
.hero-intro-desc {
  width: 58%;
  font-size: 1.1rem;
  color: var(--binding-linen);
}
.hero-intro-cta {
  width: 42%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

/* 8. Edition Catalogue */
.catalogue-section {
  background-color: var(--press-charcoal);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}
.catalogue-layout {
  display: flex;
  gap: 4rem;
}
.cat-left {
  width: 32%;
}
.cat-left .huge-num {
  font-family: var(--font-display);
  font-size: 6rem;
  color: var(--border-color);
  line-height: 1;
}
.cat-left h2 {
  font-size: 2.5rem;
  margin: 1rem 0;
}
.cat-right {
  width: 68%;
  display: flex;
  flex-direction: column;
}
.cat-row {
  display: flex;
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-color);
  gap: 2rem;
}
.cat-row:last-child {
  border-bottom: none;
}
.cat-row .num {
  font-family: var(--font-mono);
  color: var(--brass-ochre);
  width: 10%;
}
.cat-row-content {
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.cat-row h3 {
  font-size: 1.5rem;
}
.cat-row p {
  color: var(--binding-linen);
}

/* 9. Reading Mechanism */
.game-section {
  background-color: var(--ink-black);
}
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 3rem;
}
.game-header-left { width: 40%; }
.game-header-right { width: 50%; color: var(--binding-linen); }
.game-header h2 { font-size: 3rem; margin-top: 0.5rem; }

.mechanical-press-wrapper {
  background-color: var(--press-charcoal);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  position: relative;
  padding: 1px;
}
.registration-bar {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border-color);
}
.registration-bar .mark {
  width: 6px;
  height: 6px;
  background-color: var(--printer-vermilion);
}
.game-core {
  display: flex;
}
.binding-rail {
  width: 88px;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 0;
  gap: 4rem;
  position: relative;
}
.stitch {
  width: 20px;
  height: 2px;
  background-color: var(--brass-ochre);
}
.binding-rail .vertical-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-mono);
  color: var(--botanical-teal);
  letter-spacing: 0.2em;
}
.iframe-container {
  flex: 1;
  position: relative;
  aspect-ratio: 16/9;
  background-color: var(--ink-black);
}
.iframe-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.reading-controls {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--ink-black);
}
.control-btn {
  font-family: var(--font-mono);
  color: var(--binding-linen);
  font-size: 0.8rem;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.control-btn:hover { color: var(--paper-ivory); }

/* 10. Living Editions */
.editions-wrapper {
  display: flex;
  flex-direction: column;
}
.edition-01 {
  padding: 6rem 0;
  border-bottom: 1px solid var(--border-color);
}
.ed01-layout {
  display: flex;
  flex-direction: column;
  position: relative;
}
.ed01-image {
  width: 68%;
  aspect-ratio: 16/9;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.ed01-image img { width: 100%; height: 100%; object-fit: cover; }
.ed01-content {
  width: 50%;
  align-self: flex-end;
  background-color: var(--leather-olive);
  padding: 3rem;
  margin-top: -10%;
  z-index: 2;
  border: 1px solid var(--border-color);
}
.ed01-content h2 { font-size: 2.5rem; margin: 1rem 0; }

.edition-02 {
  background-color: var(--handmade-paper);
  color: var(--ink-black);
  padding: 0;
}
.ed02-layout {
  display: flex;
}
.ed02-content {
  width: 48%;
  padding: 6rem 4% 6rem 8%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.ed02-content .huge-num {
  font-family: var(--font-display);
  font-size: 5rem;
  color: var(--printer-vermilion);
  line-height: 1;
}
.ed02-content h2 { font-size: 3rem; margin: 1.5rem 0; color: var(--ink-black); }
.ed02-image {
  width: 52%;
  position: relative;
  overflow: hidden;
}
.ed02-image img { width: 100%; height: 100%; object-fit: cover; }

.edition-03 {
  background-color: var(--ink-black);
  padding: 0;
  border-bottom: 1px solid var(--border-color);
}
.ed03-strip {
  width: 100%;
  height: 200px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
}
.ed03-strip img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; filter: brightness(0.6); }
.ed03-layout {
  display: grid;
  grid-template-columns: 1fr 2fr 2fr;
  padding: 6rem 4%;
  gap: 2rem;
}
.ed03-layout .huge-num {
  font-family: var(--font-display);
  font-size: 4rem;
  color: var(--typesetter-grey);
}
.ed03-layout h2 { font-size: 2.5rem; }

/* 11. Printer's Notes */
.notes-section {
  background-color: var(--press-charcoal);
}
.notes-layout {
  display: flex;
  gap: 4rem;
}
.notes-left { width: 38%; }
.notes-left h2 { font-size: 3rem; margin-bottom: 1rem; }
.notes-right { width: 62%; display: flex; flex-direction: column; gap: 2rem; }
.note-entry {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
}
.note-entry h3 { font-size: 1.8rem; margin: 0.5rem 0 1rem 0; }

/* 12. Platform Colophon */
.colophon-section {
  background-color: var(--handmade-paper);
  color: var(--ink-black);
}
.colophon-layout {
  display: flex;
  gap: 4rem;
}
.colophon-left { width: 30%; }
.colophon-left h2 { font-size: 2.5rem; color: var(--ink-black); margin-bottom: 1rem; }
.colophon-right {
  width: 70%;
  display: flex;
  flex-direction: column;
}
.spec-row {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
}
.spec-label { width: 30%; font-family: var(--font-mono); font-size: 0.8rem; color: var(--typesetter-grey); }
.spec-value { width: 70%; font-weight: 500; }

/* 13. Correspondence Desk */
.contact-section {
  background-color: var(--binding-green);
  border-top: 1px solid var(--border-color);
}
.contact-layout {
  display: flex;
  gap: 4rem;
}
.contact-left { width: 34%; }
.contact-left h2 { font-size: 2.5rem; margin: 1rem 0 2rem 0; }
.faq-refs { margin-top: 3rem; display: flex; flex-direction: column; gap: 0.8rem; }
.contact-right { width: 66%; }

/* 14. Cookie Notice */
.cookie-notice {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 320px;
  background-color: var(--handmade-paper);
  color: var(--ink-black);
  border-top: 2px solid var(--printer-vermilion);
  border-radius: 4px;
  padding: 1.5rem;
  z-index: 9999;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: none;
}
.cookie-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.cookie-reg { width: 8px; height: 8px; background-color: var(--botanical-teal); }
.cookie-notice h3 { font-size: 1.2rem; color: var(--ink-black); margin-bottom: 0.5rem; }
.cookie-notice p { font-size: 0.9rem; margin-bottom: 1.5rem; color: #333; }
.cookie-btns { display: flex; gap: 1rem; }
.cookie-btns button {
  flex: 1;
  padding: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  border: 1px solid var(--ink-black);
}
.btn-accept { background-color: var(--ink-black); color: var(--paper-ivory); }
.btn-reject { background-color: transparent; color: var(--ink-black); }

/* 15. Bound Volume Footer */
.site-footer {
  background-color: var(--press-charcoal);
  border-top: 1px solid var(--border-color);
}
.footer-top {
  display: flex;
  padding: 4rem 4%;
  gap: 4rem;
}
.footer-colophon { width: 46%; }
.footer-brand { margin-bottom: 1.5rem; max-width: 240px; }
.footer-desc { color: var(--binding-linen); margin-bottom: 1.5rem; font-size: 0.9rem; max-width: 80%; }
.footer-directory { width: 54%; display: flex; justify-content: space-between; }
.dir-col { display: flex; flex-direction: column; gap: 0.8rem; }
.dir-col h4 { font-family: var(--font-mono); font-size: 0.8rem; color: var(--brass-ochre); margin-bottom: 0.5rem; }
.dir-col a { font-size: 0.9rem; color: var(--binding-linen); }
.dir-col a:hover { color: var(--paper-ivory); }

.footer-middle {
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  display: flex;
}
.page-edge-tab {
  flex: 1;
  text-align: center;
  padding: 1rem 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--typesetter-grey);
  border-right: 1px solid var(--border-color);
}
.page-edge-tab:last-child { border-right: none; }
.page-edge-tab:hover { background-color: var(--ink-black); color: var(--printer-vermilion); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding: 1.5rem 4%;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--typesetter-grey);
}

/* 16. Internal Pages */
.internal-main {
  background-color: var(--ink-black);
  padding: 4rem 4%;
  min-height: 70vh;
}
.masthead {
  max-width: 800px;
  margin: 0 auto 3rem auto;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 2rem;
}
.masthead h1 {
  font-size: 3rem;
  margin: 1rem 0;
}
.internal-content {
  max-width: 800px;
  margin: 0 auto;
  background-color: var(--handmade-paper);
  color: var(--ink-black);
  padding: 4rem;
  border: 1px solid var(--border-color);
  position: relative;
}
.internal-content::before {
  content: '';
  position: absolute;
  top: 10px; left: 10px; right: 10px; bottom: 10px;
  border: 1px solid rgba(0,0,0,0.1);
  pointer-events: none;
}
.internal-content h2, .internal-content h3 {
  color: var(--ink-black);
  margin: 2rem 0 1rem 0;
}
.internal-content p {
  margin-bottom: 1.5rem;
  color: #222;
}
.internal-content ul {
  margin: 0 0 1.5rem 2rem;
  color: #222;
}
.internal-content li {
  margin-bottom: 0.5rem;
}
.return-home-container {
  max-width: 800px;
  margin: 3rem auto 0 auto;
  text-align: center;
}
.btn-return {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--brass-ochre);
  border: 1px solid var(--border-color);
  padding: 1rem 2rem;
  text-transform: uppercase;
}
.btn-return:hover {
  background-color: var(--press-charcoal);
  color: var(--paper-ivory);
}

/* 17. Forms */
.contact-form { display: flex; flex-direction: column; gap: 1.5rem; }
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-group label { font-family: var(--font-mono); font-size: 0.8rem; color: var(--binding-linen); }
.contact-form input, .contact-form textarea {
  background-color: var(--ink-black);
  border: 1px solid var(--border-color);
  color: var(--paper-ivory);
  padding: 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none;
  border-color: var(--printer-vermilion);
}
.contact-form textarea { resize: vertical; min-height: 120px; }

/* 18. Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.8s ease forwards; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* 19. Responsive Rules */
@media (max-width: 1024px) {
  .header-grid { grid-template-columns: 30% 70%; }
  .header-right { display: none; } 
  .folio-grid { grid-template-columns: 1fr; }
  .folio-left { flex-direction: row; justify-content: space-between; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem; }
  .folio-right { display: flex; flex-direction: row; border-top: 1px solid var(--border-color); padding-top: 1rem; }
  .hero-image-band { width: 100%; margin-left: 0; }
  .hero-intro-row { width: 100%; margin-left: 0; flex-direction: column; gap: 2rem; }
  .hero-intro-desc, .hero-intro-cta { width: 100%; }
  
  .catalogue-layout { flex-direction: column; gap: 2rem; }
  .cat-left, .cat-right { width: 100%; }
  
  .ed01-content { width: 80%; margin-top: -20px; }
  .ed02-layout { flex-direction: column; }
  .ed02-content, .ed02-image { width: 100%; }
  .ed02-image { aspect-ratio: 16/9; }
  .ed03-layout { grid-template-columns: 1fr; }
  
  .notes-layout, .colophon-layout, .contact-layout { flex-direction: column; }
  .notes-left, .notes-right, .colophon-left, .colophon-right, .contact-left, .contact-right { width: 100%; }
  
  .footer-top { flex-direction: column; }
  .footer-colophon, .footer-directory { width: 100%; }
  .footer-directory { flex-wrap: wrap; gap: 2rem; }
}

@media (max-width: 768px) {
  .header-grid { display: flex; justify-content: space-between; align-items: center; padding: 0 4%; }
  .header-center { display: none; }
  .brand-logo-link { max-width: 200px; }
  .mobile-menu-trigger { display: block; font-family: var(--font-mono); color: var(--paper-ivory); }
  
  .game-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .game-header-left, .game-header-right { width: 100%; }
  
  .game-core { flex-direction: column; }
  .binding-rail { width: 100%; border-right: none; border-bottom: 1px solid var(--border-color); flex-direction: row; justify-content: space-between; padding: 1rem; gap: 1rem; }
  .binding-rail .vertical-text { writing-mode: horizontal-tb; transform: none; }
  
  .spec-row { flex-direction: column; gap: 0.5rem; }
  .spec-label, .spec-value { width: 100%; }
  
  .footer-middle { flex-wrap: wrap; }
  .page-edge-tab { flex: 50%; border-bottom: 1px solid var(--border-color); }
  .footer-bottom { flex-direction: column; gap: 1rem; align-items: center; text-align: center; }
  
  .internal-content { padding: 2rem; }
}

/* 20. Utilities */
.hidden { display: none !important; }