/* ══════════════════════════════════════════════════════════
   STUDIO·ITY v4 — Clean, friendly design system
   3 tools: Halftone · Dither · Risograph
   ══════════════════════════════════════════════════════════ */

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

:root {
  --bg:       #FAFAF8;
  --surface:  #FFFFFF;
  --surface-2:#F4F3F0;
  --text:     #1A1A1A;
  --text-2:   #555550;
  --text-3:   #999990;
  --border:   #E8E6E2;
  --accent:   #4A6CF7;
  --accent-h: #3B5DE8;
  --accent-bg:#EEF1FE;
  --radius:   12px;
  --shadow:   0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-lg:0 4px 12px rgba(0,0,0,0.06), 0 16px 40px rgba(0,0,0,0.08);
  --font:     'Inter', system-ui, -apple-system, sans-serif;
  --mono:     'JetBrains Mono', 'SF Mono', monospace;
}

html { height: 100%; }

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Nav ── */
.nav {
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-logo-img {
  height: 32px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}

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

.nav-link--active {
  color: var(--accent);
  background: var(--accent-bg);
}

.nav-upload {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 7px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  font-family: var(--font);
  margin-left: 8px;
}
.nav-upload:hover { background: #DEE4FD; }
.nav-upload svg { flex-shrink: 0; }

.nav-pro {
  font-size: 0.82rem;
  font-weight: 600;
  color: #71ff84;
  background: #1a1a1a;
  padding: 7px 16px;
  border-radius: 8px;
  text-decoration: none;
  margin-left: 8px;
  flex-shrink: 0;
  transition: background 0.2s, box-shadow 0.2s;
}

.nav-pro:hover { background: #111; box-shadow: 0 0 12px rgba(113, 255, 132, 0.3); }

/* ── Homepage ── */
.home-hero {
  text-align: center;
  padding: 72px 24px 48px;
  max-width: 640px;
  margin: 0 auto;
}

.home-hero h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 16px;
}

.home-hero p {
  font-size: 1.1rem;
  color: var(--text-2);
  line-height: 1.6;
}

.tool-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}

.tool-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.tool-card-preview {
  aspect-ratio: 3 / 2;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.tool-card-preview canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.tool-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tool-card-body h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.tool-card-body p {
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.5;
  flex: 1;
}

.tool-card-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 3px 10px;
  border-radius: 20px;
  margin-top: 12px;
  align-self: flex-start;
}

/* ── Tool page layout ── */
.tool-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  height: calc(100vh - 60px);
}

.tool-canvas {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--surface-2);
  position: relative;
  overflow: auto;
}

.tool-canvas canvas {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: #FFF;
}

/* Drop zone */
.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 420px;
  padding: 48px 32px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--surface);
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.drop-zone-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--text-3);
}

.drop-zone:hover .drop-zone-icon,
.drop-zone.dragover .drop-zone-icon {
  background: #FFF;
  color: var(--accent);
}

.drop-zone-text {
  text-align: center;
}

.drop-zone-text strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 4px;
}

.drop-zone-text span {
  font-size: 0.82rem;
  color: var(--text-3);
}

/* ── Sidebar ── */
.tool-sidebar {
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  height: 100%;
}

.tool-sidebar-header {
  padding: 24px 20px 16px;
}

.tool-sidebar-header h1 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.tool-sidebar-header p {
  font-size: 0.82rem;
  color: var(--text-2);
}

/* Control group */
.ctrl-group {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.ctrl-group-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

.ctrl {
  margin-bottom: 16px;
}

.ctrl:last-child { margin-bottom: 0; }

.ctrl-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.ctrl-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.ctrl-val {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Range slider */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  outline: none;
  border: 1px solid var(--border);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #FFF;
  border: 2px solid var(--accent);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  transition: box-shadow 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 4px rgba(74,108,247,0.15);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #FFF;
  border: 2px solid var(--accent);
  cursor: pointer;
}

/* Select */
select.ctrl-select {
  width: 100%;
  padding: 9px 12px;
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}

select.ctrl-select:focus { border-color: var(--accent); }

/* Color inputs */
.color-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
}

.color-swatch::-webkit-color-swatch-wrapper { padding: 0; }
.color-swatch::-webkit-color-swatch { border: none; border-radius: 6px; }

.color-label {
  font-size: 0.78rem;
  color: var(--text-3);
}

/* Toggle */
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toggle-row .ctrl-name { margin-bottom: 0; }

.toggle {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--border);
  border: none;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
}

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFF;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  transition: transform 0.2s;
}

.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(18px); }

/* ── Export bar ── */
.tool-export {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
  width: 100%;
}

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

.btn-free {
  background: var(--text);
  color: #FFF;
}

.btn-free:hover { background: #333; }
.btn-free:disabled { background: var(--border); color: var(--text-3); cursor: default; }
.btn-free:disabled:active { transform: none; }

.btn-pro {
  background: var(--accent-bg);
  color: var(--accent);
  position: relative;
}

.btn-pro:hover { background: #DEE4FD; }
.btn-pro:disabled { opacity: 0.5; cursor: default; }
.btn-pro:disabled:active { transform: none; }

.pro-dropdown {
  position: relative;
}

.pro-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 20;
}

.pro-menu.open { display: block; }

.pro-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: none;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.12s;
}

.pro-menu button:hover { background: var(--surface-2); }

.pro-menu button .fmt-label {
  flex: 1;
  text-align: left;
}

.pro-menu button .fmt-note {
  font-size: 0.72rem;
  color: var(--text-3);
  font-weight: 400;
}

.export-note {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-3);
}

/* ── SEO section ── */
.seo {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 48px 24px;
}

.seo-inner {
  max-width: 680px;
  margin: 0 auto;
}

.seo h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
  margin-top: 28px;
}

.seo h2:first-child { margin-top: 0; }

.seo p, .seo li {
  font-size: 0.92rem;
  color: var(--text-2);
  line-height: 1.7;
}

.seo p { margin-bottom: 10px; }

.seo ul {
  padding-left: 20px;
  margin-bottom: 12px;
}

.seo-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.seo-tools a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  padding: 8px 16px;
  background: var(--accent-bg);
  border-radius: 8px;
  transition: background 0.15s;
}

.seo-tools a:hover { background: #DEE4FD; }

/* ── FAQ Accordion ── */
.faq { border-top: 1px solid var(--border); background: var(--surface-2); padding: 48px 24px; }
.faq-inner { max-width: 680px; margin: 0 auto; }
.faq-title { font-size: 1.1rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 16px; }
.faq details {
  border-bottom: 1px solid var(--border);
}
.faq details:last-of-type { border-bottom: none; }
.faq summary {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  padding: 16px 0;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  user-select: none;
  -webkit-user-select: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text-3);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.faq details[open] > summary::after {
  content: '\2212';
}
.faq .faq-answer {
  padding: 0 0 16px;
  font-size: 0.92rem;
  color: var(--text-2);
  line-height: 1.7;
}
.faq .faq-answer p { margin-bottom: 8px; }
.faq .faq-answer p:last-child { margin-bottom: 0; }
.faq .faq-answer a { color: var(--accent); text-decoration: none; }
.faq .faq-answer a:hover { text-decoration: underline; }
.faq .faq-answer ul { padding-left: 20px; margin: 8px 0; }
.faq .faq-answer li { margin-bottom: 4px; }

/* ── Footer ── */
/* ── Pro banner ── */
.pro-banner {
  text-align: center;
  padding: 48px 24px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}

.pro-banner-inner {
  max-width: 480px;
  margin: 0 auto;
}

/* ── Export loading overlay ── */
.export-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.export-overlay.visible { display: flex; }

.export-overlay-logo {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.export-overlay-logo img { height: 36px; width: auto; }

.export-overlay-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(113, 255, 132, 0.2);
  border-top-color: #71ff84;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Render loading indicator (canvas area) ── */
.tool-canvas.is-rendering canvas { opacity: 0.45; transition: opacity 0.12s; }
.tool-canvas.is-rendering::after {
  content: '';
  position: absolute;
  top: 14px;
  right: 14px;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(113,255,132,0.25);
  border-top-color: #71ff84;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  pointer-events: none;
}

.export-overlay-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
}

.pro-sticker {
  display: inline-block;
  background: #71ff84;
  color: #1a1a1a;
  font-weight: 700;
  font-size: 1rem;
  padding: 8px 20px;
  border-radius: 20px;
  margin-bottom: 16px;
  letter-spacing: 0.01em;
  box-shadow: 0 0 20px rgba(113, 255, 132, 0.3);
}

.pro-sticker--modal {
  margin-bottom: 8px;
  margin-top: 4px;
}

.pro-banner h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.pro-banner p {
  font-size: 0.9rem;
  color: var(--text-2);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ── Footer ── */
.footer {
  padding: 40px 24px 24px;
  font-size: 0.82rem;
  color: var(--text-3);
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  gap: 48px;
  justify-content: space-between;
}

.footer-brand p {
  margin-top: 6px;
  color: var(--text-3);
}

.footer-logo {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-logo-img {
  height: 20px;
  width: auto;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-links strong {
  color: var(--text);
  font-size: 0.82rem;
  margin-bottom: 2px;
}

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

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

.footer-bottom {
  text-align: center;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
}

/* ── Studio nav link ── */
.nav-link-studio { font: 600 14px/1 'Inter', sans-serif; color: var(--dark, #1A1A1A); text-decoration: none; padding: 8px 10px; display: inline-flex; align-items: center; white-space: nowrap; }
.nav-link-studio:hover { opacity: .7; }
.st-pro-chip { display: inline-block; background: #71ff84; color: #0a3d14; font: 700 9px/1 'Inter', sans-serif; letter-spacing: .06em; padding: 3px 6px; border-radius: 999px; vertical-align: 1px; margin-left: 4px; }

/* ── Pro modal ── */
.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  /* Above the fixed bottom overlays (nudge 9998, freegate toast 9999, share 99999)
     so an open Pro modal — and its Get Pro button — is never covered, esp. on mobile. */
  z-index: 100001;
  align-items: center;
  justify-content: center;
}

.modal-bg.open { display: flex; }

.modal-box {
  background: var(--surface);
  border-radius: 16px;
  padding: 36px;
  max-width: 400px;
  width: 92%;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-x {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 16px;
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.modal-x:hover { background: var(--surface-2); color: var(--text); }

.modal-box h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.modal-box > p {
  color: var(--text-2);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.modal-features {
  list-style: none;
  margin-bottom: 24px;
}

.modal-features li {
  font-size: 0.88rem;
  color: var(--text-2);
  padding: 5px 0;
  padding-left: 24px;
  position: relative;
}

.modal-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.modal-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 16px;
}

.modal-price .big { font-size: 2rem; font-weight: 700; }
.modal-price .per { color: var(--text-3); }
.modal-price .save { font-size: 0.78rem; color: var(--accent); margin-left: 8px; }

.btn-accent {
  background: #1a1a1a; color: #71ff84; border: none; padding: 12px 28px;
  border-radius: 8px; font-weight: 700; font-size: 1rem; cursor: pointer;
  text-decoration: none; font-family: var(--font); transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}
.btn-accent:hover { background: #111; box-shadow: 0 0 16px rgba(113, 255, 132, 0.35); transform: translateY(-1px); }

.pro-activate-divider {
  margin: 16px 0 10px; font-size: 0.8rem; color: var(--text-3); text-align: center;
}

.pro-activate-form {
  display: flex; gap: 8px;
}
.pro-activate-form input {
  flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.85rem; font-family: var(--mono); background: var(--bg);
  color: var(--text); outline: none;
}
.pro-activate-form input:focus { border-color: var(--accent); }
.pro-activate-form .btn {
  padding: 8px 16px; font-size: 0.82rem;
}

.pro-status {
  margin-top: 8px; font-size: 0.82rem; text-align: center; min-height: 1.2em;
}
.pro-status--active { color: var(--accent); }
.pro-status--error { color: #e53e3e; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .tool-cards { grid-template-columns: repeat(2, 1fr); max-width: 640px; }
}

@media (max-width: 600px) {
  .tool-cards { grid-template-columns: 1fr; max-width: 480px; }
  .home-hero h1 { font-size: 1.7rem; }
}

@media (max-width: 768px) {
  .tool-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 45vh 1fr;
    height: calc(100vh - 56px);
  }
  .tool-canvas {
    border-bottom: 1px solid var(--border);
    padding: 16px;
  }
  .tool-canvas canvas { max-height: 100%; }
  .tool-sidebar { border-left: none; }
}

@media (max-width: 500px) {
  .home-hero { padding: 48px 20px 32px; }
  .footer-inner { flex-direction: column; gap: 24px; }
}

/* ── Hamburger (hidden on desktop) ── */
.nav-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  border-radius: 6px;
}
.nav-hamburger svg { display: block; }

/* Mobile upload (hidden on desktop, separate from the one inside nav-links) */
.nav-mobile-upload { display: none; }

/* ── Mobile: <= 640px ── */
@media (max-width: 640px) {
  .nav { padding: 0 12px; }
  .nav-logo { font-size: 0.75rem; gap: 6px; }
  .nav-logo-img { height: 26px; }

  /* Show hamburger, far right */
  .nav-hamburger { display: flex; flex-shrink: 0; order: 3; }

  /* Show mobile upload centered between logo and hamburger */
  .nav-mobile-upload {
    display: flex;
    align-items: center;
    gap: 5px;
    order: 2;
    margin: 0 auto;
    background: var(--accent);
    color: #FFF;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .nav-mobile-upload svg { flex-shrink: 0; }

  /* Hide desktop nav-links, show as dropdown when open */
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px 12px 12px;
    gap: 2px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    z-index: 99;
    margin-left: 0;
  }
  .nav-links.open { display: flex; }

  .nav-link { padding: 12px; font-size: 0.9rem; border-radius: 8px; width: 100%; }
  .nav-links .nav-upload { display: none; }
  .nav-links .nav-pro {
    width: 100%;
    text-align: center;
    padding: 12px;
    margin-left: 0;
    margin-top: 4px;
    border-radius: 8px;
  }
}

/* ── Tools dropdown nav (added jun 2026) ── */
.nav-tools { position: relative; }
.nav-tools-btn { display: flex; align-items: center; gap: 5px; font-size: 0.88rem; font-weight: 500; color: var(--text-2); background: none; border: none; cursor: pointer; padding: 6px 14px; border-radius: 8px; font-family: var(--font); transition: color .15s, background .15s; }
.nav-tools-btn:hover, .nav-tools.open .nav-tools-btn { color: var(--text); background: var(--surface-2); }
.nav-tools-btn svg { transition: transform .2s; }
.nav-tools.open .nav-tools-btn svg { transform: rotate(180deg); }
.nav-tools-panel { display: none; position: absolute; top: calc(100% + 6px); left: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; gap: 24px; box-shadow: 0 12px 32px rgba(0,0,0,0.12); z-index: 101; }
.nav-tools.open .nav-tools-panel { display: flex; }
.nav-tools-col { display: flex; flex-direction: column; gap: 2px; min-width: 134px; }
.nav-tools-head { font-family: var(--mono); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); opacity: 0.55; padding: 2px 10px 6px; }
.nav-tools-link { font-size: 0.86rem; font-weight: 500; color: var(--text-2); text-decoration: none; padding: 7px 10px; border-radius: 7px; white-space: nowrap; transition: color .15s, background .15s; }
.nav-tools-link:hover { color: var(--text); background: var(--surface-2); }
.nav-tools-link--active { color: var(--accent); background: var(--accent-bg); }
@media (min-width: 641px) {
  .nav-tools:hover .nav-tools-panel { display: flex; }
  .nav-tools:hover .nav-tools-btn { color: var(--text); background: var(--surface-2); }
  .nav-tools:hover .nav-tools-btn svg { transform: rotate(180deg); }
}
@media (max-width: 640px) {
  .nav-tools { width: 100%; }
  .nav-tools-btn { display: none; }
  .nav-tools-panel { display: flex; position: static; flex-direction: column; border: none; box-shadow: none; padding: 0; gap: 4px; }
  .nav-tools-col { min-width: 0; }
  .nav-tools-head { padding: 10px 12px 4px; }
  .nav-tools-link { padding: 12px; font-size: 0.9rem; width: 100%; }
}
/* ── Homepage: hero upload + Studio promo ── */
.hero-upload { margin-top: 28px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hero-upload-note { font-size: 0.8rem; color: var(--text-2, #888); }
.studio-promo { max-width: 1080px; margin: 8px auto 40px; padding: 0 24px; }
.studio-promo-inner { background: #1A1A1A; color: #fff; border-radius: 16px; padding: 36px 32px; text-align: center; position: relative; overflow: hidden; }
.studio-promo-inner h2 { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.01em; margin: 10px 0 12px; }
.studio-promo-inner p { color: #b9b9b4; max-width: 560px; margin: 0 auto 22px; line-height: 1.6; font-size: 0.98rem; }
.studio-promo-badge { display: inline-block; background: #71ff84; color: #0a3d14; font: 700 10px/1 var(--font, Inter); letter-spacing: .12em; padding: 4px 9px; border-radius: 999px; }
.studio-promo-note { display: block; margin-top: 12px; font-size: 0.78rem; color: #8a8a85; }
.studio-promo .btn-accent { background: #71ff84; color: #0a3d14; }
.studio-promo .btn-accent:hover { background: #8dffa0; }

/* ── Studio card in homepage grid — Pro-styled: black, green + white text ── */
.tool-card--studio { background: #1A1A1A; border-color: #1A1A1A; color: #fff; }
.tool-card--studio:hover { box-shadow: 0 0 20px rgba(113, 255, 132, 0.35); transform: translateY(-2px); }
.tool-card--studio .tool-card-body h2 { color: #71ff84; }
.tool-card--studio .tool-card-body p { color: #f0f0ec; }
.tool-card--studio .tool-card-tag { background: rgba(113,255,132,.14); color: #71ff84; }
.tool-card--studio .tool-card-preview { border-bottom-color: #2a2a2a; }
.studio-card-new { display: inline-block; background: #71ff84; color: #0a3d14; font: 700 10px/1 var(--font, Inter); letter-spacing: .1em; padding: 3px 7px; border-radius: 999px; vertical-align: 2px; margin-left: 6px; }
