/* Shared styles for the StudioTools pages (index.html, connect/). */

:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --text: #1d1d1f;
  --subtext: #5f6368;
  --border: rgba(0, 0, 0, 0.08);
  --accent: #2563eb;
  --accent-2: #7c3aed;
  --rec: #ef3b36;
  --gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --radius: 18px;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.18);
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.35);
  --max: 1160px;
}

/* Light is the default look (data-theme="light" on <html>); the nav toggle switches to dark. The system setting is ignored. */
:root[data-theme="dark"] {
    --bg: #0b0b0d;
    --surface: #141417;
    --text: #f5f5f7;
    --subtext: #a1a1a6;
    --border: rgba(255, 255, 255, 0.09);
    --accent: #6ea8ff;
    --accent-2: #b69cff;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 40px 80px -24px rgba(0, 0, 0, 0.9);
  color-scheme: dark;
}

:root[data-theme="light"] { color-scheme: light; }

/* Dark refinements: soft glow behind sections and cards that catch the light */
.is-dark section.alt {
  background:
    radial-gradient(800px 300px at 85% 0%, rgba(124, 58, 237, 0.10), transparent 70%),
    radial-gradient(700px 300px at 10% 100%, rgba(37, 99, 235, 0.10), transparent 70%),
    var(--surface);
}

.is-dark .card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)), var(--surface);
  border-color: rgba(255, 255, 255, 0.1);
}

.is-dark section.alt .card { background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)), var(--bg); }
.is-dark .card:hover { border-color: rgba(110, 168, 255, 0.35); }
.is-dark .card .icon { background: rgba(110, 168, 255, 0.14); }
.is-dark .shot { border-color: rgba(255, 255, 255, 0.12); }
/* Light-mode screenshots glare on a dark page: dim them slightly unless a dark variant is shown */
.is-dark .shot img:not([data-dark-src]) { filter: brightness(.86) contrast(1.04); }
.is-dark .table-wrap { background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent), var(--surface); }
.is-dark .section-head .kicker { color: #8fbcff; }
.is-dark .cta { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 40px 80px -30px rgba(124, 58, 237, 0.45); }

.card { transition: border-color .2s; }

.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  font-size: .95rem;
}

.theme-toggle:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(22, 22, 24, 0.78);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav .wrap {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  height: 56px;
  font-size: .9rem;
}

.nav a { color: rgba(255, 255, 255, 0.78); }
.nav a:hover { color: #fff; text-decoration: none; }

.brand { display: flex; align-items: center; gap: .55rem; font-weight: 600; color: #fff !important; }
.brand img { width: 26px; height: 26px; border-radius: 6px; }
.nav .spacer { flex: 1; }

.nav-links { display: flex; gap: 1.4rem; }

@media (max-width: 860px) { .nav-links { display: none; } }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .7rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  transition: transform .2s, box-shadow .2s, background .2s;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--gradient); color: #fff !important; box-shadow: 0 8px 24px -8px rgba(37, 99, 235, .7); }
.btn-ghost { color: #fff !important; border: 1px solid rgba(255, 255, 255, 0.25); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }
.nav .btn { padding: .4rem .9rem; font-size: .85rem; }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(1200px 600px at 75% 30%, rgba(124, 58, 237, 0.28), transparent 60%),
    radial-gradient(900px 500px at 15% 80%, rgba(37, 99, 235, 0.25), transparent 60%),
    radial-gradient(circle at 50% 40%, #3a3a3c 0%, #161618 70%);
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 3rem;
  align-items: center;
  padding-top: 5.5rem;
  padding-bottom: 5.5rem;
}

@media (max-width: 900px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); padding-top: 3.5rem; } .hero-icon img { width: min(200px, 50vw); } }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .35rem .75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  margin-bottom: 1.4rem;
}

.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rec);
  box-shadow: 0 0 0 0 rgba(239, 59, 54, .7);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 59, 54, .6); }
  70% { box-shadow: 0 0 0 9px rgba(239, 59, 54, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 59, 54, 0); }
}

@media (prefers-reduced-motion: reduce) { .rec-dot { animation: none; } }

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
}

.hero h1 .grad {
  background: linear-gradient(90deg, #7cc4ff, #b69cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.sub { font-size: 1.2rem; color: rgba(255, 255, 255, 0.75); max-width: 36rem; margin: 0 0 2rem; }
.ctas, .hero .ctas { display: flex; gap: .9rem; flex-wrap: wrap; align-items: center; }
.hero .meta { margin-top: 1.4rem; font-size: .85rem; color: rgba(255, 255, 255, 0.72); }

.hero-icon { display: flex; justify-content: center; }

.hero-icon img {
  width: min(320px, 70vw);
  border-radius: 22%;
  filter: drop-shadow(0 40px 60px rgba(0, 0, 0, 0.55));
}

/* Sections */
section { padding: 5.5rem 0; }
section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-head { max-width: 46rem; margin-bottom: 2.75rem; }
.section-head .kicker { font-size: .85rem; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); line-height: 1.12; letter-spacing: -0.02em; margin: .4rem 0 .9rem; }
.section-head p { font-size: 1.1rem; color: var(--subtext); margin: 0; }

.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
code { font-size: .9em; overflow-wrap: anywhere; }
.hero h1, .section-head h2 { overflow-wrap: break-word; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

section.alt .card { background: var(--bg); }

.card .icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  background: rgba(37, 99, 235, 0.1);
  margin-bottom: .9rem;
}

.card h3 { font-size: 1.08rem; margin: 0 0 .4rem; }
.card p { margin: 0; color: var(--subtext); font-size: .95rem; }
.card .tag { display: inline-block; margin-top: .8rem; font-size: .75rem; font-weight: 600; color: var(--accent-2); }

/* Spotlight (Media Manager) */
.spotlight { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 3rem; align-items: center; }
.spotlight.reverse { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
.spotlight.reverse .shot { order: -1; }

@media (max-width: 900px) {
  .spotlight, .spotlight.reverse { grid-template-columns: minmax(0, 1fr); }
  .spotlight.reverse .shot { order: 0; }
}

.checklist { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.checklist li { padding-left: 1.9rem; position: relative; margin-bottom: .95rem; color: var(--subtext); }
.checklist li strong { color: var(--text); }

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .3rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--gradient);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 0a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.2 14.2L4.6 10l1.4-1.4 2.8 2.8 5.2-5.2 1.4 1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 0a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.2 14.2L4.6 10l1.4-1.4 2.8 2.8 5.2-5.2 1.4 1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.shot {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}

.shot img { width: 100%; height: auto; }

/* Shown until a real screenshot exists (the <img> replaces it, see onerror) */
.shot-fallback {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2rem;
  color: #fff;
  background: radial-gradient(circle at 50% 40%, #3a3a3c 0%, #161618 75%);
}

.shot-fallback .big { font-size: 3rem; line-height: 1; margin-bottom: .6rem; }
.shot-fallback strong { display: block; font-size: 1.2rem; }
.shot-fallback span { color: rgba(255, 255, 255, .6); font-size: .9rem; }

.pill-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.pill { font-size: .8rem; font-weight: 600; padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--border); color: var(--subtext); }

/* Gallery */
.gallery { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.gallery .shot img { aspect-ratio: 1624 / 1488; object-fit: cover; object-position: top; }
.gallery figure { margin: 0; }
.gallery .shot { box-shadow: var(--shadow); }
.gallery figcaption { margin-top: .7rem; font-size: .9rem; color: var(--subtext); }
.gallery figcaption strong { color: var(--text); display: block; }

/* Comparison */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .9rem 1.1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--subtext); }
tr:last-child td { border-bottom: none; }
td.yes { color: var(--text); font-weight: 600; }
td.no { color: var(--subtext); }

/* CTA */
.cta {
  text-align: center;
  color: #fff;
  border-radius: 28px;
  padding: 4rem 1.5rem;
  background:
    radial-gradient(700px 300px at 80% 0%, rgba(124, 58, 237, 0.35), transparent 60%),
    radial-gradient(circle at 50% 40%, #3a3a3c 0%, #161618 75%);
}

.cta h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); margin: 0 0 .8rem; letter-spacing: -0.02em; }
.cta p { color: rgba(255, 255, 255, .72); margin: 0 auto 2rem; max-width: 34rem; font-size: 1.1rem; }

/* Footer */
footer { padding: 3.5rem 0 3rem; font-size: .9rem; color: var(--subtext); }
footer .cols { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 2rem; }
footer h5 { margin: 0 0 .7rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text); }
footer ul { list-style: none; padding: 0; margin: 0; }
footer li { margin-bottom: .4rem; }

/* Steps (connect/) */
.steps { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); counter-reset: step; }
.steps .card { position: relative; padding-top: 3.6rem; }

.steps .card::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 1.3rem;
  left: 1.5rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .95rem;
  color: #fff;
  background: var(--gradient);
}

/* Portrait screenshots (iPhone/iPad) */
/* The images carry their own rounded corners: no frame, shadow on the image itself */
.shot.portrait { max-width: 420px; justify-self: center; background: none; border: none; box-shadow: none; overflow: visible; }
.shot.portrait img { filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.45)); }
.is-dark .shot.portrait img:not([data-dark-src]) { filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.6)) brightness(.86) contrast(1.04); }

.requirements { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; }
.requirements li { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 1rem; color: var(--subtext); }
.requirements li strong { color: var(--text); }

@media (max-width: 600px) { .requirements li { grid-template-columns: minmax(0, 1fr); gap: .2rem; } }
