@import url(font-awesome.min.css);

/* ============================================================
   Tokens — light default
   ============================================================ */
:root {
  --bg:         #ffffff;
  --bg-alt:     #f7f7f5;
  --border:     #e8e8e5;
  --text:       #0d0d0d;
  --text-muted: #5a5a57;
  --text-dim:   #ababab;

  --f-head: 'Space Grotesk', system-ui, sans-serif;
  --f-body: 'Inter', system-ui, sans-serif;

  --accent:  #a0714f;

  --nav-h:  3.5rem;
  --pad-x:  clamp(1.5rem, 5vw, 4rem);
  --ease:   0.22s ease;
}

[data-theme="dark"] {
  --bg:         #0d0d0d;
  --bg-alt:     #141414;
  --border:     #262626;
  --text:       #f0f0ee;
  --text-muted: #888884;
  --text-dim:   #444;
  --accent:     #c49a72;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-in { opacity: 1 !important; transform: none !important; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.65;
  transition: background var(--ease), color var(--ease);
  overflow-x: hidden;
}

img { display: block; width: 100%; object-fit: cover; }
ul  { list-style: none; }
a   { color: inherit; text-decoration: none; }

/* ============================================================
   Scroll progress
   ============================================================ */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(to right, #ffffff, #c9a84c);
  z-index: 300;
  transition: width 0.1s linear;
}

/* ============================================================
   Navigation
   ============================================================ */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 var(--pad-x);
  gap: 0.5rem;
  z-index: 200;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background var(--ease), border-color var(--ease);
}

.nav-logo {
  font-family: var(--f-head);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-right: auto;
  transition: opacity var(--ease);
}
.nav-logo:hover { opacity: 0.5; }

.nav-links {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}

.nav-links a {
  font-size: 0.75rem;
  font-weight: 400;
  font-family: var(--f-head);
  color: var(--text-muted);
  letter-spacing: 0.01em;
  transition: color var(--ease);
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }

.theme-toggle {
  font-family: var(--f-head);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem 0.65rem;
  border-radius: 2px;
  margin-left: 1.5rem;
  transition: color var(--ease), border-color var(--ease);
}
.theme-toggle:hover { color: var(--text); border-color: var(--text); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none; border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: 0.75rem;
}
.nav-toggle span {
  display: block;
  width: 20px; height: 1.5px;
  background: var(--text);
  transition: transform var(--ease), opacity var(--ease);
}

/* ============================================================
   Hero
   ============================================================ */
.section--hero {
  position: relative;
  min-height: 100vh;
  padding-top: var(--nav-h);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.65) 100%);
  z-index: 1;
}
.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 30% center;
  transition: transform 0.8s ease;
}
.section--hero:hover .hero-image img { transform: scale(1.03); }

.hero-inner {
  position: relative;
  z-index: 2;
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(3rem, 6vw, 5rem) var(--pad-x);
}

.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.hero-meta span {
  font-size: 0.75rem;
  font-family: var(--f-head);
  font-weight: 400;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.04em;
}

.hero-inner h1 {
  font-family: var(--f-head);
  font-size: clamp(2.75rem, 6vw, 6rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.04em;
  align-self: flex-start;
  background: linear-gradient(to right, #ffffff, #c9a84c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.hero-tag {
  font-family: var(--f-head);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

.scroll-hint {
  font-size: 0.75rem;
  font-family: var(--f-head);
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  transition: color var(--ease);
}
.scroll-hint:hover { color: #fff; }

/* ============================================================
   Chapter sections
   ============================================================ */
.section { background: var(--bg); }
.section--alt { background: var(--bg-alt); }

.section--chapter {
  border-bottom: 1px solid var(--border);
}

.chapter-header {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: clamp(2.5rem, 5vw, 4rem) var(--pad-x) clamp(1.5rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--border);
}

.chapter-num {
  font-family: var(--f-head);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  flex-shrink: 0;
}

.chapter-header h2 {
  font-family: var(--f-head);
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}

.chapter-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.chapter-body--reverse .chapter-image { order: 2; }
.chapter-body--reverse .chapter-text  { order: 1; }

.chapter-image {
  overflow: hidden;
  min-height: clamp(280px, 40vw, 520px);
  border-right: 1px solid var(--border);
}
.chapter-body--reverse .chapter-image {
  border-right: none;
  border-left: 1px solid var(--border);
}
.chapter-image img {
  height: 100%;
  transition: transform 0.7s ease;
}
.section--chapter:hover .chapter-image img { transform: scale(1.03); }

.chapter-text {
  padding: clamp(2.5rem, 5vw, 4rem) var(--pad-x);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.75rem;
}

.chapter-lead {
  font-family: var(--f-head);
  font-size: clamp(1.2rem, 2.5vw, 1.75rem) !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text) !important;
}

.chapter-text p { color: var(--text-muted); max-width: 38ch; }

blockquote {
  font-size: 1.05rem;
  font-style: italic;
  font-family: var(--f-body);
  color: var(--text);
  line-height: 1.6;
  padding-left: 1.25rem;
  border-left: 2px solid var(--border);
}

blockquote cite {
  display: block;
  font-style: normal;
  font-family: var(--f-head);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 0.75rem;
}

.embed-wrap {
  border: 1px solid var(--border);
  overflow: hidden;
}

.gear-list { display: flex; flex-direction: column; }
.gear-list li {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--f-head);
  font-weight: 400;
}
.gear-list li:first-child { border-top: 1px solid var(--border); }

.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--f-head);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  width: fit-content;
  border-bottom: 1.5px solid var(--text);
  padding-bottom: 2px;
  transition: gap var(--ease), opacity var(--ease);
}
.cta-link:hover { gap: 0.8rem; opacity: 0.6; }

.mono {
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: var(--text-muted);
}

/* ============================================================
   Background-image sections
   ============================================================ */
.section--bgimg .chapter-body {
  display: block;
  position: relative;
  overflow: hidden;
  min-height: clamp(420px, 55vw, 680px);
}

.section--bgimg .chapter-image {
  position: absolute;
  inset: 0;
  min-height: unset;
  border: none !important;
}

.section--bgimg .chapter-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.1) 0%,
    rgba(0,0,0,0.72) 100%
  );
  z-index: 1;
}

.section--bgimg .chapter-image img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  transform: none;
  transition: transform 0.8s ease;
}
.section--bgimg:hover .chapter-image img { transform: scale(1.03); }

.section--bgimg .chapter-text {
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 2;
  width: 100%;
  max-width: 680px;
  padding: clamp(2.5rem, 5vw, 4rem) var(--pad-x);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1.25rem;
}

#music .chapter-text {
  max-width: 100%;
  align-items: center;
  text-align: center;
}

#music blockquote {
  text-align: left;
  max-width: 520px;
}

#music .embed-wrap {
  width: 100%;
  max-width: 520px;
}

/* Force light text on dark overlay */
.section--bgimg .chapter-lead { color: #fff !important; }
.section--bgimg .chapter-text p { color: rgba(255,255,255,0.75) !important; }
.section--bgimg blockquote { color: rgba(255,255,255,0.9); border-left-color: rgba(255,255,255,0.25); }
.section--bgimg blockquote cite { color: rgba(255,255,255,0.45); }
.section--bgimg .gear-list li { color: rgba(255,255,255,0.7); border-color: rgba(255,255,255,0.12); }
.section--bgimg .cta-link { color: #fff; border-bottom-color: rgba(255,255,255,0.5); }
.section--bgimg .embed-wrap { border-color: rgba(255,255,255,0.15); }
.section--bgimg .mono { color: rgba(255,255,255,0.5); }

/* ============================================================
   Section navigation
   ============================================================ */
.section-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem var(--pad-x);
  border-top: 1px solid var(--border);
}

.snav-link {
  font-family: var(--f-head);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  transition: color var(--ease);
}
.snav-link:hover { color: var(--text); }

/* ============================================================
   Technical Toolkit
   ============================================================ */
.toolkit {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}

.toolkit-intro,
.toolkit-cards {
  background: var(--bg-alt);
}

.toolkit-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 0 2rem;
  padding: clamp(3rem, 6vw, 5rem) var(--pad-x) clamp(2rem, 4vw, 3.5rem);
  border-bottom: 1px solid var(--border);
}

.toolkit-eyebrow {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.toolkit-rule {
  display: block;
  width: 80px;
  height: 1px;
  background: var(--border);
  flex-shrink: 0;
}

.toolkit-label {
  font-family: var(--f-head);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.toolkit-headline {
  font-family: var(--f-head);
  font-size: clamp(2.25rem, 5.5vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.0;
  color: var(--text);
}

.toolkit-headline em {
  font-style: italic;
  font-weight: 300;
  background: linear-gradient(to right, #f0e4c8, #c9a84c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.toolkit-desc {
  font-family: var(--f-head);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.8;
  color: var(--text-dim);
  text-align: right;
}

/* Cards */
.toolkit-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  padding: clamp(2rem, 4vw, 3.5rem) var(--pad-x) clamp(3rem, 6vw, 5rem);
}

.toolkit-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  background: var(--bg);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
[data-theme="dark"] .toolkit-card {
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.toolkit-card-num {
  font-family: var(--f-head);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #c9a84c;
}

.toolkit-card h4 {
  font-family: var(--f-head);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
}

.toolkit-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tag {
  font-family: var(--f-head);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.32rem 0.75rem;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .toolkit-intro {
    grid-template-columns: 1fr;
  }
  .toolkit-desc { text-align: left; }
  .toolkit-cards {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Contact
   ============================================================ */
.section--contact {
  padding: clamp(5rem, 10vw, 9rem) var(--pad-x);
  border-bottom: 1px solid var(--border);
}

.contact-inner {
  max-width: 700px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-inner h2 {
  font-family: var(--f-head);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.9;
  color: var(--text);
}

.contact-tagline {
  font-family: var(--f-body);
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 32ch;
  line-height: 1.5;
}

.contact-email {
  font-family: var(--f-head);
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  font-weight: 400;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  width: fit-content;
  transition: color var(--ease), border-color var(--ease);
}
.contact-email:hover { color: var(--text); border-color: var(--text); }

.social-links { display: flex; gap: 1.5rem; }
.social-links a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--f-head);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--ease);
}
.social-links a:hover { color: var(--text); }

/* ============================================================
   Scroll-in animations
   ============================================================ */
.fade-in {
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.fade-in.in-view { opacity: 1; transform: none; }

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    flex-direction: column;
    background: var(--bg);
    padding: 1.5rem var(--pad-x);
    gap: 1.2rem;
    border-bottom: 1px solid var(--border);
    z-index: 190;
  }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: 0.9rem; }
  .nav-toggle { display: flex; }

  .hero-inner { min-height: calc(100vh - var(--nav-h)); }
  .hero-image { height: auto; min-height: unset; }

  .chapter-body,
  .chapter-body--reverse {
    display: flex;
    flex-direction: column;
  }
  .chapter-body--reverse .chapter-image { order: 1; }
  .chapter-body--reverse .chapter-text  { order: 2; }
  .chapter-image {
    border-right: none !important;
    border-left: none !important;
    border-bottom: 1px solid var(--border);
    min-height: 52vw;
  }
  .chapter-text { padding: 2rem var(--pad-x); }
}
