/* ══════════════════════════════════════════════════
   VIBEPORTFOLIO — style.css
   Premium SaaS UI · Dark/Light · Mobile-first
══════════════════════════════════════════════════ */

/* ─── DESIGN TOKENS ─────────────────────────────── */
:root {
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Accent palette */
  --accent: #64ffda;
  --accent-2: #6366f1;
  --accent-warm: #f59e0b;
  --accent-glow: rgba(100, 255, 218, 0.15);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Transitions */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.35s;
}

/* ─── DARK THEME (DEFAULT) ──────────────────────── */
[data-theme="dark"] {
  --bg: #080c14;
  --bg-2: #0d1220;
  --bg-3: #131929;
  --bg-card: rgba(255,255,255,0.03);
  --bg-card-hover: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.08);
  --border-focus: rgba(100,255,218,0.4);
  --text-primary: #f0f4ff;
  --text-secondary: rgba(240,244,255,0.55);
  --text-muted: rgba(240,244,255,0.3);
  --input-bg: rgba(255,255,255,0.04);
  --input-bg-focus: rgba(100,255,218,0.05);
  --shadow-card: 0 8px 40px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 60px rgba(100,255,218,0.08);
  --navbar-bg: rgba(8,12,20,0.8);
}

/* ─── LIGHT THEME ───────────────────────────────── */
[data-theme="light"] {
  --bg: #f5f7ff;
  --bg-2: #eef0fa;
  --bg-3: #e8ecf8;
  --bg-card: rgba(255,255,255,0.7);
  --bg-card-hover: rgba(255,255,255,0.95);
  --border: rgba(0,0,0,0.08);
  --border-focus: rgba(99,102,241,0.5);
  --text-primary: #0a0f1e;
  --text-secondary: rgba(10,15,30,0.6);
  --text-muted: rgba(10,15,30,0.35);
  --input-bg: rgba(0,0,0,0.03);
  --input-bg-focus: rgba(99,102,241,0.06);
  --shadow-card: 0 8px 40px rgba(0,0,0,0.08);
  --shadow-glow: 0 0 60px rgba(99,102,241,0.06);
  --accent: #5b5bd6;
  --accent-glow: rgba(91,91,214,0.12);
  --navbar-bg: rgba(245,247,255,0.85);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  line-height: 1.6;
}

/* ─── NAVBAR ─────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background: var(--navbar-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background var(--dur) var(--ease);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  text-decoration: none;
}

.brand-icon {
  font-size: 1.4rem;
  color: var(--accent);
  animation: spin 8s linear infinite;
}

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

.brand-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 4px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.btn-primary-sm {
  background: var(--accent);
  color: #080c14;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}
.btn-primary-sm:hover { opacity: 0.85; transform: translateY(-1px); }

/* ─── HERO ───────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 2rem 60px;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: float 8s ease-in-out infinite;
}
.orb-1 {
  width: 500px; height: 500px;
  background: var(--accent);
  top: -100px; left: -100px;
  animation-delay: 0s;
}
.orb-2 {
  width: 400px; height: 400px;
  background: var(--accent-2);
  bottom: -50px; right: -80px;
  animation-delay: -3s;
}
.orb-3 {
  width: 300px; height: 300px;
  background: var(--accent-warm);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -6s;
  opacity: 0.08;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -20px) scale(1.05); }
}

.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 30%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  animation: heroFadeIn 1s var(--ease) both;
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(100,255,218,0.2);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 28px;
  letter-spacing: 0.04em;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 60%, var(--accent-warm) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.7;
  margin-bottom: 40px;
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #080c14;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 32px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.25s var(--ease);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: translateX(-100%);
  transition: transform 0.4s var(--ease);
}
.btn-primary:hover::before { transform: translateX(100%); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 40px var(--accent-glow); }
.btn-primary span { transition: transform 0.2s; }
.btn-primary:hover span { transform: translateX(4px); }

.hero-stat {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.hero-stat strong { color: var(--text-secondary); }

.hero-scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* ─── BUILDER SECTION ────────────────────────────── */
.builder-section {
  padding: 0;
  min-height: 100vh;
}

.builder-layout {
  display: grid;
  grid-template-columns: 440px 1fr;
  min-height: 100vh;
  position: relative;
}

/* ─── FORM PANEL ─────────────────────────────────── */
.form-panel {
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 32px 28px 60px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.form-panel::-webkit-scrollbar { width: 4px; }
.form-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.form-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.form-header h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.form-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Template Switcher */
.template-switcher { margin-bottom: 24px; }

.template-tabs {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.template-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.template-tab:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}
.template-tab.active {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--text-primary);
}
.tab-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Form Sections */
.form-section {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.form-section:last-of-type { border-bottom: none; }

.step-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: 0.01em;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(100,255,218,0.2);
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.field-group { margin-bottom: 14px; }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.form-label small {
  color: var(--text-muted);
  font-weight: 400;
}

.form-input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 10px 14px;
  transition: all 0.2s;
  outline: none;
}
.form-input:focus {
  border-color: var(--border-focus);
  background: var(--input-bg-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: var(--text-muted); }

.form-textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Social Fields */
.social-field {
  display: flex;
  align-items: center;
  gap: 10px;
}
.social-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  background: var(--bg-card);
}
.social-field .form-input { flex: 1; }

/* Projects */
.project-entry {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  animation: slideIn 0.3s var(--ease) both;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.project-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.project-entry-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}
.btn-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s;
}
.btn-remove:hover { color: #ff6b6b; background: rgba(255,107,107,0.1); }

.btn-add {
  width: 100%;
  padding: 10px;
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}
.btn-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* URL Field */
.url-preview-field {
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all 0.2s;
}
.url-preview-field:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.url-prefix {
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  border-right: 1px solid var(--border);
  background: var(--bg-3);
  flex-shrink: 0;
}
.url-input {
  border: none;
  border-radius: 0;
  background: transparent;
  flex: 1;
}
.url-input:focus { box-shadow: none; border-color: transparent; }

/* Action Buttons */
.form-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
}

.btn-publish {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  border: none;
  border-radius: var(--radius-md);
  color: #080c14;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  position: relative;
  overflow: hidden;
}
.btn-publish::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: translateX(-100%);
  transition: transform 0.4s var(--ease);
}
.btn-publish:hover::before { transform: translateX(100%); }
.btn-publish:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(100,255,218,0.25); }
.btn-publish:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-download {
  width: 100%;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-download:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* ─── PREVIEW PANEL ──────────────────────────────── */
.preview-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-3);
  position: sticky;
  top: 0;
  height: 100vh;
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.preview-dots {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.preview-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}
.preview-dots span:nth-child(1) { background: #ff5f57; }
.preview-dots span:nth-child(2) { background: #febc2e; }
.preview-dots span:nth-child(3) { background: #28c840; }

.preview-url {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 12px;
}

.preview-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.preview-device-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 0.6rem;
  color: var(--text-muted);
  transition: all 0.2s;
}
.preview-device-btn.active,
.preview-device-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.preview-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
  transition: all 0.35s var(--ease);
}

.preview-container.mobile-view {
  padding: 20px 40px;
}

#previewFrame {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), 0 0 0 1px var(--border);
  background: white;
  transition: all 0.35s var(--ease);
}

.mobile-view #previewFrame {
  max-width: 375px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card), 0 0 0 8px var(--bg-2), 0 0 0 9px var(--border);
}

.preview-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #28c840;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* ─── MODAL ──────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  max-width: 440px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-card);
  animation: modalSlide 0.35s var(--ease) both;
}

@keyframes modalSlide {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-icon { font-size: 3rem; margin-bottom: 16px; }

.modal-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.modal-sub {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.modal-url {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  word-break: break-all;
  margin-bottom: 24px;
}

.modal-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-copy {
  padding: 10px 24px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #080c14;
  font-family: var(--font-display);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-copy:hover { opacity: 0.85; }

.btn-ghost-modal {
  padding: 10px 24px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s;
}
.btn-ghost-modal:hover { border-color: var(--accent); color: var(--text-primary); }

/* ─── TOAST ──────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 24px;
  font-size: 0.88rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s var(--ease);
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { border-color: var(--accent); color: var(--accent); }
.toast.error { border-color: #ff6b6b; color: #ff6b6b; }

/* ─── SCROLLBAR ──────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ─── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 900px) {
  .builder-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 70vh;
  }
  .form-panel {
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .preview-panel {
    position: sticky;
    bottom: 0;
    height: 70vh;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 480px) {
  .navbar { padding: 0 1rem; }
  .hero { padding: 80px 1.25rem 50px; }
  .hero-cta { flex-direction: column; gap: 16px; }
  .form-panel { padding: 24px 16px 40px; }
  .template-tabs { flex-direction: column; }
  .template-tab { justify-content: center; }
  .modal-card { padding: 32px 24px; }
}

/* ─── UTILITY ────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

/* ─── LOADING STATE ──────────────────────────────── */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.loading {
  background: linear-gradient(90deg, var(--bg-3) 25%, var(--bg-2) 50%, var(--bg-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ─── MOBILE RESPONSIVE FIX ───────────────────── */

@media (max-width: 900px) {
  .builder-layout {
    display: flex;
    flex-direction: column;
  }

  .form-panel {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .preview-panel {
    height: 80vh;
    position: relative;
  }
}
/* Mobile preview frame */
.preview-container.mobile-view {
  display: flex;
  justify-content: center;
  align-items: center;
}

.preview-container.mobile-view iframe {
  width: 375px;
  height: 667px;
  border-radius: 20px;
  border: 8px solid #000;
}
/* Mobile preview frame */
.preview-container.mobile-view {
  display: flex;
  justify-content: center;
  align-items: center;
}

.preview-container.mobile-view iframe {
  width: 375px;
  height: 667px;
  border-radius: 20px;
  border: 8px solid #000;
}
@media (max-width: 600px) {
  .hero-title {
    font-size: 2.2rem;
  }

  .hero-sub {
    font-size: 0.95rem;
  }

  .hero-cta {
    flex-direction: column;
    gap: 12px;
  }
}
@media (max-width: 600px) {
  .form-panel {
    padding: 20px 16px;
  }

  .form-input {
    font-size: 16px; /* prevents zoom on iPhone */
  }

  .template-tabs {
    flex-direction: column;
  }
}
@media (max-width: 600px) {
  .btn-publish,
  .btn-download {
    padding: 16px;
    font-size: 1rem;
  }
}