/* App landing pages — self-contained, independent of the blog theme. */

:root {
  --bg: #ffffff;
  --text: #16161c;
  --text-soft: #5b5b66;
  --card: #f6f6fb;
  --border: #e9e9f1;
  --radius: 24px;
  --maxw: 1120px;
}

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

body.app-page, body.apps-index {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
  overflow-x: hidden;
}
/* Prevent grid/flex items from blowing out past the viewport (images default to min-width:auto). */
.hero-main > *, .feature-row > * { min-width: 0; }
a { color: var(--accent-dark); }
img { max-width: 100%; }

.only-desktop { display: none !important; }

/* ---------- Apple badge ---------- */
.badge-link { display: inline-flex; line-height: 0; flex: none; }
.badge-link img { height: 46px; width: auto; }

/* ---------- Get-app unit: badge + QR together ----------
   On mobile it's just the plain badge; on desktop it becomes a frosted card
   that also holds a divider + QR, so the two read as one cohesive unit. */
.get-app { display: inline-flex; align-items: center; gap: 18px; }
.qr { align-items: center; gap: 14px; }
.qr-div { width: 1px; align-self: stretch; background: rgba(255,255,255,.25); }
.qr img { width: 78px; height: 78px; background: #fff; border-radius: 9px; padding: 6px; }
.qr-cap { font-size: .85rem; font-weight: 600; line-height: 1.25; max-width: 9ch; color: rgba(255,255,255,.92); }

/* ---------- Phone frame ---------- */
.phone {
  border: 9px solid #14141b;
  border-radius: 46px;
  background: #14141b;
  box-shadow: 0 26px 60px rgba(20,20,45,.32);
  overflow: hidden;
  line-height: 0;
}
.phone img { display: block; width: 100%; border-radius: 37px; }

/* ---------- Site header (solid bar; icon sits on page bg, no contrast issue) ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--border); }
.site-header-inner { max-width: var(--maxw); margin: 0 auto; padding: 12px clamp(20px, 5vw, 40px); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.brand img { border-radius: 24%; box-shadow: 0 2px 6px rgba(20,20,45,.18); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: clamp(48px, 8vw, 92px) clamp(20px, 5vw, 56px) clamp(56px, 8vw, 96px);
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(160deg, var(--accent) 0%, var(--accent-dark) 100%);
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 70% at 80% -10%, rgba(255,255,255,.20), transparent 60%);
}
.hero-main {
  position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}
.hero-copy h1 {
  font-size: clamp(2.1rem, 5.4vw, 3.4rem);
  font-weight: 800; letter-spacing: -.02em; line-height: 1.08;
  margin: 0 0 .4em; max-width: 16ch;
}
.hero-copy .sub {
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  color: rgba(255,255,255,.92); margin: 0 0 28px; max-width: 46ch;
}
.hero-actions { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.social-proof { margin: 22px 0 0; font-size: .95rem; color: rgba(255,255,255,.82); max-width: 42ch; }
.hero-phone { display: flex; justify-content: center; }
.hero-phone .phone { max-width: 290px; }

/* ---------- Feature rows ---------- */
.features { max-width: var(--maxw); margin: clamp(64px, 10vw, 120px) auto; padding: 0 clamp(20px, 5vw, 40px); display: flex; flex-direction: column; gap: clamp(56px, 9vw, 110px); }
.feature-row { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; }
.feature-text .kicker {
  text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700;
  color: var(--accent); margin: 0 0 .6em;
}
.feature-text h2 { font-size: clamp(1.5rem, 3.2vw, 2.05rem); letter-spacing: -.015em; line-height: 1.15; margin: 0 0 .45em; }
.feature-text p { color: var(--text-soft); font-size: 1.08rem; margin: 0; max-width: 46ch; }
/* Full phone frame: the whole screen in a device, grounded and recognizable. */
.feature-media { display: flex; justify-content: center; }
.feature-media .phone { max-width: 270px; width: 100%; }

/* ---------- Gallery ---------- */
.gallery { max-width: var(--maxw); margin: clamp(64px, 10vw, 120px) auto; padding: 0 clamp(20px, 5vw, 40px); }
.section-head { text-align: center; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: -.02em; margin: 0 0 .3em; }
.section-head p { color: var(--text-soft); margin: 0; font-size: 1.08rem; }
.gallery-track {
  display: flex; gap: 26px; overflow-x: auto; padding: 8px 4px 30px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.gallery-track .phone { flex: 0 0 auto; width: 300px; scroll-snap-align: center; }

/* ---------- Trust ---------- */
.trust {
  max-width: var(--maxw); margin: 0 auto clamp(64px, 10vw, 120px); padding: 0 clamp(20px, 5vw, 40px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px;
}
.trust-point { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px 26px; }
.trust-point h3 { margin: 0 0 .5em; font-size: 1.15rem; color: var(--accent-dark); }
.trust-point p { margin: 0; color: var(--text-soft); }

/* ---------- Closing ---------- */
.closing { position: relative; overflow: hidden; color: #fff; text-align: center; padding: clamp(64px, 9vw, 100px) 24px; }
.closing-inner { position: relative; z-index: 1; max-width: 780px; margin: 0 auto; }
.closing-inner h2 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); letter-spacing: -.02em; margin: 0 0 .4em; }
.closing-inner p { color: rgba(255,255,255,.9); margin: 0 auto 30px; font-size: 1.1rem; max-width: 48ch; }
.closing-actions { display: flex; align-items: center; justify-content: center; gap: 24px; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.app-footer { border-top: 1px solid var(--border); text-align: center; padding: 36px 24px; color: var(--text-soft); font-size: .9rem; }
.app-footer nav { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.app-footer a { color: var(--text-soft); text-decoration: none; }
.app-footer a:hover { color: var(--text); }

/* ---------- Desktop ---------- */
@media (min-width: 768px) {
  .only-desktop { display: flex !important; }
  .badge-link img { height: 54px; }
  .hero-main { grid-template-columns: 1.05fr .95fr; gap: clamp(40px, 6vw, 80px); }
  .hero-phone .phone { max-width: 320px; }
  .gallery-track .phone { width: 320px; }
  .get-app { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); border-radius: 18px; padding: 14px 20px; }
  .feature-row { grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 84px); }
  .feature-row:nth-child(even) .feature-media { order: 2; }
}

/* ---------- Apps index (personal) ---------- */
.intro { text-align: center; max-width: 620px; margin: 0 auto; padding: 88px 24px 8px; }
.intro .avatar { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; box-shadow: 0 10px 26px rgba(20,20,45,.20); margin-bottom: 22px; }
.intro h1 { font-size: clamp(1.9rem, 5.4vw, 2.7rem); font-weight: 800; letter-spacing: -.02em; margin: 0 0 .2em; }
.intro .role { color: var(--accent-dark); font-weight: 600; font-size: 1.05rem; margin: 0 0 1.1em; }
.intro .note { color: var(--text-soft); font-size: 1.12rem; margin: 0 auto; max-width: 52ch; }
.apps-head { text-align: center; max-width: 620px; margin: 56px auto 24px; padding: 0 24px; }
.apps-head h2 { font-size: 1.15rem; letter-spacing: .01em; text-transform: uppercase; color: var(--text-soft); font-weight: 700; margin: 0; }
.app-grid { max-width: 920px; margin: 0 auto; padding: 0 24px 70px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.app-card { display: flex; align-items: center; gap: 18px; text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; transition: transform .12s ease, box-shadow .12s ease; }
.app-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(20,20,40,.12); }
.app-card img { width: 72px; height: 72px; border-radius: 22%; flex: none; box-shadow: 0 6px 16px rgba(0,0,0,.14); }
.app-card .meta h2 { margin: 0 0 .25em; font-size: 1.2rem; }
.app-card .meta p { margin: 0; color: var(--text-soft); font-size: .95rem; }
.app-card.soon { opacity: .7; pointer-events: none; }
.app-card.soon .meta p::after { content: " · coming soon"; }
.app-card .tile { width: 72px; height: 72px; border-radius: 22%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 800; color: #fff; background: linear-gradient(160deg, #8a8a9c, #5b5b66); }
.index-foot { text-align: center; padding: 0 24px 60px; color: var(--text-soft); font-size: .9rem; }
.index-foot a { color: var(--text-soft); }

/* ---------- Dark mode ---------- */
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e0e13; --text: #f2f2f7; --text-soft: #9b9ba8; --card: #18181f; --border: #272730; }
}
