@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;700&family=Manrope:wght@400;500;700&display=swap");

:root {
  --paper: #f6f3ee;
  --surface: #fffdfa;
  --ink: #1f1c19;
  --muted: #776f64;
  --line: #ddd4c6;
  --accent: #1d1b19;
  --accent-soft: #ede6d9;
  --radius: 16px;
  --shadow: 0 16px 35px rgba(17, 15, 11, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 80% 0%, #f9f6f0 0%, #f5f1e8 38%, #f4efe6 100%);
  font-family: "Manrope", "Segoe UI", sans-serif;
  line-height: 1.65;
}

a {
  color: inherit;
}

.shell {
  width: min(1200px, 92vw);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(199, 186, 166, 0.5);
  background: color-mix(in srgb, #f8f4ed 90%, transparent);
  backdrop-filter: blur(8px);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
}

.brand {
  text-decoration: none;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.5rem, 1rem + 1.5vw, 2rem);
  font-weight: 700;
}

.main-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.main-nav a {
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  padding-bottom: 3px;
}

.main-nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.page-content {
  padding: clamp(36px, 4vw, 72px) 0 clamp(42px, 4vw, 78px);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  letter-spacing: 0.01em;
  line-height: 1.12;
}

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

h2 {
  font-size: clamp(1.7rem, 2.2vw, 2.3rem);
}

.hero {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 72px);
  align-items: center;
}

.hero-photo-card {
  margin: 0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
}

.hero-photo-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(10, 9, 8, 0.08);
  pointer-events: none;
}

.hero-photo {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
  filter: grayscale(100%);
  transition: transform 0.5s ease, filter 0.5s ease;
}

.hero-photo-card:hover .hero-photo {
  transform: scale(1.04);
  filter: grayscale(15%);
}

.hero-copy {
  display: grid;
  gap: 16px;
}

.hero-meta {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
}

.hero-lead {
  margin: 0;
  max-width: 62ch;
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  color: #38332d;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 8px;
}

.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 0;
  padding: 11px 18px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-weight: 700;
  border: 1px solid transparent;
  transition: 0.2s ease;
}

.btn-solid {
  background: var(--accent);
  color: #f8f5ef;
}

.btn-solid:hover {
  background: #34302a;
}

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

.btn-ghost:hover {
  background: var(--accent-soft);
}

.bio {
  margin-top: clamp(28px, 5vw, 70px);
  max-width: 84ch;
}

.bio p {
  color: #332f2a;
}

.stats-grid {
  margin-top: clamp(26px, 4vw, 54px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.stat-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 5px 20px rgba(42, 37, 31, 0.05);
}

.stat-card p {
  color: var(--muted);
}

.stat-card a {
  font-size: 0.8rem;
  font-weight: 700;
}

.section-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 26px;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.timeline {
  border-left: 2px solid #cdc2b2;
  margin-left: 12px;
  padding-left: 20px;
  display: grid;
  gap: 16px;
}

.timeline-item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  background: var(--surface);
  box-shadow: 0 4px 12px rgba(22, 19, 15, 0.04);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -29px;
  top: 20px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #2b2620;
  border: 2px solid #f4f0e8;
}

.timeline-item .period {
  display: inline-block;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.timeline-item h2 {
  font-size: clamp(1.3rem, 1.4vw, 1.8rem);
  margin-bottom: 6px;
}

.timeline-item p {
  margin: 0;
  color: #4c463f;
}

.card-grid {
  display: grid;
  gap: 16px;
}

.card-grid-books {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.content-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  display: grid;
  gap: 12px;
}

.content-card h2 {
  font-size: clamp(1.3rem, 1.4vw, 1.8rem);
}

.book-poster {
  width: 82px;
  height: 108px;
  border: 1px solid var(--line);
  background: linear-gradient(140deg, #eee8dd, #fbf8f2);
  color: #4f473d;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.65rem;
  display: grid;
  place-items: center;
}

.stack-list {
  display: grid;
  gap: 12px;
}

.stack-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 18px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.stack-main {
  max-width: 72ch;
}

.stack-main h2 {
  font-size: clamp(1.25rem, 1.6vw, 1.8rem);
}

.stack-main p {
  margin: 6px 0 0;
  color: #5f574d;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.video-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.video-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #efe8dc;
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-fallback {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.contact-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px;
  max-width: 720px;
}

.contact-card p {
  margin: 0 0 10px;
}

.contact-card ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.muted {
  margin: 0;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, #f5f1e8 75%, #fff);
  padding: 32px 0;
}

.footer-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
}

.site-footer h2 {
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.site-footer p {
  margin: 5px 0 0;
  color: var(--muted);
  max-width: 58ch;
}

.footer-right {
  text-align: right;
}

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-photo-card {
    width: min(320px, 100%);
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stack-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-wrap {
    grid-template-columns: 1fr;
  }

  .footer-right {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .main-nav {
    gap: 10px;
  }

  .main-nav a {
    font-size: 0.63rem;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.flash {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
  background: #f8f6f1;
}

.flash-success {
  border-color: #9ec9a3;
  background: #e9f7ea;
}

.flash-error {
  border-color: #d49a9a;
  background: #f9eaea;
}

.admin-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 14px;
}

.admin-sidebar {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 10px;
  display: grid;
  gap: 6px;
  align-content: start;
}

.admin-tab {
  text-decoration: none;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #645b51;
}

.admin-tab:hover {
  background: #f3ede3;
}

.admin-tab.active {
  background: #201d19;
  color: #fff9ee;
}

.admin-editor {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px;
}

.admin-form {
  display: grid;
  gap: 8px;
}

.admin-form label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
  color: #7b7368;
}

.admin-form textarea {
  width: 100%;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  background: #fdfcf9;
  color: #28231d;
}

.admin-actions {
  display: flex;
  justify-content: flex-end;
}

.admin-login-card {
  max-width: 430px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 16px;
}

.admin-login-form {
  display: grid;
  gap: 10px;
}

.admin-login-form label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #786f64;
}

.admin-login-form input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  font-size: 0.95rem;
}

@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-form textarea {
    min-height: 420px;
  }
}

.admin-panel {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 720px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #f7f4ee;
}

.admin-left {
  background: #171412;
  color: #f7f0e3;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-brand-block h2 {
  font-size: 2rem;
}

.admin-brand-block p {
  margin: 6px 0 0;
  color: #c2b7a6;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  font-weight: 700;
}

.admin-nav {
  display: grid;
  gap: 6px;
}

.admin-nav-link {
  text-decoration: none;
  color: #d0c4b5;
  font-size: 1rem;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 700;
}

.admin-nav-link:hover {
  background: #2a2520;
  color: #f6eee1;
}

.admin-nav-link.active {
  background: #3a332c;
  color: #ffffff;
}

.admin-logout {
  margin-top: auto;
  width: 100%;
  border-color: #4a4138;
  background: #201c17;
  color: #ece1cf;
}

.admin-right {
  background: #f8f6f2;
  padding: 24px;
}

.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-top h1 {
  font-size: clamp(2rem, 3vw, 3.1rem);
}

.admin-top p {
  margin: 0;
  color: #7b7367;
}

.admin-upload-panel {
  margin-bottom: 16px;
  border: 1px solid #ddd3c5;
  border-radius: 12px;
  background: #fffefb;
  padding: 12px;
}

.admin-upload-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
}

.admin-upload-label {
  display: grid;
  gap: 6px;
  flex: 1 1 320px;
}

.admin-upload-label span {
  font-size: 0.72rem;
  color: #8e8578;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.admin-upload-label input[type="file"] {
  width: 100%;
  border: 1px solid #d8d0c3;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: "Manrope", "Segoe UI", sans-serif;
  padding: 8px 9px;
  background: #fffefb;
}

.admin-upload-hint {
  margin: 10px 0 0;
  color: #7b7367;
  font-size: 0.82rem;
  line-height: 1.5;
}

.admin-cards-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.admin-add-card {
  min-height: 260px;
  border: 2px dashed #ccc3b7;
  border-radius: 14px;
  background: transparent;
  color: #9b9081;
  font-size: 1.2rem;
  display: grid;
  place-items: center;
  gap: 8px;
  cursor: pointer;
}

.admin-add-card .plus {
  font-size: 3rem;
  line-height: 1;
}

.admin-add-card:hover {
  border-color: #8f8475;
  color: #5f574a;
}

.admin-item-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #dfd7ca;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  display: grid;
  gap: 10px;
  align-content: start;
}

.admin-delete {
  position: absolute;
  right: 10px;
  top: 10px;
  border: 1px solid #d9c0c0;
  background: #fff5f5;
  color: #912a2a;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  cursor: pointer;
}

.admin-delete:hover {
  background: #ffe6e6;
}

.admin-item-cover {
  height: 120px;
  border-radius: 10px;
  border: 1px solid #ddd0bc;
  background: linear-gradient(145deg, #f2ebdf, #faf7f2);
  display: grid;
  place-items: center;
  font-family: "Cormorant Garamond", serif;
  font-size: 2.1rem;
  color: #4f4537;
  margin-right: 70px;
}

.admin-field {
  display: grid;
  gap: 6px;
}

.admin-field span {
  font-size: 0.72rem;
  color: #8e8578;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.admin-field input,
.admin-field textarea {
  width: 100%;
  border: 1px solid #d8d0c3;
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: "Manrope", "Segoe UI", sans-serif;
  padding: 8px 9px;
  background: #fffefb;
}

.admin-field textarea {
  resize: vertical;
  min-height: 70px;
}

.admin-json-form textarea {
  width: 100%;
  min-height: 560px;
  border: 1px solid #d5cdbc;
  border-radius: 12px;
  padding: 12px;
  background: #fffefb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
}

.admin-save-wrap {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  padding-top: 6px;
}

@media (max-width: 1180px) {
  .admin-cards-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .admin-panel {
    grid-template-columns: 1fr;
  }

  .admin-cards-form {
    grid-template-columns: 1fr;
  }

  .admin-right {
    padding: 16px;
  }
}
