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

:root {
  --bg: #0f0f14;
  --surface: #1a1a24;
  --surface-2: #22222f;
  --border: #2e2e3e;
  --text: #e8e8f0;
  --text-muted: #9898b0;
  --accent: #7c6af7;
  --accent-hover: #9585ff;
  --accent-glow: rgba(124, 106, 247, 0.25);
  --success: #4ade80;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max-w: 820px;
  --article-w: 720px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 15, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}

.logo-icon {
  color: var(--accent);
  font-size: 1.2rem;
}

.main-nav {
  display: flex;
  gap: 1.5rem;
}

.main-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.main-nav a:hover {
  color: var(--text);
}

/* Hero / Tool */
.hero {
  padding: 3rem 0 2.5rem;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, var(--accent-glow) 0%, transparent 65%);
}

.hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.hero-sub {
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 2rem;
  font-size: 1.05rem;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: left;
  margin-bottom: 1.5rem;
}

#input-text {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 1.1rem;
  padding: 0.875rem 1rem;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#input-text:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

#input-text::placeholder {
  color: var(--text-muted);
}

.tool-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
}

.char-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn {
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.97);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.btn-copy {
  background: var(--accent);
  color: #fff;
  flex-shrink: 0;
}

.btn-copy:hover {
  background: var(--accent-hover);
}

.btn-copy.copied {
  background: var(--success);
}

/* Output */
.output-grid {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.output-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  text-align: left;
  transition: border-color 0.2s;
}

.output-row:hover {
  border-color: #3d3d52;
}

.style-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  min-width: 90px;
  flex-shrink: 0;
}

.style-text {
  flex: 1;
  font-size: 1.05rem;
  word-break: break-word;
  line-height: 1.4;
  min-width: 0;
}

.output-placeholder {
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 2rem 1rem;
  text-align: center;
}

/* SEO Article */
.seo-content {
  padding: 3rem 0 4rem;
  border-top: 1px solid var(--border);
}

.article-body {
  max-width: var(--article-w);
}

.article-body p {
  margin-bottom: 1.15rem;
  color: #c8c8d8;
}

.article-body h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 2.25rem 0 0.85rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.article-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.6rem;
  color: var(--text);
}

.article-body ol,
.article-body ul {
  margin: 0 0 1.15rem 1.25rem;
  color: #c8c8d8;
}

.article-body li {
  margin-bottom: 0.45rem;
}

.article-body a {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-body a:hover {
  color: #b8abff;
}

.references {
  margin-top: 3rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.references h2 {
  margin-top: 0;
  font-size: 1.2rem;
}

.references ul {
  list-style: none;
  margin: 0;
}

.references li {
  margin-bottom: 0.75rem;
}

.references li:last-child {
  margin-bottom: 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 2.5rem 0 2rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
}

.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-nav a:hover {
  color: var(--text);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 600px) {
  .main-nav {
    gap: 1rem;
  }

  .main-nav a {
    font-size: 0.8rem;
  }

  .output-row {
    flex-wrap: wrap;
  }

  .style-label {
    min-width: auto;
    width: 100%;
  }

  .btn-copy {
    width: 100%;
    padding: 0.55rem;
  }
}
