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

/* ===== CSS Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Libre Baskerville', 'Cormorant Garamond', Georgia, 'Songti SC', STSong, serif;
  background: #ffffff;
  color: #1f1f1f;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ===== Scroll margin for sticky nav ===== */
section[id] {
  scroll-margin-top: 72px;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  line-height: 1.25;
  color: #1f1f1f;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 600; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); font-weight: 600; }
h4 { font-size: 1.15rem; font-weight: 600; }

p {
  font-size: 1rem;
  line-height: 1.8;
  color: #1f1f1f;
  margin-bottom: 1.2em;
}

a {
  color: #1f1f1f;
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover { opacity: 0.7; }

ul, ol { padding-left: 1.5em; }
li { margin-bottom: 0.4em; line-height: 1.7; }

img { max-width: 100%; height: auto; display: block; }

/* ===== Elevation Shadow Scale ===== */
:root {
  --shadow-sm: 0 1px 3px rgba(31,31,31,0.08), 0 1px 2px rgba(31,31,31,0.05);
  --shadow-md: 0 4px 12px rgba(31,31,31,0.10), 0 2px 6px rgba(31,31,31,0.07);
  --shadow-lg: 0 10px 28px rgba(31,31,31,0.13), 0 4px 12px rgba(31,31,31,0.08);
  --shadow-xl: 0 20px 48px rgba(31,31,31,0.16), 0 8px 20px rgba(31,31,31,0.10);
  --radius-card: 18px;
  --nav-h: 64px;
  --color-main: #ffffff;
  --color-sub: #f5f5f5;
  --color-ink: #1f1f1f;
  --color-ink-light: #4a4a4a;
  --color-border: rgba(31,31,31,0.12);
}

/* ===== Site Wrapper ===== */
.site-wrapper {
  position: relative;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + 16px);
}

/* ===== Layer Card ===== */
.layer-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 2;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.layer-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* ===== Floating Badge ===== */
.floating-badge {
  display: inline-block;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 100px;
  padding: 0.35em 1em;
  font-size: 0.8rem;
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.08em;
  color: var(--color-ink);
  box-shadow: var(--shadow-sm);
  z-index: 4;
  position: relative;
}

.floating-badge-sm {
  display: inline-block;
  background: var(--color-sub);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  padding: 0.25em 0.8em;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--color-ink-light);
  box-shadow: var(--shadow-sm);
  margin-top: 1.2rem;
}

/* ===== Bottom Fixed Navigation ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 20px rgba(31,31,31,0.08);
}

.bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  height: var(--nav-h);
  padding: 0 1.5rem;
  gap: 1rem;
}

.bottom-nav-brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-link {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.brand-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-ink);
  white-space: nowrap;
}

.brand-logo {
  height: 36px;
  width: auto;
}

.bottom-nav-left,
.bottom-nav-right {
  flex: 1;
  display: flex;
  align-items: center;
}

.bottom-nav-left { justify-content: flex-end; }
.bottom-nav-right { justify-content: flex-start; }

.nav-flat ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.1rem;
  padding: 0;
  margin: 0;
}

.nav-flat li a {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 0.7rem;
  font-size: 0.82rem;
  font-family: 'Libre Baskerville', serif;
  letter-spacing: 0.03em;
  color: var(--color-ink);
  text-decoration: none;
  white-space: nowrap;
  min-height: 44px;
  border-radius: 8px;
  transition: background 0.2s;
}

.nav-flat li a:hover {
  background: var(--color-sub);
  opacity: 1;
}

.nav-cta {
  background: var(--color-ink) !important;
  color: var(--color-main) !important;
  border-radius: 100px !important;
  padding: 0.5rem 1.1rem !important;
  font-weight: 700;
  min-height: 44px;
}

.nav-cta:hover {
  background: #333 !important;
}

/* Nav details/summary (mobile dropdown) */
.nav-details {
  display: none;
  position: relative;
}

.nav-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  list-style: none;
  padding: 0.6rem 1rem;
  min-height: 44px;
  font-size: 0.85rem;
  color: var(--color-ink);
}

.nav-summary::-webkit-details-marker { display: none; }

.nav-hamburger {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 20px;
}

.nav-hamburger span {
  display: block;
  height: 2px;
  background: var(--color-ink);
  border-radius: 2px;
  transition: transform 0.2s;
}

.nav-details[open] .nav-hamburger span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-details[open] .nav-hamburger span:nth-child(2) {
  opacity: 0;
}
.nav-details[open] .nav-hamburger span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav-label {
  font-family: 'Libre Baskerville', serif;
}

.nav-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: var(--shadow-xl);
  padding: 0.5rem 0;
  min-width: 180px;
  list-style: none;
  z-index: 200;
  backdrop-filter: blur(8px);
}

.nav-dropdown li a {
  display: block;
  padding: 0.65rem 1.2rem;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--color-ink);
  transition: background 0.15s;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.nav-dropdown li a:hover {
  background: var(--color-sub);
  opacity: 1;
}

/* ===== Hero Section ===== */
.hero-section {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 500px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(31,31,31,0.72) 0%,
    rgba(31,31,31,0.40) 50%,
    rgba(31,31,31,0.20) 100%
  );
  z-index: 1;
}

/* Hero fallback bg when no image */
.hero-section:not(:has(.hero-bg-img)) .hero-media {
  background: linear-gradient(135deg, #1f1f1f 0%, #3a3a3a 60%, #2a2a2a 100%);
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 2rem 6rem;
  text-align: left;
}

.hero-badge {
  margin-bottom: 1.5rem;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.4);
  color: #ffffff;
  backdrop-filter: blur(6px);
}

.hero-h1 {
  color: #ffffff;
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
  max-width: 700px;
}

.hero-desc {
  color: rgba(255,255,255,0.85);
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  max-width: 560px;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  background: #ffffff;
  color: #1f1f1f;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 100px;
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.2s, transform 0.2s;
  min-height: 48px;
}

.btn-primary:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  opacity: 1;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  background: transparent;
  color: #ffffff;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 100px;
  text-decoration: none;
  transition: background 0.2s;
  min-height: 48px;
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  opacity: 1;
}

/* Hero Floating Card */
.hero-floating-card {
  position: absolute;
  right: 3rem;
  bottom: 8rem;
  z-index: 4;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 120px;
}

.fc-label {
  font-size: 0.75rem;
  color: var(--color-ink-light);
  letter-spacing: 0.06em;
}

.fc-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-ink);
}

/* Hero Scroll Hint */
.hero-scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
}

.scroll-arrow {
  display: block;
  width: 24px;
  height: 24px;
  border-right: 2px solid rgba(255,255,255,0.6);
  border-bottom: 2px solid rgba(255,255,255,0.6);
  transform: rotate(45deg);
  animation: scrollBounce 1.6s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: rotate(45deg) translateY(0); opacity: 0.7; }
  50% { transform: rotate(45deg) translateY(6px); opacity: 1; }
}

/* ===== Main Content ===== */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem 2rem;
}

/* ===== Content Section ===== */
.content-section {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3rem;
  align-items: start;
  position: relative;
}

/* ===== Aside ===== */
.content-aside {
  position: sticky;
  top: 2rem;
  z-index: 2;
}

.aside-nav-sticky {
  background: var(--color-sub);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 1.5rem 1.2rem;
  box-shadow: var(--shadow-sm);
}

.aside-nav-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-ink-light);
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--color-border);
}

.aside-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.aside-nav-list li {
  margin-bottom: 0.1rem;
}

.aside-nav-list li a {
  display: block;
  padding: 0.45rem 0.6rem;
  font-size: 0.82rem;
  color: var(--color-ink);
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.15s;
  line-height: 1.4;
  min-height: 36px;
  display: flex;
  align-items: center;
}

.aside-nav-list li a:hover {
  background: rgba(31,31,31,0.06);
  opacity: 1;
}

/* ===== Content Body ===== */
.content-body {
  position: relative;
  z-index: 1;
}

/* ===== Content Figure ===== */
.content-figure {
  margin-bottom: 2.5rem;
  padding: 2rem 2.5rem;
  background: var(--color-sub);
}

.figure-caption {
  display: block;
}

.section-heading {
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--color-ink-light);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 0;
}

/* ===== Prose Content ===== */
.prose-content {
  position: relative;
}

.prose-content > * {
  margin-bottom: 1.5rem;
}

/* Sections within prose */
.prose-content section {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--color-border);
  position: relative;
  z-index: 1;
}

.prose-content section:last-child {
  border-bottom: none;
}

.prose-content section h2 {
  margin-bottom: 0.6rem;
  padding-bottom: 0.5rem;
  position: relative;
}

.prose-content section h2::after {
  content: '';
  display: block;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--color-ink);
  border-radius: 2px;
}

.prose-content section h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
}

.prose-content section p {
  margin-bottom: 1rem;
}

.prose-content section ul,
.prose-content section ol {
  margin-bottom: 1rem;
}

/* ===== Reveal Animation ===== */
.reveal-section {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Footer ===== */
.site-footer {
  background: var(--color-ink);
  color: var(--color-main);
  margin-top: 4rem;
}

.footer-brand-section {
  padding: 3rem 2rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand-super {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.5rem, 8vw, 6rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(255,255,255,0.92);
  line-height: 1;
}

.footer-copy-section {
  padding: 1.2rem 2rem;
  text-align: center;
}

.footer-copy {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.04em;
  margin-bottom: 0;
  line-height: 1.6;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .content-section {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .content-aside {
    position: static;
  }

  .aside-nav-sticky {
    display: flex;
    flex-direction: column;
  }

  .hero-floating-card {
    display: none;
  }

  .bottom-nav-left,
  .bottom-nav-right {
    display: none;
  }

  .nav-details {
    display: block;
  }

  .bottom-nav-inner {
    justify-content: space-between;
    padding: 0 1rem;
  }

  .bottom-nav-brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (max-width: 600px) {
  .main-content {
    padding: 2.5rem 1rem 1.5rem;
  }

  .hero-content {
    padding: 0 1.2rem 5.5rem;
  }

  .hero-h1 {
    font-size: 1.9rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-primary,
  .btn-ghost {
    width: 100%;
    justify-content: center;
  }

  .content-figure {
    padding: 1.5rem;
  }

  .footer-brand-super {
    font-size: 2.5rem;
  }

  section[id] {
    scroll-margin-top: 80px;
  }
}

/* ===== Prefers Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal-section {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .scroll-arrow {
    animation: none;
  }

  .layer-card:hover {
    transform: none;
  }

  .btn-primary:hover {
    transform: none;
  }
}
