:root {
  --bg: #f5f5f7;
  --blob: #efe9ec;
  --surface: #ffffff;
  --ink: #2d2d32;
  --muted: #686870;
  --primary: #e5322d;
  --primary-hover: #c92520;
  --pill-active: #2d2d32;
  --line: #e6e6ec;
  --line-soft: #e2e2e8;
  --coral: #f26350;
  --green: #5cb85c;
  --blue: #4b7bec;
  --orange: #e67e51;
  --violet: #9b59b6;
  --teal: #e5322d;
  --teal-dark: #c92520;
  --amber: #e67e51;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.07);
  --radius: 12px;
  --font-display: "Plus Jakarta Sans", "Inter", sans-serif;
  --font-body: "Plus Jakarta Sans", "Inter", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: min(70vw, 640px);
  height: min(70vw, 640px);
  border-radius: 50%;
  background: var(--blob);
  opacity: 0.4;
  filter: blur(72px);
  z-index: -1;
  pointer-events: none;
}

body::before {
  top: -12%;
  left: -8%;
}

body::after {
  top: 18%;
  right: -12%;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.wrap {
  width: min(1400px, calc(100% - 2rem));
  margin: 0 auto;
}

.wrap-narrow {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 64px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.nav {
  height: 64px;
  width: min(1400px, calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.15rem;
  color: var(--ink);
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  background: linear-gradient(145deg, var(--primary), #ff6b66);
  position: relative;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0.4rem;
  border: 2px solid #fff;
  border-radius: 0.3rem;
  border-left-color: transparent;
  transform: rotate(45deg);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-links a {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-login {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
}

.nav-login:hover {
  color: var(--primary);
}

.btn-register {
  background: var(--primary);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 0;
  cursor: pointer;
}

.btn-register:hover {
  background: var(--primary-hover);
}

.nav-grip,
.nav-burger {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink);
}

.nav-grip:hover,
.nav-burger:hover {
  background: #f3f3f6;
}

.nav-burger {
  display: none;
}

.mobile-menu {
  display: none;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 1rem 1rem;
}

.mobile-menu.show {
  display: grid;
  gap: 0.35rem;
}

.mobile-menu a {
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  font-weight: 600;
  color: var(--ink);
}

.mobile-menu a:hover {
  background: #f5f5f7;
}

/* Hero */
.hero-hub {
  padding: 3rem 1rem 2rem;
  text-align: center;
}

.hero-hub h1 {
  margin: 0 auto 0.85rem;
  max-width: 18ch;
  font-size: clamp(2rem, 4.5vw, 2.625rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: var(--ink);
}

.hero-hub .subtitle {
  margin: 0 auto 1.5rem;
  max-width: 48rem;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.6;
  color: var(--muted);
  font-weight: 400;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 1.75rem;
}

.unlimited-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.86rem;
}

.privacy-pill span {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--green);
}

/* Filters */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  max-width: 64rem;
  margin: 0 auto 2.5rem;
}

.filter-pill {
  appearance: none;
  border: 1px solid var(--line-soft);
  background: #fff;
  color: var(--ink);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-pill:hover {
  border-color: var(--ink);
}

.filter-pill.active {
  background: var(--pill-active);
  border-color: var(--pill-active);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* Tools grid */
.tools-hub {
  width: min(1400px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0 0 4rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.25rem;
}

.hub-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  height: 100%;
  background: #fff;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid transparent;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
  cursor: pointer;
}

.hub-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(0, 0, 0, 0.08);
}

.hub-card.hidden {
  display: none;
}

.hub-card.featured {
  grid-column: span 2;
  border: 2px solid rgba(229, 50, 45, 0.35);
  background:
    linear-gradient(135deg, rgba(229, 50, 45, 0.08), rgba(255, 255, 255, 0.95) 45%),
    #fff;
  box-shadow: 0 10px 28px rgba(229, 50, 45, 0.12);
  position: relative;
  padding: 1.7rem;
}

.hub-card.featured:hover {
  border-color: var(--primary);
  box-shadow: 0 14px 32px rgba(229, 50, 45, 0.18);
}

.hub-card.featured .feature-badge {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
}

.hub-card.featured h3 {
  font-size: 1.35rem;
  padding-right: 4.5rem;
}

.hub-card.featured p {
  font-size: 0.95rem;
  max-width: 36rem;
}

@media (max-width: 640px) {
  .hub-card.featured {
    grid-column: span 1;
  }
}

.hub-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1.25rem;
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.hub-icon::before {
  content: "";
  position: absolute;
  inset: 4px -4px -4px 4px;
  border-radius: 10px;
  background: currentColor;
  opacity: 0.22;
  z-index: 0;
}

.hub-icon > span {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: currentColor;
  z-index: 1;
}

.hub-icon svg {
  width: 26px;
  height: 26px;
  position: relative;
  z-index: 2;
  display: block;
  overflow: visible;
}

.hub-icon svg,
.hub-icon svg * {
  fill: none !important;
  stroke: #ffffff !important;
  stroke-width: 2.25 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.hub-icon.coral { color: var(--coral); }
.hub-icon.green { color: var(--green); }
.hub-icon.blue { color: var(--blue); }
.hub-icon.orange { color: var(--orange); }
.hub-icon.violet { color: var(--violet); }

.hub-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  transition: color 0.2s ease;
}

.hub-card:hover h3 {
  color: var(--primary);
}

.hub-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.hub-card .soon {
  margin-top: 0.75rem;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
}

.hub-card.is-soon {
  opacity: 0.72;
  cursor: default;
}

.hub-card.is-soon:hover {
  transform: none;
}

/* About + footer */
.about-block {
  width: min(1400px, calc(100% - 2rem));
  margin: 0 auto 3rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.about-block h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  color: var(--ink);
}

.about-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  max-width: 48rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2.2rem;
  color: var(--muted);
  font-size: 0.92rem;
  background: #fff;
}

.site-footer .footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
}

.site-footer .footer-credit {
  min-width: 0;
}

.site-footer .footer-stats {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.site-footer .footer-stats strong {
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.site-footer .stats-sep {
  opacity: 0.55;
}

.site-footer a {
  color: var(--primary);
  font-weight: 700;
}

.site-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .site-footer .footer-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-footer .footer-stats {
    margin-left: 0;
    font-size: 0.74rem;
  }
}

/* ===== Tool pages (shared) ===== */
.tool-page {
  padding: 2rem 0 3rem;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

body:has(.editor-full) .site-header {
  height: 56px;
}

body:has(.editor-full) .nav {
  height: 56px;
}

.tool-page-header {
  margin-bottom: 1.4rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 0.9rem;
}

.tool-page-header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.03em;
  color: var(--ink);
}

.tool-page-header p {
  margin: 0.55rem 0 0;
  color: var(--muted);
  max-width: 40rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.dropzone {
  border: 2px dashed rgba(229, 50, 45, 0.35);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(229, 50, 45, 0.04), transparent), #fff;
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1.5rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--primary);
  background: rgba(229, 50, 45, 0.06);
  transform: scale(1.01);
}

.dropzone strong {
  display: block;
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}

.dropzone span {
  color: var(--muted);
}

.file-input {
  display: none;
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.field-label {
  font-weight: 700;
  color: var(--ink);
}

.format-select {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23686870' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 0.9rem center;
  border-radius: 999px;
  padding: 0.7rem 2.4rem 0.7rem 1rem;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  min-width: 12rem;
  cursor: pointer;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.25rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary {
  background: rgba(45, 45, 50, 0.08);
  color: var(--ink);
}

.preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.preview-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.preview-item img,
.preview-item video {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #f3f3f6;
}

.preview-item figcaption {
  padding: 0.45rem 0.55rem;
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status {
  margin-top: 1rem;
  min-height: 1.4rem;
  color: var(--muted);
  font-weight: 600;
}

.status.error {
  color: var(--primary);
}

.status.ok {
  color: #2f7a3e;
}

.progress {
  margin-top: 0.75rem;
  height: 8px;
  border-radius: 999px;
  background: rgba(45, 45, 50, 0.08);
  overflow: hidden;
  display: none;
}

.progress.show {
  display: block;
}

.progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--orange));
  transition: width 0.2s ease;
}

/* legacy aliases used by older markup */
.section { padding: 1.4rem 0 2.5rem; }
.section-head { margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; }
.tool-card { display: block; }
.tool-icon { display: none; }

@media (max-width: 1200px) {
  .tools-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 900px) {
  .tools-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .nav-links,
  .nav-grip,
  .nav-login,
  .btn-register {
    display: none;
  }

  .nav-burger {
    display: grid;
  }
}

@media (max-width: 640px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }

  .hero-hub {
    padding-top: 2rem;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
