/* codymadethis.com — shared styles (hub + tidify)
   Design language mirrors the Tidify app: iOS-native minimalism,
   flat colors, capsules, SF Pro, light/dark follows the system. */

:root {
  --bg: #ffffff;
  --fg: #111114;
  --muted: #6e6e73;
  --card: #f5f5f7;
  --line: #e3e3e8;
  --brand: #4DA8DA;
  --accent: #EB3529;
  --success: #28B44A;
  --phone-bezel: #111113;
  --r: 12px;
  --r-lg: 20px;
  --maxw: 1080px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --fg: #f2f2f7;
    --muted: #98989f;
    --card: #141416;
    --line: #2c2c2e;
    --accent: #FF3F33;
    --success: #34C759;
    --phone-bezel: #2a2a2c;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    Inter, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- type ---------- */
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.02em; }
.kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 14px;
}
.lead { color: var(--muted); font-size: clamp(17px, 2vw, 19px); }

/* ---------- nav ---------- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0;
}
.nav .brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--fg); font-weight: 700; font-size: 16px; letter-spacing: -0.01em;
}
.nav .brand:hover { text-decoration: none; }
.nav .brand img { width: 28px; height: 28px; border-radius: 7px; }
.nav .navlink { color: var(--muted); font-size: 15px; font-weight: 500; }

/* ---------- buttons / badges ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 22px; border-radius: 999px;
  background: var(--fg); color: var(--bg);
  font-weight: 600; font-size: 16px; border: none; cursor: pointer;
}
.btn:hover { text-decoration: none; opacity: 0.9; }
.appstore-badge img { height: 54px; width: auto; }
.appstore-badge:hover { opacity: 0.85; }
@media (prefers-color-scheme: dark) {
  /* official black badge already carries a white keyline — works on dark */
}

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(32px, 6vw, 72px); align-items: center;
  padding: clamp(40px, 7vw, 96px) 0 clamp(56px, 8vw, 110px);
  min-height: calc(88svh - 80px);
}
.hero-copy .eyebrow {
  display: flex; align-items: center; gap: 12px; margin-bottom: 22px;
  font-weight: 600; color: var(--muted); font-size: 15px;
}
.hero-copy .eyebrow img { width: 40px; height: 40px; border-radius: 10px; }
.hero-copy h1 {
  font-size: clamp(42px, 6.4vw, 68px);
  font-weight: 800; letter-spacing: -0.03em; margin-bottom: 20px;
}
.hero-copy h1 .accent { color: var(--accent); }
.hero-copy .lead { max-width: 46ch; margin-bottom: 30px; }
.cta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; }
.cta-meta { color: var(--muted); font-size: 14px; line-height: 1.5; }
.cta-meta .star { color: #f5a623; }

/* ---------- phone mockup ---------- */
.phone-col { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.phone {
  width: 300px; height: 620px; flex: none;
  background: var(--phone-bezel);
  border-radius: 46px; padding: 10px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.28), 0 4px 14px rgba(0,0,0,0.18);
  position: relative;
}
.screen {
  width: 100%; height: 100%; border-radius: 37px; overflow: hidden;
  position: relative; background: #0b0b0c;
}
.phone-caption { color: var(--muted); font-size: 14px; text-align: center; max-width: 300px; }

/* stacked "clutter" photo cards */
.stack { position: absolute; inset: 0; }
.card {
  position: absolute; inset: 0; overflow: hidden; border-radius: 37px;
  opacity: 0;
  animation: cardCycle 12s cubic-bezier(0.3, 0.05, 0.25, 1) infinite var(--d, 0s);
  will-change: transform, opacity;
}
.card svg { width: 100%; height: 100%; display: block; }
.c1 { --d: 0s; }
.c2 { --d: -4s; }
.c3 { --d: -8s; }

@keyframes cardCycle {
  0%      { opacity: 0; transform: translateY(16px) scale(0.92); z-index: 1; }
  4%      { opacity: 1; }
  30%     { transform: translateY(16px) scale(0.92); z-index: 1; }
  33.33%  { transform: translateY(8px)  scale(0.96); z-index: 2; }
  63%     { transform: translateY(8px)  scale(0.96); z-index: 2; }
  66.67%  { transform: translateY(0)    scale(1);    z-index: 3; }
  85%     { transform: translateY(0)    scale(1);    z-index: 3; }
  88.5%   { transform: translateY(-13%) rotate(-2deg) scale(1); z-index: 3; }
  90%     { transform: translateY(-15%) rotate(-2.2deg); opacity: 1; z-index: 3; }
  96%     { transform: translateY(-150%) rotate(-7deg); opacity: 0; z-index: 3; }
  100%    { opacity: 0; transform: translateY(16px) scale(0.92); z-index: 1; }
}

/* red swipe trail behind the flying card */
.card::after {
  content: "";
  position: absolute; left: 50%; bottom: -8px;
  width: 4px; height: 64px; margin-left: -2px;
  border-radius: 4px; background: var(--accent);
  opacity: 0;
  animation: streak 12s linear infinite var(--d, 0s);
}
@keyframes streak {
  0%, 87% { opacity: 0; }
  90%     { opacity: 0.85; }
  95%     { opacity: 0; }
  100%    { opacity: 0; }
}

/* glass chrome */
.glass {
  background: rgba(250, 250, 250, 0.78);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  color: #16161a;
}
.pill-top {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 10; text-align: center; padding: 7px 18px; border-radius: 999px;
  line-height: 1.25; white-space: nowrap;
}
.pill-top b { font-size: 14px; display: block; font-weight: 700; }
.pill-top span { font-size: 11px; color: rgba(22,22,26,0.55); }
.statusbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 9;
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 24px 0; font-size: 12px; font-weight: 600; color: #fff;
  mix-blend-mode: difference;
}
.counter {
  position: absolute; top: 64px; right: 14px; z-index: 10;
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700;
}
.counter svg { width: 14px; height: 14px; }
.counter .nums { position: relative; width: 1.6em; height: 1.2em; }
.counter .n {
  position: absolute; inset: 0; text-align: left; opacity: 0;
  animation: countShow 12s linear infinite var(--cd, 0s);
}
/* each number is visible for one third of the loop; swaps as a card flies off */
.counter .n1 { --cd: -0.4s; }  /* shows 12 */
.counter .n2 { --cd: -8.4s; }  /* shows 13 */
.counter .n3 { --cd: -4.4s; }  /* shows 14 */
@keyframes countShow {
  0%     { opacity: 1; transform: scale(1.3); }
  2.5%   { opacity: 1; transform: scale(1); }
  32%    { opacity: 1; }
  33.4%  { opacity: 0; }
  100%   { opacity: 0; }
}
.toast {
  position: absolute; left: 50%; bottom: 108px; transform: translateX(-50%);
  z-index: 10; padding: 9px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  opacity: 0;
  animation: toastShow 12s linear infinite -0.4s;
}
@keyframes toastShow {
  0%   { opacity: 0; transform: translate(-50%, 6px); }
  1.5% { opacity: 1; transform: translate(-50%, 0); }
  16%  { opacity: 1; }
  20%  { opacity: 0; transform: translate(-50%, -4px); }
  100% { opacity: 0; }
}
.actionbar {
  position: absolute; bottom: 20px; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 0 14px;
}
.abtn {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.abar {
  height: 48px; border-radius: 999px; display: flex; align-items: center;
  gap: 22px; padding: 0 22px;
}
.actionbar svg { width: 20px; height: 20px; stroke: #26262b; fill: none; stroke-width: 1.8; }
.abtn.trash svg { stroke: var(--accent); }

/* pause hook (JS adds .paused when hero offscreen) */
.paused .card, .paused .card::after, .paused .counter .n, .paused .toast {
  animation-play-state: paused;
}

/* ---------- sections ---------- */
section.feature { padding: clamp(48px, 8vw, 96px) 0; }
.feature-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(36px, 6vw, 80px); align-items: center;
}
.feature-grid h2, .center h2 {
  font-size: clamp(30px, 4.2vw, 44px); font-weight: 750; margin-bottom: 16px;
}
.feature-grid .lead { max-width: 48ch; }
.feature-grid.flip .visual { order: -1; }
.visual { display: flex; justify-content: center; }

/* screenshot in a device frame */
.shotframe {
  width: min(320px, 80vw); border-radius: 34px; padding: 9px;
  background: var(--phone-bezel);
  box-shadow: 0 18px 44px rgba(0,0,0,0.22);
}
.shotframe img { border-radius: 26px; width: 100%; }

/* floating UI row snippet */
.rowsnip {
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 14px 36px rgba(0,0,0,0.16);
  border: 1px solid var(--line);
  background: var(--bg);
}
.rowsnip img { width: 100%; }
.snipstack { display: flex; flex-direction: column; gap: 18px; width: min(430px, 88vw); }

/* fanned mini cards under Glimpses row */
.fan { display: flex; justify-content: center; height: 120px; position: relative; margin-top: 6px; }
.fan i {
  width: 86px; height: 112px; border-radius: 10px; position: absolute; top: 0;
  border: 1px solid var(--line);
}
.fan i:nth-child(1) { transform: rotate(-9deg) translateX(-72px) translateY(6px); background: #b8d8b8; }
.fan i:nth-child(2) { transform: rotate(1deg); background: #dfc9a8; z-index: 2; }
.fan i:nth-child(3) { transform: rotate(10deg) translateX(72px) translateY(7px); background: #a8c4df; }

/* gesture legend */
.gestures {
  background: var(--card); border-radius: var(--r-lg);
  padding: 34px; width: min(430px, 88vw);
  display: flex; flex-direction: column; gap: 16px;
}
.gest {
  display: flex; align-items: center; gap: 16px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px 18px; font-weight: 600;
}
.gest .glyph {
  width: 40px; height: 40px; border-radius: 999px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; background: var(--card);
}
.gest.del .glyph { background: var(--accent); color: #fff; }
.gest small { display: block; font-weight: 400; color: var(--muted); }
.gest-note { color: var(--muted); font-size: 14px; text-align: center; }

/* album chips mock */
.albummock {
  background: var(--card); border-radius: var(--r-lg);
  padding: 34px 26px; width: min(430px, 88vw);
}
.albummock .photo {
  height: 150px; border-radius: 14px;
  background: #cfa96a;
  position: relative; overflow: hidden; margin-bottom: 18px;
}
.albummock .photo::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 44%;
  background: #7d9a6d;
}
.albummock .photo::before {
  content: ""; position: absolute; top: 18px; right: 22px;
  width: 34px; height: 34px; border-radius: 50%; background: #f2e8c9;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  border: 1px solid var(--line); background: var(--bg); color: var(--fg);
  white-space: nowrap;
}
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.new { color: var(--muted); border-style: dashed; }
.albummock figcaption { margin-top: 16px; color: var(--muted); font-size: 13px; text-align: center; }

/* notification mock */
.notif {
  display: flex; gap: 12px; align-items: flex-start;
  border-radius: 16px; padding: 13px 15px;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 10px 26px rgba(0,0,0,0.12);
}
.notif img { width: 38px; height: 38px; border-radius: 9px; }
.notif .t { font-size: 12px; color: var(--muted); letter-spacing: 0.02em; }
.notif .b { font-size: 14.5px; font-weight: 600; line-height: 1.35; }

/* trust section */
.center { text-align: center; }
.trust-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  margin-top: 44px; text-align: left;
}
.tcard {
  background: var(--card); border-radius: var(--r-lg); padding: 28px 24px;
}
.tcard .num {
  width: 34px; height: 34px; border-radius: 999px;
  background: var(--fg); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; margin-bottom: 16px;
}
.tcard h3 { font-size: 19px; margin-bottom: 8px; }
.tcard p { color: var(--muted); font-size: 15px; }
.privacy-strip {
  margin-top: 26px; border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px 28px; display: flex; gap: 14px; align-items: center;
  justify-content: center; flex-wrap: wrap;
}
.privacy-strip .lock {
  width: 38px; height: 38px; border-radius: 999px; background: var(--card);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.privacy-strip p { font-size: 15.5px; }
.privacy-strip b { font-weight: 700; }

/* stats / payoff */
.statscard {
  background: var(--card); border-radius: var(--r-lg);
  padding: 40px 30px; width: min(430px, 88vw);
  text-align: center; position: relative; overflow: hidden;
}
.statscard .freed {
  font-size: 52px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05;
}
.statscard .freed small { font-size: 20px; font-weight: 700; color: var(--muted); }
.statscard .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.factchips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 22px; }
.fchip {
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--bg); border: 1px solid var(--line);
}
.fchip.streak { border-color: var(--success); color: var(--success); }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i {
  position: absolute; top: -10px; width: 7px; height: 11px; border-radius: 2px;
  opacity: 0; left: calc(var(--x) * 1%);
  background: var(--brand);
}
.confetti i:nth-child(3n)  { background: var(--accent); }
.confetti i:nth-child(3n+1){ background: var(--success); }
.confetti.go i {
  animation: fall 1.15s cubic-bezier(0.2, 0.5, 0.6, 1) forwards;
  animation-delay: calc(var(--dl) * 1ms);
}
@keyframes fall {
  0%   { opacity: 1; transform: translateY(-12px) rotate(0deg); }
  85%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(340px) rotate(calc(var(--rot) * 1deg)); }
}

/* store gallery */
.gallery {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-top: 44px;
}
.gallery figure { margin: 0; }
.gallery img {
  border-radius: 18px; border: 1px solid var(--line);
  width: 100%; height: auto;
}
@media (max-width: 860px) {
  .gallery {
    grid-template-columns: none; grid-auto-flow: column;
    grid-auto-columns: 70vw; overflow-x: auto; padding-bottom: 10px;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  }
  .gallery figure { scroll-snap-align: center; }
}

/* pricing */
.plans {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 44px;
  text-align: left;
}
.plan {
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px 28px;
  display: flex; flex-direction: column; gap: 0;
}
.plan.pro { border: 2px solid var(--brand); position: relative; }
.plan .plan-name { font-size: 21px; font-weight: 750; }
.plan .plan-price { font-size: 15px; color: var(--muted); margin: 6px 0 18px; }
.plan ul { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.plan li { padding-left: 26px; position: relative; font-size: 15.5px; }
.plan li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--success); font-weight: 800;
}
.trial-pill {
  position: absolute; top: -13px; right: 22px;
  background: var(--brand); color: #fff;
  padding: 4px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
}
.plan .fine { color: var(--muted); font-size: 13px; margin-top: 18px; }

/* final CTA */
.finale { padding: clamp(70px, 10vw, 130px) 0; }
.finale .lead { margin: 0 auto 34px; max-width: 44ch; }
.finale .appstore-badge img { height: 60px; }

/* footer */
footer {
  border-top: 1px solid var(--line);
  padding: 30px 0 44px; margin-top: 20px;
  color: var(--muted); font-size: 14px;
}
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot a { color: var(--muted); margin-left: 22px; }
.foot a:first-child { margin-left: 0; }

/* ---------- hub page ---------- */
.hub {
  min-height: 92svh; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center;
  padding: 60px 24px;
}
.hub h1 {
  font-size: clamp(44px, 8vw, 76px); font-weight: 800; letter-spacing: -0.035em;
}
.hub h1 .u {
  text-decoration: underline;
  text-decoration-color: var(--brand);
  text-decoration-thickness: 5px;
  text-underline-offset: 8px;
}
.hub .sub { color: var(--muted); font-size: clamp(17px, 2.2vw, 20px); margin: 18px 0 54px; }
.appcard {
  display: flex; align-items: center; gap: 20px; text-align: left;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 24px 28px;
  width: min(520px, 92vw); color: var(--fg);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.appcard:hover {
  text-decoration: none; transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.14);
}
.appcard img { width: 64px; height: 64px; border-radius: 15px; flex: none; }
.appcard .meta b { font-size: 19px; display: block; }
.appcard .meta span { color: var(--muted); font-size: 14.5px; display: block; margin-top: 2px; }
.appcard .meta em { font-style: normal; color: var(--brand); font-weight: 600; font-size: 14.5px; }
.appcard .go { margin-left: auto; font-size: 22px; color: var(--muted); }
.hub-foot { color: var(--muted); font-size: 13.5px; margin-top: 70px; }

/* ---------- 404 ---------- */
.lost { min-height: 80svh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 14px; padding: 24px; }
.lost h1 { font-size: clamp(40px, 7vw, 64px); font-weight: 800; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: 0; text-align: center; }
  .hero-copy .eyebrow { justify-content: center; }
  .hero-copy .lead { margin-left: auto; margin-right: auto; }
  .cta-row { justify-content: center; }
  .phone { width: 280px; height: 580px; }
  .feature-grid { grid-template-columns: 1fr; gap: 34px; }
  .feature-grid.flip .visual { order: 0; }
  .trust-cards { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr; }
}

/* ---------- motion safety ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .card::after, .counter .n, .toast, .confetti i { animation: none !important; }
  /* static composition: front card frozen mid-swipe, trail visible */
  .c3 { opacity: 1; transform: translateY(-13%) rotate(-2deg); z-index: 3; }
  .c2 { opacity: 1; transform: translateY(8px) scale(0.96); z-index: 2; }
  .c1 { opacity: 1; transform: translateY(16px) scale(0.92); z-index: 1; }
  .c3::after { opacity: 0.85; }
  .counter .n1 { opacity: 1; }
  .appcard { transition: none; }
}

/* fallback when backdrop-filter unsupported */
@supports not (backdrop-filter: blur(1px)) {
  .glass { background: rgba(250, 250, 250, 0.96); }
}
