:root {
  --bg: #0f0f13;
  --surface: #1a1a22;
  --border: #2e2e3e;
  --accent: #7c6af7;
  --accent2: #f76a8a;
  --text: #e8e8f0;
  --muted: #888899;
  --radius: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 56px;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(15, 15, 19, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.navbar {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  height: 56px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.navbar::-webkit-scrollbar { display: none; }

.nav-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: max-content;
  padding-right: .5rem;
}

.logo {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
  text-decoration: none;
}
.logo span { color: var(--accent); }

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: .88rem;
  white-space: nowrap;
  transition: color .15s;
}
.nav-link:hover { color: var(--text); }

.hero {
  position: relative;
  background: url("images/background.webp") center center / cover no-repeat;
  overflow: hidden;
  padding: 6rem 2rem;
  text-align: left;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
}
.hero-content {
  position: relative;
  max-width: 1320px;
  margin: 0 auto;
  padding-left: clamp(2rem, 8vw, 7rem);
}
.hero h1 {
  font-size: clamp(2.8rem, 7vw, 5.4rem);
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1.12;
  color: #fff;
  margin-bottom: 1.2rem;
  max-width: 1280px;
}
.hero-underline {
  display: inline;
  border-bottom: 4px solid #f5a623;
  padding-bottom: 2px;
}
.hero p {
  color: rgba(255,255,255,.75);
  font-size: 1.1rem;
  margin-bottom: 2rem;
  max-width: 480px;
}
.hero .btn-primary {
  margin-top: 2.5rem;
  padding: 1rem 2.4rem;
  font-size: 1.15rem;
  text-decoration: none;
  display: inline-block;
  background: linear-gradient(135deg, #ffb347 0%, #ff7a18 100%);
  box-shadow: 0 14px 36px rgba(255, 122, 24, .35);
}

main { flex: 1; padding: 2rem 1rem 3rem; max-width: 860px; margin: 0 auto; width: 100%; }

.page-hero {
  position: relative;
  padding: 4.5rem 1.5rem 2.5rem;
  background: linear-gradient(135deg, #171727 0%, #131a33 55%, #102744 100%);
  border-bottom: 1px solid var(--border);
}
.page-hero-inner {
  max-width: 860px;
  margin: 0 auto;
}
.page-eyebrow {
  margin: 0 0 1rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent2);
}
.page-hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -1.2px;
}
.page-hero p {
  max-width: 720px;
  color: rgba(255,255,255,.74);
  line-height: 1.75;
  font-size: 1rem;
}
.page-main {
  flex: 1;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}
.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.content-card + .content-card {
  margin-top: 1rem;
}
.content-card h2 {
  margin: 0 0 .9rem;
  font-size: 1.2rem;
  font-weight: 700;
}
.content-card h3 {
  margin: 1.1rem 0 .45rem;
  font-size: 1rem;
  font-weight: 700;
}
.content-card p,
.content-card li {
  color: var(--muted);
  line-height: 1.75;
  font-size: .96rem;
}
.content-card p + p {
  margin-top: .85rem;
}
.content-card ul {
  margin: .9rem 0 0;
  padding-left: 1.2rem;
}
.content-card li + li {
  margin-top: .55rem;
}
.content-card a {
  color: var(--accent);
  text-decoration: none;
}
.content-card a:hover {
  color: #9b8dff;
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.info-panel {
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
}
.info-panel h3 {
  margin-top: 0;
}

/* Upload */
.upload-section { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }

.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
  max-width: 600px;
}

.upload-box {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s;
}
.upload-box:hover, .upload-box.drag-over { border-color: var(--accent); }
.upload-box.has-image { border-style: solid; border-color: var(--accent); }

.upload-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: .4rem;
  padding: 1rem;
}
.upload-icon { font-size: 2.5rem; color: var(--muted); line-height: 1; }
.upload-inner p { font-weight: 600; font-size: 1rem; }
.upload-inner span { font-size: .8rem; color: var(--muted); text-align: center; }

.thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  padding: .75rem 2rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
}
.btn-primary:hover:not(:disabled) { opacity: .9; transform: translateY(-1px); }
.btn-primary:disabled { opacity: .35; cursor: not-allowed; }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: .6rem 1.2rem;
  border-radius: 999px;
  font-size: .9rem;
  cursor: pointer;
  transition: border-color .2s;
}
.btn-secondary:hover { border-color: var(--accent); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: none;
  padding: .6rem 1rem;
  font-size: .9rem;
  cursor: pointer;
}
.btn-ghost:hover { color: var(--text); }

/* Canvas section */
.canvas-section { display: flex; flex-direction: column; align-items: center; gap: 1.2rem; }

.canvas-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(124,106,247,.25);
  max-width: 100%;
}

#canvas {
  display: block;
  max-width: 100%;
  cursor: crosshair;
  touch-action: none;
}

.hint {
  position: absolute;
  bottom: .6rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: .75rem;
  padding: .3rem .8rem;
  border-radius: 999px;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity .4s;
}
.hint.fade { opacity: 0; }

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  justify-content: center;
}

.preset-btn {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  padding: .35rem .9rem;
  border-radius: 999px;
  font-size: .8rem;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.preset-btn:hover { color: var(--text); border-color: var(--accent); }

.lock-toggle {
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  font-size: .85rem;
  color: var(--muted);
  user-select: none;
}
.lock-toggle input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.lock-toggle:has(input:checked) { color: var(--accent); }

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  justify-content: center;
}

.hidden { display: none !important; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
}
.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 3rem;
}
.footer-brand {
  max-width: 420px;
}
.footer-brand h2 {
  margin: 0 0 .75rem;
  font-size: 1.4rem;
  font-weight: 800;
}
.footer-brand p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: .95rem;
}
.footer-links {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(110px, 1fr) minmax(140px, 1fr);
  gap: 2.5rem;
}
.footer-column h3 {
  margin: 0;
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
}
.footer-menu {
  list-style: none;
  margin: .9rem 0 0;
  padding: 0;
}
.footer-menu li + li {
  margin-top: .65rem;
}
.footer-menu a {
  color: var(--muted);
  text-decoration: none;
  font-size: .92rem;
}
.footer-menu a:hover {
  color: var(--accent);
}

@media (max-width: 480px) {
  .logo { font-size: 1.5rem; }
  .upload-grid { max-width: 100%; }
}

@media (max-width: 720px) {
  .footer-inner {
    flex-direction: column;
    gap: 2rem;
  }
  .footer-links {
    width: 100%;
    gap: 1.5rem;
  }
}

/* Gallery */
.gallery-section {
  padding: 4rem 0;
}
.gallery-section h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: .5rem;
  text-align: center;
}
.gallery-sub {
  color: var(--muted);
  margin-bottom: 2rem;
  text-align: center;
}
.gallery-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 0 1.5rem .5rem;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-item {
  flex: 0 0 280px;
  scroll-snap-align: start;
  border-radius: 16px;
  overflow: hidden;
}
.gallery-item img { width: 100%; height: 420px; object-fit: cover; display: block; }

/* Why section */
.why-section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}
.why-section h2 {
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 3rem;
}
.why-row {
  display: flex;
  align-items: center;
  gap: 3rem;
  margin-bottom: 4rem;
}
.why-row--reverse { flex-direction: row-reverse; }
.why-row img {
  flex: 0 0 48%;
  width: 48%;
  border-radius: 16px;
  object-fit: cover;
  aspect-ratio: 3/2;
}
.why-text { flex: 1; }
.why-text h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: .75rem;
}
.why-text p { color: var(--muted); line-height: 1.7; }

@media (max-width: 640px) {
  .why-row, .why-row--reverse { flex-direction: column; }
  .why-row img { width: 100%; flex: none; }
}

/* Features */
.features-section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}
.features-section h2 {
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 2.5rem;
}
.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.feature-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.feature-body { padding: 1.25rem 1.5rem 1.5rem; }
.feature-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: .5rem; }
.feature-card p { color: var(--muted); font-size: .9rem; line-height: 1.6; }

@media (max-width: 640px) {
  .features-grid { grid-template-columns: 1fr; }
}

/* Steps */
.steps-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
  text-align: center;
}
.steps-section h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 3rem;
}
.steps-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
}
.step-icon { font-size: 3.5rem; }
.step h3 { font-size: 1.1rem; font-weight: 700; }
.step p { color: var(--muted); font-size: .9rem; line-height: 1.6; }
.step-divider {
  font-size: 1.8rem;
  color: var(--accent);
  flex: 0 0 auto;
}
@media (max-width: 640px) {
  .steps-row { flex-direction: column; }
  .step-divider { transform: rotate(90deg); }
}

/* FAQ */
.faq-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}
.faq-section h2 {
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 2rem;
}
.faq-list {
  width: 100%;
}
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  width: 100%;
  box-sizing: border-box;
}
.faq-question {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.5;
  min-height: 3.5rem;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  display: flex;
  align-items: center;
}
.faq-item p { color: var(--muted); line-height: 1.7; margin-top: .75rem; font-size: .95rem; }
