:root {
  --ink: #15211c;
  --ink-soft: #1c2a24;
  --ink-lift: #24352d;
  --fog: #e4ece1;
  --mist: #a7b5a5;
  --leaf: #7a9a72;
  --leaf-bright: #9bc093;
  --leaf-deep: #5f7d58;
  --sand: #c9b89c;
  --text: #eef3ec;
  --text-dim: #8f9e8e;
  --danger: #d06a58;
  --line: rgba(168, 181, 166, 0.16);
  --line-strong: rgba(168, 181, 166, 0.28);
  --surface: rgba(18, 28, 24, 0.78);
  --surface-solid: #121c18;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.22);
  --font-display: "Alegreya", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --font-body: "Geologica", "Avenir Next", "Segoe UI", sans-serif;
  --pad: clamp(1.25rem, 4vw, 3rem);
  --max: 100%;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overscroll-behavior: none;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  font-family: var(--font-body);
  font-weight: 400;
  font-optical-sizing: auto;
  color: var(--text);
  background-color: #101914;
  background-image:
    radial-gradient(980px 520px at 12% -6%, rgba(122, 154, 114, 0.34), transparent 60%),
    radial-gradient(720px 440px at 92% 8%, rgba(201, 184, 156, 0.2), transparent 55%),
    radial-gradient(640px 480px at 78% 88%, rgba(95, 125, 88, 0.18), transparent 62%),
    linear-gradient(168deg, #1e2f27 0%, #15211c 38%, #0f1713 72%, #121c18 100%);
  background-attachment: fixed;
  line-height: 1.6;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* Soft moving atmosphere behind all pages */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

body::before {
  background:
    radial-gradient(42% 36% at 18% 22%, rgba(155, 192, 147, 0.16), transparent 70%),
    radial-gradient(36% 30% at 82% 18%, rgba(201, 184, 156, 0.12), transparent 68%),
    radial-gradient(48% 40% at 70% 78%, rgba(95, 125, 88, 0.14), transparent 72%);
  filter: blur(8px);
  animation: ambience-drift 26s ease-in-out infinite alternate;
}

body::after {
  background:
    radial-gradient(1.5px 1.5px at 12% 28%, rgba(238, 243, 236, 0.18), transparent),
    radial-gradient(1.5px 1.5px at 28% 62%, rgba(155, 192, 147, 0.22), transparent),
    radial-gradient(1.2px 1.2px at 64% 18%, rgba(201, 184, 156, 0.2), transparent),
    radial-gradient(1.4px 1.4px at 78% 48%, rgba(238, 243, 236, 0.14), transparent),
    radial-gradient(1.2px 1.2px at 44% 82%, rgba(155, 192, 147, 0.16), transparent),
    radial-gradient(1.3px 1.3px at 88% 76%, rgba(201, 184, 156, 0.14), transparent);
  opacity: 0.55;
  animation: ambience-twinkle 10s ease-in-out infinite alternate;
}

@keyframes ambience-drift {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: 0.85; }
  to { transform: translate3d(2.5%, -1.5%, 0) scale(1.08); opacity: 1; }
}

@keyframes ambience-twinkle {
  from { opacity: 0.35; }
  to { opacity: 0.7; }
}

@media (max-width: 860px) {
  body {
    background-attachment: scroll;
  }
}

body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--leaf-bright);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: var(--fog);
}

:focus-visible {
  outline: 2px solid rgba(155, 192, 147, 0.7);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: calc(0.85rem + env(safe-area-inset-top)) var(--pad) 0.85rem;
  background: rgba(20, 32, 26, 0.62);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--fog);
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 2rem;
  height: 2rem;
  max-width: none;
  flex: 0 0 2rem;
  border-radius: 50%;
  object-fit: cover;
}

.nav-toggle {
  display: none;
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--fog);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav-toggle:hover {
  border-color: rgba(155, 192, 147, 0.45);
  background: rgba(122, 154, 114, 0.12);
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 1.15rem;
  height: 1.5px;
  margin: 0 auto;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.28s var(--ease), opacity 0.2s ease;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 50%;
  margin-left: -0.575rem;
}

.nav-toggle-bars::before { top: 0.9rem; }
.nav-toggle-bars::after { bottom: 0.9rem; }

body.nav-open .nav-toggle-bars {
  background: transparent;
}

body.nav-open .nav-toggle-bars::before {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

body.nav-open .nav-toggle-bars::after {
  bottom: auto;
  top: 50%;
  transform: translateY(-50%) rotate(-45deg);
}

.nav-drawer-label {
  display: none;
}

.nav-backdrop {
  display: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.2rem;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.nav a {
  color: var(--mist);
  text-decoration: none;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav a:hover,
.nav .nav-muted:hover {
  color: var(--fog);
  background: rgba(255, 255, 255, 0.04);
}

.nav-muted {
  opacity: 0.7;
}

.nav .btn,
.nav .nav-cta {
  margin-left: 0.35rem;
}

.topic-picker-mobile {
  display: none;
}

.upload-hint-mobile {
  display: none;
}

main {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 2rem var(--pad) 4rem;
}

.main-flush {
  width: 100%;
  max-width: none;
  padding: 0;
}

body.page-chat {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

body.page-chat .site-footer {
  display: none;
}

.main-chat {
  flex: 1;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem var(--pad) calc(2.5rem + env(safe-area-inset-bottom));
  color: var(--text-dim);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.footer-brand img {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  align-items: center;
}

.site-footer a {
  text-decoration: none;
  color: var(--mist);
}

.site-footer a:hover {
  color: var(--fog);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.8rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--leaf-bright) 0%, var(--leaf) 100%);
  color: #0a120e;
  font: 600 0.92rem/1 var(--font-body);
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 8px 20px rgba(0, 0, 0, 0.18);
  transition:
    transform 0.25s var(--ease),
    background 0.25s var(--ease),
    border-color 0.25s var(--ease),
    box-shadow 0.25s var(--ease),
    color 0.2s var(--ease),
    filter 0.2s var(--ease);
}

.btn:hover {
  background: linear-gradient(180deg, #a8cba0 0%, var(--leaf-bright) 100%);
  color: #0a120e;
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset, 0 12px 24px rgba(0, 0, 0, 0.22);
}

.btn:active {
  transform: translateY(0);
  filter: brightness(0.96);
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: none;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line-strong);
  color: var(--fog);
  box-shadow: none;
}

.btn-ghost:hover {
  background: rgba(122, 154, 114, 0.14);
  border-color: rgba(155, 192, 147, 0.45);
  color: var(--fog);
  box-shadow: none;
}

.btn-sm {
  padding: 0.5rem 0.95rem;
  font-size: 0.84rem;
  border-radius: var(--radius-sm);
}

.btn.chat-send {
  min-height: 2.85rem;
  padding-inline: 1.15rem;
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(88dvh - 4.75rem);
  display: grid;
  align-items: start;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  background: var(--hero) center / cover no-repeat;
  transform: scale(1.04);
  animation: hero-drift 18s ease-in-out infinite alternate;
}

.hero-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(12, 20, 16, 0.52) 0%, rgba(12, 20, 16, 0.24) 44%, rgba(12, 20, 16, 0.06) 100%),
    linear-gradient(0deg, rgba(12, 20, 16, 0.4) 0%, transparent 52%);
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(6.5rem, 12vh, 8.5rem) var(--pad) clamp(1.25rem, 3vh, 2rem);
}

.brand-hero {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 10vw, 6.6rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.01em;
  color: var(--fog);
  text-shadow: 0 0 48px rgba(155, 192, 147, 0.22);
}

.brand-hero.is-visible {
  animation: brand-glow 5.5s ease-in-out infinite alternate;
}

@keyframes brand-glow {
  from { text-shadow: 0 0 28px rgba(155, 192, 147, 0.12); }
  to { text-shadow: 0 0 56px rgba(155, 192, 147, 0.32), 0 0 2px rgba(238, 243, 236, 0.2); }
}

.hero h1 {
  margin: 0 0 0.85rem;
  max-width: none;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.2vw, 2.25rem);
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.01em;
  color: var(--sand);
}

.lede,
.section-lede {
  margin: 0 0 1.25rem;
  max-width: none;
  color: var(--mist);
  font-size: 1.05rem;
  line-height: 1.65;
  font-weight: 400;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cta-band {
  position: relative;
  overflow: hidden;
}

.cta-band::before {
  content: "";
  position: absolute;
  inset: -20% 20% auto;
  height: 140%;
  background: radial-gradient(ellipse at center, rgba(122, 154, 114, 0.16), transparent 68%);
  pointer-events: none;
  animation: cta-pulse 7s ease-in-out infinite alternate;
}

.cta-band > * {
  position: relative;
  z-index: 1;
}

@keyframes cta-pulse {
  from { opacity: 0.45; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1.08); }
}

.hero-scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 28%;
  top: -30%;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(155, 192, 147, 0.1),
    transparent
  );
  animation: scan-sweep 4.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes hero-drift {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.08) translate3d(-1.5%, 1%, 0); }
}

@keyframes scan-sweep {
  0% { top: -30%; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.85s var(--ease),
    transform 0.85s var(--ease),
    filter 0.85s var(--ease);
  filter: blur(2px);
  will-change: opacity, transform;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}

[data-reveal][data-delay="1"] { transition-delay: 0.1s; }
[data-reveal][data-delay="2"] { transition-delay: 0.2s; }
[data-reveal][data-delay="3"] { transition-delay: 0.3s; }
[data-reveal][data-delay="4"] { transition-delay: 0.4s; }
[data-reveal][data-delay="5"] { transition-delay: 0.5s; }

[data-reveal="fade"] {
  transform: none;
  filter: none;
}

[data-reveal="left"] {
  transform: translateX(-24px);
}

[data-reveal="right"] {
  transform: translateX(24px);
}

[data-reveal="scale"] {
  transform: scale(0.96);
  filter: none;
}

/* Sections */
.section {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(3.5rem, 8vw, 5.5rem) var(--pad);
}

.how {
  padding-top: clamp(2rem, 4.5vw, 3rem);
}

.section h2,
.page-head h1,
.panel h2,
.auth-panel h1,
.chat-top h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.85rem, 3.1vw, 2.55rem);
  color: var(--fog);
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.steps {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(3, 1fr);
}

.steps li {
  padding: 1.15rem 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(18, 28, 24, 0.45);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}

.steps li:hover {
  border-color: rgba(155, 192, 147, 0.35);
  background: rgba(24, 36, 31, 0.7);
  transform: translateY(-2px);
}

.step-num {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--leaf-bright);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  font-weight: 600;
}

.steps h3 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.steps p {
  margin: 0;
  color: var(--text-dim);
}

.topic-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.topic-chip {
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--fog);
  text-decoration: none;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}

.topic-chip:hover {
  border-color: var(--leaf-bright);
  background: rgba(122, 154, 114, 0.14);
  color: var(--fog);
  transform: translateY(-1px);
}

/* Classical sources */
.sources .section-lede {
  max-width: none;
}

.source-list {
  list-style: none;
  margin: 2.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 0;
  counter-reset: source;
}

.source-list li {
  counter-increment: source;
  position: relative;
  padding: 1.35rem 0 1.35rem 3.25rem;
  border-top: 1px solid var(--line);
}

.source-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.source-list li::before {
  content: counter(source, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1.45rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  color: var(--leaf-bright);
}

.source-meta {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--leaf-bright);
}

.source-list h3 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  font-weight: 700;
  color: var(--fog);
  letter-spacing: -0.01em;
}

.source-title-en {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1rem;
  color: var(--sand);
}

.source-list li > p:last-child {
  margin: 0;
  max-width: none;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.cta-band {
  text-align: center;
  border-top: 1px solid var(--line);
}

.cta-band p {
  margin: 0 0 1.25rem;
  max-width: none;
  color: var(--mist);
}

/* SEO about + FAQ */
.about-seo-grid {
  display: grid;
  gap: 2rem;
  margin-top: 1.75rem;
}

.about-seo-grid > div p {
  margin: 0 0 1rem;
  color: var(--mist);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: none;
}

.about-seo-grid > div p:last-child {
  margin-bottom: 0;
}

.about-seo-grid strong {
  color: var(--fog);
  font-weight: 600;
}

.about-seo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.about-seo-list li {
  padding: 0 0 1rem;
  border-bottom: 1px solid var(--line);
}

.about-seo-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.about-seo-list h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--fog);
  letter-spacing: -0.01em;
}

.about-seo-list p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.55;
}

.faq-list {
  margin-top: 1.75rem;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1.15rem 2rem 1.15rem 0;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  font-weight: 700;
  color: var(--fog);
  letter-spacing: -0.01em;
  position: relative;
  transition: color 0.2s var(--ease);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--leaf-bright);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item summary:hover {
  color: var(--leaf-bright);
}

.faq-item p {
  margin: 0 0 1.15rem;
  max-width: none;
  color: var(--text-dim);
  font-size: 0.98rem;
  line-height: 1.65;
}

@media (min-width: 900px) {
  .about-seo-grid {
    grid-template-columns: 1.2fr 0.8fr;
    gap: 3rem;
    align-items: start;
  }
}

/* Panels / forms */
.page-head {
  margin-bottom: 1.75rem;
}

.page-head-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.panel,
.auth-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.45rem;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.auth-panel {
  width: 100%;
  max-width: none;
  margin: 2rem 0;
}

.grid-2 {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr 1.15fr;
}

.stack-form {
  display: grid;
  gap: 0.95rem;
}

.stack-form label,
.topic-select {
  display: grid;
  gap: 0.4rem;
  font-size: 0.86rem;
  color: var(--mist);
}

.stack-form input,
.stack-form select,
.stack-form textarea,
.topic-select select {
  width: 100%;
  padding: 0.78rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(6, 10, 8, 0.55);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.stack-form input:hover,
.stack-form select:hover,
.stack-form textarea:hover {
  border-color: rgba(168, 181, 166, 0.4);
}

.stack-form input:focus,
.stack-form select:focus,
.stack-form textarea:focus {
  outline: none;
  border-color: rgba(155, 192, 147, 0.55);
  background: rgba(8, 14, 11, 0.72);
  box-shadow: 0 0 0 3px rgba(122, 154, 114, 0.18);
}

.stack-form textarea {
  resize: vertical;
  min-height: 3rem;
}

.form-error {
  color: var(--danger);
}

.form-hint {
  margin: 0.35rem 0 0;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.auth-switch {
  margin-top: 1.2rem;
  color: var(--text-dim);
  font-size: 0.92rem;
}

.banner-warn {
  margin-bottom: 1.25rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid rgba(208, 106, 88, 0.38);
  border-radius: var(--radius);
  background: rgba(208, 106, 88, 0.1);
  color: #efc4bc;
}

.banner-ok {
  margin-bottom: 1.25rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid rgba(143, 179, 137, 0.4);
  border-radius: var(--radius);
  background: rgba(111, 143, 106, 0.12);
  color: var(--fog);
}

.tariff-card {
  width: min(100%, 420px);
  margin: 0 auto;
  text-align: left;
}

.tariff-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sand);
}

.tariff-price {
  margin: 0.5rem 0 1.1rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.8rem);
  color: var(--fog);
}

.tariff-price span {
  font-weight: 600;
}

.tariff-features {
  margin: 0 0 1.35rem;
  padding-left: 1.1rem;
  color: var(--mist);
  line-height: 1.6;
}

.thank-you-panel .cta-row {
  margin-top: 1.25rem;
}

.thank-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sand);
}

.thank-until {
  margin: 0.75rem 0 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(143, 179, 137, 0.35);
  border-radius: var(--radius);
  background: rgba(111, 143, 106, 0.12);
  color: var(--fog);
  font-size: 1.05rem;
}

.thank-you-panel[data-state="success"] h1 {
  color: var(--leaf-bright);
}

.banner-ok strong {
  color: var(--fog);
  font-weight: 600;
}

/* Photos */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0.65rem;
  margin: 1rem 0;
}

.photo-tile {
  position: relative;
  margin: 0;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-del {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  width: 1.55rem;
  height: 1.55rem;
  border: 0;
  border-radius: 50%;
  background: rgba(8, 12, 10, 0.78);
  color: var(--fog);
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.photo-del:hover {
  background: rgba(208, 106, 88, 0.85);
  transform: scale(1.05);
}

.upload-zone {
  display: grid;
  place-items: center;
  min-height: 118px;
  padding: 1rem;
  border: 1px dashed rgba(168, 181, 166, 0.4);
  border-radius: var(--radius);
  color: var(--mist);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.upload-zone:hover,
.upload-zone.is-drag {
  border-color: var(--leaf-bright);
  background: rgba(122, 154, 114, 0.12);
}

.guide-modal {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-solid);
  color: var(--text);
  padding: 0;
  width: min(94vw, 700px);
  max-width: min(94vw, 700px);
  max-height: min(90vh, 900px);
  box-shadow: var(--shadow-soft);
}

.guide-modal::backdrop {
  background: rgba(0, 0, 0, 0.68);
}

.guide-inner {
  padding: 1.35rem;
  overflow: auto;
  max-height: min(90vh, 900px);
}

.palm-guide-intro {
  margin: 0 0 0.9rem;
  color: var(--mist);
  line-height: 1.5;
}

.palm-guide-list {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
  color: var(--text);
  line-height: 1.55;
}

.palm-guide-list li + li {
  margin-top: 0.5rem;
}

.palm-guide-example {
  margin: 0 0 1.1rem;
  text-align: center;
}

.palm-guide-example__img {
  display: block;
  width: 100%;
  max-width: 660px;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(8, 12, 10, 0.35);
}

.palm-guide-example__caption {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.35;
  text-align: center;
}

/* Analysis */
.analysis-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.topic-nav {
  max-height: calc(100vh - 7rem);
  overflow: auto;
  position: sticky;
  top: 4.5rem;
}

.topic-group + .topic-group {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.topic-group h3 {
  margin: 0 0 0.45rem;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sand);
}

.topic-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.topic-group a {
  display: block;
  padding: 0.4rem 0.55rem;
  margin: 0 -0.35rem;
  border-radius: var(--radius-sm);
  color: var(--mist);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.topic-group a.is-active,
.topic-group a:hover {
  color: var(--fog);
  background: rgba(122, 154, 114, 0.12);
}

.analysis-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.analysis-head-copy {
  flex: 1 1 14rem;
  min-width: 0;
}

.analysis-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
}

.topic-blurb {
  margin: 0.4rem 0 0;
  max-width: 42ch;
  color: var(--mist);
  font-size: 0.92rem;
  line-height: 1.45;
}

.prose {
  white-space: pre-wrap;
  color: var(--text);
  font-size: 0.98rem;
  min-height: 8rem;
}

.stream-out.is-streaming::after {
  content: "";
  display: inline-block;
  width: 0.55ch;
  margin-left: 2px;
  background: var(--leaf-bright);
  animation: caret 0.9s steps(1) infinite;
}

@keyframes caret {
  50% { opacity: 0; }
}

.chart-mount {
  margin-top: 1.25rem;
}

/* Chat — full bleed */
.chat-banner {
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}

.chat-shell {
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(900px 420px at 10% 0%, rgba(122, 154, 114, 0.12), transparent 55%),
    radial-gradient(700px 360px at 92% 100%, rgba(201, 184, 156, 0.07), transparent 50%),
    rgba(8, 14, 11, 0.28);
  box-shadow: none;
}

.chat-top {
  padding: 1.15rem var(--pad) 0.9rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
}

.chat-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--leaf-bright);
  font-weight: 600;
}

.chat-top h1 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2rem);
}

.chat-sub {
  margin: 0.3rem 0 0;
  color: var(--text-dim);
  font-size: 0.92rem;
  max-width: 48ch;
}

.chat-log {
  padding: 1.25rem var(--pad) 1rem;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.bubble {
  max-width: min(100%, 52rem);
  padding: 0.85rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  animation: bubble-in 0.3s var(--ease) both;
}

.bubble-user {
  align-self: flex-end;
  background: rgba(122, 154, 114, 0.2);
  border-color: rgba(155, 192, 147, 0.28);
  border-bottom-right-radius: 6px;
}

.bubble-assistant {
  align-self: flex-start;
  background: rgba(18, 28, 24, 0.82);
  border-bottom-left-radius: 6px;
  backdrop-filter: blur(8px);
}

.bubble-meta {
  margin-bottom: 0.28rem;
  font-size: 0.72rem;
  color: var(--sand);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.bubble-body {
  white-space: pre-wrap;
  font-size: 0.96rem;
  line-height: 1.55;
}

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.chat-dock {
  padding: 0.65rem var(--pad) 1.1rem;
  border-top: 1px solid var(--line);
  background: rgba(8, 14, 11, 0.72);
  backdrop-filter: blur(14px);
}

.chat-suggestions[hidden] {
  display: none;
}

.chat-suggestions {
  margin-bottom: 0.75rem;
}

.suggestions-label {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.suggestion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.suggestion-chip {
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--fog);
  font: 500 0.84rem/1.2 var(--font-body);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}

.suggestion-chip:hover {
  border-color: rgba(155, 192, 147, 0.5);
  background: rgba(122, 154, 114, 0.14);
  transform: translateY(-1px);
}

.suggestion-chip:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.chat-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  align-items: end;
  padding: 0.5rem 0.5rem 0.5rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: 1.15rem;
  background: rgba(6, 10, 8, 0.72);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.chat-compose:focus-within {
  border-color: rgba(155, 192, 147, 0.45);
  box-shadow: 0 0 0 3px rgba(122, 154, 114, 0.14), var(--shadow-soft);
}

.chat-compose textarea {
  width: 100%;
  min-height: 1.5rem;
  max-height: 140px;
  padding: 0.55rem 0.15rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  line-height: 1.45;
  resize: none;
  outline: none;
  box-shadow: none;
}

.chat-compose textarea::placeholder {
  color: var(--text-dim);
}

.chat-send {
  border-radius: 0.9rem;
}

.hyro-netbar {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(0.75rem + env(safe-area-inset-bottom));
  z-index: 70;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  background: #1a2420;
  color: var(--text);
  text-align: center;
  font-size: 0.9rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  transform: translateY(140%);
  transition: transform 0.28s ease;
}

.hyro-netbar.is-on {
  transform: translateY(0);
}

.hyro-netbar.is-back {
  background: #24362a;
  color: var(--leaf-bright);
}

.hyro-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 0.75rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.55);
}

.hyro-sheet {
  width: min(100%, 440px);
  margin: 0;
  padding: 1.35rem 1.25rem 1.1rem;
  border-radius: 28px;
  background: #141c18;
  color: var(--text);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.hyro-sheet h2 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 500;
}

.hyro-sheet p {
  margin: 0;
  color: var(--mist);
}

.hyro-sheet-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.15rem;
}

.hyro-sheet-actions .btn {
  min-height: 2.85rem;
  min-width: 7.5rem;
}

html.hyro-sheet-open,
html.hyro-sheet-open body,
body.nav-open {
  overflow: hidden;
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-grid;
    place-items: center;
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(4, 8, 6, 0.62);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s var(--ease), visibility 0.28s var(--ease);
  }

  body.nav-open .nav-backdrop {
    opacity: 1;
    visibility: visible;
  }

  .nav-drawer-label {
    display: block;
    margin: 0 0 0.35rem;
    padding: 0 0.35rem;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--leaf-bright);
    font-weight: 600;
  }

  .nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    width: min(20rem, 86vw);
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.25rem;
    margin: 0;
    padding: calc(5.25rem + env(safe-area-inset-top, 0px)) 1.15rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(24, 36, 31, 0.98) 0%, rgba(12, 20, 16, 0.98) 100%);
    border-left: 1px solid var(--line-strong);
    box-shadow: -18px 0 48px rgba(0, 0, 0, 0.4);
    transform: translateX(104%);
    transition: transform 0.32s var(--ease);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.nav-open .nav {
    transform: translateX(0);
  }

  .nav a {
    display: flex;
    align-items: center;
    min-height: 2.85rem;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius);
    font-size: 1.02rem;
    color: var(--fog);
  }

  .nav a:hover,
  .nav .nav-muted:hover {
    background: rgba(122, 154, 114, 0.14);
  }

  .nav .btn,
  .nav .nav-cta {
    margin: 0.65rem 0 0;
    justify-content: center;
    width: 100%;
    border-radius: var(--radius);
  }

  .nav-muted {
    opacity: 0.78;
    margin-top: auto;
  }

  .steps,
  .grid-2,
  .analysis-layout {
    grid-template-columns: 1fr;
  }

  .topic-nav {
    display: none;
  }

  .topic-picker-mobile {
    display: grid;
    gap: 0.4rem;
    font-size: 0.86rem;
    color: var(--mist);
  }

  .topic-picker-mobile select {
    width: 100%;
    min-height: 2.85rem;
    padding: 0.75rem 2.4rem 0.75rem 0.9rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background-color: rgba(6, 10, 8, 0.55);
    color: var(--text);
    font: inherit;
    font-size: 1rem;
    appearance: none;
    background-image:
      linear-gradient(45deg, transparent 50%, var(--mist) 50%),
      linear-gradient(135deg, var(--mist) 50%, transparent 50%);
    background-position:
      calc(100% - 1.15rem) calc(50% - 0.15rem),
      calc(100% - 0.75rem) calc(50% - 0.15rem);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
  }

  .hero-copy {
    padding-top: clamp(4.5rem, 12vh, 6.5rem);
    padding-bottom: clamp(1.5rem, 4vh, 2.25rem);
  }

  .hero-veil {
    background:
      linear-gradient(180deg, rgba(6, 10, 8, 0.35) 0%, rgba(6, 10, 8, 0.2) 35%, rgba(6, 10, 8, 0.88) 100%),
      linear-gradient(90deg, rgba(6, 10, 8, 0.55) 0%, transparent 70%);
  }

  .hero-copy h1 {
    max-width: 22ch;
  }

  .cta-row {
    gap: 0.65rem;
  }

  .cta-row .btn {
    flex: 1 1 auto;
    min-width: min(100%, 9.5rem);
    min-height: 2.85rem;
  }

  .section {
    padding-block: clamp(2.75rem, 7vw, 4rem);
  }

  .source-list li {
    padding-left: 2.6rem;
  }

  .panel,
  .auth-panel {
    padding: 1.15rem 1.1rem;
  }

  .auth-panel {
    margin: 1rem auto 2rem;
  }

  .analysis-head {
    flex-direction: column;
    align-items: stretch;
  }

  .analysis-head .btn {
    width: 100%;
    min-height: 2.85rem;
  }

  .chat-top h1 {
    font-size: 1.55rem;
  }

  .chat-sub {
    display: none;
  }

  .chat-dock {
    padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
  }

  .suggestion-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.5rem;
    padding-bottom: 0.25rem;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .suggestion-row::-webkit-scrollbar {
    display: none;
  }

  .suggestion-chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
    min-height: 2.4rem;
    padding: 0.55rem 0.9rem;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
  }

  .upload-hint-desktop {
    display: none;
  }

  .upload-hint-mobile {
    display: block;
  }

  .upload-zone {
    min-height: 104px;
  }

  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  }

  .photo-del {
    width: 1.85rem;
    height: 1.85rem;
    font-size: 1.1rem;
  }

  .guide-modal {
    max-width: min(96vw, 700px);
    margin: auto;
  }

  .btn,
  .suggestion-chip,
  .topic-chip,
  .nav a,
  .photo-del,
  .upload-zone {
    touch-action: manipulation;
  }
}

@media (max-width: 560px) {
  :root {
    --pad: 1.1rem;
  }

  .brand {
    font-size: 1.45rem;
  }

  .brand-hero {
    font-size: clamp(3rem, 16vw, 4.4rem);
  }

  .hero h1 {
    font-size: clamp(1.35rem, 5.4vw, 1.7rem);
  }

  .lede,
  .section-lede {
    font-size: 0.98rem;
    max-width: none;
  }

  .cta-row {
    flex-direction: column;
  }

  .cta-row .btn {
    width: 100%;
    min-width: 0;
  }

  main {
    padding: 1.35rem var(--pad) 3rem;
  }

  .page-head {
    margin-bottom: 1.25rem;
  }

  .steps {
    gap: 0.85rem;
  }

  .steps li {
    padding: 1rem 0.95rem;
  }

  .steps h3 {
    font-size: 1.2rem;
  }

  .topic-chip {
    padding: 0.5rem 0.85rem;
    font-size: 0.86rem;
  }

  .source-list li {
    padding: 1.15rem 0 1.15rem 2.4rem;
  }

  .source-list li::before {
    top: 1.2rem;
    font-size: 0.95rem;
  }

  .chat-send span {
    display: none;
  }

  .chat-send {
    min-width: 2.85rem;
    padding-inline: 0.85rem;
  }

  .bubble {
    max-width: 94%;
    padding: 0.7rem 0.85rem;
  }

  .hyro-sheet {
    width: 100%;
    border-radius: 22px 22px 18px 18px;
  }

  .hyro-sheet-actions {
    display: grid;
  }

  .hyro-sheet-actions .btn {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .brand-hero {
    font-size: 2.7rem;
  }

  .nav {
    width: min(18.5rem, 92vw);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body::before,
  body::after,
  .hero-media,
  .hero-scan,
  .brand-hero,
  .brand-hero.is-visible,
  .cta-band::before,
  [data-reveal],
  .bubble,
  .nav,
  .nav-backdrop {
    animation: none !important;
    transition: none !important;
    filter: none !important;
  }

  body::before,
  body::after {
    opacity: 0.7;
    transform: none;
  }

  [data-reveal],
  .bubble {
    opacity: 1;
    transform: none;
  }

  .hero-media {
    transform: none;
  }
}

.app-state {
  min-height: 62vh;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 0.35rem;
  padding: 2rem 0 3rem;
}

.app-state-mark {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  margin-bottom: 0.8rem;
}

.app-state h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3rem);
}


/* Materials */
.materials-head {
  padding: clamp(2rem, 5vw, 3rem) var(--pad) 0;
  max-width: none;
}

.materials-disclaimer {
  margin: 0;
  padding: 0.95rem 1.05rem;
  border-left: 2px solid var(--leaf);
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.55;
  background: rgba(18, 28, 24, 0.4);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.materials-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
  padding: 2rem var(--pad) 1rem;
}

.materials-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(18, 28, 24, 0.5);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), background 0.25s var(--ease);
}

.materials-card:hover {
  border-color: rgba(155, 192, 147, 0.4);
  background: rgba(24, 36, 31, 0.72);
  transform: translateY(-3px);
  color: inherit;
}

.materials-card-media {
  min-height: 11rem;
  background:
    linear-gradient(180deg, transparent 40%, rgba(15, 23, 19, 0.55)),
    var(--card-img) center / cover no-repeat;
}

.materials-card-body {
  padding: 1.15rem 1.2rem 1.3rem;
  display: grid;
  gap: 0.35rem;
}

.materials-card-body h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--fog);
  letter-spacing: -0.01em;
}

.materials-card-body p:last-child {
  margin: 0.2rem 0 0;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.55;
}

.materials-sources-band {
  border-top: 1px solid var(--line);
}

.materials-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--text-dim);
}

.materials-crumb a {
  color: var(--leaf-bright);
  text-decoration: none;
}

.materials-crumb a:hover {
  color: var(--fog);
}

.material-article {
  padding-bottom: 2rem;
}

.material-hero-figure,
.material-figure {
  margin: 0;
}

.material-hero-figure {
  padding: 0 var(--pad);
  margin-bottom: 0.5rem;
}

.material-hero-figure img,
.material-figure img {
  width: 100%;
  max-height: 28rem;
  object-fit: contain;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(12, 18, 15, 0.7);
}

.material-hero-figure figcaption,
.material-figure figcaption {
  margin-top: 0.65rem;
  color: var(--text-dim);
  font-size: 0.88rem;
  line-height: 1.45;
}

.material-body {
  max-width: none;
  padding: 1.5rem var(--pad) 0;
}

.material-section + .material-section {
  margin-top: 2.4rem;
  padding-top: 2.2rem;
  border-top: 1px solid var(--line);
}

.material-section h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  font-weight: 700;
  color: var(--fog);
  letter-spacing: -0.015em;
}

.material-para {
  margin: 0 0 1rem;
  color: var(--mist);
  font-size: 1.02rem;
  line-height: 1.7;
  white-space: pre-line;
}

.material-figure {
  margin: 1.35rem 0 0.4rem;
}

.material-figure figcaption {
  margin-top: 0.65rem;
  color: var(--text-dim);
  font-size: 0.88rem;
  line-height: 1.45;
}

.material-pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  margin: 3rem var(--pad) 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.material-pager-link {
  display: grid;
  gap: 0.2rem;
  text-decoration: none;
  color: var(--fog);
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.material-pager-link:hover {
  border-color: var(--line-strong);
  background: rgba(18, 28, 24, 0.55);
  color: var(--fog);
}

.material-pager-next {
  text-align: right;
  justify-self: end;
}

.material-pager-all {
  color: var(--leaf-bright);
  text-decoration: none;
  font-size: 0.92rem;
}

.material-pager-all:hover {
  color: var(--fog);
}

@media (max-width: 860px) {
  .materials-grid {
    grid-template-columns: 1fr;
  }

  .material-pager {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .material-pager-next {
    text-align: left;
    justify-self: stretch;
  }

  .material-hero-figure img,
  .material-figure img {
    max-height: 20rem;
  }
}
