/* ===========================================================
   Page-specific styles
   (download, support, blog, single, legal)
   =========================================================== */

/* ---- Download page ---- */
.download-hero {
  position: relative;
  padding-top: calc(var(--nav-h) + clamp(48px, 8vw, 96px));
  padding-bottom: clamp(48px, 8vw, 96px);
  overflow: hidden;
}
.download-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-hero);
  z-index: 0;
  pointer-events: none;
}

.download-hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}

.download-hero__icon {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow-lg);
  margin-bottom: var(--space-5);
}
.download-hero__icon svg { width: 44px; height: 44px; color: #fff; }

.download-hero__icon--logo {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  padding: 14px;
}
.download-hero__icon--logo svg {
  width: 100%;
  height: 100%;
  color: var(--color-text);
}

.download-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.download-card__qr {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.download-card__qr canvas { width: 144px; height: 144px; flex-shrink: 0; }
.download-card__qr-txt h4 { font-size: var(--fs-md); font-weight: var(--weight-bold); margin-bottom: 4px; color: #0A0A0F; }
.download-card__qr-txt p { font-size: var(--fs-sm); color: #6B7280; }

@media (max-width: 880px) {
  .download-hero__inner { grid-template-columns: 1fr; }
}

/* Hide QR on phones — no point scanning a QR with the device you're on. */
@media (max-width: 640px) {
  .download-card__qr { display: none; }
}

/* Screenshots scroll gallery */
.screenshots-row {
  display: flex;
  gap: var(--space-5);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-block: var(--space-4);
  padding-inline: var(--gutter);
  margin-inline: calc(var(--gutter) * -1);
  scroll-padding: var(--gutter);
  scrollbar-width: none;
}
.screenshots-row::-webkit-scrollbar { display: none; }
.screenshots-row__item {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: 240px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  transition: transform var(--duration) var(--ease-out), box-shadow var(--duration) var(--ease-out);
}
.screenshots-row__item:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.screenshots-row__item img { display: block; width: 100%; height: auto; }

/* ---- Support page ---- */
.support-hero {
  text-align: center;
  padding-top: calc(var(--nav-h) + clamp(64px, 9vw, 120px));
  padding-bottom: clamp(56px, 8vw, 96px);
  position: relative;
  overflow: hidden;
}
.support-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-hero);
  pointer-events: none;
  z-index: 0;
}
.support-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin-inline: auto;
}
.support-hero h1 {
  font-size: var(--fs-5xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-tight);
  margin: var(--space-5) 0 var(--space-4);
}
.support-hero p {
  font-size: var(--fs-lg);
  color: var(--color-text-muted);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: clamp(56px, 8vw, 96px);
}
@media (max-width: 720px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: transform var(--duration) var(--ease-out), box-shadow var(--duration) var(--ease-out);
}
.contact-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.contact-card__icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  background: var(--color-primary-50);
  color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
}
.contact-card__icon svg { width: 26px; height: 26px; }
.contact-card h3 { font-size: var(--fs-xl); font-weight: var(--weight-bold); }
.contact-card p { color: var(--color-text-muted); line-height: var(--lh-relaxed); }
.contact-card a { color: var(--color-primary); font-weight: var(--weight-semibold); margin-top: auto; }

/* ---- Blog ---- */
.blog-hero {
  text-align: center;
  padding-top: calc(var(--nav-h) + clamp(64px, 9vw, 120px));
  padding-bottom: clamp(48px, 7vw, 80px);
  position: relative;
  overflow: hidden;
}
.blog-hero h1 {
  font-size: var(--fs-5xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-tight);
}
.blog-hero p {
  font-size: var(--fs-lg);
  color: var(--color-text-muted);
  max-width: 540px;
  margin: var(--space-3) auto 0;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
@media (max-width: 1024px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .blog-grid { grid-template-columns: 1fr; } }

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--duration) var(--ease-out), box-shadow var(--duration) var(--ease-out);
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.post-card__thumb {
  aspect-ratio: 16/9;
  background: var(--grad-primary-soft);
  position: relative;
  overflow: hidden;
}
.post-card__thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}
.post-card:hover .post-card__thumb img { transform: scale(1.05); }
.post-card__thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--color-primary) 14%, transparent), color-mix(in srgb, var(--color-accent) 14%, transparent));
}
.post-card__thumb--placeholder svg { width: 48px; height: 48px; color: var(--color-primary); opacity: 0.5; }

.post-card__body { padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); flex: 1; }
.post-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--color-text-soft);
  letter-spacing: 0.04em;
}
.post-card__meta svg { width: 14px; height: 14px; }
.post-card__title {
  font-size: var(--fs-xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-snug);
  line-height: var(--lh-snug);
  color: var(--color-text);
}
.post-card__excerpt { color: var(--color-text-muted); font-size: var(--fs-sm); line-height: var(--lh-relaxed); }
.post-card__cta { margin-top: auto; }

.pagination {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  margin-top: clamp(56px, 8vw, 96px);
}
.pagination a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  transition: background var(--duration) var(--ease-out), border-color var(--duration) var(--ease-out);
}
.pagination a:hover { background: var(--color-surface-2); border-color: var(--color-text); }

/* ---- Single post (article) ---- */
.article {
  padding-top: calc(var(--nav-h) + clamp(40px, 6vw, 72px));
  padding-bottom: clamp(64px, 9vw, 120px);
}
.article__head {
  max-width: 760px;
  margin: 0 auto var(--space-10);
  text-align: center;
}
.article__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  transition: color var(--duration-fast) var(--ease-out);
}
.article__back:hover { color: var(--color-primary); }
.article__back::before { content: '←'; }

.article__meta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--color-text-soft);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--space-5);
}
.article__meta svg { width: 14px; height: 14px; }

.article h1 {
  font-size: clamp(36px, 5vw, 60px);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-tight);
  background: var(--grad-text);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}

.article__hero {
  margin: 0 auto clamp(40px, 6vw, 72px);
  max-width: 1080px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
}
.article__hero img { width: 100%; height: 100%; object-fit: cover; }

.article__body {
  max-width: 720px;
  margin: 0 auto;
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
  color: var(--color-text);
}
.article__body p { margin-bottom: var(--space-5); color: var(--color-text); }
.article__body h2 {
  font-size: var(--fs-3xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  margin: var(--space-12) 0 var(--space-5);
}
.article__body h3 {
  font-size: var(--fs-xl);
  font-weight: var(--weight-bold);
  margin: var(--space-8) 0 var(--space-3);
}
.article__body a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: var(--color-primary-200);
  text-underline-offset: 4px;
  transition: text-decoration-color var(--duration-fast) var(--ease-out);
}
.article__body a:hover { text-decoration-color: var(--color-primary); }
.article__body ul, .article__body ol {
  margin: var(--space-5) 0;
  padding-left: var(--space-5);
}
.article__body ul li, .article__body ol li { margin-bottom: var(--space-2); list-style: disc; }
.article__body ol li { list-style: decimal; }
.article__body blockquote {
  margin: var(--space-8) 0;
  padding: var(--space-5) var(--space-6);
  border-left: 4px solid var(--color-primary);
  background: var(--color-primary-50);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  font-size: var(--fs-lg);
}
.article__body img {
  margin: var(--space-8) auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}
.article__body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 2px 6px;
}
.article__body pre {
  margin: var(--space-6) 0;
  padding: var(--space-5);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow-x: auto;
}
.article__body pre code { background: none; border: 0; padding: 0; }
.article__body hr {
  border: 0;
  height: 1px;
  background: var(--color-border);
  margin: var(--space-12) 0;
}

/* ---- Legal pages (privacy/terms) ---- */
.legal {
  padding-top: calc(var(--nav-h) + clamp(40px, 6vw, 72px));
  padding-bottom: clamp(64px, 9vw, 120px);
}
.legal__head {
  max-width: 720px;
  margin: 0 auto var(--space-12);
  text-align: center;
}
.legal__head h1 {
  font-size: clamp(40px, 5vw, 64px);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-tight);
  background: var(--grad-text);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}
.legal__updated {
  display: inline-block;
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--color-text-soft);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legal__layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-12);
  max-width: 1080px;
  margin: 0 auto;
}
@media (max-width: 880px) { .legal__layout { grid-template-columns: 1fr; } }

.legal__toc {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
@media (max-width: 880px) { .legal__toc { position: static; flex-direction: row; flex-wrap: wrap; } }
.legal__toc h4 {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-text-soft);
  margin-bottom: var(--space-2);
}
.legal__toc a {
  display: block;
  padding: 6px 10px;
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.legal__toc a:hover, .legal__toc a.is-active {
  color: var(--color-primary);
  background: var(--color-primary-50);
  border-left-color: var(--color-primary);
}

.legal__body { font-size: var(--fs-base); line-height: var(--lh-relaxed); color: var(--color-text); }
.legal__body section { margin-bottom: var(--space-10); }
.legal__body h2 {
  font-size: var(--fs-2xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-snug);
  margin-bottom: var(--space-4);
  scroll-margin-top: calc(var(--nav-h) + 24px);
}
.legal__body h3 {
  font-size: var(--fs-lg);
  font-weight: var(--weight-bold);
  margin: var(--space-6) 0 var(--space-2);
}
.legal__body p { margin-bottom: var(--space-4); color: var(--color-text); }
.legal__body ul { margin: var(--space-3) 0 var(--space-4) var(--space-5); }
.legal__body ul li { list-style: disc; margin-bottom: 4px; }
.legal__body strong { color: var(--color-text); font-weight: var(--weight-semibold); }
.legal__body a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px; }
