/* ============================================================
   OIZ Apps — shared app-page styles
   Same design language as the homepage: a dark, lit "tray"
   holding purpose-built instruments. The publisher chrome stays
   colourless; each app brings its own hue via --app, set in the
   app's theme.css (linked AFTER this file on every app page).
   ============================================================ */

:root {
  /* Surfaces — warm graphite tray (overridden per app in theme.css) */
  --bg:        #12130f;   /* the tray */
  --bg-2:      #171812;   /* deeper pockets */
  --surface:   #16170f;   /* section-alt */
  --surface-2: #1c1e17;   /* raised cards */
  --border:    rgba(242, 241, 234, 0.09);
  --border-2:  rgba(242, 241, 234, 0.16);

  /* Ink */
  --text:      #f2f1ea;   /* chalk */
  --text-dim:  #c9ccbd;   /* body text */
  --muted:     #9aa091;   /* spec / engraving text */

  /* The app's own hue — every app page overrides this */
  --app:       #c8f135;
  --app-ink:   #131804;   /* text on the accent */

  /* Light on the tray */
  --page-light: #22241a;  /* lit top of the tray */
  --grain: 0.035;

  /* Shadows (overridden by light themes) */
  --shadow-icon: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 30px rgba(0, 0, 0, 0.3);
  --shadow-shot: 0 16px 44px rgba(0, 0, 0, 0.45);

  --font-display: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, sans-serif;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, "Roboto Mono", monospace;

  --radius: 26px;
  --radius-sm: 14px;
  --container: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: color-mix(in srgb, var(--app) 35%, transparent); }

/* The lit tray: one soft overhead light, plus a bloom in the app's hue */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background:
    radial-gradient(90% 60% at 82% -8%, color-mix(in srgb, var(--app) 9%, transparent) 0%, transparent 62%),
    radial-gradient(120% 80% at 50% -10%, var(--page-light) 0%, var(--bg) 46%, var(--bg-2) 100%);
}
/* faint film grain so the stage reads as a real surface */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 22px; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 62px; gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 11px;
  font-family: var(--font-display);
  font-weight: 700; font-size: 19px; letter-spacing: -0.01em; color: var(--text);
}
/* the lens: a lit bead in the app's hue */
.brand-dot {
  width: 15px; height: 15px; border-radius: 50%; flex: none;
  background:
    radial-gradient(circle at 32% 30%, #fff 0%, var(--app) 30%, #3a3d31 78%, #0d0e0a 100%);
  box-shadow: 0 0 14px color-mix(in srgb, var(--app) 60%, transparent);
}
.site-nav { display: flex; align-items: center; gap: 8px; }
.site-nav a {
  color: var(--muted); font-size: 15px; font-weight: 500;
  padding: 8px 10px; border-radius: 9px; transition: color 0.15s ease;
}
.site-nav a:hover { color: var(--text); }
.site-nav .nav-cta {
  color: var(--app-ink); background: var(--app);
  padding: 8px 16px; border-radius: 999px; font-weight: 650;
  transition: transform 0.15s var(--ease), opacity 0.15s ease;
}
.site-nav .nav-cta:hover { transform: translateY(-1px); opacity: 0.92; color: var(--app-ink); }
@media (max-width: 640px) { .site-nav a:not(.nav-cta) { display: none; } }

/* ---------------- Buttons & badges ---------------- */
.btn-primary {
  display: inline-block; background: var(--app); color: var(--app-ink);
  font-weight: 700; font-size: 16.5px; padding: 13px 26px; border-radius: 999px;
  transition: transform 0.15s var(--ease), opacity 0.15s ease;
}
.btn-primary:hover { transform: translateY(-1px); opacity: 0.92; }
.btn-secondary {
  display: inline-block; color: var(--text); font-weight: 600; font-size: 16px;
  padding: 12px 24px; border-radius: 999px; border: 1px solid var(--border-2);
  background: var(--surface-2);
  transition: border-color 0.15s ease;
}
.btn-secondary:hover { border-color: color-mix(in srgb, var(--app) 45%, var(--border-2)); }

/* App Store badge — standard, recognisable, Apple-compliant */
.appstore-badge {
  display: inline-flex; align-items: center; gap: 11px;
  background: #000; color: #fff; border: 1px solid #4c4f47;
  border-radius: 13px; padding: 9px 18px 9px 15px;
  transition: transform 0.15s var(--ease), border-color 0.15s ease;
}
.appstore-badge:hover { transform: translateY(-1px); border-color: #8b8e83; }
.appstore-badge svg { width: 24px; height: 29px; flex: none; }
.appstore-badge .badge-text { display: flex; flex-direction: column; line-height: 1.12; text-align: left; }
.appstore-badge .badge-small { font-size: 10.5px; font-weight: 400; letter-spacing: 0.02em; }
.appstore-badge .badge-big { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }

/* Chips — the engraving voice, each with a lit dot in the app's hue */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap;
  border: 1px solid var(--border-2); border-radius: 999px;
  padding: 5px 13px; display: inline-flex; align-items: center; gap: 7px;
}
.chip::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none;
  background: var(--app);
  box-shadow: 0 0 8px color-mix(in srgb, var(--app) 60%, transparent);
}

/* ---------------- Hero ---------------- */
.hero { padding: clamp(48px, 8vh, 76px) 0 clamp(40px, 6vh, 60px); overflow: hidden; }
.hero-grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr;
  gap: 48px; align-items: center;
}
@media (max-width: 860px) {
  .hero { padding: 44px 0 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5.2vw, 54px); line-height: 1.06;
  letter-spacing: -0.03em; font-weight: 700; margin-bottom: 18px;
  text-wrap: balance;
}
.hero h1 .accent { color: color-mix(in srgb, var(--app) 72%, var(--text)); }
.hero .lede {
  font-size: clamp(16.5px, 2vw, 19px); color: var(--text-dim);
  max-width: 56ch; line-height: 1.55; margin-bottom: 28px;
}
.hero-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 24px; }
.hero-phone {
  max-width: 340px; margin: 0 auto; border-radius: 30px;
  border: 1px solid var(--border-2);
  background: var(--bg-2);
  box-shadow: var(--shadow-shot),
              0 12px 44px color-mix(in srgb, var(--app) 18%, transparent);
}
.app-identity { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.app-identity img {
  width: 72px; height: 72px; border-radius: 18px; flex: none;
  box-shadow: var(--shadow-icon);
}
.app-identity .app-id-name {
  font-family: var(--font-display);
  font-weight: 600; font-size: 17px; line-height: 1.3; letter-spacing: -0.01em;
}
.app-identity .app-id-sub {
  font-family: var(--font-mono); color: var(--muted);
  font-size: 12px; letter-spacing: 0.02em; margin-top: 3px;
}

/* ---------------- Sections ---------------- */
.section { padding: clamp(48px, 8vh, 72px) 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 640px; padding-bottom: 18px; margin-bottom: 30px; border-bottom: 1px solid var(--border); }
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(25px, 3.4vw, 33px); letter-spacing: -0.025em;
  line-height: 1.12; margin-bottom: 12px; font-weight: 600;
  text-wrap: balance;
}
.section-head p { color: var(--text-dim); font-size: 16.5px; }
.center { text-align: center; }
.center .section-head { margin-left: auto; margin-right: auto; }

/* ---------------- Cards & grids ---------------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  position: relative;
  background: linear-gradient(180deg, var(--surface-2) 0%, color-mix(in srgb, var(--surface-2) 55%, var(--bg-2)) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
  box-shadow: var(--shadow-card);
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease);
}
.card h3 {
  font-family: var(--font-display);
  font-size: 18.5px; margin-bottom: 8px; letter-spacing: -0.015em;
  line-height: 1.25; font-weight: 600;
}
.card p { color: var(--text-dim); font-size: 15.5px; }
.card .card-icon {
  width: 44px; height: 44px; border-radius: 13px;
  background: color-mix(in srgb, var(--app) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--app) 22%, transparent);
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; margin-bottom: 16px;
}
/* card-as-link: the product catches its own light */
a.card::before {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius);
  background: radial-gradient(120% 130% at 84% 8%,
    color-mix(in srgb, var(--app) 12%, transparent) 0%, transparent 56%);
  opacity: 0; transition: opacity 0.45s var(--ease); pointer-events: none;
}
a.card > * { position: relative; }
a.card:hover, a.card:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--app) 30%, var(--border-2));
}
a.card:hover::before, a.card:focus-visible::before { opacity: 1; }

/* ---------------- Screenshot gallery ---------------- */
.shots {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(72vw, 270px);
  gap: 20px; overflow-x: auto; padding: 8px 22px 22px;
  scroll-snap-type: x mandatory; scrollbar-width: thin;
  scrollbar-color: var(--surface-2) transparent;
  max-width: var(--container); margin: 0 auto;
}
.shots figure { scroll-snap-align: center; }
.shots img {
  border-radius: 18px; border: 1px solid var(--border-2);
  background: var(--bg-2);
  box-shadow: var(--shadow-shot);
}
.shots figcaption {
  font-family: var(--font-mono);
  color: var(--muted); font-size: 12.5px; letter-spacing: 0.02em;
  text-align: center; margin-top: 12px;
}

/* ---------------- Steps ---------------- */
.step-num {
  width: 40px; height: 40px; border-radius: 50%;
  font-family: var(--font-mono); font-weight: 500; font-size: 16px;
  color: color-mix(in srgb, var(--app) 75%, var(--text));
  background: color-mix(in srgb, var(--app) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--app) 35%, transparent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--app) 20%, transparent);
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}

/* ---------------- FAQ ---------------- */
.faq-list { max-width: 760px; margin: 0 auto; display: grid; gap: 12px; }
.faq-list details {
  background: linear-gradient(180deg, var(--surface-2) 0%, color-mix(in srgb, var(--surface-2) 55%, var(--bg-2)) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 4px 22px;
  transition: border-color 0.3s ease;
}
.faq-list details[open] { border-color: color-mix(in srgb, var(--app) 32%, var(--border-2)); }
.faq-list summary {
  cursor: pointer; font-weight: 650; font-size: 16.5px; padding: 16px 0;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+"; font-family: var(--font-mono);
  color: color-mix(in srgb, var(--app) 75%, var(--text));
  font-size: 20px; font-weight: 400; flex: none;
}
.faq-list details[open] summary::after { content: "–"; }
.faq-list .faq-body { padding: 0 0 18px; color: var(--text-dim); font-size: 15.5px; }
.faq-list .faq-body a { color: color-mix(in srgb, var(--app) 65%, var(--text)); font-weight: 600; }
.faq-list .faq-body a:hover { color: var(--app); }

/* ---------------- CTA banner ---------------- */
.cta-banner {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--surface-2) 0%, color-mix(in srgb, var(--surface-2) 55%, var(--bg-2)) 100%);
  border: 1px solid color-mix(in srgb, var(--app) 26%, var(--border-2));
  border-radius: 28px; padding: clamp(32px, 6vw, 64px); text-align: center;
}
.cta-banner::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(110% 120% at 50% -20%,
    color-mix(in srgb, var(--app) 14%, transparent) 0%, transparent 60%);
}
.cta-banner > * { position: relative; }
.cta-banner h2 {
  font-family: var(--font-display);
  font-size: clamp(25px, 3.8vw, 38px); letter-spacing: -0.025em;
  line-height: 1.12; margin-bottom: 12px; font-weight: 600;
  text-wrap: balance;
}
.cta-banner p { color: var(--text-dim); max-width: 44em; margin: 0 auto 28px; }
.cta-banner .hero-ctas { justify-content: center; margin-bottom: 0; }

/* ---------------- Footer ---------------- */
.site-footer { border-top: 1px solid var(--border); padding: 52px 0 42px; margin-top: 24px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.3fr; gap: 36px; margin-bottom: 34px; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 {
  font-family: var(--font-mono);
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); margin-bottom: 14px; font-weight: 500;
}
.site-footer ul { list-style: none; display: grid; gap: 10px; }
.site-footer ul a { color: var(--text-dim); font-size: 15px; transition: color 0.15s ease; }
.site-footer ul a:hover { color: var(--text); }
.footer-about p { color: var(--muted); font-size: 14.5px; max-width: 32ch; margin-top: 12px; }
.footer-legal {
  border-top: 1px solid var(--border); padding-top: 26px;
  color: var(--muted); font-size: 13px;
}
.footer-legal p + p { margin-top: 7px; }

/* ---------------- Breadcrumbs ---------------- */
.breadcrumbs {
  padding: 20px 0 0;
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.02em;
  color: var(--muted);
}
.breadcrumbs a { color: var(--muted); transition: color 0.15s ease; }
.breadcrumbs a:hover { color: var(--text); }
.breadcrumbs span[aria-current] { color: var(--text-dim); }

/* ---------------- Article / guide prose ---------------- */
.article { padding: 32px 0 56px; }
.article-inner { max-width: 760px; margin: 0 auto; }
.article h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.6vw, 44px); line-height: 1.1;
  letter-spacing: -0.03em; margin-bottom: 16px; font-weight: 700;
  text-wrap: balance;
}
.article .article-meta {
  font-family: var(--font-mono);
  font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 32px;
  display: flex; align-items: center; gap: 9px;
}
.article .article-meta::before {
  content: ""; width: 22px; height: 1px; background: var(--border-2); flex: none;
}
.prose h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 27px); letter-spacing: -0.02em;
  margin: 40px 0 14px; line-height: 1.18; font-weight: 600;
}
.prose h3 {
  font-family: var(--font-display);
  font-size: 19px; margin: 28px 0 10px; letter-spacing: -0.015em; font-weight: 600;
}
.prose p { margin: 0 0 16px; color: var(--text-dim); }
.prose ul, .prose ol { margin: 0 0 16px 22px; color: var(--text-dim); }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: color-mix(in srgb, var(--app) 80%, var(--text)); }
.prose strong { color: var(--text); }
.prose a { color: color-mix(in srgb, var(--app) 65%, var(--text)); font-weight: 600; }
.prose a:hover { color: var(--app); }
.prose .table-wrap { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; min-width: 420px; }
.prose th, .prose td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.prose th {
  background: var(--surface-2);
  font-family: var(--font-mono); font-weight: 500;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
}
.prose tr:last-child td { border-bottom: none; }
.prose .formula {
  font-family: var(--font-mono);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px 20px; margin: 0 0 16px; font-size: 15.5px; color: var(--text);
  overflow-x: auto; white-space: nowrap;
}
.prose .note {
  background: color-mix(in srgb, var(--app) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--app) 25%, transparent);
  border-radius: var(--radius-sm); padding: 16px 20px; margin: 0 0 16px;
  font-size: 15px; color: var(--text-dim);
}

.app-callout {
  position: relative; overflow: hidden;
  display: flex; gap: 18px; align-items: flex-start;
  background: linear-gradient(180deg, var(--surface-2) 0%, color-mix(in srgb, var(--surface-2) 55%, var(--bg-2)) 100%);
  border: 1px solid color-mix(in srgb, var(--app) 28%, var(--border-2));
  border-radius: 20px; padding: 24px; margin: 36px 0;
  box-shadow: var(--shadow-card);
}
.app-callout::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 130% at 84% 0%,
    color-mix(in srgb, var(--app) 10%, transparent) 0%, transparent 56%);
}
.app-callout > * { position: relative; }
.app-callout img { width: 64px; height: 64px; border-radius: 15px; flex: none; box-shadow: var(--shadow-icon); }
.app-callout h3 {
  font-family: var(--font-display);
  margin: 0 0 6px; font-size: 18px; letter-spacing: -0.015em; font-weight: 600;
}
.app-callout p { font-size: 15px; margin-bottom: 14px; color: var(--text-dim); }
.app-callout .callout-links { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
@media (max-width: 520px) { .app-callout { flex-direction: column; } }

.learn-more {
  font-weight: 600; font-size: 15px;
  color: color-mix(in srgb, var(--app) 62%, var(--text));
  display: inline-flex; align-items: center;
  padding: 6px 2px; border-radius: 8px;
  transition: color 0.2s ease;
}
.learn-more::after { content: " →"; white-space: pre; transition: transform 0.25s var(--ease); display: inline-block; }
.learn-more:hover { color: var(--app); }
.learn-more:hover::after { transform: translateX(4px); }

.related-guides { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
.related-guides h2 {
  font-family: var(--font-display);
  font-size: 21px; margin-bottom: 18px; letter-spacing: -0.015em; font-weight: 600;
}
.related-guides ul { list-style: none; margin: 0; display: grid; gap: 10px; }
.related-guides li { margin: 0; }

/* ---------------- Focus states ---------------- */
a:focus-visible, summary:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--app) 70%, var(--text));
  outline-offset: 3px; border-radius: 8px;
}

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}
