@import url('https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Merriweather:wght@300;400;700&display=swap');

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

:root {
  --c-white: #ffffff;
  --c-light: #f5f5f5;
  --c-dark: #1f1f1f;
  --c-mid: #2e2e2e;
  --c-muted: #6b6b6b;
  --c-border: rgba(255,255,255,0.12);
  --c-accent: #d4a855;
  --c-accent2: #8b3a5a;
  --nav-h: 60px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.35);
  --shadow-md: 0 6px 20px rgba(0,0,0,0.45);
  --shadow-lg: 0 14px 40px rgba(0,0,0,0.55);
  --shadow-xl: 0 28px 60px rgba(0,0,0,0.65);
  --radius-card: 18px;
  --font-display: 'Abril Fatface', Georgia, serif;
  --font-body: 'Merriweather', 'Noto Serif SC', serif;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background: var(--c-dark);
  color: var(--c-light);
}

body {
  font-family: var(--font-body);
  line-height: 1.75;
  background: var(--c-dark);
  color: var(--c-light);
  overflow-x: hidden;
  padding-bottom: var(--nav-h);
}

/* ── Screen-reader only ── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ── Site Wrapper ── */
.site-wrapper {
  position: relative;
  z-index: 1;
}

/* ══ BOTTOM NAV ══ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(31,31,31,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--c-border);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
  height: var(--nav-h);
}

.bottom-nav-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 12px;
  gap: 8px;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--c-accent2);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.nav-brand:hover { transform: scale(1.08); box-shadow: var(--shadow-md); }

.nav-logo-img { width: 28px; height: 28px; object-fit: contain; border-radius: 6px; }
.nav-logo-text {
  font-family: var(--font-display);
  color: var(--c-white);
  font-size: 14px;
  line-height: 1;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0;
  margin: 0;
}
.nav-list::-webkit-scrollbar { display: none; }

.nav-list li { flex-shrink: 0; }

.nav-link {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 10px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: rgba(245,245,245,0.75);
  text-decoration: none;
  border-radius: 8px;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}
.nav-link:hover, .nav-link:focus-visible {
  background: rgba(212,168,85,0.15);
  color: var(--c-accent);
  outline: none;
}

.nav-search {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.search-input {
  width: 120px;
  height: 34px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  color: var(--c-light);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 0 10px;
  outline: none;
  transition: border-color 0.2s, width 0.3s ease;
}
.search-input::placeholder { color: var(--c-muted); }
.search-input:focus {
  border-color: var(--c-accent);
  width: 160px;
}

/* ══ HERO ══ */
.hero-section {
  position: relative;
  min-height: 45vh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  padding: 40px 32px 48px;
  background: linear-gradient(135deg, var(--c-dark) 0%, #2a1a24 50%, #1f1f1f 100%);
}

.hero-slash {
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 56px;
  background: var(--c-dark);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
  z-index: 3;
}

.hero-collage {
  position: relative;
  width: 100%;
  max-width: 640px;
  min-height: 240px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.hero-card {
  position: absolute;
  border-radius: var(--radius-card);
  overflow: hidden;
}

.hero-card-back {
  width: 55%;
  min-height: 160px;
  top: 0; left: 0;
  background: linear-gradient(135deg, var(--c-accent2) 0%, #3d1a2a 100%);
  transform: translateY(-12px) rotate(-3deg) translateZ(0);
  z-index: 1;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(212,168,85,0.2);
}

.hero-card-front {
  width: 72%;
  min-height: 200px;
  bottom: 0; right: 0;
  background: rgba(31,31,31,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateZ(0);
  z-index: 2;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255,255,255,0.1);
}

.hero-card-inner {
  padding: 24px 28px;
  text-align: right;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-accent);
  background: rgba(212,168,85,0.12);
  padding: 4px 10px;
  border-radius: 4px;
  align-self: flex-end;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 4vw, 40px);
  line-height: 1.15;
  color: var(--c-white);
  text-align: right;
  letter-spacing: 0.01em;
}

.hero-sub {
  font-size: 13px;
  font-weight: 300;
  line-height: 1.6;
  color: rgba(245,245,245,0.65);
  text-align: right;
  max-width: 320px;
  align-self: flex-end;
}

/* ══ MAIN CONTENT ══ */
.content-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.content-section {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  position: relative;
}

/* ── Aside (left side) ── */
.content-aside {
  flex-shrink: 0;
  width: 220px;
  position: sticky;
  top: 20px;
  z-index: 2;
}

.aside-inner {
  background: rgba(46,46,46,0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-card);
  padding: 20px 18px;
  box-shadow: var(--shadow-md);
  transform: translateZ(0);
}

.aside-heading {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--c-accent);
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}

.aside-inner hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin-bottom: 14px;
}

.aside-toc {
  list-style: decimal;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.aside-toc li a {
  font-size: 13px;
  color: rgba(245,245,245,0.65);
  text-decoration: none;
  line-height: 1.4;
  transition: color 0.15s;
  display: block;
}
.aside-toc li a:hover { color: var(--c-accent); }

/* ── Figure / Content Area ── */
.content-figure {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.page-content-wrap {
  background: rgba(40,40,40,0.6);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-card);
  padding: 36px 40px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ── Content typography ── */
.page-content-wrap h2 {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 28px);
  color: var(--c-white);
  margin: 2em 0 0.3em;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.page-content-wrap h2 + hr {
  border: none;
  border-top: 2px solid var(--c-accent2);
  margin-bottom: 1em;
  width: 60px;
}

.page-content-wrap h3 {
  font-family: var(--font-display);
  font-size: clamp(17px, 2.5vw, 22px);
  color: var(--c-accent);
  margin: 1.6em 0 0.4em;
  letter-spacing: 0.01em;
}

.page-content-wrap h3 + hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin-bottom: 0.8em;
}

.page-content-wrap p {
  font-size: 16px;
  line-height: 1.85;
  color: rgba(245,245,245,0.85);
  margin-bottom: 1.1em;
}

.page-content-wrap ul,
.page-content-wrap ol {
  padding-left: 1.5em;
  margin-bottom: 1.1em;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.page-content-wrap li {
  font-size: 16px;
  line-height: 1.7;
  color: rgba(245,245,245,0.8);
}

.page-content-wrap a {
  color: var(--c-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}
.page-content-wrap a:hover { color: var(--c-white); }

.page-content-wrap strong {
  color: var(--c-white);
  font-weight: 700;
}

.page-content-wrap div {
  scroll-margin-top: calc(var(--nav-h) + 20px);
  margin-bottom: 2.4em;
}

.page-content-wrap img {
  max-width: 100%;
  border-radius: 12px;
  margin: 1em 0;
  box-shadow: var(--shadow-md);
}

.page-content-wrap table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 15px;
}
.page-content-wrap th,
.page-content-wrap td {
  padding: 10px 14px;
  border: 1px solid var(--c-border);
  text-align: left;
  line-height: 1.5;
}
.page-content-wrap th {
  background: rgba(212,168,85,0.12);
  color: var(--c-accent);
  font-weight: 700;
}

.page-content-wrap blockquote {
  border-left: 3px solid var(--c-accent2);
  margin: 1.2em 0;
  padding: 10px 18px;
  background: rgba(139,58,90,0.1);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: rgba(245,245,245,0.7);
}

/* ══ FOOTER ══ */
.site-footer {
  background: #161616;
  border-top: 1px solid var(--c-border);
  margin-bottom: var(--nav-h);
}

.site-footer > div {
  padding: 36px 32px;
  border-bottom: 1px solid var(--c-border);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Four-column layout on desktop */
@media (min-width: 900px) {
  .site-footer {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    gap: 0;
  }
  .site-footer > div {
    border-bottom: none;
    border-right: 1px solid var(--c-border);
    max-width: none;
    margin: 0;
  }
  .site-footer > div:last-child {
    border-right: none;
  }
}

.footer-section-title {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--c-accent);
  margin-bottom: 10px;
}

.footer-contact hr,
.footer-nav-links hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin-bottom: 16px;
}

.footer-email {
  font-size: 14px;
  color: rgba(245,245,245,0.65);
  margin-bottom: 16px;
}
.footer-email a { color: var(--c-accent); text-decoration: none; }
.footer-email a:hover { text-decoration: underline; }

.subscribe-form { display: flex; flex-direction: column; gap: 8px; }
.subscribe-label { font-size: 13px; color: rgba(245,245,245,0.55); }

.subscribe-row { display: flex; gap: 8px; }

.subscribe-input {
  flex: 1;
  height: 38px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  color: var(--c-light);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 0 10px;
  outline: none;
  transition: border-color 0.2s;
}
.subscribe-input:focus { border-color: var(--c-accent); }
.subscribe-input::placeholder { color: var(--c-muted); }

.subscribe-btn {
  height: 38px;
  padding: 0 16px;
  background: var(--c-accent2);
  color: var(--c-white);
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
  min-width: 60px;
}
.subscribe-btn:hover { background: #a0476d; transform: translateY(-1px); }

.footer-logo {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--c-white);
  display: block;
  margin-bottom: 10px;
}
.footer-desc {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(245,245,245,0.5);
}

.footer-nav-title {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--c-accent);
  margin-bottom: 10px;
}
.footer-nav-list {
  list-style: decimal;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer-nav-list li a {
  font-size: 13px;
  color: rgba(245,245,245,0.6);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-nav-list li a:hover { color: var(--c-accent); }

.footer-copyright {
  font-size: 13px;
  color: rgba(245,245,245,0.5);
  margin-bottom: 6px;
}
.footer-notice {
  font-size: 12px;
  color: rgba(245,245,245,0.35);
  line-height: 1.5;
}

/* ══ SCROLL REVEAL ══ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ══ HR in aside-inner (h2+hr contract) ══ */
hr {
  border: none;
  border-top: 1px solid var(--c-border);
}

/* ══ Scroll margin for nav sections ══ */
div[id] {
  scroll-margin-top: calc(var(--nav-h) + 16px);
}

/* ══ RESPONSIVE ══ */
@media (max-width: 768px) {
  .content-section {
    flex-direction: column;
  }

  .content-aside {
    width: 100%;
    position: static;
    order: -1;
  }

  .aside-toc {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 12px;
    padding-left: 0;
    list-style: none;
  }

  .hero-section {
    padding: 32px 20px 52px;
    min-height: 40vh;
    justify-content: center;
  }

  .hero-collage {
    max-width: 100%;
    min-height: 200px;
  }

  .hero-card-back {
    width: 60%;
    min-height: 120px;
  }

  .hero-card-front {
    width: 80%;
    min-height: 160px;
  }

  .hero-title { text-align: right; }

  .page-content-wrap {
    padding: 24px 20px;
  }

  .content-main {
    padding: 32px 16px 48px;
  }

  .nav-list {
    gap: 0;
  }

  .nav-link {
    font-size: 12px;
    padding: 0 7px;
  }

  .search-input {
    width: 80px;
  }
  .search-input:focus { width: 110px; }

  .site-footer > div {
    padding: 28px 20px;
  }

  .subscribe-row { flex-direction: column; }
  .subscribe-btn { width: 100%; }
}

@media (max-width: 480px) {
  .hero-card-inner { padding: 16px 18px; }
  .hero-sub { display: none; }
  .search-input { display: none; }
}

/* ══ Reduced motion ══ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  * { transition: none !important; animation: none !important; }
}

button[aria-expanded]{min-width:44px;min-height:44px}
