/* Teresa Castagnino — The Architecture of Perception */

:root {
  --black: #1a1a1a;
  --dark: #0d0d0d;
  --white: #fafaf8;
  --off-white: #f5f5f2;
  --cream: #f0ede6;
  --mid: #777;
  --light: #aaa;
  --rule: #e0ddd8;
  --accent: #c4a265;
  --accent-dark: #8b7355;
  --accent-light: rgba(196, 162, 101, 0.10);
  --accent-glow: rgba(196, 162, 101, 0.25);
  --font-serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-w: 720px;
  --wide-w: 1080px;
  --gutter: 1.5rem;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-serif);
  color: var(--black);
  background: var(--white);
  line-height: 2;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-dark);
}

/* ── Nav ─────────────────────────────────────────── */

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 13, 13, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(196, 162, 101, 0.15);
  padding: 0.75rem var(--gutter);
}

.nav-inner {
  max-width: var(--wide-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--accent);
  margin: 4px 0;
  transition: transform 0.3s;
}

/* ── Layout ──────────────────────────────────────── */

.content-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.page-content {
  padding: 4rem 0 6rem;
}

/* ── Typography ──────────────────────────────────── */

h1 {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

h2 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.3;
  margin-top: 3rem;
  margin-bottom: 1rem;
}

h3 {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1.5rem;
}

.subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--mid);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.author-label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

/* ── Hero (Dark) ─────────────────────────────────── */

.hero {
  background: var(--dark);
  background-image: url('hero-bg.jpg');
  background-size: cover;
  background-position: left center;
  color: #fff;
  padding: 0;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(13, 13, 13, 0.3) 0%,
    rgba(13, 13, 13, 0.7) 40%,
    rgba(13, 13, 13, 0.92) 70%,
    rgba(13, 13, 13, 0.98) 100%
  );
  z-index: 1;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--wide-w);
  margin: 0 auto;
  padding: 6rem var(--gutter);
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
  align-items: center;
}

.hero-text {
  max-width: 560px;
}

.hero h1 {
  font-size: 3.2rem;
  color: #fff;
  margin-bottom: 0.75rem;
  line-height: 1.15;
}

.hero .subtitle {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.6);
  max-width: 480px;
}

.hero .author-label {
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.hero-rule {
  width: 60px;
  height: 2px;
  background: var(--accent);
  margin: 1.5rem 0;
  border: none;
}

.hero-intro {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.5);
  max-width: 480px;
  line-height: 1.8;
}

.hero-cover {
  display: flex;
  justify-content: center;
}

.hero-cover img {
  width: 100%;
  max-width: 260px;
  height: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(196, 162, 101, 0.08);
  border: 1px solid rgba(196, 162, 101, 0.15);
}

/* ── Accent band ─────────────────────────────────── */

.accent-band {
  background: var(--cream);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 3rem 0;
}

.accent-band-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ── Chapter card ────────────────────────────────── */

.chapter-list {
  margin-top: 1rem;
}

.chapter-card {
  display: block;
  padding: 2rem 2.5rem;
  border: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
  margin-bottom: 1.5rem;
  position: relative;
}

.chapter-card:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 4px 20px rgba(196, 162, 101, 0.12);
}

.chapter-card::after {
  content: "\2192";
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.3s;
}

.chapter-card:hover::after {
  opacity: 1;
}

.chapter-num {
  font-family: var(--font-sans);
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.chapter-card-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.chapter-card-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--mid);
}

.chapter-coming {
  opacity: 0.4;
  pointer-events: none;
}

/* ── Chapter reading page ────────────────────────── */

.chapter-hero {
  background: var(--dark);
  color: #fff;
  padding: 5rem 0 4rem;
  text-align: center;
  position: relative;
}

.chapter-hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--white));
}

.chapter-hero .chapter-num {
  color: var(--accent);
  margin-bottom: 1rem;
}

.chapter-hero h1 {
  color: #fff;
  font-size: 2.8rem;
  max-width: 600px;
  margin: 0 auto 0.5rem;
}

.chapter-hero .subtitle {
  color: rgba(255, 255, 255, 0.5);
  max-width: 500px;
  margin: 0 auto 1.5rem;
}

.chapter-hero .author-label {
  color: var(--accent);
}

.chapter-body {
  padding: 2rem 0 4rem;
}

.chapter-body p {
  font-size: 1rem;
  text-align: left;
}

.chapter-body ul {
  list-style: none;
  padding: 0;
  margin-bottom: 1.5rem;
}

.chapter-body ul li {
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.5rem;
}

.chapter-body ul li::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  left: 0;
  top: 0.85em;
}

/* ── Language divider ────────────────────────────── */

.lang-divider {
  text-align: center;
  margin: 4rem 0;
  position: relative;
}

.lang-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--rule);
}

.lang-divider span {
  position: relative;
  background: var(--white);
  padding: 0 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ── Pull quote ──────────────────────────────────── */

.pull-quote {
  border-left: 3px solid var(--accent);
  padding: 1.5rem 0 1.5rem 1.5rem;
  margin: 2.5rem 0;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--black);
  line-height: 1.8;
  background: linear-gradient(to right, var(--accent-light), transparent);
}

/* ── Signature block ─────────────────────────────── */

.signature {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.signature-name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
}

.signature-role {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid);
  margin-top: 0.25rem;
}

/* ── Downloads ───────────────────────────────────── */

.download-section {
  margin: 3rem 0;
  padding: 2.5rem;
  background: var(--dark);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.download-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
}

.download-section h3 {
  margin-top: 0;
  color: var(--accent);
}

.download-section p {
  color: rgba(255, 255, 255, 0.5);
}

.download-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.download-btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.75rem 2rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}

.download-btn:hover {
  background: var(--accent);
  color: var(--dark);
  box-shadow: 0 0 20px rgba(196, 162, 101, 0.3);
}

/* ── Key concept cards ───────────────────────────── */

.concept-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.concept-card {
  padding: 1.5rem;
  border: 1px solid var(--rule);
  text-align: center;
}

.concept-card .concept-icon {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
  display: block;
}

.concept-card h4 {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 0.5rem;
}

.concept-card p {
  font-size: 0.85rem;
  color: var(--mid);
  line-height: 1.6;
  margin-bottom: 0;
}

/* ── About page ──────────────────────────────────── */

.about-content {
  max-width: 600px;
}

.about-content p {
  font-size: 1rem;
}

/* ── Footer ──────────────────────────────────────── */

footer {
  background: var(--dark);
  color: rgba(255, 255, 255, 0.3);
  padding: 2rem var(--gutter) 3rem;
  font-family: var(--font-sans);
  font-size: 0.67rem;
  letter-spacing: 0.04em;
  text-align: center;
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer small {
  display: block;
  margin-top: 0.5rem;
}

footer small a {
  color: rgba(255, 255, 255, 0.35);
  transition: color 0.2s;
}

footer small a:hover {
  color: var(--accent);
}

/* ── Mobile ──────────────────────────────────────── */

@media (max-width: 768px) {
  html {
    font-size: 16px;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(13, 13, 13, 0.97);
    backdrop-filter: blur(16px);
    padding: 1rem var(--gutter);
    border-bottom: 1px solid rgba(196, 162, 101, 0.15);
    gap: 0.75rem;
  }

  .nav-links.open {
    display: flex;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    padding: 3rem var(--gutter);
    text-align: center;
  }

  .hero-text {
    max-width: 100%;
  }

  .hero h1 {
    font-size: clamp(2rem, 8vw, 3.2rem);
  }

  .hero-cover {
    order: -1;
  }

  .hero-cover img {
    max-width: 180px;
  }

  .hero-rule {
    margin: 1.5rem auto;
  }

  .hero .subtitle,
  .hero-intro {
    max-width: 100%;
  }

  .chapter-hero h1 {
    font-size: clamp(1.8rem, 7vw, 2.8rem);
    padding: 0 1rem;
  }

  .concept-grid {
    grid-template-columns: 1fr;
  }

  .download-links {
    flex-direction: column;
  }

  .chapter-card::after {
    display: none;
  }
}
