/* Core theme */
:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-soft: #f7fbf8;
  --border: #d9e6dd;
  --text: #183025;
  --muted: #5f6f66;
  --green-dark: #1f4d36;
  --green: #2f7d4f;
  --green-soft: #edf6f0;
  --brown: #b08a57;
  --brown-dark: #8e6c43;
  --shadow: 0 8px 22px rgba(18, 50, 35, 0.08);
  --radius: 16px;
  --max: 1100px;
  --content-width: 100%;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  --mono: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  width: 100%;
  overflow-x: hidden;
  font-family: var(--font);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfb 100%);
  color: var(--text);
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }

.requirement-link {
  color: var(--green-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
button, input, textarea { font: inherit; }

.progress-wrap {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(31, 77, 54, 0.12);
  z-index: 9999;
}
.progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2f7d4f, #6aa56f);
}

.site-header {
  background: var(--green-dark);
  color: white;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  width: 100%;
}
.site-header__inner {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 22px 18px 18px;
}

.site-title-wrap h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 800;
}
.site-subtitle {
  margin: 8px 0 0;
  color: rgba(255,255,255,0.86);
  font-size: 0.98rem;
}

.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.section-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
  background: var(--brown);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}
.section-nav a:hover { background: var(--brown-dark); }

.page {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 18px 18px 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(47, 125, 79, 0.08);
  color: var(--green-dark);
  border: 1px solid rgba(47, 125, 79, 0.12);
  font-size: 0.84rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.card h2, .intro h2 {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-size: 1.5rem;
}
.card p, .intro p {
  margin: 0 0 12px;
  color: var(--text);
}
.preamble {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.preamble h3 {
  margin: 24px 0 10px;
  color: var(--green-dark);
  font-size: 1.18rem;
}
.preamble h3:first-child { margin-top: 0; }
.preamble ol {
  margin: 0 0 16px;
  padding-left: 24px;
}
.preamble li { margin-bottom: 6px; }
.preamble a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.preamble-figure {
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel-soft);
}
.preamble-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 720px;
  object-fit: contain;
  background: #fff;
}
.preamble-figure figcaption {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 0.92rem;
}
.note {
  margin: 16px 0;
  padding: 13px 15px;
  border-left: 4px solid var(--brown);
  border-radius: 0 12px 12px 0;
  background: #fbf7f1;
  color: var(--text);
}

.panel-grid {
  display: grid;
  min-width: 0;
  gap: 12px;
  margin-top: 14px;
}
.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  gap: 12px;
}
.stack { display: grid; min-width: 0; gap: 12px; }

.field-group {
  display: grid;
  min-width: 0;
  gap: 6px;
}
.field-group label {
  font-weight: 700;
  color: var(--green-dark);
}
.field-group .hint,
.small-muted {
  color: var(--muted);
  font-size: 0.92rem;
}
.field-group input,
.field-group textarea,
.field-group select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
}
.field-group input:focus,
.field-group textarea:focus {
  outline: none;
  border-color: rgba(47, 125, 79, 0.45);
  box-shadow: 0 0 0 4px rgba(47, 125, 79, 0.10);
}

/* Prefilled inputs should be light grey */
.prefilled {
  color: #9aa4ab !important;
  background: #f6f7f8 !important;
}

.toggle-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 4px 0;
  color: var(--text);
  font-weight: 700;
}
.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.code-panel {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #fbfdfb;
}
.code-panel__hint {
  padding: 10px 12px;
  background: #fbfdfb;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
  border-bottom: 1px solid var(--border);
}
.code-panel__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f3f8f5;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}
.copy-btn {
  border: 1px solid #d2ddda;
  background: #fff;
  color: var(--green-dark);
  padding: 7px 11px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}
.copy-btn:hover { background: var(--green-soft); }
pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  max-width: 100%;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 0.92rem;
  line-height: 1.55;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  margin-top: 14px;
}
.sample-count-control {
  max-width: 300px;
  margin-top: 16px;
}
.sample-table {
  width: 100%;
  min-width: 1800px;
  border-collapse: collapse;
  table-layout: auto;
}
.sample-table th, .sample-table td {
  border-bottom: 1px solid #e7eee8;
  padding: 8px;
  vertical-align: top;
  word-break: break-word;
}
.sample-table th {
  position: sticky;
  top: 0;
  background: #f7faf7;
  text-align: left;
  color: var(--green-dark);
  font-size: 0.82rem;
  white-space: nowrap;
  word-break: normal;
}
.sample-cell {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 8px 9px;
  border: 1px solid #d7e2dc;
  border-radius: 10px;
  background: #fff;
  box-sizing: border-box;
  font-size: 0.82rem;
  color: #183025;
}
.sample-cell.prefilled {
  color: #9aa4ab !important;
  background: #f6f7f8 !important;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.preview-toggle {
  margin-top: 16px;
}
.primary, .secondary {
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 800;
  cursor: pointer;
}
.primary {
  border: 1px solid rgba(255,255,255,0.12);
  background: var(--green-dark);
  color: #fff;
}
.secondary {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--green-dark);
}
.primary:hover { background: #17422d; }
.secondary:hover { background: #f5f8f6; }

.standards-wrap {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.standard-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fbfdfb;
}
.standard-row textarea {
  min-height: 130px;
  resize: vertical;
}
.field-label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  color: var(--green-dark);
}
.field-label input,
.field-label textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
}
.field-label input.prefilled,
.field-label textarea.prefilled {
  color: #9aa4ab !important;
  background: #f6f7f8 !important;
}

.validation-card {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbfdfb;
}
.validation-card__title {
  font-weight: 800;
  color: var(--green-dark);
  margin-bottom: 8px;
}
.validation-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}
.validation-list li.ok { color: #256f47; }
.validation-list li.bad { color: #8d5a24; }

.small-muted {
  color: var(--muted);
  font-size: 0.92rem;
}
.hidden { display: none !important; }

@media (max-width: 760px) {
  .page { padding: 14px 12px 48px; }
  .site-header__inner { padding: 18px 12px 14px; }
  .two-col { grid-template-columns: 1fr; }
  .section-nav { gap: 8px; }
  .section-nav a { width: 100%; }
  .card { padding: 14px; }
  .sample-table { min-width: 100%; }
  .sample-table th, .sample-table td { padding: 6px 8px; font-size: 0.8rem; }
}

/* GRUMP workshop visual system */
:root {
  --bg: #f7f7f4;
  --panel: #f7f7f4;
  --panel-soft: #ffffff;
  --border: #cfcfca;
  --text: #101010;
  --muted: #636363;
  --green-dark: #101010;
  --green: #101010;
  --green-soft: #ecece7;
  --brown: #101010;
  --brown-dark: #000000;
  --shadow: none;
  --radius: 0;
  --max: 1240px;
  --font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { text-underline-offset: 4px; }

.requirement-link {
  color: var(--text);
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.progress-wrap {
  height: 2px;
  background: transparent;
}

.progress { background: var(--text); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 247, 244, 0.96);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.site-header__inner {
  width: min(calc(100% - 40px), var(--max));
  max-width: none;
  padding: 16px 0 14px;
}

.site-title-wrap {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.site-title-wrap h1 {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.site-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-nav {
  gap: 0;
  margin-top: 14px;
  border-top: 1px solid var(--border);
}

.section-nav a {
  justify-content: flex-start;
  margin-right: clamp(14px, 2vw, 28px);
  padding: 11px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.section-nav a:hover,
.section-nav a:focus-visible {
  background: transparent;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 5px;
}

.page {
  width: min(calc(100% - 40px), var(--max));
  max-width: none;
  padding: 0 0 100px;
  gap: 0;
}

.card {
  padding: clamp(62px, 8vw, 104px) 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.card:last-child { border-bottom: 0; }

.section-kicker {
  display: block;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card h2,
.intro h2 {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 0 22px;
  color: var(--text);
  font-family: var(--serif);
  font-size: clamp(2.1rem, 4vw, 3.8rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.card:not(.intro) h2 {
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  line-height: 1.12;
}

.card h3,
.preamble h3 {
  color: var(--text);
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
  font-weight: 500;
  line-height: 1.2;
}

.card > p,
.intro > p,
.preamble > p,
.preamble > ol {
  width: 100%;
  max-width: var(--content-width);
}

.card p,
.intro p { color: var(--text); }

.intro > p:first-of-type {
  max-width: var(--content-width);
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.55;
}

.preamble {
  margin-top: clamp(48px, 7vw, 84px);
  padding-top: clamp(48px, 7vw, 84px);
  border-top: 1px solid var(--text);
}

.preamble h3 { margin: 42px 0 14px; }
.preamble h3:first-child { margin-top: 0; }

.preamble > h3,
.preamble-figure,
.note,
.card > h3,
.card > .panel-grid,
.card > .field-group,
.card > .two-col,
.card > .code-panel,
.card > .table-wrap,
.card > .sample-count-control,
.card > .actions,
.card > .standards-wrap,
.card > .validation-card,
.card > .small-muted,
.card > .grump-cta,
.card > .repository-setup {
  width: 100%;
  max-width: var(--content-width);
}

.preamble a { color: var(--text); }

.preamble-figure {
  margin: 30px 0;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--panel-soft);
}

.preamble-figure figcaption {
  padding: 13px 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.note {
  max-width: var(--content-width);
  margin: 24px 0;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--text);
  border-radius: 0;
  background: var(--panel-soft);
}

.panel-grid,
.two-col,
.stack { gap: 18px; }

.panel-grid { margin-top: 28px; }

.transfer-builder { margin-top: 24px; }

.repository-setup {
  margin-top: 44px;
  padding: 28px;
  border: 1px solid var(--text);
  background: var(--panel-soft);
}

.repository-setup h3 { margin: 0 0 12px; }
.repository-setup > p { margin: 0 0 24px; }
.repository-setup .code-panel { margin-top: 24px; }

.field-group { gap: 8px; }

.field-group label,
.field-label {
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.field-group .hint,
.small-muted {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.field-group input,
.field-group textarea,
.field-group select,
.field-label input,
.field-label textarea,
.sample-cell {
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: #ffffff;
  color: var(--text);
}

.field-group input:focus,
.field-group textarea:focus,
.field-group select:focus,
.field-label input:focus,
.field-label textarea:focus,
.sample-cell:focus {
  outline: 2px solid var(--text);
  outline-offset: 1px;
  border-color: var(--text);
  box-shadow: none;
}

.prefilled,
.sample-cell.prefilled,
.field-label input.prefilled,
.field-label textarea.prefilled {
  background: #ecece7 !important;
  color: #777772 !important;
}

.toggle-row {
  padding: 8px 0;
  font-size: 0.84rem;
}

.toggle-row input { accent-color: var(--text); }

.code-panel {
  margin-top: 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.code-panel__hint {
  padding: 13px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
}

.code-panel__bar {
  padding: 10px 12px;
  border-bottom: 1px solid #3e3e3e;
  background: #151515;
  color: #c8c8c3;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.copy-btn {
  padding: 6px 10px;
  border: 1px solid #4b4b4b;
  border-radius: 0;
  background: #191919;
  color: #f4f4f4;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.copy-btn:hover,
.copy-btn:focus-visible {
  background: #f4f4f4;
  color: #191919;
}

pre {
  padding: 24px 22px;
  background: #151515;
  color: #f3f3ed;
  font-size: 0.82rem;
  line-height: 1.6;
}

.table-wrap {
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: 0;
}

.sample-count-control { margin-top: 24px; }

.sample-table th,
.sample-table td {
  border-bottom-color: var(--border);
  padding: 9px;
}

.sample-table th {
  background: #ecece7;
  color: var(--text);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sample-cell { font-size: 0.8rem; }

.actions {
  gap: 8px;
  margin-top: 20px;
}

.preview-toggle { margin-top: 20px; }

.primary,
.secondary {
  padding: 10px 14px;
  border: 1px solid var(--text);
  border-radius: 0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.primary {
  background: var(--text);
  color: #ffffff;
}

.secondary {
  background: transparent;
  color: var(--text);
}

.primary:hover,
.primary:focus-visible {
  background: #ffffff;
  color: var(--text);
}

.grump-cta {
  margin-top: 48px;
  padding: 32px;
  border: 1px solid var(--text);
  background: var(--panel-soft);
}

.grump-cta h3 { margin: 0 0 12px; }
.grump-cta p { margin: 0 0 22px; }

.grump-cta__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.secondary:hover,
.secondary:focus-visible {
  background: var(--text);
  color: #ffffff;
}

.standards-wrap {
  gap: 18px;
  margin-top: 24px;
}

.standard-row {
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: #ffffff;
}

.validation-card {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: #ffffff;
}

.validation-card__title {
  color: var(--text);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.validation-list li.ok { color: #2f5e42; }
.validation-list li.bad { color: #7b4d26; }

@media (max-width: 900px) {
  .two-col { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .site-header__inner,
  .page { width: min(calc(100% - 28px), var(--max)); }

  .site-header__inner { padding: 14px 0 12px; }

  .site-title-wrap { display: grid; gap: 3px; }

  .section-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
  }

  .section-nav a {
    width: auto;
    margin: 0;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
  }

  .card { padding: 58px 0; }
  .two-col { grid-template-columns: 1fr; }
  .sample-table { min-width: 1800px; }
  .grump-cta { padding: 24px 20px; }
  .repository-setup { padding: 24px 20px; }
}

@media (max-width: 480px) {
  .section-nav { grid-template-columns: 1fr; }
  .site-title-wrap h1 { font-size: 1.05rem; }
  .card h2,
  .intro h2 { font-size: 2.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
