/**
 * rstew.art - shared Work Study shell
 * Linked from sibling study folders as ../study.css (live root)
 * together with ../site.css. Sticky navy header + orange scroll
 * progress match homepage; chalkboard footer shared. No em dashes.
 */

:root {
  --scroll: 0;
  --charcoal: #585757;
  --light-grey: #d2d2d2;
  --blue: #1c4e9e;
  --light-blue: #6d8ac6;
  --orange: #f37123;
  --orange-alt: #F37223;
  --white: #eaeaea;
  --paper: #f7f7f5;
  --blue-grey: #54656f;
  --blue-green: #233845;
  --museo-sans: "museo-sans", "Museo Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --museo: "museo-slab", "Museo Slab", Georgia, "Times New Roman", serif;
  --shell-max: 760px;
  --header-h: 3rem;

  /* Study aliases (keep local component CSS readable) */
  --bg: var(--paper);
  --surface: #e8eef6;
  --primary: var(--blue);
  --text: var(--charcoal);
  --text2: var(--blue-grey);
  --border: #c5d0de;
  --s2: #f0f3f8;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

::selection {
  background-color: var(--orange);
  color: var(--white);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--museo-sans);
  background: center / auto repeat url("assets/ltbg.png"), var(--light-blue);
  color: var(--charcoal);
  line-height: 1.55;
}

a {
  color: var(--blue);
}

a:hover {
  color: var(--orange);
}

/* Sticky navy header (matches homepage) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--blue);
  color: var(--white);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  box-shadow: none;
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-family: var(--museo);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--white);
  text-decoration: none;
  line-height: 1;
  flex: 0 0 auto;
}

.site-header__word {
  color: var(--white);
}

.site-header__x {
  display: block;
  width: 0.85rem;
  height: 0.85rem;
  margin: 0 0.05rem;
  flex: 0 0 auto;
}

.site-header__meta {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(234, 234, 234, 0.75);
  white-space: nowrap;
}

.site-nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.site-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.15rem 0.1rem;
}

.site-nav__list a {
  display: inline-block;
  color: rgba(234, 234, 234, 0.78);
  text-decoration: none;
  font-family: var(--museo-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.3rem 0.45rem;
  border-radius: 3px;
  border-bottom: 2px solid transparent;
  transition: color 0.175s ease, border-color 0.175s ease, background-color 0.175s ease;
}

.site-nav__list a:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.site-nav__list a:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.site-nav__list a.is-active,
.site-nav__list a[aria-current="true"] {
  color: var(--white);
  border-bottom-color: var(--orange);
}

@media (max-width: 720px) {
  .site-header {
    flex-wrap: wrap;
    padding: 0.65rem 1rem 0.55rem;
  }

  .site-nav {
    flex: 1 1 100%;
    order: 3;
    justify-content: flex-start;
  }

  .site-nav__list {
    justify-content: flex-start;
  }

  .site-nav__list a {
    font-size: 0.68rem;
    padding: 0.25rem 0.4rem;
  }
}

/* Orange scroll progress under sticky nav (homepage rail) */
.progress {
  height: 0.3em;
  width: 0%;
  background-color: var(--orange);
  display: block;
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
}

.progress.scroll-driven {
  animation-name: progress;
  animation-duration: 1s;
  animation-timing-function: linear;
}

@keyframes progress {
  to {
    width: 100%;
  }
}

.scroll-driven {
  animation-play-state: paused;
  animation-delay: calc(var(--scroll, 0) * -1s);
  animation-iteration-count: 1;
  animation-fill-mode: both;
}

html {
  scroll-padding-top: calc(var(--header-h) + 1.25rem);
}

.path-btn {
  appearance: none;
  font-family: var(--museo-sans);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.2;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.path-btn:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.path-btn--primary {
  background: var(--blue);
  border: 1px solid var(--blue);
  color: var(--white);
}

.path-btn--primary:hover {
  background: var(--orange);
  border-color: var(--orange);
  box-shadow: 0 6px 14px rgba(243, 113, 35, 0.28);
  color: var(--white);
}

.path-btn--ghost {
  background: var(--white);
  border: 1px solid var(--blue-grey);
  color: var(--blue);
}

.path-btn--ghost:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.wrap {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
}

.page-label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange);
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.crumb {
  font-size: 0.8rem;
  color: var(--blue-grey);
  margin: 0 0 1.25rem;
}

.crumb a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}

.crumb a:hover {
  color: var(--orange);
}

.chapter-tag {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange);
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.study-hero {
  margin: 0 0 1.5rem;
  padding: 1.15rem 1.2rem 1.2rem;
  background: #f3f3f3;
  border: 1px solid var(--light-grey);
  border-radius: 10px;
  border-top: 3px solid var(--orange);
}

h1 {
  font-family: var(--museo);
  font-size: clamp(1.55rem, 3.5vw, 2.1rem);
  margin: 0 0 0.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--blue);
  line-height: 1.15;
}

.lead {
  color: var(--blue-grey);
  margin: 0;
  font-size: 1.05rem;
  max-width: 40rem;
  line-height: 1.5;
}

h2 {
  font-family: var(--museo);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
  color: var(--blue);
}

h3 {
  font-family: var(--museo-sans);
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: var(--blue-green);
}

p {
  margin: 0 0 0.85rem;
}

.section {
  margin: 0 0 2rem;
  scroll-margin-top: calc(var(--header-h) + 0.75rem);
}

.box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.15rem;
  margin: 0 0 1rem;
  border-left: 3px solid var(--orange);
}

.box-label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--orange);
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}

.toc a {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--blue);
  border: 1px solid var(--border);
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  background: var(--s2);
  font-weight: 700;
}

.toc a:hover {
  color: var(--white);
  background: var(--orange);
  border-color: var(--orange);
}

.process {
  display: grid;
  gap: 0.65rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.process li {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem 0.85rem 3rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.process li:hover {
  border-color: var(--orange);
  box-shadow: 0 4px 12px rgba(28, 78, 158, 0.08);
}

.process li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0.75rem;
  top: 0.85rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.process li p:last-child {
  margin-bottom: 0;
}

.process .step-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin: 0 0 0.25rem;
  color: var(--blue-green);
}

.demo-stage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.15rem 1.15rem;
  margin: 0 0 1rem;
}

.demo-note {
  font-size: 0.85rem;
  color: var(--blue-grey);
  margin: 0.65rem 0 0;
}

.callout {
  border-left: 3px solid var(--orange);
  background: var(--s2);
  padding: 0.85rem 1rem;
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  border-radius: 0 8px 8px 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

.meta-grid {
  display: grid;
  gap: 0.5rem;
  margin: 0.75rem 0 0;
}

@media (min-width: 560px) {
  .meta-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.meta-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
}

.meta-card .k {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--orange);
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.meta-card .v {
  margin: 0;
  font-size: 0.9rem;
}

.tag {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--blue);
  border: 1px solid var(--border);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--s2);
  margin: 0 0.35rem 0.35rem 0;
  font-weight: 700;
}

.hint-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.75rem 0 0;
}

.sprite-thumb {
  margin: 1rem 0 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.sprite-thumb .thumb-frame {
  position: relative;
  background: var(--s2);
  padding: 0.75rem;
}

.sprite-thumb img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  background: #fff;
}

.sprite-thumb figcaption {
  padding: 0.65rem 0.9rem;
  font-size: 0.8rem;
  color: var(--blue-grey);
  border-top: 1px solid var(--border);
  background: var(--s2);
  margin: 0;
}

.sprite-thumb figcaption strong {
  color: var(--blue-green);
  font-weight: 700;
}

.diagram {
  margin: 1rem 0 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.diagram .diagram-label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--orange);
  font-weight: 700;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: var(--s2);
}

.diagram svg {
  display: block;
  width: 100%;
  height: auto;
  background: #fafbfd;
}

.diagram figcaption {
  padding: 0.55rem 0.9rem;
  font-size: 0.8rem;
  color: var(--blue-grey);
  border-top: 1px solid var(--border);
  margin: 0;
  background: #fff;
}

.diagram-stack {
  display: grid;
  gap: 0.85rem;
  margin: 1rem 0 0;
}

/* Homepage chalkboard footer (shared live pattern) */
.site-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 1.5rem 1.5rem 1.25rem;
  text-align: center;
  color: var(--light-grey);
  font-family: var(--museo-sans);
  width: 100%;
  background: center / cover no-repeat url("assets/chalkboard.jpg"), #1a1a1a;
  box-shadow: inset 0 12px 14px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1000px;
  flex-wrap: wrap;
  gap: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.15rem 0;
}

.footer-corp {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
}

.footer-logo {
  width: 50px;
  height: 50px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.footer-dba {
  display: flex;
  flex-direction: column;
}

.footer-dba strong {
  color: var(--white);
  font-size: 1.2rem;
  letter-spacing: 1px;
}

.footer-dba span {
  font-size: 0.9rem;
  color: #999;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
  text-align: right;
}

.footer-chapters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.85rem 1.5rem;
}

.footer-utils {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem 1.25rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-link {
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  font-family: var(--museo-sans);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  position: relative;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--orange);
}

.footer-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--orange);
  transition: width 0.3s ease;
}

.footer-link:hover::after {
  width: 100%;
}

.footer-util {
  color: #999;
  text-decoration: none;
  font-weight: 500;
  font-family: var(--museo-sans);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
  position: relative;
}

.footer-util:hover {
  color: var(--orange);
}

.footer-util::after {
  content: "";
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -3px;
  left: 0;
  background-color: var(--orange);
  transition: width 0.3s ease;
}

.footer-util:hover::after {
  width: 100%;
}

.footer-bottom {
  margin-top: 0.25rem;
  width: 100%;
  max-width: 1000px;
  color: #777;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
}

.footer-bottom small {
  font-size: 0.85rem;
}

.footer-meta {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(234, 234, 234, 0.55);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .footer-content {
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }

  .footer-bottom {
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }

  .footer-corp {
    flex-direction: column;
    text-align: center;
  }

  .footer-nav {
    align-items: center;
    text-align: center;
  }

  .footer-chapters,
  .footer-utils {
    justify-content: center;
  }
}

code {
  font-size: 0.85em;
  background: var(--s2);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  color: var(--blue-green);
}
