/* /apps/ section — App Store-style product pages on the portfolio palette.
   Hand-maintained; scripts/build-apps.mjs only emits the HTML that links here. */

:root {
  --bg: #f5f0eb;
  --surface: #ffffff;
  --surface-2: #faf7f3;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --faint: #9a9a9a;
  --line: #e8e2db;
  --accent: #007aff;
  --accent-dark: #0062cc;
  --radius: 16px;
  --shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
  --wrap: 1080px;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-family: var(--sans); font-weight: 700; font-size: clamp(1.85rem, 3.4vw, 2.5rem); letter-spacing: -0.03em; line-height: 1.12; }
h2 { font-family: var(--sans); font-weight: 700; font-size: clamp(1.3rem, 2.2vw, 1.6rem); letter-spacing: -0.02em; margin-bottom: 14px; }
h3 { font-weight: 600; font-size: 1.05rem; margin-bottom: 6px; }
p { color: var(--muted); }
ul, ol { padding-left: 1.2em; color: var(--muted); }
li { margin: 4px 0; }
b, strong { color: var(--text); font-weight: 600; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.narrow { max-width: 720px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
section { padding: 44px 0; }
section + section { border-top: 1px solid var(--line); }
.eyebrow {
  display: inline-block; font-size: 0.7rem; font-weight: 500; letter-spacing: 2px;
  text-transform: uppercase; color: var(--faint); margin-bottom: 10px;
}

/* ---- nav ---- */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(245, 240, 235, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 16px; }
.brand { font-family: var(--serif); font-weight: 900; font-size: 1.15rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 0.9rem; }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.btn-primary, .nav-links a.btn-primary:hover { color: #fff; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 999px; font-weight: 500; font-size: 0.92rem; transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease; white-space: nowrap; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px #d6cfc7; }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.appstore { display: inline-flex; align-items: center; gap: 10px; background: #1a1a1a; color: #fff; border-radius: 12px; padding: 8px 16px 8px 12px; transition: transform 0.2s ease, background 0.2s ease; }
.appstore:hover { text-decoration: none; background: #000; transform: translateY(-1px); }
.appstore svg { width: 26px; height: 26px; flex-shrink: 0; }
.appstore .t { display: flex; flex-direction: column; line-height: 1.05; }
.appstore small { font-size: 0.62rem; font-weight: 400; opacity: 0.85; }
.appstore strong { font-size: 1.05rem; font-weight: 600; color: #fff; }

/* ---- breadcrumb ---- */
.crumbs { font-size: 0.8rem; color: var(--faint); padding: 18px 0 0; }
.crumbs ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; color: inherit; }
.crumbs li + li::before { content: '›'; margin-right: 6px; color: #c8c0b8; }
.crumbs a { color: var(--faint); }
.crumbs a:hover { color: var(--text); }
.crumbs [aria-current] { color: var(--muted); }

/* ---- hero ---- */
.hero { padding-top: 28px; }
.hero-grid { display: grid; grid-template-columns: 148px 1fr; gap: 32px; align-items: start; }
.hero-icon { width: 148px; height: 148px; border-radius: 33px; box-shadow: var(--shadow-lg); }
.hero .tagline { font-size: 1.15rem; color: var(--muted); margin-top: 8px; max-width: 640px; }
.hero .cat { font-size: 0.85rem; color: var(--faint); margin-top: 6px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 20px; }
.trust { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 18px; font-size: 0.8rem; color: var(--faint); padding: 0; list-style: none; }
.trust li { margin: 0; }
.trust li + li::before { content: '·'; margin-right: 10px; color: #c8c0b8; }

/* ---- screenshots ---- */
.shots { padding-top: 8px; }
.shots-row { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 12px 0 18px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.shots-row::-webkit-scrollbar { height: 6px; }
.shots-row::-webkit-scrollbar-thumb { background: #ddd5cc; border-radius: 3px; }
.shot { flex: 0 0 auto; width: 240px; aspect-ratio: 1290 / 2796; border-radius: 22px; overflow: hidden; scroll-snap-align: start; box-shadow: var(--shadow); background: var(--surface); }
.shot.ipad { width: 320px; aspect-ratio: auto; }
.shot img { width: 100%; height: 100%; object-fit: cover; }

/* ---- facts block ---- */
.facts { padding: 26px 0; }
.facts-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px 22px; background: var(--surface); border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--shadow); }
.facts-grid dt { font-size: 0.7rem; letter-spacing: 1px; text-transform: uppercase; color: var(--faint); }
.facts-grid dd { font-size: 0.9rem; color: var(--text); margin-top: 3px; line-height: 1.4; }
@media (max-width: 900px) { .facts-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .facts-grid { grid-template-columns: repeat(2, 1fr); padding: 16px; gap: 12px 16px; } }

/* ---- cards / grids ---- */
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--surface); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card p { font-size: 0.92rem; }
.lede { font-size: 1.15rem; line-height: 1.65; color: #444; }
.highlights { margin-top: 30px; }

/* ---- long-form sections ---- */
.prose h2 { margin-top: 0; }
.prose p + p { margin-top: 12px; }
.prose ul { margin-top: 12px; }
.prose + .prose { margin-top: 36px; padding-top: 36px; border-top: 1px dashed var(--line); }

/* ---- link list (official-site guides) ---- */
.link-list { list-style: none; padding: 0; margin-top: 14px; display: grid; gap: 8px; }
.link-list li { margin: 0; }
.link-list a { display: flex; justify-content: space-between; gap: 12px; background: var(--surface); border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow); color: var(--text); font-weight: 500; font-size: 0.95rem; }
.link-list a::after { content: '↗'; color: var(--faint); }
.link-list a:hover { text-decoration: none; color: var(--accent); }

/* ---- how-to ---- */
.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 14px; margin-top: 10px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 40px 1fr; gap: 14px; background: var(--surface); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.steps li::before { content: counter(step); width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.steps h3 { margin-bottom: 4px; }
.steps p { font-size: 0.92rem; }

/* ---- pricing ---- */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 10px; }
.plan { background: var(--surface); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.plan h3 { display: flex; align-items: center; gap: 8px; }
.plan .pill { font-size: 0.68rem; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: #e9f3ff; color: var(--accent); }
.plan ul { list-style: none; padding: 0; margin-top: 10px; }
.plan li { padding-left: 22px; position: relative; font-size: 0.92rem; }
.plan li::before { content: ''; position: absolute; left: 0; top: 9px; width: 12px; height: 12px; border-radius: 50%; background: #dfeeff; box-shadow: inset 0 0 0 3px var(--accent); }
.plan-note { font-size: 0.8rem; color: var(--faint); margin-top: 14px; }

/* ---- information ---- */
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 32px; margin-top: 6px; }
.info-grid div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.info-grid dt { font-size: 0.78rem; color: var(--faint); }
.info-grid dd { font-size: 0.95rem; color: var(--text); margin-top: 2px; }

/* ---- faq ---- */
.faq details { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); margin-top: 10px; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 20px; font-weight: 600; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--faint); font-weight: 400; font-size: 1.3rem; line-height: 1; transition: transform 0.2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .a { padding: 0 20px 18px; font-size: 0.95rem; }

/* ---- chips ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin-top: 6px; }
.chips li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 0.85rem; color: var(--muted); margin: 0; }

/* ---- app cards (gallery + related) ---- */
.app-card { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center; background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); color: inherit; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.app-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.app-card img { width: 64px; height: 64px; border-radius: 14px; }
.app-card h3 { margin: 0; font-size: 1rem; }
.app-card p { font-size: 0.85rem; margin-top: 2px; }
.app-card .get { font-size: 0.78rem; font-weight: 600; color: var(--accent); background: #eef4ff; padding: 6px 14px; border-radius: 999px; letter-spacing: 0.5px; }

/* gallery rows: card + 3 preview shots, App Store "Today" feel */
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.gallery-item { background: var(--surface); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); color: inherit; display: block; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.gallery-item:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.gallery-head { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; }
.gallery-head img { width: 64px; height: 64px; border-radius: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.gallery-head h2 { margin: 0; font-family: var(--sans); font-size: 1.05rem; font-weight: 600; letter-spacing: 0; }
.gallery-head p { font-size: 0.85rem; margin-top: 2px; }
.gallery-head .cat { font-size: 0.72rem; color: var(--faint); margin-top: 3px; }
.gallery-head .get { font-size: 0.78rem; font-weight: 600; color: var(--accent); background: #eef4ff; padding: 6px 14px; border-radius: 999px; }
.gallery-shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.gallery-shots div { aspect-ratio: 1290 / 2796; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.gallery-shots img { width: 100%; height: 100%; object-fit: cover; }

/* ---- gallery category chips ---- */
.cats-bar { padding: 22px 0 4px; }
.cats { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.cats::-webkit-scrollbar { display: none; }
.cat-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 0.86rem; font-weight: 500; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease; }
.cat-chip span { font-size: 0.72rem; color: var(--faint); background: var(--surface-2); padding: 1px 7px; border-radius: 999px; }
.cat-chip:hover { text-decoration: none; border-color: #d6cfc7; color: var(--text); transform: translateY(-1px); }
.cat-chip.is-active { background: var(--text); border-color: var(--text); color: #fff; }
.cat-chip.is-active span { background: rgba(255, 255, 255, 0.18); color: #fff; }
.gallery { padding-top: 14px; }
.gallery-item[hidden] { display: none; }

/* entry animation on the gallery (also plays after the folder-open transition from the home page) */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.gallery-item { animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 60ms); }
.cats-bar { animation: rise 0.4s ease both; }
@media (prefers-reduced-motion: reduce) { .gallery-item, .cats-bar { animation: none; } }

/* ---- footer ---- */
.footer { border-top: 1px solid var(--line); padding: 34px 0 48px; font-size: 0.82rem; color: var(--faint); }
.footer-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.footer a { color: var(--muted); }
.footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
.footer .note { margin-top: 14px; max-width: 720px; font-size: 0.75rem; }

/* cross-document crossfade with the home page */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---- guides ---- */
.guide-head { padding: 26px 0 8px; }
.guide-head h1 { margin-top: 4px; }
.guide-meta { font-size: 0.82rem; color: var(--faint); margin-top: 10px; }
.answer { margin-top: 22px; background: var(--surface); border-left: 4px solid var(--accent); border-radius: 12px; padding: 16px 20px; box-shadow: var(--shadow); }
.answer-label { display: block; font-size: 0.68rem; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; font-weight: 600; }
.answer p { color: var(--text); font-size: 1.05rem; line-height: 1.6; }
.guide-body { padding-bottom: 10px; }
.guide-body > section { padding: 30px 0; border-top: 1px solid var(--line); }
.guide-body > section:first-child { border-top: 0; }
.guide-body h2 { margin-bottom: 12px; }
.guide-body p + p { margin-top: 12px; }
.guide-fig, .step-fig { margin: 18px 0 0; }
.guide-fig picture, .step-fig picture { display: block; width: 220px; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.step-fig picture { width: 180px; margin-top: 12px; }
figcaption { font-size: 0.78rem; color: var(--faint); margin-top: 8px; max-width: 420px; }
.guide-steps { margin-top: 12px; }
.tbl-wrap { overflow-x: auto; margin-top: 16px; -webkit-overflow-scrolling: touch; }
/* data tables break out of the 720px reading column so 8-column device tables do not wrap every cell */
.guide-body .tbl-wrap { position: relative; left: 50%; transform: translateX(-50%); width: min(var(--wrap), 100vw - 32px); }
.guide-body td, .guide-body tbody th { white-space: nowrap; }
.guide-body td:last-child { white-space: normal; min-width: 220px; }
.guide-body table { font-size: 0.85rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; background: var(--surface); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
caption { text-align: left; font-size: 0.8rem; color: var(--faint); padding: 0 0 8px; caption-side: top; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: 0.72rem; letter-spacing: 1px; text-transform: uppercase; color: var(--faint); background: var(--surface-2); }
tbody th { font-weight: 600; color: var(--text); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
.limits ul { margin-top: 8px; }
.method { margin-top: 30px; padding: 18px 20px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 12px; }
.method h2 { font-size: 0.8rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--faint); font-weight: 600; margin-bottom: 8px; }
.method p { font-size: 0.85rem; }
.app-cta { display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: center; background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); color: inherit; }
.app-cta:hover { text-decoration: none; box-shadow: var(--shadow-lg); }
.app-cta img { width: 64px; height: 64px; border-radius: 14px; }
.app-cta h2 { font-size: 1.05rem; margin: 0; }
.app-cta p { font-size: 0.88rem; margin-top: 2px; }
.cta-meta { display: block; font-size: 0.75rem; color: var(--faint); margin-top: 4px; }
.calc { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-top: 16px; }
.calc-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.calc label { display: flex; flex-direction: column; gap: 6px; font-size: 0.78rem; color: var(--faint); }
.calc input { font: inherit; font-size: 1rem; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); width: 100%; }
.calc input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.calc-out { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.calc-out dt { font-size: 0.7rem; letter-spacing: 1px; text-transform: uppercase; color: var(--faint); }
.calc-out dd { font-size: 1.25rem; font-weight: 600; color: var(--text); margin-top: 2px; }
.calc-note { font-size: 0.78rem; color: var(--faint); margin-top: 14px; }
@media (max-width: 640px) { .calc-row { grid-template-columns: 1fr; } .calc-out { grid-template-columns: repeat(2, 1fr); } .guide-fig picture { width: 180px; } }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g3 { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  section { padding: 34px 0; }
  .nav-links { gap: 14px; font-size: 0.85rem; }
  .nav-links .hide-m { display: none; }
  .hero-grid { grid-template-columns: 1fr; gap: 18px; }
  .hero-icon { width: 108px; height: 108px; border-radius: 24px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .shot { width: 200px; }
  .shot.ipad { width: 270px; }
  .app-card { grid-template-columns: 52px 1fr auto; }
  .app-card img { width: 52px; height: 52px; border-radius: 12px; }
  .gallery-head { grid-template-columns: 56px 1fr; }
  .gallery-head img { width: 56px; height: 56px; }
  .gallery-head .get { display: none; }
  .steps li { grid-template-columns: 32px 1fr; }
  .steps li::before { width: 32px; height: 32px; font-size: 0.9rem; }
}
