/* ============================================================
   Nash-Ramsey Toolbox — Basecamp-inspired stylesheet
   ============================================================ */

:root {
  --green-dark:   #1a4731;
  --green-mid:    #2f7d52;
  --green-light:  #4caf78;
  --green-pale:   #e8f5ee;
  --cream:        #faf9f4;
  --cream-dark:   #f0ede4;
  --charcoal:     #1d2124;
  --body-text:    #374151;
  --muted:        #6b7280;
  --border:       #d1cfc6;
  --code-bg:      #f3f0e8;
  --code-text:    #1a4731;
  --step-badge:   #1a4731;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
  --shadow-md:    0 4px 16px rgba(0,0,0,.10);
  --radius:       8px;
  --radius-lg:    14px;
  --max-w:        900px;
  --font-sans:    "Helvetica Neue", Arial, sans-serif;
  --font-mono:    "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--cream);
  color: var(--body-text);
  line-height: 1.7;
}

h1, h2, h3, h4 {
  color: var(--charcoal);
  line-height: 1.25;
  font-weight: 800;
}

a { color: var(--green-mid); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* ── Layout helpers ───────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 72px 0;
}

.section + .section {
  border-top: 1px solid var(--border);
}

.section--shaded {
  background: var(--cream-dark);
}

/* ── Navigation ───────────────────────────────────────────── */
.nav {
  background: var(--green-dark);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}

.nav__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.01em;
}

.nav__logo span {
  color: var(--green-light);
}

.nav__links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav__links a {
  color: rgba(255,255,255,.75);
  font-size: .875rem;
  font-weight: 600;
  transition: color .15s;
}

.nav__links a:hover {
  color: #fff;
  text-decoration: none;
}

.nav__cta {
  background: var(--green-light);
  color: var(--green-dark) !important;
  padding: 7px 16px;
  border-radius: 6px;
  font-weight: 700 !important;
  transition: background .15s !important;
}

.nav__cta:hover {
  background: #6dd99a !important;
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  background: var(--green-dark);
  background-image:
    radial-gradient(ellipse at 70% 50%, rgba(47,125,82,.35) 0%, transparent 65%),
    radial-gradient(ellipse at 10% 80%, rgba(26,71,49,.6) 0%, transparent 60%);
  color: #fff;
  padding: 96px 24px 88px;
  text-align: center;
}

.hero__eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--green-light);
  margin-bottom: 16px;
}

.hero h1 {
  color: #fff;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  letter-spacing: -.03em;
  max-width: 700px;
  margin: 0 auto 20px;
}

.hero__sub {
  font-size: 1.15rem;
  color: rgba(255,255,255,.78);
  max-width: 580px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

.hero__authors {
  font-size: .85rem;
  color: rgba(255,255,255,.5);
  margin-bottom: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}

.btn:hover { transform: translateY(-1px); text-decoration: none; }

.btn--primary {
  background: var(--green-light);
  color: var(--green-dark);
  box-shadow: 0 4px 18px rgba(76,175,120,.35);
}

.btn--primary:hover {
  background: #6dd99a;
  box-shadow: 0 6px 24px rgba(76,175,120,.45);
}

.btn--outline {
  background: transparent;
  border: 2px solid rgba(255,255,255,.35);
  color: rgba(255,255,255,.85);
  margin-left: 12px;
}

.btn--outline:hover {
  border-color: rgba(255,255,255,.7);
  color: #fff;
}

.hero__badge {
  display: inline-block;
  margin-top: 32px;
  font-size: .8rem;
  color: rgba(255,255,255,.45);
  letter-spacing: .04em;
}

/* ── Feature cards ────────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, transform .15s;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card__icon {
  font-size: 1.8rem;
  margin-bottom: 14px;
}

.card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--green-dark);
}

.card p {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.55;
}

/* ── Section headings ─────────────────────────────────────── */
.section__label {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--green-mid);
  margin-bottom: 8px;
}

.section__heading {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: -.02em;
  margin-bottom: 14px;
}

.section__intro {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 640px;
  margin-bottom: 36px;
}

/* ── Requirements list ────────────────────────────────────── */
.req-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
}

.req-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

.req-list__icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.req-list strong {
  display: block;
  color: var(--charcoal);
  font-size: .95rem;
  margin-bottom: 2px;
}

.req-list span {
  font-size: .875rem;
  color: var(--muted);
}

/* ── Package structure ────────────────────────────────────── */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.folder-item {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--green-mid);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

.folder-item__name {
  font-family: var(--font-mono);
  font-size: .85rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 4px;
}

.folder-item p {
  font-size: .875rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Numbered steps ───────────────────────────────────────── */
.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 28px;
  position: relative;
}

.steps::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 40px;
  bottom: 40px;
  width: 2px;
  background: var(--border);
}

.step {
  display: flex;
  gap: 20px;
  position: relative;
  padding-bottom: 28px;
}

.step:last-child { padding-bottom: 0; }

.step__badge {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--green-dark);
  color: #fff;
  font-weight: 800;
  font-size: .95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 4px var(--cream);
}

.step__body {
  padding-top: 8px;
  flex: 1;
}

.step__body h3 {
  font-size: 1rem;
  color: var(--charcoal);
  margin-bottom: 6px;
}

.step__body p {
  font-size: .9rem;
  color: var(--body-text);
  margin-bottom: 10px;
}

/* ── Code blocks ──────────────────────────────────────────── */
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--green-mid);
  border-radius: var(--radius);
  padding: 18px 20px;
  overflow-x: auto;
  margin: 12px 0 0;
  box-shadow: var(--shadow-sm);
}

code {
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--code-text);
  line-height: 1.6;
}

p code, li code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: .82em;
  color: var(--green-dark);
}

/* ── Inline comment color in code blocks ─────────────────── */
.comment { color: #888; font-style: italic; }
.keyword { color: #1a4731; font-weight: 700; }
.string  { color: #b55a00; }
.fn      { color: #0d5e8a; }

/* ── Function reference table ─────────────────────────────── */
.ref-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 28px;
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.ref-table th {
  background: var(--green-dark);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 12px 18px;
  text-align: left;
}

.ref-table td {
  padding: 13px 18px;
  font-size: .88rem;
  color: var(--body-text);
  border-top: 1px solid var(--border);
  vertical-align: top;
}

.ref-table tr:hover td { background: var(--green-pale); }

.ref-table td:first-child {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--green-dark);
  font-weight: 600;
  white-space: nowrap;
}

/* ── Callout box ──────────────────────────────────────────── */
.callout {
  background: var(--green-pale);
  border: 1px solid #b2d9c0;
  border-left: 4px solid var(--green-mid);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0;
  font-size: .9rem;
  color: var(--green-dark);
}

.callout strong { color: var(--green-dark); }

/* ── Warning callout ──────────────────────────────────────── */
.callout--warn {
  background: #fffbeb;
  border-color: #fcd34d;
  border-left-color: #d97706;
  color: #78350f;
}

/* ── Figure images ────────────────────────────────────────── */
.figures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}

@media (max-width: 620px) {
  .figures { grid-template-columns: 1fr; }
}

.figure-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.figure-box__caption {
  padding: 10px 14px;
  font-size: .8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--cream-dark);
  font-style: italic;
}

/* ── Download section ─────────────────────────────────────── */
.download-band {
  background: var(--green-dark);
  color: #fff;
  padding: 64px 24px;
  text-align: center;
}

.download-band h2 {
  color: #fff;
  font-size: 2rem;
  letter-spacing: -.02em;
  margin-bottom: 12px;
}

.download-band p {
  color: rgba(255,255,255,.7);
  max-width: 480px;
  margin: 0 auto 32px;
}

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  background: #111a15;
  color: rgba(255,255,255,.45);
  padding: 32px 24px;
  text-align: center;
  font-size: .8rem;
}

.footer a { color: rgba(255,255,255,.55); }
.footer a:hover { color: #fff; }

/* ── Responsive tweaks ────────────────────────────────────── */
@media (max-width: 640px) {
  .nav__links { display: none; }
  .hero { padding: 64px 20px; }
  .btn--outline { display: none; }
  .steps::before { left: 16px; }
  .step__badge { width: 34px; height: 34px; font-size: .85rem; }
}
