/* ================================================================
   BOOKS — distinct author-site identity
   A darker, editorial, literary feel separate from the UX portfolio.
================================================================ */

:root {
  /* Author palette */
  --ink-author:        #0F1419;
  --ink-author-2:      #161E28;
  --ink-author-3:      #1E2733;
  --paper:             #F4F1EA;
  --paper-dim:         #C9C5BC;
  --paper-muted:       #8A919C;
  --gold:              #C9A227;
  --gold-soft:         rgba(201, 162, 39, 0.12);
  --gold-line:         rgba(201, 162, 39, 0.35);
  --line-author:       rgba(244, 241, 234, 0.10);
  --line-author-mid:   rgba(244, 241, 234, 0.18);

  /* Typography */
  --font-serif:        Georgia, 'Times New Roman', serif;
  --font-display:      'Archivo', 'Helvetica Neue', sans-serif;
  --font-sans:         'Instrument Sans', system-ui, sans-serif;
  --font-mono:         'Spline Sans Mono', 'SF Mono', monospace;

  --ease-out:          cubic-bezier(0.16, 1, 0.3, 1);
  --max-w:             1160px;
  --gutter:            clamp(1.25rem, 4vw, 2.5rem);
}

/* Override the portfolio canvas completely */
body {
  background: var(--ink-author) !important;
  background-image: none !important;
  color: var(--paper);
  font-family: var(--font-sans);
  line-height: 1.7;
}

::selection { background: var(--gold); color: var(--ink-author); }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ================================================================
   NAVIGATION — minimal author toolbar
================================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 68px;
  background: rgba(15, 20, 25, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-author);
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}
.nav-logo::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 50%;
  flex-shrink: 0;
}
.nav-logo:hover { color: var(--gold); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--paper-dim);
  transition: color 0.2s;
  position: relative;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--paper); }

.nav-links a[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}

.nav-cta {
  color: var(--ink-author) !important;
  background: var(--gold);
  padding: 0.5rem 1.1rem !important;
  border-radius: 6px;
  font-weight: 600 !important;
  transition: background 0.2s, color 0.2s !important;
}
.nav-cta:hover { background: #E0B73A !important; color: var(--ink-author) !important; }

/* ================================================================
   FRAMES — editorial panels, no design-tool chrome
================================================================ */
.frame {
  width: min(var(--max-w), calc(100% - 2 * var(--gutter)));
  max-width: var(--max-w);
  margin: 0 auto 4rem;
  background: var(--ink-author-2);
  border: 1px solid var(--line-author);
  border-radius: 14px;
  position: relative;
}

/* Hide the portfolio-style frame labels on book pages */
.frame__label,
.hero__framename { display: none; }

.frame__inner { padding: 4rem 4.5rem; }

/* ================================================================
   HERO
================================================================ */
.hero {
  min-height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8.5rem 0 3rem;
  position: relative;
}

.hero__frame {
  width: min(var(--max-w), calc(100% - 2 * var(--gutter)));
  max-width: var(--max-w);
  margin: 0 auto;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.book-hero__frame {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 4rem;
  align-items: center;
}

.book-cover {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  transform: perspective(1000px) rotateY(-5deg) rotateX(2deg);
  transition: transform 0.4s var(--ease-out);
}
.book-cover:hover {
  transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}
.book-cover img,
.book-cover svg {
  width: 100%;
  height: auto;
  display: block;
}

.book-breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--paper-muted);
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.6rem;
}
.book-breadcrumb a { color: var(--paper-dim); }
.book-breadcrumb a:hover { color: var(--gold); }

.book-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.5rem;
}
.book-meta__tag {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-dim);
  background: var(--ink-author-3);
  border: 1px solid var(--line-author);
  padding: 0.35rem 0.75rem;
  border-radius: 99px;
}
.book-meta__tag--accent {
  color: var(--gold);
  background: var(--gold-soft);
  border-color: var(--gold-line);
}

.book-title {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 5.5vw, 4.2rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--paper);
  margin-bottom: 1.1rem;
}

.book-subtitle {
  font-family: var(--font-sans);
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  color: var(--paper-dim);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  max-width: 52ch;
}

.book-byline {
  font-size: 1rem;
  color: var(--paper-muted);
  margin-bottom: 2rem;
}
.book-byline a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.book-byline a:hover { color: #E0B73A; }

.book-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.book-actions .btn,
.notify-form button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.9rem 1.5rem;
  border-radius: 8px;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
}
.book-actions .btn:hover,
.notify-form button:hover { transform: translateY(-2px); }

.btn--primary {
  background: var(--gold);
  color: var(--ink-author);
  box-shadow: 0 6px 20px rgba(201, 162, 39, 0.22);
}
.btn--primary:hover { background: #E0B73A; }

.btn--secondary {
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--line-author-mid);
}
.btn--secondary:hover { border-color: var(--gold); color: var(--gold); }

.book-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line-author);
}
.book-detail {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.book-detail__label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper-muted);
}
.book-detail__value {
  font-size: 0.92rem;
  color: var(--paper-dim);
  font-weight: 500;
}

/* ================================================================
   MAIN CONTENT
================================================================ */
.book-content {
  padding: 2rem 0 5rem;
}

.book-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4rem;
  align-items: start;
}

.book-section {
  margin-bottom: 3rem;
}
.book-section:last-child { margin-bottom: 0; }

.book-section__title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--paper);
  margin-bottom: 1.1rem;
  letter-spacing: -0.01em;
}

.book-section p {
  color: var(--paper-dim);
  margin-bottom: 1.1rem;
  max-width: 62ch;
}
.book-section p:last-child { margin-bottom: 0; }

.book-section em {
  color: var(--paper);
  font-family: var(--font-serif);
  font-style: italic;
}

.book-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.book-list li {
  position: relative;
  padding-left: 1.5rem;
  color: var(--paper-dim);
}
.book-list li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 0.8rem;
  top: 0.15rem;
}

/* ================================================================
   SIDEBAR
================================================================ */
.book-sidebar {
  position: sticky;
  top: 100px;
}

.author-card,
.book-card {
  background: var(--ink-author-2);
  border: 1px solid var(--line-author);
  border-radius: 12px;
  padding: 1.75rem;
  margin-bottom: 1.25rem;
}

.author-card__avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--ink-author-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 1.1rem;
  border: 1px solid var(--line-author-mid);
}

.author-card__name {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--paper);
  margin-bottom: 0.25rem;
}

.author-card__role {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--paper-muted);
  margin-bottom: 1rem;
}

.author-card p {
  font-size: 0.94rem;
  color: var(--paper-dim);
  line-height: 1.65;
}

.notify-card {
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
}
.notify-card__title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--paper);
  margin-bottom: 0.5rem;
}
.notify-card p {
  font-size: 0.92rem;
  color: var(--paper-dim);
  margin-bottom: 1rem;
}
.notify-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.notify-form input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line-author-mid);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  background: var(--ink-author);
  color: var(--paper);
}
.notify-form input::placeholder { color: var(--paper-muted); }
.notify-form input:focus {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.notify-form button {
  width: 100%;
  justify-content: center;
  border: none;
  background: var(--gold);
  color: var(--ink-author);
  cursor: pointer;
}
.notify-form button:hover { background: #E0B73A; }

/* ================================================================
   BOOKS LISTING
================================================================ */
.books-list {
  display: grid;
  gap: 2rem;
}

.book-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 2rem;
  background: var(--ink-author-2);
  border: 1px solid var(--line-author);
  border-radius: 12px;
  padding: 2rem;
  transition: border-color 0.25s, transform 0.25s var(--ease-out);
}
.book-item:hover {
  border-color: var(--gold-line);
  transform: translateY(-3px);
}

.book-item__cover {
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s var(--ease-out);
}
.book-item:hover .book-item__cover { transform: scale(1.02); }

.book-item__cover img,
.book-item__cover svg {
  width: 100%;
  height: auto;
  display: block;
}

.book-item__body { display: flex; flex-direction: column; justify-content: center; }

/* ================================================================
   FOOTER
================================================================ */
footer.frame {
  background: transparent;
  border: none;
  box-shadow: none;
}
footer.frame .frame__inner {
  padding: 2rem 0 3rem;
  text-align: center;
}
footer p {
  color: var(--paper-muted);
  font-size: 0.9rem;
}
footer a { color: var(--gold); }
footer a:hover { color: #E0B73A; }

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 900px) {
  .book-hero__frame { grid-template-columns: 1fr; gap: 2.5rem; text-align: center; }
  .book-cover { max-width: 280px; margin: 0 auto; }
  .book-breadcrumb { justify-content: center; }
  .book-meta { justify-content: center; }
  .book-subtitle { margin-left: auto; margin-right: auto; }
  .book-actions { justify-content: center; }
  .book-details { text-align: left; }
  .book-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .book-sidebar { position: static; }
}

@media (max-width: 560px) {
  .nav { padding: 0 1.25rem; height: 64px; }
  .nav-links { gap: 1.1rem; }
  .nav-links a { font-size: 0.72rem; }
  .nav-logo { font-size: 0.95rem; }
  .frame__inner { padding: 2.25rem 1.5rem; }
  .book-item { grid-template-columns: 1fr; text-align: center; }
  .book-item__cover { max-width: 160px; margin: 0 auto; }
  .book-item .book-meta { justify-content: center; }
  .book-item .book-actions { justify-content: center; }
}
