/* =============================================================================
   SILK SORCERY & STEEL — Dark Gallery Theme
   S.K. Drake | silksorceryandsteel.com
   Pre-Raphaelite oil painting aesthetic
   ============================================================================= */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@300;400;500;600&family=Lora:ital,wght@0,400;0,600;1,400&display=swap');

/* =============================================================================
   CSS CUSTOM PROPERTIES
   ============================================================================= */
:root {
  /* Backgrounds */
  --color-bg:        #120a0b;
  --color-surface:   #1a1012;
  --color-elevated:  #221518;

  /* Text */
  --color-text:      #b4a078;
  --color-text-dim:  rgba(180, 160, 120, 0.5);
  --color-text-mute: rgba(180, 160, 120, 0.3);
  --color-text-bright: #d4b896;

  /* Accents */
  --color-gold:      #d4b896;
  --color-accent:    #9070d0;

  /* Borders */
  --color-border:    rgba(180, 160, 120, 0.2);
  --color-border-hover: rgba(180, 160, 120, 0.6);

  /* Fonts */
  --font-display:    'Cormorant Garamond', Georgia, serif;
  --font-body:       'Inter', system-ui, sans-serif;
  --font-reader:     'Lora', Georgia, serif;

  /* Spacing */
  --nav-height:      60px;
  --max-width:       1200px;
  --narrow-width:    800px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;
}

/* =============================================================================
   RESET & BASE
   ============================================================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.7;
  padding-top: var(--nav-height);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

a {
  color: var(--color-text-bright);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-gold);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* =============================================================================
   TYPOGRAPHY
   ============================================================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text-bright);
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
}

h3 {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
}

h4 {
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  font-weight: 400;
  font-style: italic;
}

p {
  margin-bottom: 1em;
  color: var(--color-text);
}

p:last-child {
  margin-bottom: 0;
}

.small-caps {
  font-variant: small-caps;
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  font-size: 0.9em;
}

.subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--color-text-dim);
  margin-top: 0.5em;
}

/* =============================================================================
   LAYOUT
   ============================================================================= */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.content-narrow {
  max-width: var(--narrow-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

.section + .section {
  padding-top: 0;
}

/* =============================================================================
   NAVIGATION
   ============================================================================= */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(18, 10, 11, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-gold);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.nav-logo:hover {
  color: var(--color-text-bright);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  transition: color var(--transition-fast);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}

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

.nav-beta {
  font-size: 0.75rem !important;
  color: var(--color-accent) !important;
  border: 1px solid rgba(144, 112, 208, 0.3) !important;
  border-bottom: 1px solid rgba(144, 112, 208, 0.3) !important;
  padding: 3px 10px !important;
  border-radius: 3px;
  transition: all var(--transition-fast) !important;
}

.nav-beta:hover {
  background: rgba(144, 112, 208, 0.1) !important;
  border-color: var(--color-accent) !important;
  color: var(--color-accent) !important;
}

.nav-admin {
  font-size: 0.75rem !important;
  color: var(--color-gold) !important;
  border: 1px solid rgba(201, 168, 124, 0.3) !important;
  border-bottom: 1px solid rgba(201, 168, 124, 0.3) !important;
  padding: 3px 10px !important;
  border-radius: 3px;
  transition: all var(--transition-fast) !important;
}

.nav-admin:hover {
  background: rgba(201, 168, 124, 0.1) !important;
  border-color: var(--color-gold) !important;
  color: var(--color-gold) !important;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  cursor: pointer;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  transition: all var(--transition-base);
}

.nav-hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Nav */
@media (max-width: 768px) {
  .nav-hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(18, 10, 11, 0.97);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    gap: 0;
    padding: 16px 0;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 12px 24px;
    width: 100%;
    border-bottom: none !important;
    font-size: 1rem;
  }

  .nav-beta,
  .nav-admin {
    margin: 8px 24px 0 !important;
    width: calc(100% - 48px) !important;
    text-align: center;
  }
}

/* =============================================================================
   CARDS
   ============================================================================= */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  transition: transform var(--transition-base), border-color var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--color-border-hover);
}

.card-image {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 20px;
}

.card-body h3,
.card-body h4 {
  margin-bottom: 8px;
}

/* =============================================================================
   BUTTONS
   ============================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  color: var(--color-text);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--color-border-hover);
  color: var(--color-gold);
  background: rgba(180, 160, 120, 0.05);
}

.btn-primary {
  border-color: var(--color-gold);
  color: var(--color-bg);
  background: var(--color-gold);
}

.btn-primary:hover {
  background: var(--color-text-bright);
  border-color: var(--color-text-bright);
  color: var(--color-bg);
}

/* =============================================================================
   HERO
   ============================================================================= */
.hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: calc(-1 * var(--nav-height));
  padding-top: var(--nav-height);
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(18, 10, 11, 0.3) 0%,
    rgba(18, 10, 11, 0.5) 40%,
    rgba(18, 10, 11, 0.85) 80%,
    rgba(18, 10, 11, 1) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 40px 24px;
  max-width: 900px;
}

.hero-content h1 {
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8);
}

/* =============================================================================
   CHARACTER GALLERY
   ============================================================================= */
.gallery-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  padding: 40px 24px;
}

.char-portrait {
  flex: 0 0 200px;
  cursor: pointer;
  position: relative;
  transition: transform var(--transition-base);
}

.char-portrait:hover {
  transform: translateY(-6px);
}

.char-portrait img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  transition: border-color var(--transition-base);
  filter: sepia(0.15) brightness(0.9);
}

.char-portrait:hover img {
  border-color: var(--color-border-hover);
  filter: sepia(0) brightness(1);
}

.char-portrait .char-name {
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-bright);
  text-align: center;
}

.char-portrait .char-role {
  font-size: 0.78rem;
  color: var(--color-text-dim);
  text-align: center;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}

.char-expand {
  display: none;
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 32px;
  margin-top: 24px;
  animation: fadeIn var(--transition-base) ease;
}

.char-expand.open {
  display: block;
}

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

/* =============================================================================
   MAINTENANCE PLACEHOLDER
   ============================================================================= */
.maintenance {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height));
  text-align: center;
  padding: 40px 24px;
}

.maintenance h2 {
  font-size: 2rem;
  margin-bottom: 16px;
}

.maintenance p {
  color: var(--color-text-dim);
  max-width: 480px;
}

/* =============================================================================
   FOOTER
   ============================================================================= */
.footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 48px 24px;
  text-align: center;
  margin-top: 80px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-gold);
  margin-bottom: 12px;
}

.footer-tagline {
  font-style: italic;
  font-family: var(--font-display);
  color: var(--color-text-dim);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.footer-links a {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-dim);
}

.footer-links a:hover {
  color: var(--color-gold);
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--color-text-mute);
}

/* =============================================================================
   NEWSLETTER FORM
   ============================================================================= */
.newsletter-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 24px;
}

.newsletter-form input[type="email"] {
  flex: 1 1 280px;
  min-width: 0;
  padding: 10px 16px;
  background: var(--color-elevated);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  color: var(--color-text);
  font-size: 0.9rem;
  transition: border-color var(--transition-fast);
  outline: none;
}

.newsletter-form input[type="email"]::placeholder {
  color: var(--color-text-mute);
}

.newsletter-form input[type="email"]:focus {
  border-color: var(--color-border-hover);
}

.newsletter-form button {
  flex: 0 0 auto;
}

/* =============================================================================
   PARCHMENT CARD (world / lore content)
   ============================================================================= */
.parchment-card {
  background: var(--color-elevated);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 32px 40px;
  position: relative;
}

.parchment-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: linear-gradient(135deg,
    rgba(180, 160, 120, 0.03) 0%,
    transparent 50%,
    rgba(144, 112, 208, 0.02) 100%
  );
  pointer-events: none;
}

.parchment-card h3,
.parchment-card h4 {
  margin-bottom: 16px;
}

.parchment-card p {
  font-family: var(--font-reader);
  line-height: 1.8;
}

/* =============================================================================
   PURPLE ACCENT
   ============================================================================= */
.accent-purple {
  color: var(--color-accent);
}

.border-purple {
  border-color: rgba(144, 112, 208, 0.4);
}

/* =============================================================================
   UTILITIES
   ============================================================================= */
.text-center { text-align: center; }
.text-dim    { color: var(--color-text-dim); }
.text-bright { color: var(--color-text-bright); }
.text-mute   { color: var(--color-text-mute); }

.mt-1 { margin-top:  8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 40px; }

.mb-2 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 40px; }

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

/* =============================================================================
   READER TYPOGRAPHY (beta reader pages)
   ============================================================================= */
.reader-body {
  font-family: var(--font-reader);
  font-size: 1.05rem;
  line-height: 1.9;
  max-width: 680px;
  margin: 0 auto;
}

.reader-body h2 {
  font-size: 1.8rem;
  margin-top: 48px;
  margin-bottom: 24px;
}

.reader-body p + p {
  text-indent: 1.5em;
  margin-bottom: 0;
}

/* =============================================================================
   FORMS (auth pages)
   ============================================================================= */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  background: var(--color-elevated);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  color: var(--color-text);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast);
  outline: none;
}

.form-group input:focus {
  border-color: var(--color-border-hover);
}

.form-group input::placeholder {
  color: var(--color-text-mute);
}

.form-error {
  font-size: 0.82rem;
  color: #e07070;
  margin-top: 6px;
}

.form-success {
  font-size: 0.82rem;
  color: #70c070;
  margin-top: 6px;
}

/* =============================================================================
   DIVIDER
   ============================================================================= */
.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 48px 0;
}

.divider-ornament {
  text-align: center;
  position: relative;
  margin: 48px 0;
}

.divider-ornament::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--color-border);
}

.divider-ornament span {
  position: relative;
  background: var(--color-bg);
  padding: 0 16px;
  font-family: var(--font-display);
  color: var(--color-text-mute);
  font-size: 1.2rem;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */
@media (max-width: 768px) {
  .section {
    padding: 48px 0;
  }

  .gallery-row {
    gap: 16px;
  }

  .char-portrait {
    flex: 0 0 140px;
  }

  .parchment-card {
    padding: 24px 20px;
  }

  .footer-links {
    gap: 16px;
  }

  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.8rem; }
  h3 { font-size: 1.4rem; }
}

@media (max-width: 480px) {
  .container,
  .content-narrow {
    padding: 0 16px;
  }

  .newsletter-form {
    flex-direction: column;
    align-items: stretch;
  }

  .newsletter-form input[type="email"] {
    flex: none;
  }
}
