.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Below-the-fold content sections */
.content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 var(--space-md);
  text-shadow: 0 1px 1px light-dark(rgba(255, 255, 255, 0.8), rgba(0, 0, 0, 0.5));
}

/* Subtle dot-grid texture behind content */
.content::after {
  content: '';
  position: absolute;
  inset: 0;
  left: calc(-50vw + 50%);
  width: 100vw;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(
    circle,
    light-dark(rgba(0, 0, 0, 0.15), rgba(255, 255, 255, 0.1)) 1px,
    transparent 1px
  );
  background-size: 14px 14px;
}

/* Zone 1: Lede statement */
.content-lede {
  position: relative;
  padding: 4rem 0 3rem;
}

/* Multi-line fading rule — lines fan out with decreasing opacity */
.content-lede::before {
  content: '';
  position: absolute;
  top: 0;
  left: calc(-50vw + 50%);
  width: 100vw;
  height: 32px;
  background:
    linear-gradient(to bottom,
      light-dark(var(--gray-400), var(--gray-600)) 0px,
      transparent 1px
    ) 0 0 / 100% 100% no-repeat,
    linear-gradient(to bottom,
      light-dark(rgba(160, 160, 170, 0.9), rgba(100, 100, 110, 0.7)) 0px,
      transparent 1px
    ) 0 5px / 100% 100% no-repeat,
    linear-gradient(to bottom,
      light-dark(rgba(160, 160, 170, 0.6), rgba(100, 100, 110, 0.45)) 0px,
      transparent 1px
    ) 0 11px / 100% 100% no-repeat,
    linear-gradient(to bottom,
      light-dark(rgba(160, 160, 170, 0.35), rgba(100, 100, 110, 0.25)) 0px,
      transparent 1px
    ) 0 18px / 100% 100% no-repeat,
    linear-gradient(to bottom,
      light-dark(rgba(160, 160, 170, 0.18), rgba(100, 100, 110, 0.12)) 0px,
      transparent 1px
    ) 0 26px / 100% 100% no-repeat;
}

/* Tinted inset shadow — indigo wash fading downward from section top */
.content-lede::after {
  content: '';
  position: absolute;
  top: 0;
  left: calc(-50vw + 50%);
  width: 100vw;
  height: 90px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    light-dark(rgba(35, 17, 120, 0.12), rgba(100, 80, 220, 0.2)) 0%,
    light-dark(rgba(35, 17, 120, 0.05), rgba(100, 80, 220, 0.08)) 40%,
    transparent 100%
  );
}

.content-lede-heading {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 2.75rem;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--color-text);
  margin-bottom: var(--space-lg);
}

.content-lede-body {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--color-text-secondary);
  max-width: 520px;
}

.content-lede-accent {
  color: var(--color-text);
  font-weight: 500;
}

/* Zone 2: Category clusters */
.content-cluster {
  position: relative;
  padding-top: var(--space-2xl);
}

.content-cluster:last-of-type {
  padding-bottom: var(--space-2xl);
}

/* Multi-line fading rule — same pattern as lede */
.content-cluster::before {
  content: '';
  position: absolute;
  top: 0;
  left: calc(-50vw + 50%);
  width: 100vw;
  height: 32px;
  background:
    linear-gradient(to bottom,
      light-dark(var(--gray-400), var(--gray-600)) 0px,
      transparent 1px
    ) 0 0 / 100% 100% no-repeat,
    linear-gradient(to bottom,
      light-dark(rgba(160, 160, 170, 0.9), rgba(100, 100, 110, 0.7)) 0px,
      transparent 1px
    ) 0 5px / 100% 100% no-repeat,
    linear-gradient(to bottom,
      light-dark(rgba(160, 160, 170, 0.6), rgba(100, 100, 110, 0.45)) 0px,
      transparent 1px
    ) 0 11px / 100% 100% no-repeat,
    linear-gradient(to bottom,
      light-dark(rgba(160, 160, 170, 0.35), rgba(100, 100, 110, 0.25)) 0px,
      transparent 1px
    ) 0 18px / 100% 100% no-repeat,
    linear-gradient(to bottom,
      light-dark(rgba(160, 160, 170, 0.18), rgba(100, 100, 110, 0.12)) 0px,
      transparent 1px
    ) 0 26px / 100% 100% no-repeat;
}

/* Tinted inset shadow — mirrors lede::after, fades upward from bottom of last cluster */
.content-cluster:last-of-type::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: calc(-50vw + 50%);
  width: 100vw;
  height: 90px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    to top,
    light-dark(rgba(35, 17, 120, 0.12), rgba(100, 80, 220, 0.2)) 0%,
    light-dark(rgba(35, 17, 120, 0.05), rgba(100, 80, 220, 0.08)) 40%,
    transparent 100%
  );
}

.content-cluster-label {
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-xl);
}

.content-category {
  display: grid;
  grid-template-columns: 0.4fr 0.6fr;
  gap: var(--space-md) var(--space-xl);
  padding: var(--space-lg) 0;
  align-items: baseline;
}

@media (max-width: 480px) {
  .content-category {
    grid-template-columns: 1fr;
    gap: var(--space-xs);
  }
}

.content-category-name {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.75rem;
  letter-spacing: 0;
  color: var(--color-text);
  line-height: 1.3;
}

.content-category-desc {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--color-text-secondary);
}

/* Footer */
.footer {
  position: relative;
  z-index: 1;
  padding: 4rem var(--space-md) max(3rem, env(safe-area-inset-bottom));
  text-align: center;
  text-shadow: 0 1px 1px light-dark(rgba(255, 255, 255, 0.8), rgba(0, 0, 0, 0.5));
}

/* Solid background — covers noise and dot-grid */
.footer::after {
  content: '';
  position: absolute;
  inset: 0;
  left: calc(-50vw + 50%);
  width: 100vw;
  z-index: -1;
  background: light-dark(var(--white), var(--black));
}

/* Multi-line fading rule — same pattern */
.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: calc(-50vw + 50%);
  width: 100vw;
  height: 32px;
  background:
    linear-gradient(to bottom,
      light-dark(var(--gray-400), var(--gray-600)) 0px,
      transparent 1px
    ) 0 0 / 100% 100% no-repeat,
    linear-gradient(to bottom,
      light-dark(rgba(160, 160, 170, 0.9), rgba(100, 100, 110, 0.7)) 0px,
      transparent 1px
    ) 0 5px / 100% 100% no-repeat,
    linear-gradient(to bottom,
      light-dark(rgba(160, 160, 170, 0.6), rgba(100, 100, 110, 0.45)) 0px,
      transparent 1px
    ) 0 11px / 100% 100% no-repeat,
    linear-gradient(to bottom,
      light-dark(rgba(160, 160, 170, 0.35), rgba(100, 100, 110, 0.25)) 0px,
      transparent 1px
    ) 0 18px / 100% 100% no-repeat,
    linear-gradient(to bottom,
      light-dark(rgba(160, 160, 170, 0.18), rgba(100, 100, 110, 0.12)) 0px,
      transparent 1px
    ) 0 26px / 100% 100% no-repeat;
}

.footer-logo {
  font-weight: 600;
  font-size: clamp(2.4rem, 9.5vw, 4.2rem);
  letter-spacing: -0.04em;
  line-height: 1;
  color: light-dark(var(--gray-600), var(--gray-200));
  text-transform: lowercase;
  user-select: none;
  margin-bottom: var(--space-xl);
}

.footer-logo .logo-serif {
  display: block;
  font-size: clamp(3.2rem, 12.5vw, 5.8rem);
  letter-spacing: 0.01em;
  line-height: 0.85;
  margin-top: 0.05em;
}

.footer-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.3em;
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xl);
}

.footer-trust-highlight {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  color: var(--color-accent);
  font-weight: 500;
}

.footer-trust-icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.footer-trust-punct {
  color: var(--color-text-tertiary);
  font-weight: 400;
  margin-left: -0.3em;
}

.footer-byline {
  font-size: var(--text-xs);
  color: light-dark(#8a8a93, var(--gray-500));
  letter-spacing: 0.01em;
}

.footer-legal {
  margin-top: var(--space-md);
  font-size: 0.6875rem;
  color: var(--color-text-tertiary);
  letter-spacing: 0.01em;
}

.footer-legal a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.footer-legal a:hover {
  color: var(--color-text-secondary);
}

.footer-legal-sep {
  margin: 0 0.4em;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  flex-shrink: 0;
}

.editor-wrapper {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--space-lg);
}

.action-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding-bottom: max(var(--space-lg), env(safe-area-inset-bottom));
  flex-shrink: 0;
}
