/* ========== Root / tokens ========== */
:root {
  --brand: #f97316;
  --brand-ink: #e64700;
  --ink: #111;
  --muted: #6b7280;
  --bg: #fafafa;

  --tile-bg: #f7f8fa;
  --tile-br: #e6e9ef;
  --tile-r: 14px;
  --gap: 20px;

  --tile-min: 260px; /* min column width */
  --tile-h: 200px; /* fixed card height -> equal boxes */
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
  background: var(--bg);
  color: #1f2937;
}

/* ========== Hero ========== */
.hero__bg {
  background-image: var(--hero-bg);
}
.hero {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 12px auto 40px;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 16/6.5;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  isolation: isolate;
}
.hero--fullbleed {
  max-width: 100vw;
  width: 100vw;
  border-radius: 0;
  box-shadow: none;
  left: 50%;
  transform: translateX(-50%);
}
.hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}
.hero__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.55) 0%,
      rgba(0, 0, 0, 0.25) 45%,
      rgba(0, 0, 0, 0.1) 100%
    ),
    radial-gradient(80% 100% at 50% 100%, rgba(0, 0, 0, 0.18), transparent 60%);
  z-index: 1;
}
.hero__inner {
  position: relative;
  z-index: 2;
  height: 100%;
  padding: clamp(16px, 4vw, 36px);
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  color: #fff;
}
.hero__eyebrow {
  font-size: 12px;
  opacity: 0.9;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 8px;
   text-shadow: 0 0.2px 1px black;
}
.hero__title {
  margin: 0;
  font-size: clamp(28px, 4.2vw, 44px);
  line-height: 1.1;
  font-weight: 800;
  text-shadow: 0 2px 4px black;
}
.hero__subtitle {
  text-align: center;
  margin: 10px 0 0;
  font-size: clamp(14px, 1.6vw, 18px);
  opacity: 0.95;
  max-width: 60ch;
}
/* scroll-down button */
.scroll-down{
  position:absolute;
  left:50%;
  bottom:16px;
  transform:translateX(-50%);
  width:44px; height:44px;
  border-radius:9999px;
  background:#fff;
  border:1px solid #e6e9ef;
  display:grid; place-items:center;
  box-shadow:0 4px 14px rgba(16,24,40,.10);
  color: var(--brand, #f97316);
  text-decoration:none;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  z-index: 3; /* above overlay */
}

.scroll-down:hover{
  background: var(--brand, #f97316);
  color:#fff;
  box-shadow:0 8px 22px rgba(249,115,22,.25);
  transform:translateX(-50%) translateY(-2px);
}

.scroll-down i{ font-size:18px; line-height:1; }

/* gentle float animation */
@keyframes floaty {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-6px); }
}
.scroll-down{ animation: floaty 2.2s ease-in-out infinite; }

/* respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .scroll-down{ animation: none; }
}
/* ================================
   Intro Section — Consistent Layout
================================ */
.intro {
  max-width: 1100px;       /* matches typical section width */
  margin: 0 auto 80px;     /* centers + same bottom spacing as others */
  padding: 60px 32px;      /* same inner padding as next sections */
  text-align: center;
}

.intro__title {
  font-size: 2.25rem;      /* ~36px */
  font-weight: 700;
  color: #111827;
  margin-bottom: 16px;
  line-height: 1.2;
}

.intro__subtitle {
  font-size: 1.125rem;
  color: #6b7280;
  margin-bottom: 24px;
}

.intro__copy p {
  font-size: 1rem;
  color: #374151;
  line-height: 1.8;
  margin: 12px 0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* ========== Section header ========== */
.section-block {
  width: min(1100px, 92vw);
  margin: 80px auto;
}
.section-head {
  margin: 0 0 12px;
}
.section-title {
  margin: 0;
  font-size: 28px;
  margin-bottom: 25px;

}
.section-kicker {
  margin: 6px 0 0;
  color: #6b7280;
}

/* ========== Grid (cards) ========== */
.grid {
  display: grid;
  grid-auto-flow: row;
  grid-template-columns: repeat(auto-fit, minmax(var(--tile-min), 1fr));
  gap: var(--gap);
}

/* ========== Card / tile ========== */
.tile {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: var(--tile-h);
  background: var(--tile-bg);
  border: 1px solid var(--tile-br);
  border-radius: var(--tile-r);
  padding: 18px;
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}
.tile:hover {
  transform: translateY(-2px);
  background: #fff;
  border-color: #d5dae3;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.06);
}

/* icon */
.tile__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  margin-bottom: 10px;
  background: rgba(249, 115, 22, 0.1);
  color: var(--brand);
  display: inline-grid;
  place-items: center;
  font-size: 22px;
}

/* heading / body (clamped so heights stay equal) */
.tile__title {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile__desc {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile,
.tile * {
  min-width: 0;
}

/* arrow button (no text) */
.start {
  all: unset;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background: #fff;
  border: 1px solid var(--tile-br);
  display: inline-grid;
  place-items: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  cursor: pointer;
}
.start {
  z-index: 3;
}
.start::before {
  content: "\2192"; /* → */
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  color: var(--brand);
}
.tile:hover .start {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 6px 14px rgba(249, 115, 22, 0.25);
}
.tile:hover .start::before {
  color: #fff;
}
.start:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* make sure nothing clips the floating arrow */
.bottom-card {
  height: 0;
  padding: 0;
  margin: 0;
  overflow: visible;
}

/* ========== Modal (same structure you had) ========== */
dialog {
  border: 0;
  padding: 0;
  border-radius: 14px;
  max-width: 560px;
  width: 90%;
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}
.modal-outer {
  background: #fff;
  padding: 40px 40px 76px;
  border-radius: 20px;
  position: relative;
}
.modal {
  background: #fff;
  border: 2px solid #eee;
  border-radius: 16px;
  padding: 20px;
  position: relative;
}
.modal h3 {
  margin: 0 0 10px;
  font-size: 20px;
}
.outer-actions {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ========== Footer spacing help ========== */
footer {
  margin-top: 40px;
}

/* ========== Responsive tweaks ========== */
@media (min-width: 1280px) {
  .grid {
    gap: 24px;
  }
  :root {
    --tile-min: 280px;
    --tile-h: 210px;
  }
}
@media (max-width: 860px) {
  .intro {
    padding: 22px;
  }
}
@media (max-width: 768px) {
  :root {
    --tile-min: 220px;
    --tile-h: 190px;
  }
  .intro__title {
    font-size: 28px;
  }
}
@media (max-width: 480px) {
  :root {
    --tile-h: 180px;
  }
}

/* Layout: two columns */
.page-grid{
  display:grid;
  grid-template-columns: 280px minmax(0,1fr);
  gap: 32px;
  align-items:start;
}

/* Sticky TOC */
.toc-doc{
  position: sticky;
  top: 88px; /* adjust to your navbar height */
  align-self: start;
  max-height: calc(100vh - 88px - 16px);
  overflow:auto;
  padding-right: 8px;
  z-index: 1; /* below content modals, above background */
}

.toc-doc__title{
  font-size: 12px;
  letter-spacing: .08em;
  color:#6b7280; /* gray-500 */
  margin: 0 0 14px;
  margin-left: 30px;
}

/* Rail + moving cursor */
.toc-doc__wrap{ position: relative; padding-left: 18px; }
.toc-doc__rail{
  position: absolute; left: 6px; top: 0; bottom: 0;
  width: 1px; background: #e5e7eb; /* gray-200 */
}
.toc-doc__cursor{
  position: absolute; left: 6px; width: 2px; height: 20px;
  background:#111827; /* gray-900 */
  border-radius: 1px;
  transform: translateY(0);
  transition: transform .18s ease, height .18s ease;
}

/* Links */
.toc-doc__nav{ display:flex; flex-direction:column; gap: 30px; }
.toc-doc__link{
  display:block;
  padding: 2px 0 2px 12px;
  color:#4b5563; /* gray-600 */
  text-decoration:none;
  line-height:1.3;
  font-size: 15px;
}
.toc-doc__link:hover{ color:#111827; }
.toc-doc__link.is-active{
  color:#111827;
  font-weight:700;
}

/* Sub-level indent */
.toc-doc__link--sub{ margin-left: 14px; font-size:14px; }

/* Make anchors land cleanly below sticky header */
.level, .card-container, .section, [id]{
  scroll-margin-top: 96px; /* slightly > sticky top */
}

/* Smooth scrolling */
html{ scroll-behavior: smooth; }

/* Mobile: hide the aside and use single column */
@media (max-width: 1024px){
  .page-grid{ grid-template-columns: 1fr; }
  .toc-doc{ display:none; }
}
