/* ─── TOKENS ─────────────────────────────────────────── */
:root {
  --bg:        #FBF9F4;
  --bg-mid:    #F3EFE4;
  --bg-soft:   #FFFFFF;
  --ink:       #33312C;
  --ink-dim:   #837C6B;
  --accent:      #5C7A93;
  --accent-light:#82A0BC;
  --accent-dark: #3F5C74;
  --drama:       #C97B5D;
  --drama-light: #E7B79B;
  --gap: 1.5rem;
  --nav-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 400;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent-dark);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 300;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
}

/* ─── CUSTOM CURSOR ──────────────────────────────────── */
#cursor {
  position: fixed; top: 0; left: 0; z-index: 9999;
  width: 10px; height: 10px;
  background: var(--accent-dark);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: transform .15s ease, width .2s ease, height .2s ease;
  mix-blend-mode: multiply;
}
#cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 9998;
  width: 36px; height: 36px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: transform .4s cubic-bezier(.23,1,.32,1), width .3s, height .3s, opacity .3s;
  opacity: .5;
}
body:hover #cursor { opacity: 1; }

/* ─── NAVBAR ─────────────────────────────────────────── */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  padding: 0 4rem;
  transition: background .4s, backdrop-filter .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}
#navbar.scrolled {
  background: rgba(251,249,244,.88);
  backdrop-filter: blur(12px);
  border-bottom-color: rgba(63,92,116,.15);
}
.nav-logo {
  font-family: 'Fraunces', serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--ink);
  flex: 1;
}
.nav-logo span { color: var(--accent-dark); }
.nav-links {
  display: flex; gap: 2.8rem;
  list-style: none;
}
.nav-links a {
  font-family: 'Rajdhani', sans-serif;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  position: relative;
  padding-bottom: 4px;
  transition: color .25s;
}
.nav-links a::after {
  content: '';
  position: absolute; bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--accent-dark);
  transition: width .3s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--accent-dark); }
.nav-links a.active::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

/* ─── SECTION BASE ───────────────────────────────────── */
section {
  position: relative; z-index: 1;
  min-height: 100vh;
  padding: calc(var(--nav-h) + 4rem) 4rem 5rem;
}
.section-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .7rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--accent-dark);
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.2rem;
}
.section-label::before {
  content: '';
  display: inline-block; width: 40px; height: 1px;
  background: var(--accent-dark);
}

/* ─── HERO ───────────────────────────────────────────── */
#hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding-top: var(--nav-h);
  overflow: hidden;
  position: relative;
}
.hero-bg-line {
  position: absolute;
  top: 0; right: 12%;
  width: 1px; height: 100%;
  background: linear-gradient(to bottom, transparent, var(--accent-dark) 30%, var(--accent) 60%, transparent);
  opacity: .14;
}
.hero-inner {
  max-width: 900px;
  padding-left: 2rem;
  position: relative;
  z-index: 2;
}
.hero-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .72rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp .8s .2s forwards;
}
.hero-name {
  font-family: 'Fraunces', serif;
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 600;
  line-height: .98;
  letter-spacing: -.01em;
  color: var(--ink);
  margin-bottom: .6rem;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp .9s .35s forwards;
}
.hero-name em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent-dark);
}
.hero-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  font-weight: 400;
  font-style: italic;
  color: var(--ink-dim);
  margin-bottom: 1.6rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp .9s .5s forwards;
  max-width: 34rem;
}
.hero-desc {
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.8;
  color: var(--ink-dim);
  max-width: 460px;
  margin-bottom: 2.5rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp .9s .65s forwards;
}
.hero-cta {
  display: flex; gap: 1.5rem; align-items: center;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp .9s .8s forwards;
}
.btn-primary {
  display: inline-block;
  padding: .85rem 2.2rem;
  background: var(--accent-dark);
  color: #fff;
  font-family: 'Rajdhani', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  transition: color .3s;
}
.btn-primary::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--ink);
  transform: translateX(-101%);
  transition: transform .35s cubic-bezier(.77,0,.18,1);
}
.btn-primary:hover::before { transform: translateX(0); }
.btn-primary span { position: relative; z-index: 1; }
.btn-ghost {
  font-family: 'Rajdhani', sans-serif;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  display: flex; align-items: center; gap: .6rem;
  transition: color .25s;
}
.btn-ghost::after {
  content: '→';
  transition: transform .25s;
}
.btn-ghost:hover { color: var(--accent-dark); }
.btn-ghost:hover::after { transform: translateX(5px); }

.hero-portrait {
  position: absolute;
  top: 0; right: 0;
  width: 34vw;
  max-width: 480px;
  height: 100%;
  overflow: hidden;
  z-index: 1;
  -webkit-mask-image: linear-gradient(to left, black 55%, transparent 100%);
  mask-image: linear-gradient(to left, black 55%, transparent 100%);
  opacity: .9;
}
.hero-portrait img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(.75);
}
.portrait-bw { opacity: 0; transition: opacity .5s ease; }
.hero-portrait:hover .portrait-bw { opacity: 1; }

.hero-word {
  position: absolute; right: 17vw; top: 50%;
  transform: translateY(-50%);
  font-family: 'Fraunces', serif;
  font-size: 13vw;
  font-weight: 700;
  color: rgba(63,92,116,.05);
  user-select: none;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
}
.hero-scroll {
  position: absolute; bottom: 2.5rem; left: 4rem;
  display: flex; align-items: center; gap: 1rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .65rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-dim);
  opacity: 0;
  z-index: 2;
  animation: fadeUp .8s 1.2s forwards;
}
.hero-scroll::before {
  content: '';
  width: 1px; height: 60px;
  background: linear-gradient(to bottom, var(--accent-dark), transparent);
  animation: scrollPulse 2s 1.5s infinite;
}
@keyframes scrollPulse {
  0%,100% { opacity: .4; }
  50% { opacity: 1; }
}

/* ─── DIVIDER ────────────────────────────────────────── */
.gold-rule {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.75rem;
  max-width: 20rem;
}
.gold-rule::before {
  content: '';
  flex: 1; height: 1px;
  background: linear-gradient(to right, var(--accent-dark), transparent);
}
.gold-rule-dot {
  width: 5px; height: 5px;
  background: var(--accent-dark);
  transform: rotate(45deg);
}

/* ─── BOOKS ──────────────────────────────────────────── */
#bocker {
  background: var(--bg-mid);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: calc(var(--nav-h) + 1.75rem) 4rem 1.5rem;
}
.section-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.section-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.01em;
}
.section-title em { font-style: italic; color: var(--accent-dark); }
.section-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .7rem;
  letter-spacing: .15em;
  color: var(--ink-dim);
  padding-bottom: .3rem;
}

.books-rows {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.book-group {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.group-heading {
  display: flex;
  align-items: baseline;
  gap: .8rem;
  margin-bottom: .6rem;
}
.group-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  font-weight: 600;
}
.group-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .65rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.book-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
/* ─── BOOK SPOTLIGHT ─────────────────────────────────── */
.book-spotlight {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 4rem;
  align-items: center;
  padding-bottom: 2.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(63,92,116,.15);
}
.spotlight-media {
  position: relative;
  max-width: 320px;
}
.spotlight-badge {
  position: absolute;
  top: -.9rem; left: -.9rem;
  z-index: 2;
  display: flex; align-items: center; gap: .5rem;
  background: var(--accent-dark);
  color: #fff;
  padding: .55rem 1rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .62rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.spotlight-badge::before {
  content: '';
  width: 5px; height: 5px;
  background: var(--accent-light);
  transform: rotate(45deg);
}
.spotlight-frame {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
  background: var(--bg-soft);
  box-shadow: 0 30px 60px -24px rgba(51,49,44,.4);
}
.spotlight-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .7s cubic-bezier(.25,.46,.45,.94);
}
.spotlight-media:hover .spotlight-frame img { transform: scale(1.05); }
.spotlight-frame-border {
  position: absolute;
  bottom: -1.1rem; right: -1.1rem;
  width: 90%; height: 95%;
  border: 1px solid rgba(63,92,116,.3);
  pointer-events: none;
  z-index: -1;
}
.spotlight-content { max-width: 34rem; }
.spotlight-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: .8rem;
}
.spotlight-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -.01em;
  margin-bottom: 1.1rem;
}
.spotlight-title em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent-dark);
}
.spotlight-desc {
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--ink-dim);
  margin-bottom: 1.8rem;
}
.spotlight-cta {
  display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap;
}

/* ─── BOOK FEATURE (secondary titles) ────────────────── */
.book-feature {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.feature-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.feature-media {
  position: relative;
  max-width: 220px;
  margin-bottom: 1.6rem;
}
.feature-frame {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
  background: var(--bg-soft);
  box-shadow: 0 16px 32px -18px rgba(51,49,44,.3);
}
.feature-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .7s cubic-bezier(.25,.46,.45,.94);
}
.book-feature:hover .feature-frame img { transform: scale(1.05); }
.feature-frame-border {
  position: absolute;
  bottom: -.7rem; right: -.7rem;
  width: 90%; height: 95%;
  border: 1px solid rgba(63,92,116,.25);
  pointer-events: none;
  z-index: -1;
}
.feature-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .62rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--drama);
  margin-bottom: .5rem;
}
.book-feature[data-genre="deckare"] .feature-tag { color: var(--accent-dark); }
.feature-title {
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: .6rem;
}
.feature-desc {
  font-size: .88rem;
  line-height: 1.65;
  color: var(--ink-dim);
  margin-bottom: 1rem;
  flex: 1;
}
.feature-link {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: 'Rajdhani', sans-serif;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-dark);
  border-bottom: 1px solid rgba(63,92,116,.35);
  padding-bottom: .2rem;
  align-self: flex-start;
  transition: color .2s, border-color .2s;
}
.feature-link-icon { transition: transform .25s; }
.feature-link:hover { color: var(--ink); border-color: var(--ink); }
.feature-link:hover .feature-link-icon { transform: translateX(4px); }

/* ─── ABOUT ──────────────────────────────────────────── */
#om {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}
.about-visual { position: relative; max-width: 32rem; left: 15vw; }
.about-photo-frame {
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--bg-soft);
  position: relative;
  overflow: hidden;
}
.about-photo-color, .about-photo-bw {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.about-photo-bw { opacity: 0; transition: opacity .5s ease; }
.about-photo-frame:hover .about-photo-bw { opacity: 1; }
.about-frame-border {
  position: absolute;
  bottom: -1.5rem; right: -1.5rem;
  width: 90%; height: 95%;
  border: 1px solid rgba(63,92,116,.3);
  pointer-events: none;
}
.about-stat-badge {
  position: absolute;
  top: 2rem; left: -2rem;
  background: var(--accent-dark);
  color: #fff;
  padding: 1rem 1.4rem;
}
.about-stat-badge strong {
  display: block;
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}
.about-stat-badge span {
  font-family: 'Rajdhani', sans-serif;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.about-content .section-title { margin-bottom: 1.8rem; }
.about-text {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.85;
  color: var(--ink-dim);
  margin-bottom: 1.4rem;
  max-width: 42rem;
}
.about-skills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem 2rem;
  margin-top: 2.5rem;
}
.skill-item {
  display: flex; align-items: center; gap: .7rem;
  font-family: 'Rajdhani', sans-serif;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.skill-item::before {
  content: '◆';
  font-size: .45rem;
  color: var(--accent-dark);
}

/* ─── CONTACT ────────────────────────────────────────── */
#kontakt {
  background: var(--bg-mid);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100vh;
}
.contact-tagline {
  font-family: 'Fraunces', serif;
  font-size: clamp(2.2rem, 5.5vw, 4.2rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.01em;
  margin-bottom: 1.5rem;
}
.contact-tagline em { font-style: italic; color: var(--accent-dark); }
.contact-sub {
  font-size: 1rem;
  font-weight: 400;
  color: var(--ink-dim);
  max-width: 420px;
  line-height: 1.8;
  margin-bottom: 3rem;
}
.contact-links {
  display: flex; gap: 1.25rem; flex-wrap: wrap; justify-content: center;
  margin-bottom: 4rem;
}
.contact-link {
  display: flex; align-items: center; gap: .7rem;
  font-family: 'Rajdhani', sans-serif;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: .7rem 1.6rem;
  border: 1px solid rgba(63,92,116,.25);
  transition: color .25s, border-color .25s, background .25s;
}
.contact-link:not(.contact-link-static):hover {
  color: #fff;
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}
.contact-link-static {
  font-style: italic;
  border-style: dashed;
}
.contact-email {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.1rem, 2.6vw, 1.7rem);
  font-style: italic;
  color: var(--accent-dark);
  border-bottom: 1px solid rgba(63,92,116,.35);
  padding-bottom: .2rem;
  transition: border-color .25s;
}
.contact-email:hover { border-color: var(--accent-dark); }
.contact-footer {
  position: absolute; bottom: 2.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .62rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  opacity: .6;
}

/* ─── ANIMATIONS ─────────────────────────────────────── */
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .8s ease, transform .8s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: .15s; }
.reveal-delay-2 { transition-delay: .3s; }
.reveal-delay-3 { transition-delay: .45s; }

/* ─── SCROLL PROGRESS ────────────────────────────────── */
#progress-bar {
  position: fixed; top: 0; left: 0; z-index: 200;
  height: 2px;
  background: linear-gradient(to right, var(--accent-dark), var(--accent));
  width: 0%;
  transition: width .1s linear;
}

/* ─── REDUCED MOTION ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #cursor, #cursor-ring { display: none; }
  body { cursor: auto; }
  .hero-eyebrow, .hero-name, .hero-title, .hero-desc, .hero-cta, .hero-scroll {
    animation: none; opacity: 1; transform: none;
  }
  .reveal { opacity: 1; transform: none; transition: none; }
  .spotlight-frame img, .feature-frame img, .portrait-bw, .about-photo-bw { transition: none; }
}

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 900px) {
  section { padding: calc(var(--nav-h) + 3rem) 2rem 4rem; }
  #navbar { padding: 0 2rem; }
  .hero-portrait { width: 45vw; opacity: .5; }
  .hero-word { display: none; }
  #bocker {
    min-height: auto;
    padding: calc(var(--nav-h) + 2rem) 2rem 3rem;
  }
  .book-spotlight {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-bottom: 2rem;
  }
  .spotlight-media { max-width: 240px; }
  .spotlight-content { max-width: none; }
  .books-rows { gap: 2.5rem; }
  .book-group { flex: none; }
  .book-grid { grid-template-columns: repeat(2, 1fr); gap: 1.75rem 1rem; }
  #om { grid-template-columns: 1fr; gap: 3rem; }
  .about-visual { max-width: 360px; left: 0; margin: 0 auto; }
  .about-photo-color { position: relative;}
  #cursor, #cursor-ring { display: none; }
  body { cursor: auto; }
  #kontakt {text-align: left;}
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--bg);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .4s ease;
    border-bottom: 1px solid rgba(63,92,116,.15);
  }
  .nav-links.open { max-height: 20rem; }
  .nav-links li { border-top: 1px solid rgba(63,92,116,.1); }
  .nav-links a { display: block; padding: 1rem 1.5rem; }

  .hero-portrait { display: none; }
  .hero-inner { padding-left: 0; }
  .book-grid { grid-template-columns: 1fr; }
  .about-stat-badge { left: 0; }
  .hero-scroll { left: 1.5rem; }
}
