/* ============================================================
   taatub.com — warm editorial specimen sheet
   Fraunces (display) + Instrument Sans (body), warm paper ground,
   asymmetric two-column app sections, bleeding filmstrips.
   ============================================================ */

:root {
  --paper: #f5f2ec;
  --paper-raised: #efeade;
  --ink: #1a1815;
  --ink-soft: rgba(26, 24, 21, 0.62);
  --ink-faint: rgba(26, 24, 21, 0.14);
  --accent: #a8452b;
  --accent-soft: rgba(168, 69, 43, 0.14);

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  --font-body: "Instrument Sans", -apple-system, "Segoe UI", sans-serif;

  /* Masthead expanded <-> compact endpoints. --scroll-progress (0-1) is written
     by main.js on every scroll frame; every value below is a calc() blend
     between its expanded and compact endpoint, so the shrink tracks scroll
     position directly instead of playing out over time. Defaults to 0
     (expanded) so the page is correct before JS runs. */
  --wm-size: clamp(4.25rem, 9vw, 7.25rem);
  --wm-size-compact: 1.45rem;
  --masthead-pad-top: clamp(2rem, 5vw, 3.25rem);
  --masthead-pad-bottom: clamp(1rem, 2vw, 1.5rem);
  --masthead-pad-compact: 1rem;
  --masthead-h-expanded: calc(var(--wm-size) * 0.88 + var(--masthead-pad-top) + var(--masthead-pad-bottom));
  --masthead-h-compact: calc(var(--wm-size-compact) * 0.88 + var(--masthead-pad-compact) * 2);
  --scroll-progress: 0;

  --grain-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

html {
  scroll-padding-top: 5rem;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

/* ---------- paper grain ---------- */

.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: var(--grain-image);
}

main,
footer {
  position: relative;
  z-index: 1;
}

/* ---------- masthead ---------- */

.masthead {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding-top: calc(var(--masthead-pad-top) * (1 - var(--scroll-progress)) + var(--masthead-pad-compact) * var(--scroll-progress));
  padding-bottom: calc(var(--masthead-pad-bottom) * (1 - var(--scroll-progress)) + var(--masthead-pad-compact) * var(--scroll-progress));
  padding-inline: var(--gutter);
  background: var(--paper);
}

.masthead::before {
  /* Same grain tile as the page-wide .grain overlay, scoped to just this box,
     so an opaque masthead doesn't read as a flatter patch against the
     textured page below it. */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: var(--grain-image);
}

/* ---------- hero ---------- */

.hero {
  padding: 0 var(--gutter) clamp(1.5rem, 3vw, 2.25rem);
}

main {
  padding-top: calc(var(--masthead-h-expanded) * (1 - var(--scroll-progress)) + var(--masthead-h-compact) * var(--scroll-progress));
}

.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: calc(var(--wm-size) * (1 - var(--scroll-progress)) + var(--wm-size-compact) * var(--scroll-progress));
  line-height: 0.88;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.hero-line {
  max-width: 36em;
  margin: 0;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.55;
  color: var(--ink-soft);
}

.rule {
  height: 1px;
  background: var(--ink-faint);
  border: 0;
  margin: 1.75rem 0 0;
  width: 100%;
}

/* ---------- scroll reveal ---------- */

.reveal {
  animation: rise 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--d, 0) * 0.12s);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.in-view {
  animation: rise 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

section.app,
.contact-grid {
  opacity: 0;
}

section.app.in-view,
.contact-grid.in-view {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .in-view,
  section.app,
  .contact-grid {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---------- apps ---------- */

.apps {
  padding-block: clamp(1rem, 3vw, 2rem);
}

.app {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  column-gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
  padding-block: clamp(2rem, 5vw, 3.5rem);
}

.app + .app {
  border-top: 1px solid var(--ink-faint);
}

.app-info {
  padding-left: var(--gutter);
  padding-right: 1rem;
}

.app-number {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.75rem, 5vw, 4.25rem);
  color: var(--accent);
  opacity: 0.55;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.app-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.app-icon {
  width: 60px;
  height: 60px;
  border-radius: 22%;
  box-shadow: 0 10px 24px -14px rgba(26, 24, 21, 0.5);
  flex-shrink: 0;
}

.app-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 2.6vw, 2.15rem);
  line-height: 1.1;
}

.app-tagline {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.app-desc {
  margin: 0 0 1.5rem;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  max-width: 34em;
}

.app-features {
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.app-features li {
  font-size: 0.9rem;
  color: var(--ink-soft);
  padding-left: 1.1rem;
  position: relative;
}

.app-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.app-meta {
  margin: 0 0 1.25rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.store-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--accent);
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

.store-link span {
  transition: transform 0.2s ease;
  display: inline-block;
}

.store-link:hover span {
  transform: translateX(4px);
}

/* ---------- filmstrip ---------- */

.app-filmstrip {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-block: 0.5rem 2.5rem;
  scrollbar-width: none;
}

.app-filmstrip::-webkit-scrollbar {
  display: none;
}

.app-filmstrip img {
  flex: 0 0 auto;
  width: clamp(190px, 22vw, 250px);
  aspect-ratio: 375 / 812;
  height: auto;
  object-fit: cover;
  border-radius: 16px;
  scroll-snap-align: start;
  box-shadow: 0 16px 44px -22px rgba(26, 24, 21, 0.4);
  background: #fff;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-filmstrip img:hover {
  transform: translateY(-6px);
}

.app-filmstrip::after {
  content: "";
  flex: 0 0 auto;
  width: var(--gutter);
}

/* ---------- contact / footer ---------- */

.contact {
  padding: clamp(2.5rem, 6vw, 4rem) var(--gutter) clamp(2rem, 5vw, 3rem);
}

.contact-grid {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(2rem, 6vw, 5rem);
  padding-top: 2.25rem;
}

.contact-label {
  margin: 0 0 0.6rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.contact-email {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--ink-faint);
}

.contact-email:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.contact-grid a[href*="privacy"] {
  display: block;
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}

.contact-grid a[href*="privacy"]:hover {
  color: var(--accent);
}

.site-footer {
  padding: 1.5rem var(--gutter) 2.5rem;
}

.site-footer p {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .app {
    grid-template-columns: 1fr;
    row-gap: 2rem;
  }

  .app-info {
    padding-right: var(--gutter);
  }

  .app-filmstrip img {
    width: clamp(180px, 62vw, 240px);
  }
}
