/* Sheafs landing page. The "folio" look of the App Store tiles: warm laid paper, a serif
   headline, an oxblood rule. Fonts are the system's (New York / Caslon on Apple devices,
   Georgia elsewhere), which is also the point of the app. */

:root {
  --bg: #ece4d6;
  --paper: #f6f1e7;
  --ink: #1f1913;
  --muted: #54493e;
  --accent: #8a3a22;
  --accent-dark: #6b2c18;
  --rule: rgba(31, 25, 19, 0.14);
  --shadow-sm: 0 1px 2px rgba(58, 38, 18, 0.12), 0 6px 18px rgba(58, 38, 18, 0.14);
  --shadow-lg: 0 2px 6px rgba(58, 38, 18, 0.16), 0 28px 60px rgba(58, 38, 18, 0.26);
  --font-display: "Big Caslon", "Hoefler Text", "Iowan Old Style", "Palatino", Georgia, serif;
  --font-body: "Hoefler Text", "Iowan Old Style", "Baskerville", "Charter", Georgia, serif;
  --font-sans: "Gill Sans", "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 14px;
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 60% at 28% 18%, rgba(255, 251, 243, 0.85), transparent 70%),
    radial-gradient(ellipse 70% 50% at 85% 95%, rgba(150, 110, 70, 0.16), transparent 70%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.25  0 0 0 0 0.15  0 0 0 0.10 0'/></filter><rect width='300' height='300' filter='url(%23n)'/></svg>"),
    var(--bg);
  background-attachment: fixed, fixed, scroll, scroll;
  min-height: 100vh;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding-left: calc(1.25rem + var(--safe-left));
  padding-right: calc(1.25rem + var(--safe-right));
}
.container.narrow { max-width: 880px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.08; letter-spacing: -0.012em; }
h2 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem); }
h3 { font-size: 1.45rem; }

.kicker {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.9em;
  margin-bottom: 1rem;
}
.kicker::before { content: ""; width: 2.6em; height: 2px; background: var(--accent); }
.kicker-center { justify-content: center; text-align: center; }
.kicker-center::after { content: ""; width: 2.6em; height: 2px; background: var(--accent); }

.section-title { text-align: center; margin-bottom: 0.9rem; }
.section-subtitle {
  text-align: center;
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto 2.75rem;
  font-size: 1.15rem;
}

/* Header */
.header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(236, 228, 214, 0.82);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--rule);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.nav-logo {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-display); font-size: 1.4rem; color: var(--ink);
}
.nav-logo img { border-radius: 7px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); }
.nav-logo:hover { text-decoration: none; }
.nav-links { display: flex; gap: 1.4rem; }
.nav-link { font-family: var(--font-sans); font-size: 0.92rem; font-weight: 500; color: var(--muted); }
.nav-link:hover { color: var(--accent); text-decoration: none; }
@media (max-width: 560px) { .nav-link:not(:last-child) { display: none; } }

/* Hero */
.hero { padding: clamp(3rem, 7vw, 6.5rem) 0 clamp(2.5rem, 5vw, 5rem); }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 5fr 7fr; gap: 3.5rem; }
}
.hero-title {
  font-size: clamp(3.6rem, 2.4rem + 5vw, 6.2rem);
  line-height: 0.98;
  margin-bottom: 1rem;
}
.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1rem + 1.2vw, 1.8rem);
  line-height: 1.25;
  margin-bottom: 1.25rem;
}
.hero-description { color: var(--muted); margin-bottom: 1.75rem; max-width: 48ch; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.hero-note { font-family: var(--font-sans); font-size: 0.85rem; color: var(--muted); margin-top: 1.1rem; }
.hero-figure img { width: 100%; }
@media (min-width: 960px) { .hero-figure { margin-right: -4%; } }

.app-store-badge { display: inline-flex; line-height: 0; }
.app-store-badge img { height: 50px; width: auto; }
.app-store-badge:hover { opacity: 0.88; text-decoration: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 50px; padding: 0 1.4rem;
  border-radius: 9px;
  font-family: var(--font-sans); font-weight: 600; font-size: 1rem;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-secondary { border: 1.5px solid var(--ink); color: var(--ink); background: transparent; }
.btn-secondary:hover { background: var(--ink); color: var(--paper); }

/* Sections */
section { padding: clamp(3rem, 6vw, 5.5rem) 0; }
section + section { border-top: 1px solid var(--rule); }

.duo-grid { display: grid; gap: 2rem; }
@media (min-width: 760px) { .duo-grid { grid-template-columns: repeat(3, 1fr); gap: 1.75rem; } }
.duo-card .art { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; margin-bottom: 0.6rem; }
.duo-card img { width: auto; max-width: 100%; max-height: 100%; }
.duo-card h3 { margin-bottom: 0.35rem; }
.duo-card p { color: var(--muted); }

.features-grid { display: grid; gap: 1.5rem; }
@media (min-width: 680px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1020px) { .features-grid { grid-template-columns: repeat(3, 1fr); } }
.feature-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.6rem 1.6rem 1.7rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}
.feature-card h3 { margin-bottom: 0.55rem; }
.feature-card h3::before { content: "❧ "; color: var(--accent); }
.feature-card p { color: var(--muted); font-size: 1rem; }

/* Screenshot shelves: a horizontal scroll with snapping, no JavaScript */
.shelf {
  display: flex; gap: 1.5rem; align-items: flex-start;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem calc(max(1.25rem, (100vw - 1180px) / 2 + 1.25rem)) 1.5rem;
  scrollbar-width: thin;
}
.shelf figure { flex: 0 0 auto; width: min(68vw, 290px); scroll-snap-align: center; }
.shelf img { width: 100%; }
.shelf figcaption { font-size: 0.95rem; line-height: 1.45; color: var(--muted); padding: 0 0.6rem; }
.shelf figcaption strong { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.25rem; color: var(--ink); margin-bottom: 0.15rem; }
.shelf-ipad figure { width: min(80vw, 380px); }
.shelf-ipad figure.wide { width: min(90vw, 620px); }
.shelf-ipad figcaption { padding: 0 1rem; }

/* Open source */
.open-source { text-align: center; }
.steps-grid { display: grid; gap: 2rem; margin: 0 0 3rem; text-align: left; }
@media (min-width: 720px) { .steps-grid { grid-template-columns: repeat(3, 1fr); } }
.step-number {
  font-family: var(--font-display);
  font-size: 1.1rem;
  width: 2.2rem; height: 2.2rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--accent); color: var(--paper);
  margin-bottom: 0.9rem;
}
.step h3 { font-size: 1.3rem; margin-bottom: 0.35rem; }
.step p { color: var(--muted); font-size: 1rem; }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1rem; }

/* Footer */
.footer {
  border-top: 1px solid var(--rule);
  padding: 2.5rem 0 calc(2.5rem + env(safe-area-inset-bottom, 0px));
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}
.footer-small { font-family: var(--font-sans); font-size: 0.78rem; margin-top: 0.75rem; opacity: 0.8; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
