/* ════════════════════════════════════════════════════════════════
   Driftless Literary - Main Stylesheet
   ════════════════════════════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black:     #0a0a08;
  --off-black: #111109;
  --gold:      #c9a84c;
  --gold-dim:  #8a6e2f;
  --cream:     #f2ede4;
  --cream-mid: #e8e1d6;
  --warm-grey: #b8b0a4;
  --text:      #1c1b17;
  --nav-h:     64px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Cormorant Garamond', Georgia, serif;
  background: var(--cream);
  color: var(--text);
  cursor: default;
  line-height: 1.6;
}

/* ── Navigation ───────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  z-index: 100;
  border-bottom: 1px solid rgba(201,168,76,0.15);
}

.nav-logo {
  font-family: 'Cormorant Infant', Georgia, serif;
  font-style: italic;
  font-weight: 300;
  font-size: 1.5rem;
  color: var(--gold);
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
}

.nav-links {
  display: flex;
  gap: 40px;
  list-style: none;
}

.nav-links a {
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream-mid);
  text-decoration: none;
  transition: color 0.3s, border-color 0.3s;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gold);
  border-bottom-color: var(--gold-dim);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--gold);
  transition: all 0.3s;
}

/* ── Pages ────────────────────────────────────────── */
.page {
  display: none;
  min-height: 100vh;
  padding-top: var(--nav-h);
}
.page.active { display: block; }

/* ══════════════════════════════════════════════════
   PAGE 1 — HOME
══════════════════════════════════════════════════ */

/* Hero */
.hero {
  position: relative;
  height: calc(100vh - var(--nav-h));
  overflow: hidden;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: contrast(1.05) brightness(0.88);
}

/* Gradient overlay */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10,10,8,0.15) 0%,
    rgba(10,10,8,0.05) 40%,
    rgba(10,10,8,0.55) 75%,
    rgba(10,10,8,0.85) 100%
  );
}

.hero-text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 80px 64px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero-eyebrow {
  font-family: 'Jost', sans-serif;
  font-weight: 200;
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0;
  animation: fadeUp 1s ease 0.3s forwards;
}

.hero-headline {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(2.8rem, 5vw, 4.4rem);
  line-height: 1.12;
  color: var(--cream);
  max-width: 720px;
  opacity: 0;
  animation: fadeUp 1s ease 0.55s forwards;
}

.hero-rule {
  width: 48px;
  height: 1px;
  background: var(--gold);
  opacity: 0;
  animation: fadeUp 1s ease 0.75s forwards;
}

.hero-sub {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(242,237,228,0.82);
  max-width: 520px;
  opacity: 0;
  animation: fadeUp 1s ease 0.9s forwards;
}

.hero-cta {
  display: inline-block;
  margin-top: 8px;
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid var(--gold-dim);
  padding-bottom: 3px;
  transition: color 0.3s, border-color 0.3s;
  width: fit-content;
  opacity: 0;
  animation: fadeUp 1s ease 1.1s forwards;
  cursor: pointer;
}

.hero-cta:hover {
  color: var(--cream);
  border-color: var(--cream);
}

/* Definitions section */
.definitions {
  background: var(--black);
  padding: 80px 80px 88px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px 80px;
  border-bottom: 1px solid rgba(201,168,76,0.12);
}

.def-word {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--gold);
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.def-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: 1.05rem;
  line-height: 1.75;
  color: rgba(242,237,228,0.72);
}

/* Mission strip */
.mission {
  background: var(--cream);
  padding: 96px 80px;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 64px;
  align-items: start;
}

.mission-label {
  font-family: 'Jost', sans-serif;
  font-weight: 200;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold-dim);
  padding-top: 8px;
}

.mission-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  line-height: 1.55;
  color: var(--text);
}

.mission-text strong {
  font-weight: 600;
  font-style: normal;
  color: var(--black);
}

/* ══════════════════════════════════════════════════
   PAGE 2 — WHO WE ARE
══════════════════════════════════════════════════ */

.page-header {
  background: var(--black);
  padding: 80px 80px 72px;
  border-bottom: 1px solid rgba(201,168,76,0.12);
}

.page-eyebrow {
  font-family: 'Jost', sans-serif;
  font-weight: 200;
  font-size: 0.65rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
}

.page-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  color: var(--cream);
  line-height: 1.15;
  max-width: 600px;
}

.page-title-rule {
  width: 40px;
  height: 1px;
  background: var(--gold-dim);
  margin-top: 28px;
}

/* Agent bios */
.agents {
  background: var(--cream);
  padding: 96px 80px;
  display: flex;
  flex-direction: column;
  gap: 96px;
}

.agent {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 64px;
  align-items: start;
}

.agent:nth-child(even) {
  grid-template-columns: 1fr 320px;
}

.agent:nth-child(even) .agent-image-wrap {
  order: 2;
}

.agent:nth-child(even) .agent-content {
  order: 1;
}

.agent-image-wrap {
  position: relative;
}

.agent-image {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
  filter: grayscale(100%) contrast(1.05);
}

.agent-image-accent {
  position: absolute;
  bottom: -12px;
  right: -12px;
  width: 80px;
  height: 80px;
  border: 1px solid var(--gold-dim);
  pointer-events: none;
}

.agent-content {
  padding-top: 8px;
}

.agent-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-size: 1.8rem;
  color: var(--black);
  margin-bottom: 4px;
}

.agent-title {
  font-family: 'Jost', sans-serif;
  font-weight: 200;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 28px;
}

.agent-rule {
  width: 32px;
  height: 1px;
  background: var(--gold-dim);
  margin-bottom: 28px;
}

.agent-bio {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: 1.05rem;
  line-height: 1.85;
  color: #3a3830;
  margin-bottom: 20px;
}

.agent-interests {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--warm-grey);
}

/* ══════════════════════════════════════════════════
   PAGE 3 — HOW WE WORK
══════════════════════════════════════════════════ */

/* Values section */
.values-section {
  background: var(--cream);
  padding: 96px 80px;
}

.values-intro {
  max-width: 720px;
  margin-bottom: 80px;
}

.values-intro p {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: 1.2rem;
  line-height: 1.8;
  color: #3a3830;
}

.values-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: var(--cream-mid);
  border: 1px solid var(--cream-mid);
}

.value-card {
  background: var(--cream);
  padding: 48px 44px;
  transition: background 0.3s;
}

.value-card:hover {
  background: var(--off-black);
}

.value-card:hover .value-number,
.value-card:hover .value-title,
.value-card:hover .value-text {
  color: var(--cream);
}

.value-card:hover .value-title {
  color: var(--gold);
}

.value-number {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-style: italic;
  font-size: 3rem;
  color: var(--cream-mid);
  line-height: 1;
  margin-bottom: 16px;
  transition: color 0.3s;
}

.value-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--black);
  margin-bottom: 12px;
  transition: color 0.3s;
}

.value-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.8;
  color: #5a5650;
  transition: color 0.3s;
}

/* ── Submission Form ───────────────────────────────────────── */

/* Submit CTA Section */
.submit-cta-section {
  background: var(--black);
  padding: 96px 80px;
}

.cta-container {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.cta-container h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(2rem, 3vw, 2.6rem);
  color: var(--cream);
  margin-bottom: 16px;
}

.cta-container p {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: 1.1rem;
  color: rgba(242,237,228,0.7);
  line-height: 1.7;
  margin-bottom: 32px;
}

.submission-form-section {
  background: var(--black);
  padding: 96px 80px;
}

.form-container {
  max-width: 800px;
  margin: 0 auto;
}

.form-header {
  text-align: center;
  margin-bottom: 48px;
}

.form-header h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(2rem, 3vw, 2.6rem);
  color: var(--cream);
  margin-bottom: 16px;
}

.form-header p {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: 1.05rem;
  color: rgba(242,237,228,0.7);
  line-height: 1.7;
}

.submission-form {
  background: var(--off-black);
  border: 1px solid rgba(201,168,76,0.15);
  padding: 48px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.full-width {
  margin-bottom: 24px;
}

.form-group label {
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1rem;
  padding: 14px 16px;
  background: var(--black);
  border: 1px solid rgba(201,168,76,0.2);
  color: var(--cream);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(242,237,228,0.4);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201,168,76,0.15);
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23c9a84c' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.form-group select option {
  background: var(--black);
  color: var(--cream);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

/* File Upload Styles */
.file-upload-wrapper {
  position: relative;
}

.file-input {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.file-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background: var(--black);
  border: 2px dashed rgba(201,168,76,0.3);
  transition: all 0.3s;
  text-align: center;
}

.file-upload-label:hover,
.file-upload-wrapper:hover .file-upload-label {
  border-color: var(--gold);
  background: rgba(201,168,76,0.05);
}

.file-upload-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.file-upload-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.1rem;
  color: var(--cream);
  margin-bottom: 8px;
}

.file-upload-hint {
  font-family: 'Jost', sans-serif;
  font-size: 0.7rem;
  color: rgba(242,237,228,0.5);
  letter-spacing: 0.1em;
}

.file-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(201,168,76,0.1);
  border: 1px solid var(--gold-dim);
  margin-top: 12px;
}

.file-selected span {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1rem;
  color: var(--cream);
}

.file-remove {
  background: none;
  border: none;
  color: var(--warm-grey);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 8px;
  transition: color 0.3s;
}

.file-remove:hover {
  color: #e57373;
}

.form-divider {
  height: 1px;
  background: rgba(201,168,76,0.15);
  margin: 32px 0;
}

.form-actions {
  text-align: center;
  margin-top: 32px;
}

.btn-primary {
  display: inline-block;
  padding: 16px 40px;
  background: transparent;
  color: var(--gold);
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--gold-dim);
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}

.btn-primary:hover {
  background: var(--gold);
  color: var(--black);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-message {
  margin-top: 24px;
  padding: 16px;
  text-align: center;
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  border-radius: 2px;
}

.form-message.success {
  background: rgba(76, 175, 80, 0.15);
  border: 1px solid rgba(76, 175, 80, 0.3);
  color: #81c784;
}

.form-message.error {
  background: rgba(244, 67, 54, 0.15);
  border: 1px solid rgba(244, 67, 54, 0.3);
  color: #e57373;
}

/* ══════════════════════════════════════════════════
   PAGE 4 — CATALOGUE
══════════════════════════════════════════════════ */

.catalogue-section {
  background: var(--cream);
  padding: 72px 80px 96px;
}

.catalogue-headline {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  color: var(--black);
  text-align: center;
  margin-bottom: 56px;
}

.catalogue-intro {
  max-width: 560px;
  margin-bottom: 56px;
}

.catalogue-intro p {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #5a5650;
}

/* ── Flipbook Viewer ─────────────────────────────────────────── */

.flipbook-container {
  background: var(--off-black);
  border: 1px solid rgba(201,168,76,0.15);
  padding: 32px;
  position: relative;
}

.flipbook-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
}

.flipbook-btn {
  width: 48px;
  height: 48px;
  background: transparent;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.flipbook-btn:hover {
  background: var(--gold);
  color: var(--black);
}

.flipbook-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.flipbook-nav {
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--cream);
  min-width: 80px;
  text-align: center;
}

.flipbook-viewport {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 500px;
  background: var(--black);
  border: 1px solid rgba(201,168,76,0.1);
}

#pdf-canvas {
  max-width: 100%;
  height: auto;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

.flipbook-loading,
.flipbook-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--off-black);
}

.flipbook-loading {
  color: var(--gold-dim);
  font-family: 'Jost', sans-serif;
  font-weight: 200;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(201,168,76,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.flipbook-error {
  color: var(--warm-grey);
  font-family: 'Cormorant Garamond', Georgia, serif;
}

.flipbook-error p {
  margin-bottom: 8px;
}

.catalogue-download {
  margin-top: 32px;
  text-align: center;
}

.catalogue-download p {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  color: var(--warm-grey);
  margin-bottom: 16px;
}

/* ── Footer ───────────────────────────────────────── */
footer {
  background: var(--black);
  padding: 56px 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(201,168,76,0.1);
}

.footer-logo {
  font-family: 'Cormorant Infant', Georgia, serif;
  font-style: italic;
  font-weight: 300;
  font-size: 1.3rem;
  color: var(--gold);
}

.footer-text {
  font-family: 'Jost', sans-serif;
  font-weight: 200;
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(184,176,164,0.5);
}

/* ── Animations ───────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ───────────────────────────────────── */

@media (max-width: 960px) {
  nav {
    padding: 0 24px;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--black);
    flex-direction: column;
    padding: 24px;
    gap: 16px;
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .nav-toggle {
    display: flex;
  }

  .hero-text {
    padding: 0 32px 48px;
  }

  .definitions {
    grid-template-columns: 1fr;
    padding: 48px 32px;
    gap: 40px;
  }

  .mission {
    grid-template-columns: 1fr;
    padding: 64px 32px;
    gap: 24px;
  }

  .page-header {
    padding: 64px 32px 56px;
  }

  .agents {
    padding: 64px 32px;
    gap: 64px;
  }

  .agent {
    grid-template-columns: 1fr !important;
    gap: 32px;
  }

  .agent:nth-child(even) .agent-image-wrap,
  .agent:nth-child(even) .agent-content {
    order: unset;
  }

  .agent-image-wrap {
    max-width: 280px;
    margin: 0 auto;
  }

  .values-section {
    padding: 64px 32px;
  }

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

  .submission-form-section {
    padding: 64px 32px;
  }

  .submit-cta-section {
    padding: 64px 32px;
  }

  .submission-form {
    padding: 32px 24px;
  }

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

  .file-upload-label {
    padding: 24px 16px;
  }

  .catalogue-section {
    padding: 48px 24px 64px;
  }

  .flipbook-container {
    padding: 16px;
  }

  footer {
    flex-direction: column;
    gap: 16px;
    text-align: center;
    padding: 32px 24px;
  }
}

@media (max-width: 480px) {
  .hero-headline {
    font-size: 2rem;
  }

  .page-title {
    font-size: 1.8rem;
  }

  .value-card {
    padding: 32px 24px;
  }
}
