/* Kaladan Vorx — modern single-page author site */

:root {
  --ink: #0e0c0f;
  --bg-deep: #0c0a08;
  --bg-elevated: #151210;
  --surface: rgba(28, 24, 20, 0.78);
  --surface-solid: #1c1814;
  --paper: #f4efe6;
  --paper-dim: #c9bfb0;
  --border: rgba(244, 239, 230, 0.08);
  --border-strong: rgba(201, 162, 39, 0.22);
  --text: #f4efe6;
  --text-muted: #a89b8c;
  --text-soft: #d4cfc4;
  --gold: #c9a227;
  --gold-bright: #ddb84a;
  --gold-soft: rgba(201, 162, 39, 0.32);
  --accent: var(--gold);
  --accent-dim: var(--gold-soft);
  --accent-text: #1a1508;
  --ember: #8b3a2e;
  --ember-soft: #c49a8e;
  --radius-lg: 20px;
  --radius-md: 12px;
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-author: "Cormorant Garamond", "Palatino Linotype", Palatino, Georgia, serif;
  --shadow-soft: 0 28px 90px rgba(14, 12, 15, 0.65);
  --shadow-book: 0 32px 64px rgba(14, 12, 15, 0.55), 0 0 0 1px rgba(244, 239, 230, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg-deep);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 110% 85% at 50% -25%, rgba(201, 162, 39, 0.14), transparent 52%),
    radial-gradient(ellipse 55% 45% at 100% 15%, rgba(139, 58, 46, 0.1), transparent 48%),
    radial-gradient(ellipse 50% 42% at 0% 100%, rgba(201, 162, 39, 0.06), transparent 50%),
    linear-gradient(175deg, #181410 0%, var(--bg-deep) 42%, #0a0807 100%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(244, 239, 230, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 239, 230, 0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black 20%, transparent 70%);
  pointer-events: none;
}

.site-header {
  padding: clamp(2.5rem, 7vw, 4.5rem) 1.5rem clamp(1.5rem, 4vw, 2rem);
  text-align: center;
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  padding-left: 0.22em;
}

.author-name {
  margin: 0;
  font-family: var(--font-author);
  font-weight: 700;
  font-size: clamp(2.75rem, 7.5vw, 4.5rem);
  letter-spacing: 0.02em;
  line-height: 1.08;
  background: linear-gradient(165deg, var(--paper) 0%, var(--paper-dim) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 42px var(--gold-soft));
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem clamp(3rem, 8vw, 5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 3vw, 1.75rem);
}

.surface {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.book-showcase {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 4vw, 3rem);
  align-items: center;
  padding: clamp(1.75rem, 4vw, 2.75rem);
}

@media (min-width: 880px) {
  .book-showcase {
    grid-template-columns: minmax(220px, 300px) 1fr;
    gap: clamp(2rem, 4vw, 3.5rem);
    padding: clamp(2rem, 4vw, 3rem);
  }
}

.book-visual {
  position: relative;
  display: flex;
  justify-content: center;
  z-index: 0;
}

.book-accent {
  position: absolute;
  width: min(100%, 280px);
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-md);
  background: radial-gradient(ellipse at center, var(--accent-dim), transparent 65%);
  filter: blur(32px);
  transform: scale(1.15);
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  z-index: 0;
}

.book-3d-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 320px;
  margin-inline: auto;
  padding: clamp(0.35rem, 2vw, 0.85rem);
  perspective: 1100px;
  perspective-origin: 50% 42%;
  display: flex;
  justify-content: center;
}

.book-3d-float {
  width: 100%;
  max-width: 300px;
  animation: book-float-y 5.5s ease-in-out infinite;
}

@keyframes book-float-y {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .book-3d-float {
    animation: none;
  }
}

.cover-frame {
  position: relative;
  margin: 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-book);
  overflow: visible;
  max-width: 300px;
  width: 100%;
  aspect-ratio: 2 / 3;
  border: 1px solid var(--border-strong);
}

.cover-frame.book-3d__book {
  --rx: 2deg;
  --ry: -4deg;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform 0.14s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .cover-frame.book-3d__book {
    transform: rotateX(1deg) rotateY(-3deg);
  }
}

.cover-link {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
  transform: translateZ(0);
}

.cover-frame.book-3d__book > .cover-placeholder {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.cover-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  height: 100%;
  padding: 1.5rem;
  text-align: center;
  background: linear-gradient(155deg, #2a2420 0%, var(--ink) 100%);
  color: var(--text-muted);
}

/* `display: flex` above must not beat the native [hidden] behavior — keep cover visible when image loads */
.cover-placeholder[hidden] {
  display: none !important;
}

.cover-placeholder-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.cover-placeholder-note {
  font-size: 0.8125rem;
  line-height: 1.45;
  max-width: 18ch;
}

.book-copy {
  padding: 0;
  min-width: 0;
}

.label {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ember-soft);
}

.book-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.375rem, 2.8vw, 1.875rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text);
}

.book-tagline {
  margin: 0 0 1rem;
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.55;
}

.book-blurb {
  margin: 0 0 1.75rem;
  color: var(--text-soft);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.link-amazon-alt {
  width: 100%;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

@media (min-width: 520px) {
  .link-amazon-alt {
    width: auto;
    margin-left: 0.35rem;
  }
}

.link-amazon-alt:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.link-amazon-alt:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.8rem 1.25rem;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid transparent;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn-primary {
  background: linear-gradient(165deg, #a67c1f 0%, var(--gold) 48%, var(--gold-bright) 100%);
  color: var(--accent-text);
  border-color: rgba(26, 21, 8, 0.25);
  box-shadow:
    0 0 0 1px rgba(201, 162, 39, 0.35),
    0 12px 36px rgba(201, 162, 39, 0.28);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(221, 184, 74, 0.45),
    0 16px 44px rgba(201, 162, 39, 0.38);
}

.btn-secondary {
  background: rgba(244, 239, 230, 0.06);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: rgba(244, 239, 230, 0.1);
  border-color: rgba(201, 162, 39, 0.35);
}

.btn-arrow {
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.btn-primary:hover .btn-arrow {
  transform: translateX(3px);
}

.fine-print {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 52ch;
}

.fine-print code {
  font-family: ui-monospace, monospace;
  font-size: 0.85em;
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: rgba(201, 162, 39, 0.12);
  color: var(--paper-dim);
}

/* Bio */

.bio-section {
  padding: clamp(1.75rem, 4vw, 2.75rem);
}

.bio-header {
  margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.bio-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.125rem, 2vw, 1.35rem);
  letter-spacing: -0.02em;
  color: var(--text);
}

.bio-kicker {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
}

.bio-body {
  width: 100%;
  max-width: none;
}

.bio-body p {
  margin: 0 0 1.1em;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.7;
}

.bio-body p:last-child {
  margin-bottom: 0;
}

.bio-body p.bio-highlight {
  color: var(--text);
}

.bio-highlight {
  position: relative;
  padding: 1.15rem 1.15rem 1.15rem 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(201, 162, 39, 0.08);
  border: 1px solid rgba(201, 162, 39, 0.2);
}

.bio-highlight::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85rem;
  bottom: 0.85rem;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
}

.bio-highlight cite {
  font-style: normal;
  font-weight: 600;
  color: var(--text);
}

.site-footer {
  text-align: center;
  padding: 2rem 1rem 2.5rem;
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.site-footer p {
  margin: 0;
}
