@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

:root {
  --bg:            #e8ede7;
  --surface:       #f2f5f1;
  --border:        #c4d0c2;
  --text:          #2a3228;
  --text-muted:    #4f7250;
  --accent:        #725772;
  --accent-dark:   #4d3a4d;
  --accent-light:  #bba6bb;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 22px; }

/* ── Page transitions ────────────────────── */

@view-transition {
  navigation: auto;
}

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

main {
  animation: pageIn 0.22s ease both;
}

body {
  font-family: 'EB Garamond', Georgia, serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Nav ─────────────────────────────────── */

.site-nav {
  padding: 18px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: #725772;
  z-index: 100;
}

.nav-name {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #f2f5f1;
}

.nav-name em {
  font-style: italic;
  color: #bba6bb;
  font-weight: 400;
}

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

.nav-links a {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(242, 245, 241, 0.65);
  font-weight: 500;
  transition: color 0.18s;
}

.nav-links a:hover { color: #f2f5f1; }
.nav-links a.active { color: #bba6bb; }

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

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: #f2f5f1;
  border-radius: 2px;
}

.nav-mobile {
  display: none;
  flex-direction: column;
  background: #725772;
  border-bottom: 2px solid #5c4460;
  padding: 8px 24px 20px;
}

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

.nav-mobile a {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(242, 245, 241, 0.65);
  font-weight: 500;
  padding: 12px 0;
  border-bottom: 1px solid rgba(242, 245, 241, 0.15);
}

.nav-mobile a:last-child { border-bottom: none; }
.nav-mobile a.active { color: #bba6bb; }

/* ── Layout ──────────────────────────────── */

main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 56px 40px 80px;
}

footer {
  background: #725772;
  padding: 24px 48px;
  text-align: center;
  font-size: 0.68rem;
  color: rgba(242, 245, 241, 0.82);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

/* ── Page header ─────────────────────────── */

.page-header {
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 52px;
}

.page-header h1 {
  font-size: 2.6rem;
  font-weight: 500;
  letter-spacing: -0.3px;
  line-height: 1.15;
  margin-bottom: 10px;
}

.page-header p {
  font-size: 1rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Button ──────────────────────────────── */

.btn {
  display: inline-block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--accent);
  border: 1px solid var(--accent-light);
  border-radius: 30px;
  padding: 9px 22px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  background: none;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.btn:hover {
  background: var(--accent);
  color: var(--surface);
  border-color: var(--accent);
}

/* ── Home hero ───────────────────────────── */

.home-hero {
  position: relative;
  width: 100%;
  min-height: 52vh;
  background: url('images/hero.png') center center / cover no-repeat;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.home-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(44, 36, 40, 0.18) 0%,
    rgba(44, 36, 40, 0.08) 60%,
    rgba(44, 36, 40, 0.22) 100%
  );
}

.home-hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 9% 40px 0;
}

.home-tagline {
  font-size: 2rem;
  color: #2a2018;
  font-style: normal;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.2px;
  text-shadow: 0 1px 8px rgba(240, 230, 210, 0.5);
}

/* ── Home grid ───────────────────────────── */

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 56px;
  align-items: start;
}

.home-bio-section h2 {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #7b9a7b;
  font-weight: 500;
  margin-bottom: 20px;
}

.home-bio p {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text);
}

.home-bio p + p { margin-top: 16px; }

.home-book-section .home-section-label {
  margin-bottom: 24px;
}

.home-grid .featured-book {
  flex-direction: column;
  gap: 20px;
}

.home-grid .featured-cover {
  width: 100%;
  max-width: 180px;
}

.home-section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 28px;
}

.featured-book {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

.featured-cover {
  flex-shrink: 0;
  width: 108px;
  height: 162px;
  background: linear-gradient(145deg, #a6bba5, #7b9a7b);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px;
  font-style: italic;
  font-size: 0.82rem;
  color: var(--accent-dark);
  line-height: 1.4;
  box-shadow: 3px 4px 18px rgba(100,80,130,0.18);
}

.featured-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.featured-info h2 {
  font-size: 1.35rem;
  font-weight: 500;
  margin-bottom: 4px;
  line-height: 1.3;
}

.featured-info .meta {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 14px;
}

.featured-info p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 20px;
}

/* ── Books ───────────────────────────────── */

.books-grid {
  display: flex;
  flex-direction: column;
}

.book-card {
  display: flex;
  gap: 36px;
  align-items: flex-start;
  padding: 36px 0;
  border-bottom: 1px solid var(--border);
}

.book-card:first-child { padding-top: 0; }
.book-card:last-child  { border-bottom: none; }

.book-cover {
  flex-shrink: 0;
  width: 130px;
  aspect-ratio: 2 / 3;
  background: linear-gradient(145deg, #a6bba5, #7b9a7b);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  font-style: italic;
  font-size: 0.78rem;
  color: var(--accent-dark);
  line-height: 1.5;
  box-shadow: 3px 6px 20px rgba(100,80,130,0.15);
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.book-badge {
  display: inline-block;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border: 1px solid var(--accent-light);
  border-radius: 20px;
  padding: 4px 12px;
  margin-bottom: 10px;
}

.book-card-body {
  flex: 1;
  min-width: 0;
}

.book-card-body h2 {
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 4px;
  line-height: 1.3;
}

.book-card-body .meta {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 14px;
}

.book-card-body p {
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 12px;
}

.book-card-body p:last-child { margin-bottom: 0; }

.book-card-actions {
  flex-shrink: 0;
  width: 130px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

/* ── Writing ─────────────────────────────── */

.writing-item {
  display: flex;
  gap: 28px;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.writing-item:first-child { padding-top: 0; }
.writing-item:last-child  { border-bottom: none; }

.writing-aside {
  flex-shrink: 0;
  width: 72px;
  text-align: right;
  padding-top: 3px;
}

.writing-aside .year {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.writing-aside .type {
  display: block;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent-light);
  font-weight: 600;
  margin-top: 3px;
}

.writing-author {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 8px;
}

.writing-body h2 {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 7px;
  line-height: 1.3;
  transition: color 0.18s;
}

.writing-body h2 a:hover { color: var(--accent); }

.writing-body p {
  font-size: 0.88rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 12px;
}

.writing-body .pub {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--accent);
  font-weight: 500;
}

/* ── Contact ─────────────────────────────── */

.contact-simple {
  max-width: 520px;
  padding-top: 24px;
}

.contact-simple h1 {
  font-size: 2.8rem;
  font-weight: 400;
  margin-bottom: 20px;
  line-height: 1.15;
}

.contact-simple p {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 28px;
}

.contact-email {
  display: inline-block;
  font-size: 1.1rem;
  color: var(--accent);
  border-bottom: 1px solid var(--accent-light);
  padding-bottom: 2px;
  transition: color 0.18s, border-color 0.18s;
  margin-bottom: 28px;
}

.contact-email:hover {
  color: var(--accent-dark);
  border-color: var(--accent);
}

.contact-simple .contact-links {
  display: flex;
  gap: 24px;
  margin-top: 0;
}

.contact-simple .contact-links a {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.18s;
}

.contact-simple .contact-links a:hover { color: var(--accent); }

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}

.contact-left p {
  font-size: 0.96rem;
  line-height: 1.85;
  color: var(--text);
}

.contact-left p + p { margin-top: 16px; }

.contact-links {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-links a {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color 0.18s;
}

.contact-links a:hover { color: var(--accent); }

.contact-links .link-label {
  width: 56px;
  color: var(--accent-light);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--text-muted);
  font-weight: 500;
}

.form-field input,
.form-field textarea,
.form-field select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.18s;
  width: 100%;
  appearance: none;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: var(--accent-light);
}

.form-field textarea { min-height: 130px; resize: vertical; }

.form-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  margin-top: -4px;
}

/* ── Chapter list ────────────────────────── */

.chapter-list {
  margin-top: 20px;
  padding: 16px 18px;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.chapter-list-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 10px;
}

.chapter-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
}

.chapter-columns span {
  font-size: 0.82rem;
  color: var(--text);
  width: 50%;
  padding: 3px 0;
  line-height: 1.4;
}

.chapter-divider {
  width: 100% !important;
  font-size: 0.72rem !important;
  color: var(--accent) !important;
  font-style: italic;
  padding: 8px 0 4px !important;
  letter-spacing: 0.5px;
}

/* ── Excerpt modal — book style ──────────── */

.excerpt-overlay {
  position: fixed;
  inset: 0;
  background: rgba(42, 50, 40, 0.62);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.excerpt-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.excerpt-modal {
  background: #f7f3ec;
  border-radius: 3px;
  max-width: min(92vw, 980px);
  width: 100%;
  max-height: 86vh;
  display: flex;
  flex-direction: row;
  box-shadow:
    -8px 2px 24px rgba(0,0,0,0.20),
    8px 2px 20px rgba(0,0,0,0.10),
    0 16px 56px rgba(42,50,40,0.30);
  transform-origin: 28% center;
  transform: perspective(1400px) rotateY(-14deg) scale(0.93);
  opacity: 0;
  transition:
    transform 0.36s cubic-bezier(0.34, 1.08, 0.64, 1),
    opacity 0.28s ease;
}

.excerpt-overlay.open .excerpt-modal {
  transform: perspective(1400px) rotateY(0deg) scale(1);
  opacity: 1;
}

/* Left page — title / metadata */
.book-left {
  width: 230px;
  flex-shrink: 0;
  background: #ede8df;
  border-right: 1px solid #cec6ba;
  padding: 40px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 3px 0 0 3px;
}

.book-left-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

.book-type {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 2.2px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 14px;
}

.book-left h2 {
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 10px;
}

.book-from {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.5;
  margin-bottom: 32px;
}

.book-ornament {
  font-size: 0.9rem;
  color: var(--accent-light);
  letter-spacing: 6px;
}

.excerpt-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
  font-family: inherit;
  align-self: flex-start;
  margin-top: 8px;
}

.excerpt-close:hover { color: var(--text); }

/* Right page — content */
.book-right {
  flex: 1;
  overflow-y: auto;
  padding: 44px 48px 44px 44px;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
}

.excerpt-body p {
  font-size: 0.95rem;
  line-height: 1.9;
  color: var(--text);
  margin-bottom: 20px;
  text-align: justify;
}

.excerpt-body p:first-child::first-letter {
  font-size: 2.8rem;
  font-weight: 500;
  float: left;
  line-height: 0.85;
  margin: 6px 8px 0 0;
  color: var(--accent);
}

.excerpt-body p:last-child { margin-bottom: 0; }

.excerpt-body.poetry p {
  text-align: left;
  line-height: 2;
  margin-bottom: 28px;
}

.excerpt-body.poetry p:first-child::first-letter {
  font-size: inherit;
  float: none;
  color: inherit;
  margin: 0;
  line-height: inherit;
}

.story-divider {
  text-align: center;
  color: var(--accent-light);
  letter-spacing: 8px;
  margin: 28px 0;
  font-size: 0.82rem;
  user-select: none;
}

.btn-excerpt {
  display: inline-block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 9px 22px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  background: none;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  margin-top: 8px;
}

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

/* ── Footer note ─────────────────────────── */

.footer-note {
  font-size: 0.72rem;
  color: rgba(242, 245, 241, 0.68);
  margin-bottom: 8px;
  letter-spacing: 0.2px;
  line-height: 1.6;
}

.footer-link {
  color: rgba(242, 245, 241, 0.65);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.18s;
}

.footer-link:hover { color: rgba(242, 245, 241, 0.95); }

/* ── Support page ────────────────────────── */

.support-grid {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.support-heading {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 24px;
}

.support-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.support-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.support-item:first-child { padding-top: 0; }
.support-item:last-child  { border-bottom: none; }

.support-name {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
  text-decoration: none;
  transition: color 0.18s;
}

.support-name:hover { color: var(--accent); }

.support-tag {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-muted);
  font-weight: 500;
  vertical-align: middle;
  margin-left: 6px;
}

.support-item p {
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--text-muted);
}

/* ── Mobile ──────────────────────────────── */

@media (max-width: 640px) {
  html { font-size: 19px; }

  .site-nav    { padding: 14px 20px; }
  .nav-links   { display: none; }
  .nav-hamburger { display: flex; }
  .nav-mobile  { padding: 8px 20px 16px; }

  main   { padding: 32px 20px 56px; }
  footer { padding: 20px; }

  .home-grid { grid-template-columns: 1fr; gap: 36px; }
  .home-grid .featured-book { flex-direction: row; }
  .home-grid .featured-cover { max-width: 110px; }

  .excerpt-modal {
    flex-direction: column;
    transform-origin: center bottom;
    transform: translateY(20px) scale(0.97);
    max-height: 90vh;
  }
  .excerpt-overlay.open .excerpt-modal { transform: translateY(0) scale(1); }
  .book-left {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-right: none;
    border-bottom: 1px solid #cec6ba;
    border-radius: 3px 3px 0 0;
    gap: 16px;
  }
  .book-left-inner { flex-direction: row; align-items: center; gap: 12px; justify-content: flex-start; }
  .book-left h2 { font-size: 1rem; margin-bottom: 0; }
  .book-type { margin-bottom: 0; }
  .book-from, .book-ornament { display: none; }
  .book-right { padding: 20px 20px 28px; }
  .excerpt-body p:first-child::first-letter { font-size: 2rem; }

  .home-hero { min-height: 40vh; }
  .home-tagline { font-size: 1.45rem; }
  .home-hero-content { padding-top: 10%; }

  .featured-book  { flex-direction: column; gap: 20px; }
  .featured-cover { width: 100px; height: 150px; }

  .book-card { flex-wrap: wrap; gap: 20px; }
  .book-cover { width: 100px; }
  .book-card-body { flex: 1; min-width: 200px; }
  .book-card-actions { width: 100%; flex-direction: row; flex-wrap: wrap; }

  .writing-item  { flex-direction: column; gap: 4px; }
  .writing-aside { width: auto; text-align: left; flex-direction: row; display: flex; gap: 10px; align-items: center; }
  .writing-aside .type { margin-top: 0; }

  .contact-layout { grid-template-columns: 1fr; gap: 36px; }

  .page-header h1 { font-size: 2rem; }
}
