/* ============================================================
   VARIABLES & RESET
   ============================================================ */

:root {
  --bg: #f5f0e7;
  --ink: #1a1714;
  --forest: #1d4b38;
  --forest-mid: #2d6b51;
  --amber: #c4772a;
  --mist: #ebe6dc;
  --rule: #d5cfc4;
  --nav-w: 228px;

  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

/* Skip link for keyboard / screen-reader users */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--forest);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 0 0 4px 4px;
  text-decoration: none;
  z-index: 9999;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* Global focus style */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 2px;
}

a {
  color: inherit;
}
img,
svg {
  display: block;
  max-width: 100%;
}

/* ============================================================
   SIDEBAR NAVIGATION
   ============================================================ */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--nav-w);
  background: var(--forest);
  z-index: 100;
  display: flex;
  flex-direction: column;

  /* Subtle inner-right shadow */
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

.nav-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 2.75rem 1.75rem 2rem;
}

.nav-brand {
  margin-bottom: 3rem;
}

.nav-title {
  display: block;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}

.nav-subtitle {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.nav-links {
  list-style: none;
  flex: 1;
}
.nav-links li {
  margin-bottom: 0.1rem;
}

.nav-link {
  display: block;
  padding: 0.45rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  border-radius: 3px;
  position: relative;
  transition:
    color 0.2s,
    background 0.2s;
}

.nav-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 0;
  background: var(--amber);
  border-radius: 2px;
  transition: height 0.25s var(--ease-out);
}

.nav-link:hover {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.07);
}
.nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.nav-link.active::before {
  height: 55%;
}

.nav-credit {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.48);
}

.nav-credit a {
  color: rgba(255, 255, 255, 0.62);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-credit a:hover {
  color: rgba(255, 255, 255, 0.9);
}

/* ============================================================
   MOBILE HEADER
   ============================================================ */

.mobile-header {
  display: none;
  position: fixed;
  inset: 0 0 auto 0;
  height: 54px;
  background: var(--forest);
  z-index: 200;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
}

.mobile-brand {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
}

.mobile-menu-btn {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 4px;
}

.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 2px;
  transition:
    transform 0.2s,
    opacity 0.2s;
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--forest);
  z-index: 300;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.mobile-overlay.open {
  display: flex;
}

.mobile-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.3rem;
  cursor: pointer;
  transition: color 0.2s;
}
.mobile-close:hover {
  color: rgba(255, 255, 255, 0.85);
}

.mobile-nav-links {
  list-style: none;
  text-align: center;
}

.mobile-nav-link {
  display: block;
  padding: 0.65rem 1.5rem;
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  transition: color 0.2s;
}
.mobile-nav-link:hover {
  color: #fff;
}

/* ============================================================
   MAIN & LAYOUT
   ============================================================ */

.main {
  margin-left: var(--nav-w);
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7rem 5.5rem 5rem;
  position: relative;
  overflow: hidden;
}

/* Atmospheric background glow */
.hero::before {
  content: "";
  position: absolute;
  top: -15%;
  right: -8%;
  width: 55%;
  height: 75%;
  background: radial-gradient(
    ellipse at 70% 30%,
    rgba(29, 75, 56, 0.1) 0%,
    transparent 65%
  );
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: 8%;
  left: 8%;
  width: 35%;
  height: 40%;
  background: radial-gradient(
    ellipse at 30% 70%,
    rgba(196, 119, 42, 0.07) 0%,
    transparent 60%
  );
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1.4rem;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(3.4rem, 7.5vw, 6.8rem);
  font-weight: 500;
  line-height: 1.01;
  letter-spacing: -0.01em;
  color: var(--forest);
  margin-bottom: 2.25rem;
  max-width: 16ch;
}

.hero-sub {
  font-size: clamp(0.98rem, 1.5vw, 1.1rem);
  font-weight: 400;
  line-height: 1.78;
  color: rgba(26, 23, 20, 0.78);
  max-width: 54ch;
}

.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 5.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  color: rgba(26, 23, 20, 0.48);
}

/* Hero load animations */
.hero-anim {
  opacity: 0;
  transform: translateY(20px);
  animation: heroIn 0.9s var(--ease-out) forwards;
}
.delay-1 {
  animation-delay: 0.18s;
}
.delay-2 {
  animation-delay: 0.34s;
}
.delay-3 {
  animation-delay: 0.55s;
}

@keyframes heroIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   CONTENT SECTIONS
   ============================================================ */

.section {
  padding: 6.5rem 5.5rem;
  position: relative;
  overflow: hidden;
}

.section-alt {
  background: var(--mist);
}

/* Oversized background section number */
.section::before {
  content: attr(data-num);
  position: absolute;
  top: 1.5rem;
  right: 3rem;
  font-family: var(--serif);
  font-size: 13rem;
  font-weight: 600;
  line-height: 1;
  color: rgba(29, 75, 56, 0.045);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.section-inner {
  max-width: 820px;
  position: relative;
  z-index: 1;
}

.section-head {
  margin-bottom: 3.5rem;
}

.section-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.9rem;
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4.5vw, 3.75rem);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.01em;
  color: var(--forest);
}

/* ============================================================
   WHY IT MATTERS
   ============================================================ */

.lead {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  font-weight: 400;
  line-height: 1.82;
  color: var(--ink);
  max-width: 68ch;
}

/* ============================================================
   MENTAL MODELS
   ============================================================ */

.models-grid {
  display: grid;
  gap: 1.25rem;
}

.model-card {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: 1.25rem;
  padding: 1.6rem 1.75rem;
  background: var(--bg);
  border-radius: 5px;
  border-left: 3px solid transparent;
  transition:
    border-color 0.3s ease,
    transform 0.35s var(--ease-out),
    box-shadow 0.3s ease;
}

.model-card:hover {
  border-color: var(--amber);
  transform: translateX(5px);
  box-shadow: 4px 0 20px rgba(29, 75, 56, 0.06);
}

.model-num {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--amber);
  opacity: 0.55;
  line-height: 1.2;
  padding-top: 0.05rem;
}

.model-body h3 {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--forest);
  line-height: 1.2;
  margin-bottom: 0.6rem;
}

.model-body p {
  font-size: 0.9rem;
  line-height: 1.78;
  color: rgba(26, 23, 20, 0.82);
}

.model-body p + p {
  margin-top: 0.45rem;
}

.attr {
  font-size: 0.76rem !important;
  font-style: italic;
  color: rgba(26, 23, 20, 0.55) !important;
}

.attr a {
  color: var(--forest-mid);
  text-decoration: none;
  border-bottom: 1px solid rgba(45, 107, 81, 0.3);
  transition:
    color 0.2s,
    border-color 0.2s;
}
.attr a:hover {
  color: var(--amber);
  border-color: var(--amber);
}

/* ============================================================
   PITFALLS
   ============================================================ */

.pitfalls-list {
  list-style: none;
}

.pitfall {
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  gap: 1.25rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--rule);
}

.pitfalls-list .pitfall:first-child {
  border-top: 1px solid var(--rule);
}

.pitfall-mark {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--amber);
  opacity: 0.6;
  line-height: 1.4;
}

.pitfall-body h3 {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--forest);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.pitfall-body p {
  font-size: 0.9rem;
  line-height: 1.78;
  color: rgba(26, 23, 20, 0.82);
}

.privacy-note {
  margin-top: 2.75rem;
  padding: 1.1rem 1.4rem;
  background: rgba(29, 75, 56, 0.055);
  border-left: 3px solid var(--forest);
  border-radius: 0 4px 4px 0;
}

.privacy-note p {
  font-size: 0.85rem;
  line-height: 1.7;
  color: rgba(26, 23, 20, 0.8);
}

.privacy-note strong {
  color: var(--forest);
  font-weight: 500;
}

/* ============================================================
   USE CASES — ACCORDION
   ============================================================ */

.section-intro {
  font-size: 0.95rem;
  font-weight: 400;
  color: rgba(26, 23, 20, 0.7);
  margin-bottom: 2.25rem;
  max-width: 58ch;
}

.accordion-list {
  border-top: 1px solid var(--rule);
}

.accordion {
  border-bottom: 1px solid var(--rule);
}

.acc-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.acc-summary::-webkit-details-marker {
  display: none;
}

.acc-head {
  flex: 1;
  min-width: 0;
}

.acc-title {
  display: block;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--forest);
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.acc-desc {
  display: block;
  font-size: 0.82rem;
  color: rgba(26, 23, 20, 0.65);
  line-height: 1.5;
}

/* Plus/minus icon */
.acc-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  position: relative;
}

.acc-icon::before,
.acc-icon::after {
  content: "";
  position: absolute;
  background: var(--amber);
  border-radius: 2px;
  top: 50%;
  left: 50%;
  transition:
    transform 0.28s var(--ease-out),
    opacity 0.28s;
}

.acc-icon::before {
  width: 14px;
  height: 2px;
  transform: translate(-50%, -50%);
}
.acc-icon::after {
  width: 2px;
  height: 14px;
  transform: translate(-50%, -50%);
}

details[open] .acc-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
  opacity: 0;
}

/* Accordion body */
.acc-body {
  overflow: hidden;
  /* JS manages height during animation; CSS handles open state */
}

details[open] .acc-body {
  padding-bottom: 1.75rem;
}

.acc-body ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.acc-body li {
  font-size: 0.9rem;
  color: rgba(26, 23, 20, 0.82);
  line-height: 1.65;
  padding-left: 1.3rem;
  position: relative;
}

.acc-body li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--amber);
  font-size: 0.78rem;
  top: 0.08em;
}

/* ============================================================
   TOOLS & RESOURCES
   ============================================================ */

.resources-layout {
  display: grid;
  gap: 3.5rem;
}

.rgroup-title {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1.4rem;
}

/* Tools */
.tool-list {
  display: flex;
  flex-direction: column;
}

.tool {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--rule);
}

.tool-list .tool:first-child {
  border-top: 1px solid var(--rule);
}

.tool-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 0.4rem;
}

.tool-name {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--forest);
}

.tool-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 0.75rem;
}

.tool-links a,
.tool-link-single {
  font-size: 0.74rem;
  color: var(--forest-mid);
  text-decoration: none;
  border-bottom: 1px solid rgba(45, 107, 81, 0.28);
  transition:
    color 0.2s,
    border-color 0.2s;
  letter-spacing: 0.02em;
}

.tool-links a:hover,
.tool-link-single:hover {
  color: var(--amber);
  border-color: var(--amber);
}

.tool p {
  font-size: 0.87rem;
  line-height: 1.68;
  color: rgba(26, 23, 20, 0.76);
}

/* Reading lists */
.reading-list {
  display: flex;
  flex-direction: column;
}

.reading {
  display: block;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  transition: padding-left 0.25s var(--ease-out);
}

.reading-list .reading:first-child {
  border-top: 1px solid var(--rule);
}

.reading:hover {
  padding-left: 0.4rem;
}
.reading:hover .reading-title {
  color: var(--amber);
}

.reading-title {
  display: block;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--forest);
  margin-bottom: 0.3rem;
  line-height: 1.2;
  transition: color 0.2s;
}

.reading-desc {
  display: block;
  font-size: 0.86rem;
  line-height: 1.65;
  color: rgba(26, 23, 20, 0.73);
}

/* ============================================================
   SCROLL-TRIGGERED REVEALS
   ============================================================ */

.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.75s var(--ease-out),
    transform 0.75s var(--ease-out);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 960px) {
  .sidebar {
    display: none;
  }
  .mobile-header {
    display: flex;
  }

  .main {
    margin-left: 0;
    padding-top: 54px;
  }

  .hero {
    padding: 4.5rem 2rem 3.5rem;
    min-height: calc(100vh - 54px);
  }

  .hero-scroll {
    left: 2rem;
  }

  .section {
    padding: 4.5rem 2rem;
  }

  .section::before {
    font-size: 8rem;
    top: 1rem;
    right: 1rem;
  }
}

@media (max-width: 580px) {
  .hero-title {
    font-size: 2.9rem;
  }

  .model-card {
    grid-template-columns: 1.75rem 1fr;
    gap: 0.9rem;
  }

  .pitfall {
    grid-template-columns: 1.4rem 1fr;
    gap: 0.9rem;
  }

  .acc-summary {
    gap: 0.75rem;
  }
}
