:root {
  --bg: #f8fbfd;
  --bg-2: #eaf3f8;
  --paper: #ffffff;
  --ink: #14314a;
  --ink-2: #244357;
  --muted: #587384;
  --line: #c8dbe6;
  --line-strong: #8fb3c6;
  --cyan: #20b8c6;
  --cyan-soft: #dff8fb;
  --steel: #91abbc;
  --warm: #e7b246;
  --shadow: 0 24px 60px rgba(14, 49, 72, .12);
  --shadow-soft: 0 12px 28px rgba(14, 49, 72, .08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-image:
    linear-gradient(90deg, rgba(200, 219, 230, .18) 1px, transparent 1px),
    linear-gradient(0deg, rgba(200, 219, 230, .18) 1px, transparent 1px);
  background-size: 44px 44px;
}

body::before {
  display: none;
}

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

button {
  font: inherit;
}

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

.page-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 72px;
  padding: .75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: rgba(248, 251, 253, .92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  min-width: 0;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand span {
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: .24em;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 1.45rem;
  color: var(--ink-2);
  font-size: .92rem;
  font-weight: 650;
}

.topnav a {
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}

.topnav a:hover,
.topnav a[aria-current="page"] {
  color: var(--cyan);
}

.nav-cta {
  padding: .72rem 1rem;
  color: var(--paper) !important;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 3px;
}

.nav-cta:hover {
  background: var(--cyan);
  border-color: var(--cyan);
}

.tutorial-layout {
  width: min(1420px, calc(100% - 40px));
  margin: 0 auto;
  padding: .55rem 0 4rem;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 240px;
  gap: 1.25rem;
  align-items: start;
}

.tutorial-sidebar,
.guide-aside {
  position: sticky;
  top: 96px;
}

.tutorial-sidebar {
  min-height: calc(100vh - 128px);
  padding: 1.1rem;
  background: rgba(234, 243, 248, .72);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}

.sidebar-brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.sidebar-brand strong {
  display: block;
  margin-top: .1rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 500;
}

.eyebrow,
.content-kicker {
  display: block;
  color: var(--cyan);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.doc-nav {
  display: grid;
  gap: .35rem;
  margin-top: 1rem;
}

.doc-link,
.module-button,
.module-group summary {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  text-align: left;
  font-weight: 650;
  border-radius: 4px;
}

.doc-link,
.module-group summary {
  padding: .72rem .75rem;
}

.module-group {
  margin-top: .2rem;
}

.module-group summary {
  cursor: pointer;
  color: var(--ink);
}

.module-list {
  display: grid;
  gap: .35rem;
  padding: .2rem 0 .25rem .45rem;
}

.module-button {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: .65rem;
  padding: .55rem .6rem;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, box-shadow .2s ease;
}

.module-button img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  padding: .24rem;
  border-radius: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.doc-link:hover,
.module-button:hover,
.module-button.active {
  color: var(--cyan);
  background: rgba(255, 255, 255, .78);
}

.module-button.active {
  box-shadow: inset 3px 0 0 var(--cyan);
}

.tutorial-main {
  min-width: 0;
}

.title-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: .55rem;
  padding: 0;
}

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

h1 {
  max-width: 820px;
  margin-bottom: .3rem;
  color: var(--ink);
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2.2rem, 3.05vw, 3.25rem);
  font-weight: 400;
  line-height: .98;
  letter-spacing: -.02em;
}

.title-row p {
  max-width: 780px;
  margin-bottom: 0;
  color: var(--ink-2);
  font-size: .98rem;
  line-height: 1.38;
}

.quiet-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  white-space: nowrap;
  padding: .8rem 1rem;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 3px;
  font-weight: 750;
  box-shadow: var(--shadow-soft);
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.quiet-button:hover {
  transform: translateY(-2px);
  background: var(--cyan);
  border-color: var(--cyan);
}

.module-header,
.selected-guide,
.notes-section {
  background: rgba(255, 255, 255, .88);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow-soft);
}

.module-header {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.module-title-block {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.module-title-block img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  padding: .45rem;
  background: var(--ink);
  border-radius: 5px;
}

.module-title-block h2 {
  margin-bottom: .15rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.85rem;
  font-weight: 500;
}

.module-title-block p {
  margin-bottom: 0;
  color: var(--ink-2);
}

.module-meta {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.module-meta span,
.guide-chips span,
.process-chip,
.screenshot-step {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: .32rem .58rem;
  color: var(--ink-2);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
}

.submodule-zone,
.process-section {
  margin-top: .85rem;
}

.section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .5rem;
}

.section-label span {
  color: var(--ink);
  font-weight: 800;
}

.section-label small {
  color: var(--muted);
  font-size: .88rem;
}

.submodule-tabs {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  padding: .55rem;
  background: rgba(234, 243, 248, .68);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.submodule-tab {
  min-height: 38px;
  padding: .52rem .85rem;
  color: var(--ink-2);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-weight: 800;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.submodule-tab:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}

.submodule-tab.active {
  color: var(--paper);
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--cyan);
}

.selected-guide {
  margin-top: .85rem;
  padding: 1rem;
}

.guide-copy {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.guide-badge {
  display: inline-flex;
  margin-bottom: .55rem;
  padding: .28rem .52rem;
  color: var(--ink);
  background: var(--cyan-soft);
  border: 1px solid rgba(32, 184, 198, .35);
  border-radius: 3px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
}

.guide-heading h2 {
  margin-bottom: .2rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: 2.15rem;
  font-weight: 500;
  letter-spacing: -.02em;
}

.guide-heading p {
  margin-bottom: 0;
  color: var(--ink-2);
  font-size: 1.04rem;
}

.guide-chips {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.guide-progress {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(24px, 1fr));
  gap: .45rem;
  margin-top: .75rem;
}

.guide-progress span {
  height: 4px;
  background: var(--line);
  border-radius: 999px;
}

.guide-progress span.active {
  background: linear-gradient(90deg, var(--cyan), var(--warm));
}

.process-list {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.process-list li {
  display: block;
  overflow: hidden;
  padding: .85rem;
  background: rgba(255, 255, 255, .88);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow-soft);
}

.process-step-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: .7rem;
  align-items: start;
  margin-bottom: .65rem;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: var(--paper);
  background: var(--ink);
  border-radius: 4px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: .82rem;
  font-weight: 800;
}

.process-list strong {
  display: block;
  margin-bottom: .12rem;
  color: var(--ink);
  font-size: 1.18rem;
}

.process-list p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.42;
}

.process-shot {
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.process-shot img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--paper);
}

.missing-shot {
  display: grid;
  place-items: center;
  min-height: 320px;
  padding: 2rem;
  color: var(--muted);
  background: #f7fafc;
  border-bottom: 1px solid var(--line);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: .9rem;
  text-align: center;
}

.missing-shot[hidden] {
  display: none;
}

.process-shot figcaption {
  padding: .7rem .85rem;
  color: #d9ebf3;
  background: #0b1824;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: .95rem;
  line-height: 1.55;
}

.notes-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.25rem;
  padding: 1.25rem;
}

.notes-section h2 {
  margin-bottom: .85rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.7rem;
  font-weight: 500;
}

.notes-section ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink-2);
}

.notes-section li + li {
  margin-top: .55rem;
}

.notes-section p {
  color: var(--ink-2);
}

.guide-aside {
  display: grid;
  gap: 1rem;
}

.guide-card {
  display: grid;
  gap: .65rem;
  padding: 1rem;
  background: rgba(255, 255, 255, .88);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow-soft);
}

.guide-card a {
  padding: .6rem .7rem;
  color: var(--ink-2);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-weight: 700;
}

.guide-card a:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}

.guide-card.compact p {
  margin: 0;
  color: var(--ink-2);
}

@media (max-width: 1180px) {
  .tutorial-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .guide-aside {
    display: none;
  }
}

@media (max-width: 860px) {
  .topbar {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
    padding: 1rem;
  }

  .topnav {
    width: 100%;
    gap: .6rem;
    flex-wrap: wrap;
    overflow-x: visible;
    padding-bottom: .15rem;
  }

  .topnav a {
    white-space: nowrap;
  }

  .tutorial-layout {
    width: min(100% - 28px, 760px);
    grid-template-columns: 1fr;
    padding-top: 1rem;
  }

  .tutorial-sidebar {
    position: static;
    min-height: 0;
  }

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

  .title-row,
  .module-header,
  .guide-copy,
  .section-label,
  .notes-section {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .module-meta,
  .guide-chips {
    justify-content: flex-start;
  }

  .process-step-head {
    grid-template-columns: 48px 1fr;
  }

  .process-chip {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .brand span {
    font-size: 1rem;
  }

  h1 {
    font-size: clamp(2.15rem, 11vw, 3rem);
  }

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

  .module-title-block {
    align-items: flex-start;
    flex-direction: column;
  }
}
