/* ============================================================
   TextClean — main.css
   Shared across all pages. Mobile-first. No frameworks.
   Target: Lighthouse 90+ performance, accessibility, SEO
   ============================================================ */

/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --black:     #080808;
  --ink:       #1a1a1a;
  --ink-2:     #444;
  --ink-3:     #777;
  --ink-4:     #aaa;
  --line:      #e8e8e8;
  --surface:   #f7f7f7;
  --surface-2: #f0f0f0;
  --white:     #fff;
  --accent:    #0057ff;
  --accent-dk: #0040cc;
  --success:   #0d7a4a;
  --danger:    #c0392b;
  --radius-s:  6px;
  --radius-m:  10px;
  --radius-l:  14px;
  --radius-xl: 20px;
  --max:       1080px;
  --trans:     0.14s ease;
}

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--white);
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
}
a { color: inherit; }
img { display: block; max-width: 100%; }

/* ── LAYOUT ───────────────────────────────────────────────── */
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ── HEADER ───────────────────────────────────────────────── */
.tc-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.tc-header .container {
  display: flex; align-items: center;
  justify-content: space-between; gap: 16px;
}
.tc-logo {
  display: flex; align-items: center; gap: 7px;
  font-weight: 600; font-size: 1rem;
  color: var(--black); text-decoration: none;
  letter-spacing: -.3px;
}
.tc-logo-mark { font-size: 1.1rem; }
.tc-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.tc-nav a {
  padding: 5px 11px;
  border-radius: var(--radius-s);
  font-size: 0.8rem; font-weight: 500;
  color: var(--ink-3); text-decoration: none;
  transition: background var(--trans), color var(--trans);
}
.tc-nav a:hover { background: var(--surface); color: var(--ink); }
.tc-nav a.active { color: var(--ink); background: var(--surface); }

/* ── AD SLOTS ─────────────────────────────────────────────── */
.ad-slot {
  width: 100%; min-height: 90px;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius-m);
  display: flex; align-items: center;
  justify-content: center;
  font-size: 0.75rem; color: var(--ink-4);
  text-align: center;
}
.ad-slot-header { margin: 0 0 8px; }
.ad-slot-footer { margin: 32px 0 0; }

/* ── HERO ─────────────────────────────────────────────────── */
.tc-hero { padding: 44px 0 32px; }
.tc-hero-inner { max-width: 640px; }
.tc-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.tc-hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 700; letter-spacing: -.6px;
  line-height: 1.18; color: var(--black);
  margin-bottom: 14px;
}
.tc-hero p {
  font-size: 1rem; color: var(--ink-3); line-height: 1.7;
  max-width: 560px;
}

/* ── TOOL SECTION ─────────────────────────────────────────── */
.tc-tool { padding: 8px 0 48px; }

/* toggles */
.tc-toggles {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 16px; align-items: center;
}
.tc-toggle-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; color: var(--ink-2);
  cursor: pointer; user-select: none;
}
.tc-toggle-label input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer;
}

/* action buttons */
.tc-actions {
  display: flex; flex-wrap: wrap; gap: 7px;
  margin-bottom: 20px;
}
.tc-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 13px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--white);
  color: var(--ink-2);
  font-family: var(--font); font-size: 0.82rem; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: background var(--trans), border-color var(--trans),
              color var(--trans), transform var(--trans);
  -webkit-tap-highlight-color: transparent;
}
.tc-btn:hover  { background: var(--surface); border-color: var(--ink-4); color: var(--black); }
.tc-btn:active { transform: scale(0.97); background: var(--surface-2); }
.tc-btn.tc-flash { background: var(--black); color: var(--white); border-color: var(--black); }
.tc-btn--primary {
  background: var(--black); color: var(--white);
  border-color: var(--black); font-weight: 600;
}
.tc-btn--primary:hover  { background: var(--ink-2); border-color: var(--ink-2); }
.tc-btn--danger { color: var(--danger); border-color: #f5c0bb; }
.tc-btn--danger:hover { background: #fdf0ef; }

/* editor grid */
.tc-editor {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 680px) {
  .tc-editor { grid-template-columns: 1fr 28px 1fr; align-items: start; gap: 10px; }
}
.tc-arrow {
  display: none; color: var(--ink-4); font-size: 1.2rem;
  padding-top: 50px; text-align: center;
}
@media (min-width: 680px) { .tc-arrow { display: block; } }

.tc-pane { display: flex; flex-direction: column; gap: 7px; }
.tc-pane-header {
  display: flex; justify-content: space-between; align-items: center;
}
.tc-pane-label {
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4);
}
.tc-pane-count { font-size: 0.72rem; color: var(--ink-4); }

.tc-textarea {
  width: 100%; min-height: 240px;
  padding: 13px 15px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--white);
  font-family: var(--font); font-size: 0.9rem; line-height: 1.65;
  color: var(--ink); resize: vertical; outline: none;
  transition: border-color var(--trans), box-shadow var(--trans);
}
.tc-textarea:focus { border-color: var(--black); box-shadow: 0 0 0 3px rgba(0,0,0,.05); }
.tc-textarea::placeholder { color: var(--ink-4); }
.tc-textarea--out { background: var(--surface); color: var(--ink-2); cursor: default; }

.tc-pane-footer {
  display: flex; align-items: center; gap: 8px; min-height: 34px;
}
.tc-pane-footer--right { justify-content: flex-end; }
.tc-copy-feedback { font-size: 0.8rem; color: var(--success); font-weight: 500; }
.tc-copy-btn {
  padding: 9px 20px;
  border: none; border-radius: var(--radius-m);
  background: var(--black); color: var(--white);
  font-family: var(--font); font-size: 0.86rem; font-weight: 600;
  cursor: pointer; transition: background var(--trans), transform var(--trans);
}
.tc-copy-btn:hover  { background: var(--ink-2); }
.tc-copy-btn:active { transform: scale(0.97); }
.tc-copy-btn.copied { background: var(--success); }

.tc-clean-all-row {
  display: flex; justify-content: center; margin-top: 20px;
}

/* ── SHARE BAR ────────────────────────────────────────────── */
.tc-share {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin: 20px 0 0;
}
.tc-share-label { font-size: 0.78rem; color: var(--ink-4); }
.tc-share-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--white);
  font-family: var(--font); font-size: 0.78rem; font-weight: 500;
  color: var(--ink-2); text-decoration: none; cursor: pointer;
  transition: background var(--trans), border-color var(--trans);
}
.tc-share-btn:hover { background: var(--surface); border-color: var(--ink-4); color: var(--black); }

/* ── CONTENT SECTIONS ─────────────────────────────────────── */
.tc-content { padding: 48px 0; border-top: 1px solid var(--line); }
.tc-content + .tc-content { border-top: none; padding-top: 0; }

.tc-section-eyebrow {
  font-size: 0.72rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}
.tc-content h2 {
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  font-weight: 700; letter-spacing: -.3px;
  color: var(--black); margin-bottom: 14px;
}
.tc-content h3 {
  font-size: 1rem; font-weight: 600; color: var(--black);
  margin: 20px 0 8px;
}
.tc-content p { font-size: 0.92rem; color: var(--ink-2); line-height: 1.75; margin-bottom: 12px; }
.tc-content ul, .tc-content ol {
  padding-left: 20px; margin-bottom: 12px;
}
.tc-content li { font-size: 0.9rem; color: var(--ink-2); line-height: 1.7; margin-bottom: 4px; }

/* steps */
.tc-steps { display: flex; flex-direction: column; gap: 16px; margin: 20px 0; }
.tc-step { display: flex; gap: 14px; align-items: flex-start; }
.tc-step-num {
  flex-shrink: 0; width: 28px; height: 28px;
  border-radius: 50%; border: 1.5px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: var(--ink-3);
}
.tc-step-body h4 { font-size: 0.9rem; font-weight: 600; color: var(--black); margin-bottom: 3px; }
.tc-step-body p  { font-size: 0.85rem; color: var(--ink-3); margin: 0; }

/* use cases grid */
.tc-uses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px; margin: 20px 0;
}
.tc-use-card {
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  font-size: 0.85rem; color: var(--ink-2); line-height: 1.5;
}
.tc-use-card strong { display: block; font-weight: 600; color: var(--black); margin-bottom: 3px; }

/* FAQ */
.tc-faq { margin: 20px 0; }
.tc-faq-item {
  border-bottom: 1px solid var(--line); padding: 14px 0;
}
.tc-faq-item:last-child { border-bottom: none; }
.tc-faq-q {
  font-size: 0.92rem; font-weight: 600; color: var(--black);
  cursor: pointer; display: flex; justify-content: space-between;
  align-items: center; gap: 12px; list-style: none;
  user-select: none;
}
.tc-faq-q::after { content: '+'; font-size: 1.1rem; color: var(--ink-4); flex-shrink: 0; }
details[open] .tc-faq-q::after { content: '−'; }
.tc-faq-a {
  font-size: 0.87rem; color: var(--ink-2); line-height: 1.7;
  padding: 10px 0 0;
}

/* keyword links */
.tc-keyword-links {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0;
}
.tc-keyword-links a {
  padding: 5px 12px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem; color: var(--ink-2);
  text-decoration: none;
  transition: background var(--trans), border-color var(--trans), color var(--trans);
}
.tc-keyword-links a:hover { background: var(--black); color: var(--white); border-color: var(--black); }

/* ── FOOTER ───────────────────────────────────────────────── */
.tc-footer {
  border-top: 1px solid var(--line); padding: 28px 0;
}
.tc-footer-inner {
  display: flex; flex-wrap: wrap;
  justify-content: space-between; align-items: flex-start;
  gap: 20px;
}
.tc-footer-brand { font-weight: 600; font-size: 0.9rem; color: var(--black); margin-bottom: 4px; }
.tc-footer-copy  { font-size: 0.78rem; color: var(--ink-4); max-width: 320px; line-height: 1.6; }
.tc-footer-links { display: flex; flex-wrap: wrap; gap: 12px; }
.tc-footer-links a {
  font-size: 0.78rem; color: var(--ink-3);
  text-decoration: none; transition: color var(--trans);
}
.tc-footer-links a:hover { color: var(--black); }

/* ── FOCUS VISIBLE ────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) { outline: none; }

/* ── MOBILE ───────────────────────────────────────────────── */
@media (max-width: 480px) {
  .tc-hero    { padding: 28px 0 20px; }
  .tc-tool    { padding: 8px 0 32px; }
  .tc-content { padding: 32px 0; }
  .tc-nav     { display: none; }
  .tc-copy-btn { width: 100%; text-align: center; }
  .tc-pane-footer--right { flex-direction: column; align-items: flex-start; }
  .tc-clean-all-row button { width: 100%; justify-content: center; }
}