/* Remixly — "marketing workbench": clear card grid, platform color hints,
   single raspberry-ink accent. Light default; explicit dark override.
   :root tokens mirror projects/remixly/DESIGN.md frontmatter 1:1. */

:root {
  /* light (paper) — native LIGHT base */
  --bg: #f6f3ee;
  --bg-2: #efe9e0;
  --surface: #fffdf8;
  --surface-2: #f3ece1;
  --line: #e2d8c8;
  --line-strong: #cabda6;
  --ink: #26201c;
  --muted: #6a5e52;
  --faint: #9c8e7c;
  --accent: #b03a5b;            /* raspberry-ink */
  --accent-deep: #8c2c47;
  --accent-soft: rgba(176, 58, 91, 0.12);
  --accent-glow: rgba(176, 58, 91, 0.26);
  --accent-ink: #ffffff;
  --ok: #3f7d4e;
  --warn: #b06a12;
  --danger: #b03b2e;
  --px: #1d1f22;                /* platform tint: X */
  --pli: #1565c0;               /* LinkedIn */
  --pig: #c13584;               /* Instagram */
  --pyt: #c4302b;               /* YouTube */
  --pnl: #4a5b3d;               /* Newsletter */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 1px 0 var(--line);
  --shadow-lift: 0 8px 22px -14px rgba(0,0,0,.28);
  --shadow-focus: 0 0 0 3px var(--accent-soft);
  --font-display: "Space Grotesk", "Pretendard", system-ui, sans-serif;
  --font-body: "Inter", "Pretendard", system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ===== 3-way theme — opposite (dark) override. base :root above = native LIGHT. ===== */
:root[data-theme="dark"] {
  --bg: #1a1714;
  --bg-2: #100e0c;
  --surface: #2a2420;
  --surface-2: #15110f;
  --line: rgba(255,255,255,0.12);
  --line-strong: rgba(255,255,255,0.16);
  --ink: #ece1d6;
  --muted: #b3a594;
  --faint: #897b68;
  --accent: #e0647f;
  --accent-deep: #c44762;
  --accent-soft: rgba(224, 100, 127, 0.16);
  --accent-glow: rgba(0,0,0,0.42);
  --accent-ink: #1a0d11;
  --ok: #6fbf7e;
  --warn: #e0a64a;
  --danger: #e87a6a;
  --px: #d7d9dc;
  --pli: #6aa3e8;
  --pig: #e36fa6;
  --pyt: #ec7570;
  --pnl: #9fb88e;
}

/* system fallback when no explicit [data-theme] (no-JS / first paint) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #1a1714;
    --bg-2: #100e0c;
    --surface: #2a2420;
    --surface-2: #15110f;
    --line: rgba(255,255,255,0.12);
    --line-strong: rgba(255,255,255,0.16);
    --ink: #ece1d6;
    --muted: #b3a594;
    --faint: #897b68;
    --accent: #e0647f;
    --accent-deep: #c44762;
    --accent-soft: rgba(224, 100, 127, 0.16);
    --accent-glow: rgba(0,0,0,0.42);
    --accent-ink: #1a0d11;
    --ok: #6fbf7e;
    --warn: #e0a64a;
    --danger: #e87a6a;
    --px: #d7d9dc;
    --pli: #6aa3e8;
    --pig: #e36fa6;
    --pyt: #ec7570;
    --pnl: #9fb88e;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background:
    radial-gradient(900px 520px at 88% -8%, var(--accent-soft), transparent 60%),
    radial-gradient(700px 460px at -4% 108%, var(--accent-soft), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
b, h1, h2, h3 { font-weight: 700; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent-soft); }

/* i18n switcher theming bridge */
.i18n-switch {
  --i18n-switch-bg: var(--surface-2);
  --i18n-switch-border: var(--line);
  --i18n-switch-fg: var(--ink);
  --i18n-switch-active-bg: var(--accent-soft);
  --i18n-switch-active-fg: var(--accent);
  --i18n-switch-menu-bg: var(--surface);
  --i18n-switch-menu-border: var(--line);
}

/* ── topbar ─────────────────────────────────────────────── */
.topbar {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px clamp(16px, 5vw, 32px) 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 13px; }
.logo {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--accent), var(--accent-deep));
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  box-shadow: 0 8px 22px -10px var(--accent-glow);
  letter-spacing: -.04em;
}
.brand h1 {
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: -.01em;
  line-height: 1.1;
}
.brand p { font-size: 12.5px; color: var(--muted); }
.brand .accent { color: var(--accent); font-weight: 600; }

.offline-badge {
  display: none;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: .02em;
  border: 1px solid var(--accent-soft);
  background: var(--accent-soft);
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.offline-badge .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* ── workspace: 2-col input | results ───────────────────── */
.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 4px clamp(16px, 5vw, 32px) 40px;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.col-input { position: sticky; top: 12px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.tool-title {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 700;
  letter-spacing: -.005em;
}
.hint {
  font-size: 12px; color: var(--muted);
  line-height: 1.5; padding: 0 20px 4px;
}
.card-body { padding: 16px 20px 18px; }

.editor {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  padding: 14px 16px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.editor:focus { border-color: var(--accent); box-shadow: var(--shadow-focus); }
.editor::placeholder { color: var(--faint); font-style: italic; }

.input-stats {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  margin-top: 10px;
  min-height: 18px;
}
.istat {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.istat b { color: var(--accent); font-weight: 700; }

/* ── options ────────────────────────────────────────────── */
.opts {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}
.opt-title {
  font-size: 11.5px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
  margin-bottom: 10px;
}
.opt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.opt-grid .field { display: flex; flex-direction: column; gap: 5px; }
.opt-grid .field-wide { grid-column: 1 / -1; }
.opt-grid label {
  font-size: 12px; color: var(--muted); font-weight: 600;
}
.opt-grid input,
.opt-grid select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  padding: 9px 11px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.opt-grid input:focus,
.opt-grid select:focus { border-color: var(--accent); box-shadow: var(--shadow-focus); }

/* ── buttons ────────────────────────────────────────────── */
.actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 12px;
  align-items: center;
}
.btn {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .12s ease;
}
.btn:hover { border-color: var(--line-strong); background: var(--surface); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:active { transform: scale(.98); }
.btn-primary {
  background: linear-gradient(150deg, var(--accent), var(--accent-deep));
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn-ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn-mini {
  font-size: 12px;
  padding: 6px 11px;
}

/* ── results column ─────────────────────────────────────── */
.results-head {
  margin-bottom: 14px;
}
.results-head .hint { padding: 4px 0 0; }

.results-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.results-empty,
.out-empty {
  padding: 28px 20px;
  text-align: center;
  color: var(--faint);
  font-style: italic;
  font-size: 14px;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.platform-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow .15s ease, transform .15s ease;
}
.platform-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.pc-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.pc-title {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-size: 15px; font-weight: 600;
}
.pc-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
}
.pc-dot-x { background: var(--px); }
.pc-dot-linkedin { background: var(--pli); }
.pc-dot-instagram { background: var(--pig); }
.pc-dot-youtube { background: var(--pyt); }
.pc-dot-newsletter { background: var(--pnl); }

.pc-specs {
  display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: flex-end;
}
.spec-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}
.spec-pill.spec-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.spec-pill.spec-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.spec-pill.spec-bad { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }

.pc-body {
  padding: 14px 16px;
  max-height: 360px;
  overflow: auto;
}
.out-text {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}
.thread {
  display: flex; flex-direction: column; gap: 10px;
}
.tweet {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
}
.tweet-body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}
.pc-actions {
  display: flex; gap: 8px;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
}

/* ── ad slots ───────────────────────────────────────────── */
.ad-slot { display: none; margin: 22px 0; }
.ad-slot.is-live, .ad-slot.is-preview { display: block; }
.ad-label {
  display: block; font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--faint);
  opacity: .8; margin-bottom: 5px; text-align: center;
}
.ad-ph {
  display: none; align-items: center; justify-content: center;
  min-height: 90px; padding: 18px;
  border: 1px dashed var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--faint);
  font-size: 12px; text-align: center;
}
.ad-slot.is-preview .ad-ph { display: flex; }
.ad-slot.is-preview .adsbygoogle { display: none !important; }
.ad-slot.is-live .ad-ph { display: none; }

/* ── info / FAQ ─────────────────────────────────────────── */
.info {
  margin-top: 30px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
.info h2 {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--ink);
  margin: 22px 0 8px;
}
.info > h2:first-child { margin-top: 0; }
.info p { margin-bottom: 8px; }
.info b { color: var(--ink); }
.faq { margin: 4px 0 8px; }
.faq dt { color: var(--ink); font-weight: 600; margin-top: 12px; }
.faq dd { margin: 4px 0 0; }

.disclaimer {
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.65;
  text-align: center;
  padding: 0 8px;
}
.disclaimer b { color: var(--ink); }

/* ── footer ─────────────────────────────────────────────── */
.foot {
  max-width: 1240px;
  margin: 0 auto;
  padding: 8px clamp(16px, 5vw, 32px) 80px;
  text-align: center;
}
.foot a { color: var(--faint); font-size: 12px; }
.foot a:hover { color: var(--accent); }

/* ── toast ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.is-err { background: var(--danger); color: #fff; }
.toast.is-ok { background: var(--ok); color: #fff; }

/* ── RTL ────────────────────────────────────────────────── */
[dir="rtl"] .pc-specs { justify-content: flex-start; }

/* ── responsive ─────────────────────────────────────────── */
@media (max-width: 880px) {
  .workspace { grid-template-columns: 1fr; }
  .col-input { position: static; }
}
@media (max-width: 680px) {
  .topbar { flex-wrap: wrap; padding-top: 18px; }
  .brand h1 { font-size: 19px; }
  .opt-grid { grid-template-columns: 1fr; }
  .offline-badge { display: none !important; }
  .pc-head { padding: 11px 13px; }
  .pc-body { padding: 12px 13px; max-height: 300px; }
  .hint { display: none; }
  .results-head .hint { display: block; }
}

@media (min-width: 760px) {
  .offline-badge { display: inline-flex; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
