:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --accent: #ff1744;
  --accent-hover: #d50000;
  --border: #e5e5e5;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06);
  --shadow-hover: 0 8px 24px rgba(0,0,0,.08);
  --font: 'Plus Jakarta Sans', system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.header--center {
  justify-content: center;
}

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

.nav-item {
  position: relative;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: color .2s;
  padding: 0.5rem 0;
}

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

.nav-link--all {
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
}

.nav-link--all:hover {
  background: var(--accent-hover);
  color: #fff;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.03em;
  transition: opacity .2s;
}

.logo:hover {
  opacity: .85;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-text {
  letter-spacing: -0.02em;
}

.btn {
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background .2s, color .2s;
}

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

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

/* Main */
main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  width: 100%;
}

/* Hero */
.hero {
  padding: 4.5rem 0 5rem;
  text-align: center;
}

.hero-label {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.25rem, 5.5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: var(--text);
}

.hero-desc {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

/* Tools */
.tools {
  padding: 2rem 0 3rem;
}

.section-title {
  margin: 0 0 1.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.tool-card {
  display: block;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
  box-shadow: var(--shadow);
}

.tool-card:hover {
  border-color: transparent;
  box-shadow: var(--shadow-hover);
}

.tool-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg);
  border-radius: 10px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1rem;
}

.tool-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
}

.tool-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* About */
.about {
  padding: 3rem 0;
  text-align: center;
  border-top: 1px solid var(--border);
}

.about .section-title {
  color: var(--text);
  margin-bottom: 0.5rem;
}

.about p {
  margin: 0;
  color: var(--text-muted);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* Footer */
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.footer a {
  color: var(--text-muted);
  text-decoration: none;
}

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

/* Legal pages & SEO page */
.legal-page,
.seo-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.seo-page {
  max-width: 900px;
}

.seo-page h1 {
  margin: 0 0 1.5rem;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

.seo-page h2 {
  margin: 2.5rem 0 1rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

.seo-page h3 {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.seo-page p {
  margin: 0 0 1rem;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-muted);
}

.seo-page ul,
.seo-page ol {
  margin: 1rem 0 1rem 1.5rem;
  padding: 0;
}

.seo-page li {
  margin: 0.5rem 0;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-muted);
}

.seo-page strong {
  color: var(--text);
  font-weight: 600;
}

.legal-page h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.legal-updated {
  margin: 0 0 2rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.legal-page section {
  margin-bottom: 1.75rem;
}

.legal-page section h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.legal-page section p,
.legal-page section li {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.legal-page section ul {
  margin: 0.5rem 0 0 1.25rem;
  padding: 0;
}

.legal-page section a {
  color: var(--accent);
  text-decoration: none;
}

.legal-page section a:hover {
  text-decoration: underline;
}

.legal-page .back {
  display: inline-block;
  margin-top: 2rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
}

.legal-page .back:hover {
  color: var(--text);
}

.seo-page .back {
  display: inline-block;
  margin-top: 2rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s;
}

.seo-page .back:hover {
  opacity: 0.8;
}

.seo-page section {
  margin-bottom: 2rem;
}

/* Tool page (converter) */
.page-tool {
  padding: 2rem 0 4rem;
}

.page-tool .back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  transition: color .2s;
}

.page-tool .back:hover {
  color: var(--text);
}

.page-tool h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-tool .subtitle {
  margin: 0 0 2rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.tool-option {
  max-width: 520px;
  margin: 0 auto 1rem;
}

.tool-option label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.tool-option input[type="text"],
.tool-option input[type="password"],
.tool-option input[type="number"],
.tool-option input[type="file"],
.tool-option textarea,
.tool-option select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-family: var(--font);
  font-size: 0.9375rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.tool-option textarea {
  resize: vertical;
  min-height: 80px;
}

.tool-option input:focus,
.tool-option select:focus {
  outline: none;
  border-color: var(--accent);
}

.upload-zone {
  max-width: 520px;
  margin: 0 auto 1.5rem;
  padding: 3rem 2rem;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: border-color .2s, background .2s;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(255, 23, 68, .04);
}

.upload-zone input[type="file"] {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

.upload-zone label {
  cursor: pointer;
  display: block;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.upload-zone p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 0.65rem 1.25rem;
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.tool-actions {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.file-list {
  max-width: 520px;
  margin: 0 auto 1rem;
  padding: 0;
  list-style: none;
}

.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
}

.file-list .remove {
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1.25rem;
  line-height: 1;
  opacity: 0.7;
}

.file-list .remove:hover {
  opacity: 1;
  color: var(--text);
}

#previewContainer {
  max-width: 520px;
  margin: 1.5rem auto 0;
  padding: 1.5rem;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
  display: none;
}

#previewContainer video,
#previewContainer audio {
  width: 100%;
  margin-bottom: 1rem;
}

#previewContainer p {
  margin: 0.5rem 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

#statusContainer {
  max-width: 520px;
  margin: 1rem auto;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

@media (max-width: 640px) {
  .header {
    padding: 1rem;
  }
  .main-nav {
    display: none;
  }
  .hero {
    padding: 3rem 0 3rem;
  }
  .tool-grid {
    grid-template-columns: 1fr;
  }
}
