/* SplitMyText website — shared styles. Brand: #7C3AED violet (from the app icon). */

@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/sora-600-latin.woff2') format('woff2');
}

:root {
  color-scheme: light dark;
  --ink: #7C3AED;
  --ink-hover: #6D28D9;
  --ink-soft: #f3eeff;
  --navy: #14101f;
  --text: #1f2329;
  --text-2: #4a5059;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --bg-panel: #ffffff;
  --ok: #16a34a;
  --err-bg: #fef2f2;
  --err-border: #fca5a5;
  --err-text: #991b1b;
  --radius: 10px;
  --maxw: 1080px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #a78bfa;
    --ink-hover: #c4b5fd;
    --ink-soft: #2a2140;
    --text: #e5e7eb;
    --text-2: #b6bcc8;
    --muted: #8b93a1;
    --border: #2a2f3a;
    --bg: #0f1117;
    --bg-soft: #151823;
    --bg-panel: #161a26;
    --err-bg: #2c1215;
    --err-border: #7f1d1d;
    --err-text: #fca5a5;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; color: var(--text); }
h1 { font-size: 34px; margin: 0 0 12px; letter-spacing: -0.5px; }
h2 { font-size: 28px; margin: 0 0 16px; letter-spacing: -0.3px; }
h3 { font-size: 19px; margin: 0 0 8px; }
p { margin: 0 0 16px; color: var(--text-2); }
img { max-width: 100%; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* App promo bar — scrolls away (the header below sticks) */
.app-promo a {
  display: block; background: #7C3AED; color: #fff; text-align: center;
  padding: 9px 18px; font-size: 14px; font-weight: 600;
}
.app-promo a:hover { background: #6D28D9; text-decoration: none; }

/* Portrait ad in the right screen gutter — absolute, so it scrolls with the page */
.ad-side { display: none; position: absolute; top: 170px; right: 10px; width: 160px; height: 600px; }
@media (min-width: 1430px) { .ad-side { display: block; } }

.pill { display: inline-block; background: var(--ink-soft); color: var(--ink); font-size: 12.5px;
  font-weight: 700; padding: 4px 12px; border-radius: 999px; }

/* Header / nav */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 24px; height: 64px; }
.nav-links { display: flex; gap: 22px; margin-left: 8px; flex: 1; justify-content: flex-end; }
.nav-links a { color: var(--text-2); font-size: 15px; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* Brand lockup — badge + "split·my·text" in Sora 600, dots in brand violet. */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand-badge { width: 30px; height: 30px; display: block; flex: none; }
.brand-name {
  font-family: "Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 600; font-size: 20px; letter-spacing: -0.3px; line-height: 1; color: var(--text);
}
.brand-name .dot { color: #7C3AED; }
@media (prefers-color-scheme: dark) { .brand-name .dot { color: #a78bfa; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius);
  font-size: 15px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-panel); color: var(--text);
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { text-decoration: none; background: var(--bg-soft); }
.btn-primary { background: #7C3AED; border-color: #7C3AED; color: #fff; }
.btn-primary:hover { background: #6D28D9; border-color: #6D28D9; color: #fff; }
.btn-lg { padding: 13px 26px; font-size: 17px; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn .tick { color: var(--ok); }

/* Intro */
.intro { padding: 40px 0 8px; }
.intro h1 { max-width: 24ch; }
.intro .lead { font-size: 18px; color: var(--text-2); max-width: 62ch; margin-bottom: 8px; }

/* Tool */
.tool { padding: 16px 0 40px; }
.panel {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px;
}
textarea#input {
  width: 100%; min-height: 220px; resize: vertical;
  font-family: var(--mono); font-size: 14px; line-height: 1.55;
  color: var(--text); background: var(--bg); caret-color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px;
}
textarea#input:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; }
.input-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-top: 10px;
}
.counts { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.input-actions { display: flex; gap: 8px; }
.btn-sm { padding: 6px 12px; font-size: 13.5px; font-weight: 500; }

.privacy-note {
  display: flex; gap: 9px; align-items: flex-start;
  background: var(--ink-soft); border-radius: var(--radius);
  padding: 10px 14px; margin-top: 14px; font-size: 14px; color: var(--text-2);
}
.privacy-note svg { flex: none; margin-top: 3px; color: var(--ink); }
.privacy-note strong { color: var(--text); }

/* Controls */
.controls { display: flex; flex-wrap: wrap; gap: 14px 18px; margin-top: 18px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 5px; width: 180px; flex: none; }
.field select, .field input[type="number"], .field input[type="text"] { width: 100%; height: 40px; }
.field-grow { flex: 1 1 260px; width: auto; }
@media (max-width: 560px) { .field { width: 100%; } }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); font-weight: 400; }
select, input[type="number"], input[type="text"] {
  font: inherit; font-size: 14.5px; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; min-height: 38px;
}
select:focus-visible, input:focus-visible, .btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; }
.checkbox-field { display: flex; align-items: center; gap: 8px; min-height: 38px; }
.checkbox-field label { font-size: 14px; font-weight: 500; color: var(--text); }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: #7C3AED; }
.split-row { display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.error {
  background: var(--err-bg); border: 1px solid var(--err-border); color: var(--err-text);
  border-radius: var(--radius); padding: 9px 13px; font-size: 14px;
}
.notice { font-size: 13.5px; color: var(--muted); }

/* Results */
.results { margin-top: 26px; }
.results-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 0 14px;
}
.results-bar .summary { font-weight: 600; font-size: 15px; margin-right: auto; }
.chunk {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px;
  margin-bottom: 14px; overflow: hidden;
}
.chunk.copied { border-color: var(--ok); }
.chunk-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--border); background: var(--bg-soft);
}
.chunk-head .label { font-size: 13.5px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.chunk-body {
  font-family: var(--mono); font-size: 13.5px; line-height: 1.55; color: var(--text);
  white-space: pre-wrap; overflow-wrap: anywhere;
  padding: 12px 16px; max-height: 240px; overflow-y: auto;
}

/* Ad slot — clean placeholder until AdSense is live */
.ad-wrap { padding: 8px 0 28px; }
.ad-slot {
  border: 1px dashed var(--border); border-radius: var(--radius);
  min-height: 90px; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12px; letter-spacing: 1px; text-transform: uppercase;
}

/* Sections */
.section { padding: 56px 0; }
.section-soft { background: var(--bg-soft); }
.section h2 { text-align: center; }
.section .sub { text-align: center; color: var(--muted); max-width: 60ch; margin: 0 auto 36px; }
.eyebrow { text-align: center; color: var(--ink); font-weight: 700; font-size: 13px;
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 10px; }
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px; padding: 22px; }
.card .step {
  width: 34px; height: 34px; border-radius: 8px; background: var(--ink-soft); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; margin-bottom: 10px;
}
.card p { margin: 0; font-size: 15px; }

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; }
.faq details { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; background: var(--bg-panel); }
.faq summary { cursor: pointer; font-weight: 600; padding: 13px 16px; color: var(--text); }
.faq details > div { padding: 0 16px 14px; color: var(--text-2); font-size: 15px; }

/* Doc / prose pages */
.prose { max-width: 760px; margin: 0 auto; }
.prose h2 { font-size: 24px; margin-top: 40px; }
.prose h3 { margin-top: 26px; }
.prose ul, .prose ol { color: var(--text-2); padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.page-head { padding: 48px 0 8px; }
.page-head h1 { font-size: 32px; }
.page-head .lead { font-size: 18px; color: var(--muted); }

/* Contact form */
.form-grid { display: grid; gap: 16px; max-width: 640px; }
.form-grid label { font-size: 14px; font-weight: 600; color: var(--text-2); display: block; margin-bottom: 5px; }
.form-grid input, .form-grid textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
}
.form-grid textarea { min-height: 150px; resize: vertical; }
.banner-ok, .banner-err { border-radius: var(--radius); padding: 11px 14px; font-size: 14.5px; margin-bottom: 18px; }
.banner-ok { background: #ecfdf5; border: 1px solid #6ee7b7; color: #065f46; }
.banner-err { background: var(--err-bg); border: 1px solid var(--err-border); color: var(--err-text); }
@media (prefers-color-scheme: dark) {
  .banner-ok { background: #0c2b21; border-color: #14532d; color: #6ee7b7; }
}
.hp { position: absolute; left: -9999px; top: -9999px; }

/* Footer — stays dark in both schemes */
.site-footer { background: var(--navy); color: #c9cede; padding: 48px 0 30px; margin-top: 8px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
.site-footer h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .8px; margin: 0 0 12px; }
.site-footer a { color: #c9cede; display: block; margin-bottom: 8px; font-size: 14.5px; }
.site-footer a:hover { color: #fff; }
.site-footer .brand-name { color: #fff; }
.site-footer .brand-name .dot { color: #a78bfa; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); margin-top: 32px; padding-top: 20px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: #8b8fa8; font-size: 13.5px; }

/* Responsive */
@media (max-width: 860px) {
  h1 { font-size: 28px; }
  .grid-3 { grid-template-columns: 1fr; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 14px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .section { padding: 44px 0; }
  .panel { padding: 14px; }
}
@media (max-width: 560px) {
  .nav-links { display: none; }
}

/* Accessibility: visible keyboard focus, skip link, reduced-motion */
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.site-footer :focus-visible { outline-color: #fff; }
.skip-link {
  position: absolute; left: 12px; top: -56px; z-index: 100;
  background: #7C3AED; color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 600;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; text-decoration: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Reference tables (character-limits page) */
.limits-table { width: 100%; border-collapse: collapse; margin: 18px 0 8px; font-size: 14.5px; }
.limits-table th, .limits-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.limits-table th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
.limits-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.limits-table .btn-sm { white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.updated { font-size: 13px; color: var(--muted); }

/* App-store badge row (app section) */
.store-badges { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; }
.app-store-badge { display: inline-flex; line-height: 0; border-radius: 7px; }
.app-store-badge:focus-visible { outline: 2px solid #7C3AED; outline-offset: 3px; }
