/* Aligned with app TrellisTheme.swift (TrellisColors) */
:root {
  color-scheme: dark;
  --trellis-bg: rgb(69, 91, 90);
  --trellis-text: rgb(224, 231, 216);
  --trellis-elevated: rgb(80, 101, 100);
  --trellis-bar: rgb(56, 78, 77);
  --trellis-accent: rgb(167, 196, 159);
  --trellis-accent-on: rgb(32, 48, 46);
  --trellis-separator: rgba(255, 255, 255, 0.12);
  --trellis-muted: rgba(224, 231, 216, 0.68);
  /* Ruled notebook line height (manifesto body); matches app lyric rhythm */
  --line-step: clamp(1.65rem, 2.75vw, 1.8125rem);
  /* TrellisColors.workspaceTabBarSegmentSelectedPalette — WorkspaceChromeAppTitleText */
  --chrome-title-gradient: linear-gradient(
    90deg,
    rgb(153, 117, 133) 0%,
    rgb(163, 138, 122) 25%,
    rgb(153, 148, 122) 50%,
    rgb(128, 153, 138) 75%,
    rgb(128, 140, 168) 100%
  );
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Rounded",
    "Helvetica Neue",
    sans-serif;
  line-height: 1.5;
  color: var(--trellis-text);
  background: var(--trellis-bg);
}

/* Full-height column: main grows, footer sits at bottom */
.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 2rem) clamp(1.15rem, 4vw, 1.75rem) clamp(2rem, 6vw, 3.5rem);
}

/* ——— Landing (ruled notebook sheet) ——— */
.landing-main {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

/* Ruled notebook sheet (landing letter + download), Trellis colors only */
.notebook-sheet {
  position: relative;
  padding: clamp(1.15rem, 3.5vw, 1.6rem) clamp(1rem, 3vw, 1.35rem) clamp(1.35rem, 3vw, 1.75rem)
    clamp(2.55rem, 5.5vw, 3rem);
  border-radius: 4px;
  border: 1px solid var(--trellis-separator);
  background-color: var(--trellis-bg);
  background-image:
    linear-gradient(
      90deg,
      transparent 0,
      transparent calc(2.35rem - 1px),
      rgba(200, 118, 110, 0.48) calc(2.35rem - 1px),
      rgba(200, 118, 110, 0.48) 2.35rem,
      transparent 2.35rem
    ),
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc(var(--line-step) - 1px),
      rgba(255, 255, 255, 0.09) calc(var(--line-step) - 1px),
      rgba(255, 255, 255, 0.09) var(--line-step)
    );
  background-size: 100% 100%, 100% var(--line-step);
  background-repeat: no-repeat, repeat;
  background-position: 0 0, 0 0;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.manifesto {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.manifesto-head {
  margin-bottom: calc(var(--line-step) * 0.65);
  padding-bottom: calc(var(--line-step) * 0.45);
  border-bottom: 1px solid var(--trellis-separator);
}

.manifesto-title {
  margin: 0;
  font-size: clamp(1.35rem, 3.5vw, 1.65rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: calc(var(--line-step) * 1.35);
  color: var(--trellis-text);
}

.manifesto-body {
  font-family:
    ui-monospace,
    "SF Mono",
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    "Liberation Mono",
    "Courier New",
    monospace;
  font-size: calc(var(--line-step) / 1.75);
  line-height: var(--line-step);
  color: var(--trellis-text);
}

.manifesto-body p {
  margin: 0 0 var(--line-step);
}

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

.manifesto-body em {
  color: var(--trellis-accent);
  font-style: italic;
}

.manifesto-body strong {
  font-weight: 600;
  color: var(--trellis-accent);
}

.download-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  text-align: center;
  margin-top: calc(var(--line-step) * 1.15);
  padding-top: calc(var(--line-step) * 0.85);
  border-top: 1px solid var(--trellis-separator);
}

.app-download-name {
  margin: 0;
  font-family:
    ui-monospace,
    "SF Mono",
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    "Liberation Mono",
    "Courier New",
    monospace;
  font-size: clamp(1.45rem, 4.2vw, 2rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: lowercase;
  background-image: var(--chrome-title-gradient);
  background-size: 100% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .app-download-name {
    background-image: none;
    color: var(--trellis-text);
    -webkit-text-fill-color: var(--trellis-text);
  }
}

.app-store-link {
  display: inline-block;
  line-height: 0;
  border-radius: 6px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.app-store-link:hover {
  transform: scale(1.02);
  opacity: 0.95;
}

.app-store-link:focus-visible {
  outline: 2px solid var(--trellis-accent);
  outline-offset: 4px;
}

.app-store-link img {
  display: block;
  width: min(200px, 72vw);
  height: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ——— Shared footer ——— */
.site-footer {
  flex-shrink: 0;
  margin-top: auto;
  background: var(--trellis-bar);
  border-top: 1px solid var(--trellis-separator);
}

.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin: 0;
  padding: 0.9rem 1.25rem;
  list-style: none;
  font-size: 0.875rem;
  font-weight: 500;
}

.site-footer-nav a {
  color: var(--trellis-muted);
  text-decoration: none;
}

.site-footer-nav a:hover {
  color: var(--trellis-text);
}

.site-footer-nav a:focus-visible {
  outline: 2px solid var(--trellis-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.site-footer-nav a[aria-current="page"] {
  color: var(--trellis-accent);
}

/* Slightly wider measure for long-form legal copy */
.site-main.legal-doc {
  max-width: min(46rem, 94vw);
}

.legal-doc h1 {
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.legal-updated {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  color: var(--trellis-muted);
}

.legal-summary {
  margin: 0 0 2rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--trellis-separator);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.12);
}

.legal-summary h2 {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.legal-summary ul {
  margin: 0;
  padding-left: 1.2rem;
}

.legal-summary li {
  margin: 0.35rem 0;
}

article.legal a {
  color: var(--trellis-accent);
}

article.legal h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.01em;
}

article.legal h2:first-of-type {
  margin-top: 0;
}

article.legal h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
}

article.legal p {
  margin: 0 0 0.85rem;
}

article.legal ul {
  margin: 0 0 0.85rem;
  padding-left: 1.25rem;
}

article.legal li {
  margin: 0.35rem 0;
}
