/* Shared Repixel site styles — used by SEO landing pages + tool pages.
   Mirrors the visual language of the original index.html. */

:root {
  --red:#ED1C24;
  --yellow:#FFD800;
  --green:#2ECC40;
  --cyan:#00BFF3;
  --navy:#1A1A4E;
  --sky:#7ECCF2;
  --sky-2:#5BBCE8;
  --sky-deep:#3AA8DC;
  --white:#ffffff;
  --ink:#0E1E3A;
  --ink-soft:#3a4b72;
  --panel:#ffffff;
  --panel-2:#F4FAFD;
  --line:#D5EAF5;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--sky);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.6;
}
.pixel { font-family: 'Press Start 2P', monospace; letter-spacing: .02em; line-height: 1.5; }
a { color: var(--sky-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

.sky {
  position: relative;
  background:
    radial-gradient(1200px 600px at 50% -10%, #B8E4F7 0%, transparent 60%),
    linear-gradient(180deg, #8FD5F5 0%, #5BBCE8 55%, #3AA8DC 100%);
  color: #fff;
}

.container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.narrow    { max-width: 780px; margin: 0 auto; padding: 0 20px; }

/* ================ Top nav ================ */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; gap: 16px;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.nav .brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 900; font-size: 20px; }
.nav .brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav .brand .pixel { font-size: 13px; color: var(--yellow); text-shadow: 2px 2px 0 var(--navy); }
.nav ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.nav ul a { color: #fff; font-weight: 700; opacity: .9; font-size: 14px; }
.nav ul a:hover { opacity: 1; text-decoration: none; }
.nav .cta {
  background: var(--yellow); color: var(--navy);
  padding: 9px 16px; border-radius: 10px; font-weight: 900; font-size: 14px;
  box-shadow: 0 3px 0 #c9a800;
}
.nav .cta:hover { filter: brightness(1.04); text-decoration: none; }
@media (max-width: 720px) { .nav ul { display: none; } }

/* ================ Buttons ================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px; border-radius: 14px; border: none;
  font-weight: 900; font-size: 15px; letter-spacing: .02em;
  text-decoration: none; transition: transform .08s ease, filter .15s ease;
  line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn-yellow { background: var(--yellow); color: var(--navy); box-shadow: 0 4px 0 #c9a800; }
.btn-red    { background: var(--red);    color: #fff;         box-shadow: 0 4px 0 #a8121a; }
.btn-green  { background: var(--green);  color: #fff;         box-shadow: 0 4px 0 #1f9e2f; }
.btn-ghost  { background: rgba(255,255,255,.12); color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.35) inset; }
.btn-white  { background: #fff; color: var(--navy); box-shadow: 0 4px 0 #cde6f2; }
.btn-big    { padding: 18px 28px; font-size: 17px; border-radius: 16px; }

/* ================ Section headers ================ */
.hero {
  padding: 48px 24px 56px;
  text-align: center;
  color: #fff;
}
.hero h1 { font-size: clamp(32px, 5vw, 56px); line-height: 1.1; margin: 0 0 18px; font-weight: 900; text-shadow: 0 3px 0 rgba(0,0,0,.15); }
.hero p.lede { font-size: clamp(16px, 2vw, 20px); max-width: 680px; margin: 0 auto 24px; opacity: .95; }
.hero .ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ================ Content blocks ================ */
.card {
  background: var(--panel); color: var(--ink);
  border-radius: 18px; padding: 28px;
  box-shadow: 0 14px 40px rgba(12, 34, 70, .18);
}
.card h2 { margin-top: 0; font-size: 26px; color: var(--navy); }
.card h3 { color: var(--navy); }

.section { padding: 52px 0; }
.section.on-sky h2 { color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.15); }
.section h2 { font-size: clamp(24px, 3.3vw, 36px); margin: 0 0 18px; font-weight: 900; }
.prose p  { margin: 0 0 14px; font-size: 16px; color: var(--ink-soft); }
.prose ul { margin: 0 0 14px; padding-left: 22px; color: var(--ink-soft); }
.prose li { margin: 6px 0; }
.prose strong { color: var(--ink); }

/* ================ FAQ ================ */
details.faq {
  background: #fff; color: var(--ink);
  border-radius: 14px; padding: 16px 20px; margin-bottom: 10px;
  box-shadow: 0 6px 18px rgba(12, 34, 70, .1);
  cursor: pointer;
}
details.faq summary {
  font-weight: 800; font-size: 16px; color: var(--navy); list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--sky-deep); font-size: 22px; font-weight: 900; transition: transform .15s; }
details.faq[open] summary::after { content: "–"; }
details.faq p { margin: 10px 0 0; color: var(--ink-soft); }

/* ================ Footer ================ */
.footer {
  background: var(--navy); color: #cfd8ea; padding: 28px 20px;
  text-align: center; font-size: 14px;
}
.footer a { color: #fff; margin: 0 10px; }

/* ================ Tool (pixel-art maker) ================ */
.tool-wrap { padding: 0 20px 56px; }
.tool {
  max-width: 980px; margin: 0 auto;
  background: #fff; border-radius: 22px;
  box-shadow: 0 20px 60px rgba(12, 34, 70, .25);
  overflow: hidden;
}
.tool-head {
  background: var(--panel-2); padding: 22px 26px; border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between;
}
.tool-head h2 { margin: 0; color: var(--navy); font-size: 20px; }
.tool-body { padding: 26px; color: var(--ink); }

.drop {
  display: block;
  border: 3px dashed var(--sky-2); border-radius: 16px;
  padding: 40px 20px; text-align: center; background: var(--panel-2);
  cursor: pointer; transition: background .15s, border-color .15s;
}
.drop:hover, .drop.drag { background: #E9F6FD; border-color: var(--sky-deep); }
.drop input[type="file"] { display: none; }
.drop .big { font-size: 18px; font-weight: 900; color: var(--navy); }
.drop .sub { color: var(--ink-soft); font-size: 14px; margin-top: 6px; }

.controls {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 22px 0;
}
@media (max-width: 640px) { .controls { grid-template-columns: 1fr; } }
.ctl-label { display: block; font-weight: 800; color: var(--navy); margin-bottom: 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  border: 2px solid var(--line); background: #fff; color: var(--ink);
  padding: 10px 14px; border-radius: 999px; font-weight: 800; font-size: 14px;
}
.pill:hover { border-color: var(--sky-2); }
.pill.active { background: var(--sky-2); color: #fff; border-color: var(--sky-2); }

.preview { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 22px; }
@media (max-width: 640px) { .preview { grid-template-columns: 1fr; } }
.preview figure { margin: 0; background: var(--panel-2); border-radius: 14px; overflow: hidden; padding: 12px; text-align: center; }
.preview figure figcaption { font-weight: 800; color: var(--navy); margin-bottom: 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.preview figure img, .preview figure canvas {
  width: 100%; height: auto; display: block; margin: 0 auto;
  image-rendering: pixelated; image-rendering: crisp-edges;
  border-radius: 8px; background: #fff;
}
/* Hide the pixel-art <img> while we're still processing (prevents
   the browser's broken-image icon from flashing before src is set). */
.preview figure.loading img { visibility: hidden; }
.preview figure.loading {
  position: relative;
  min-height: 240px;
  background:
    linear-gradient(90deg, var(--panel-2) 0%, #e4f2fb 50%, var(--panel-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.result-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.result-meta { color: var(--ink-soft); font-size: 13px; margin-top: 10px; }

.notice {
  margin-top: 14px; padding: 12px 14px; border-radius: 12px;
  background: #FFF6CE; color: #6b5800; font-size: 14px; font-weight: 700;
}
.error { background: #FFE6E6; color: #a8121a; }
.spinner {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.5); border-top-color: #fff;
  animation: spin 1s linear infinite; vertical-align: -3px; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
