:root {
  color-scheme: light;
  --paper: #f7f5ef;
  --surface: #ffffff;
  --ink: #142022;
  --muted: #5c676a;
  --line: #d8d6cf;
  --blue: #1d6fa5;
  --blue-soft: #d9ecff;
  --green: #2d7650;
  --green-soft: #dff2e7;
  --amber: #a16f12;
  --amber-soft: #fff0ca;
  --red: #a34639;
  --red-soft: #ffe1dc;
  --violet: #5e5a94;
  --violet-soft: #e7e5f6;
  --shadow: 0 18px 42px rgba(20, 32, 34, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

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

code {
  background: #ece9df;
  border: 1px solid #ddd8cb;
  border-radius: 5px;
  color: #203034;
  font-size: 0.92em;
  padding: 0.1rem 0.28rem;
}

.topbar {
  align-items: center;
  background: rgba(247, 245, 239, 0.96);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 5vw;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-weight: 800;
  gap: 0.75rem;
  min-width: max-content;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 7px;
  color: var(--paper);
  display: inline-flex;
  font-size: 0.78rem;
  height: 2.05rem;
  justify-content: center;
  width: 2.05rem;
}

.nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.nav a {
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 700;
  padding: 0.55rem 0.7rem;
}

.nav a:hover,
.nav a:focus-visible {
  background: #e9e5d9;
  color: var(--ink);
  outline: none;
}

main {
  overflow: hidden;
}

.intro-section,
.section {
  padding: 5.5rem 5vw;
}

.intro-section {
  align-items: center;
  display: grid;
  gap: 3.25rem;
  grid-template-columns: minmax(0, 0.88fr) minmax(320px, 1.12fr);
  min-height: calc(100vh - 68px);
}

.intro-copy {
  max-width: 700px;
  min-width: 0;
}

.eyebrow {
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 0.8rem;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.6rem, 5.2vw, 5.9rem);
  line-height: 0.96;
  letter-spacing: 0;
  margin-bottom: 1.4rem;
  max-width: 900px;
  overflow-wrap: break-word;
}

h2 {
  font-size: clamp(2rem, 3.8vw, 4.15rem);
  line-height: 1.02;
  letter-spacing: 0;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.1rem;
  line-height: 1.2;
  letter-spacing: 0;
  margin-bottom: 0.45rem;
}

.lead {
  color: #334044;
  font-size: clamp(1.06rem, 1.6vw, 1.28rem);
  max-width: 720px;
}

.summary-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 2rem;
}

.summary-grid div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 116px;
  padding: 1rem;
}

.summary-grid strong,
.summary-grid span {
  display: block;
}

.summary-grid strong {
  font-size: 1.12rem;
  margin-bottom: 0.35rem;
}

.summary-grid span {
  color: var(--muted);
  font-size: 0.94rem;
}

.flow-figure {
  margin: 0;
  min-width: 0;
}

.flow-figure img {
  aspect-ratio: 1200 / 680;
  display: block;
  height: auto;
  max-width: 100%;
  width: 100%;
}

.flow-figure figcaption {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.8rem;
}

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

.section-heading {
  max-width: 850px;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.07rem;
}

.process-list {
  counter-reset: process;
  display: grid;
  gap: 0.9rem;
  list-style: none;
  margin: 2.4rem 0 0;
  padding: 0;
}

.process-list li {
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 72px minmax(0, 1fr);
  min-height: 120px;
  padding: 1.25rem;
}

.process-list span {
  align-items: center;
  background: var(--blue-soft);
  border: 1px solid #a9d4f4;
  border-radius: 7px;
  color: #174a70;
  display: inline-flex;
  font-weight: 900;
  height: 54px;
  justify-content: center;
  width: 54px;
}

.process-list p,
.method-note p,
.weekly-grid p,
.audit-grid p,
.status-panel p,
.type-detail p,
.type-detail dd {
  color: var(--muted);
  margin-bottom: 0;
}

.method-note {
  background: var(--green-soft);
  border: 1px solid #b9dbc8;
  border-radius: 8px;
  margin-top: 1.1rem;
  padding: 1.25rem;
}

.split-section {
  background: #fbfaf6;
}

.drive-layout {
  align-items: stretch;
  display: grid;
  gap: 1.2rem;
  grid-template-columns: minmax(310px, 0.95fr) minmax(0, 1.05fr);
  margin-top: 2.5rem;
}

.intro-section > *,
.drive-layout > *,
.type-workspace > *,
.weekly-grid > *,
.audit-grid > * {
  min-width: 0;
}

.folder-tree,
.status-panel,
.type-detail,
.weekly-grid div,
.audit-grid div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.folder-tree,
.status-panel {
  padding: 1.3rem;
}

.tree-title {
  color: var(--green);
  font-weight: 900;
  margin-bottom: 0.7rem;
}

.folder-tree ul {
  color: #334044;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.75;
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.folder-tree ul ul {
  border-left: 1px solid var(--line);
  margin: 0.25rem 0 0.25rem 0.65rem;
  padding-left: 0.8rem;
}

.status-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 1rem 0 1.15rem;
}

.status-grid span {
  background: var(--amber-soft);
  border: 1px solid #e4c56e;
  border-radius: 6px;
  color: #553f08;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.84rem;
  font-weight: 700;
  min-height: 42px;
  overflow-wrap: anywhere;
  padding: 0.55rem 0.62rem;
}

.weekly-section {
  background: #eff6f1;
}

.weekly-grid,
.audit-grid {
  display: grid;
  gap: 1rem;
  margin-top: 2.4rem;
}

.weekly-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.weekly-grid div,
.audit-grid div {
  min-height: 150px;
  padding: 1.25rem;
}

.types-section {
  background: #f4f1fb;
}

.type-workspace {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(230px, 320px) minmax(0, 1fr);
  margin-top: 2.4rem;
}

.type-tabs {
  align-content: start;
  display: grid;
  gap: 0.55rem;
}

.type-tab {
  background: var(--surface);
  border: 1px solid #d7d1ed;
  border-radius: 8px;
  color: #35324f;
  cursor: pointer;
  font: inherit;
  font-size: 0.96rem;
  font-weight: 800;
  min-height: 52px;
  padding: 0.8rem 0.9rem;
  text-align: left;
}

.type-tab:hover,
.type-tab:focus-visible {
  border-color: var(--violet);
  outline: none;
}

.type-tab.is-active {
  background: var(--violet);
  color: #ffffff;
}

.type-detail {
  min-height: 420px;
  padding: 1.55rem;
}

.type-code {
  background: var(--violet-soft);
  border: 1px solid #c6c1e8;
  border-radius: 6px;
  color: #3a3566;
  display: inline-block;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
  font-weight: 800;
  margin-bottom: 1rem;
  padding: 0.36rem 0.52rem;
}

.type-detail h3 {
  font-size: clamp(1.55rem, 3vw, 2.55rem);
  line-height: 1.05;
  margin-bottom: 0.85rem;
}

.type-detail dl {
  display: grid;
  gap: 0.9rem;
  margin: 1.35rem 0 0;
}

.type-detail dl div {
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
}

.type-detail dt {
  color: var(--ink);
  font-weight: 900;
  margin-bottom: 0.28rem;
}

.type-detail dd {
  margin-left: 0;
}

.audit-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 2rem 5vw;
}

.footer p {
  margin: 0;
}

@media (max-width: 980px) {
  .intro-section,
  .drive-layout,
  .type-workspace {
    grid-template-columns: 1fr;
  }

  .intro-section {
    min-height: auto;
    padding-top: 4rem;
  }

  .summary-grid,
  .weekly-grid,
  .audit-grid {
    grid-template-columns: 1fr;
  }

  .type-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.7rem;
    padding-bottom: 0.8rem;
    padding-top: 0.8rem;
    position: static;
  }

  .nav {
    justify-content: flex-start;
  }

  .intro-section,
  .section {
    padding: 3.4rem 1rem;
  }

  .intro-copy,
  .section-heading,
  .flow-figure {
    max-width: min(calc(100vw - 2rem), 358px);
    width: min(calc(100vw - 2rem), 358px);
  }

  .summary-grid,
  .status-grid,
  .type-tabs {
    grid-template-columns: 1fr;
  }

  .process-list li {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2rem, 9vw, 2.55rem);
    line-height: 1;
    max-width: min(calc(100vw - 2rem), 358px);
  }
}
