@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg:         #f8f9fa;
  --bg-2:       #ffffff;
  --bg-dark:    #1a1a2e;
  --border:     #e2e8f0;
  --text:       #1a1a2e;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
  --blue:       #2196f3;
  --blue-dark:  #1565c0;
  --yellow:     #fbbf24;
  --mint:       #10b981;
  --white:      #ffffff;
  --radius:     12px;
  --radius-lg:  20px;
  --font:       'Inter', system-ui, sans-serif;
  --shadow:     0 2px 16px rgba(0,0,0,0.08);
  --shadow-md:  0 4px 32px rgba(0,0,0,0.12);
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); overflow-x: hidden; }

/* ── Navbar ── */
.navbar {
  position: fixed; top:0; left:0; right:0; z-index:100;
  display:flex; align-items:center; justify-content:space-between;
  padding: 1rem 2rem;
  background: rgba(248,249,250,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-size:1.2rem; font-weight:800; color: var(--bg-dark);
  letter-spacing:-0.02em;
}
.nav-logo span { color: var(--blue); }
.lang-switcher { display:flex; gap:4px; background:var(--border); border-radius:8px; padding:3px; }
.lang-btn {
  background:none; border:none; color:var(--text-muted);
  font-size:0.75rem; font-weight:600; font-family:var(--font);
  padding: 0.3rem 0.65rem; border-radius:6px; cursor:pointer; transition:all 0.2s;
}
.lang-btn.active { background:var(--white); color:var(--text); box-shadow: 0 1px 4px rgba(0,0,0,0.1); }

/* ── Hero ── */
.hero {
  background: var(--bg-dark);
  color: var(--white);
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
  padding: 8rem 4rem 5rem;
  max-width: 1200px;
  margin: 0 auto;
}
.hero-eyebrow {
  display:inline-block;
  font-size:0.75rem; font-weight:600; letter-spacing:0.1em; text-transform:uppercase;
  color: var(--yellow);
  margin-bottom:1.25rem;
}
.hero-headline {
  font-size: clamp(2.4rem, 4.5vw, 3.8rem);
  font-weight:800; line-height:1.1; letter-spacing:-0.025em;
  margin-bottom:1.25rem; color: var(--white);
}
.hero-headline em { color: var(--yellow); font-style:normal; }
.hero-sub { font-size:1rem; color: rgba(255,255,255,0.65); line-height:1.7; max-width:440px; margin-bottom:2rem; }
.hero-cta {
  display:inline-flex; align-items:center; gap:0.5rem;
  background: var(--blue); color: var(--white);
  border:none; border-radius:var(--radius);
  padding: 0.85rem 1.75rem;
  font-size:0.95rem; font-weight:600; font-family:var(--font);
  cursor:pointer; transition: all 0.2s;
}
.hero-cta:hover { background: var(--blue-dark); transform: translateY(-1px); }

/* ── Phone mockup ── */
.phone-mockup {
  width:200px; height:400px;
  background: #2a2a40;
  border-radius:32px;
  border: 2px solid rgba(255,255,255,0.1);
  box-shadow: 0 40px 80px rgba(0,0,0,0.4);
  margin: 0 auto;
  position:relative; overflow:hidden;
  display:flex; align-items:center; justify-content:center;
}
.phone-mockup::before {
  content:''; position:absolute; top:14px; left:50%; transform:translateX(-50%);
  width:50px; height:5px; background:rgba(255,255,255,0.15); border-radius:100px;
}
.phone-inner { text-align:center; color:rgba(255,255,255,0.4); font-size:0.75rem; z-index:1; }
.phone-icon { font-size:2.5rem; margin-bottom:0.5rem; }

/* ── Secció fons clar ── */
.light-section { background: var(--bg); }
.dark-section  { background: var(--bg-dark); color: var(--white); }

/* ── How ── */
.how-section { padding: 5rem 2rem; max-width:1000px; margin:0 auto; }
.section-title {
  font-size: clamp(1.6rem,3vw,2.2rem); font-weight:800;
  letter-spacing:-0.02em; text-align:center; margin-bottom:3rem;
}
.how-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:1.25rem; }
.how-step {
  background:var(--white); border:1px solid var(--border);
  border-radius:var(--radius-lg); padding:1.75rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.how-step:hover { transform:translateY(-4px); box-shadow:var(--shadow-md); }
.step-number {
  font-size:2rem; font-weight:800; color:var(--blue);
  opacity:0.25; margin-bottom:0.75rem; line-height:1;
}
.step-title { font-size:1rem; font-weight:700; margin-bottom:0.4rem; }
.step-desc { font-size:0.875rem; color:var(--text-muted); line-height:1.6; }

/* ── Tool ── */
.tool-section { padding:4rem 2rem 6rem; max-width:1100px; margin:0 auto; }
.tool-card {
  background:var(--white); border:1px solid var(--border);
  border-radius:var(--radius-lg); padding:2.5rem;
  display:grid; grid-template-columns:320px 1fr;
  gap:2.5rem; align-items:start;
  box-shadow: var(--shadow);
}
.tool-controls { display:flex; flex-direction:column; gap:1.25rem; }
.control-label {
  font-size:0.75rem; font-weight:600; letter-spacing:0.06em;
  text-transform:uppercase; color:var(--text-muted); margin-bottom:0.4rem; display:block;
}
select, input[type="file"] {
  width:100%; background:var(--bg); border:1px solid var(--border);
  border-radius:var(--radius); padding:0.65rem 0.9rem;
  color:var(--text); font-size:0.875rem; font-family:var(--font);
  transition:border-color 0.2s; cursor:pointer;
}
select:focus, input[type="file"]:focus { outline:none; border-color:var(--blue); }
select { appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 12px center; padding-right:2rem; }

.status-box {
  background:var(--bg); border:1px solid var(--border);
  border-radius:var(--radius); padding:0.875rem 1rem;
}
.stat-row { display:flex; justify-content:space-between; font-size:0.82rem; padding:0.25rem 0; }
.stat-row + .stat-row { border-top:1px solid var(--border); margin-top:0.25rem; }
.stat-label { color:var(--text-muted); }
.stat-value { font-weight:700; color:var(--text); }

.download-btn {
  width:100%; background:var(--blue); color:var(--white);
  border:none; border-radius:var(--radius);
  padding:0.85rem 1.5rem;
  font-size:0.95rem; font-weight:600; font-family:var(--font);
  cursor:pointer; transition:all 0.2s;
}
.download-btn:hover:not(:disabled) { background:var(--blue-dark); transform:translateY(-1px); }
.download-btn:disabled { background:var(--border); color:var(--text-faint); cursor:not-allowed; }

/* ── Canvas ── */
.canvas-panel { display:flex; flex-direction:column; align-items:center; gap:0.75rem; }
.canvas-wrapper {
  background:var(--bg); border:2px dashed var(--border);
  border-radius:var(--radius-lg); padding:12px;
  display:flex; align-items:center; justify-content:center;
  min-height:220px; width:100%; transition:border-color 0.3s;
}
.canvas-wrapper.has-image { border-style:solid; border-color:var(--blue); }
#outputCanvas { max-width:100%; max-height:460px; display:none; border-radius:8px; cursor:grab; touch-action:none; }
#outputCanvas.dragging { cursor:grabbing; }
.placeholder-text { font-size:0.875rem; color:var(--text-faint); text-align:center; padding:2rem; }
.hint-text { font-size:0.75rem; color:var(--text-muted); text-align:center; }

/* ── Divider ── */
.divider { height:1px; background:var(--border); margin:0; }

/* ── Footer ── */
footer {
  background:var(--bg-dark); color:rgba(255,255,255,0.4);
  text-align:center; padding:2rem; font-size:0.8rem;
}

/* ── Responsive ── */
@media(max-width:900px) {
  .hero { grid-template-columns:1fr; padding:7rem 1.5rem 4rem; text-align:center; }
  .hero-sub { margin:0 auto 2rem; }
  .hero-visual { display:none; }
  .tool-card { grid-template-columns:1fr; padding:1.5rem; }
}
@media(max-width:600px) {
  .navbar { padding:0.875rem 1.25rem; }
  .how-section, .tool-section { padding-left:1.25rem; padding-right:1.25rem; }
}
@media(prefers-reduced-motion:reduce) { *, *::before, *::after { animation:none !important; transition:none !important; } }
