/* GIF Forge — design tokens (verified, Skillry/Raphael brief) */
:root {
  --bg: #f4f1e9;
  --ink: #121313;
  --accent: #f4ff71;
  --card-pricing: #f8f6ef;
  --card-testimonial: #fffdf8;
  --input-bg: #f9f8f3;
  --white: #ffffff;
  --muted: #5c5c55;
  --border: #121313;
  --radius: 14px;
  --shadow: 4px 4px 0 #121313;
  --shadow-sm: 3px 3px 0 #121313;
  --max-width: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

img { max-width: 100%; display: block; }
a { color: var(--ink); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: clamp(1.9rem, 4.4vw, 3rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -0.015em; }
h3 { font-size: 1.15rem; font-weight: 700; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }
.section-sub { color: var(--muted); max-width: 640px; margin: 0 0 28px; font-size: 1.05rem; }

/* ---------- buttons ---------- */
.btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  border: 2px solid var(--ink);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  background: var(--white);
  color: var(--ink);
  padding: 10px 22px;
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn-dark { background: var(--ink); color: var(--white); }
.btn-pill { border-radius: 999px; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.btn:active { transform: translate(1px, 1px); box-shadow: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-large { padding: 14px 32px; font-size: 1.1rem; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 2px solid var(--ink);
}
.header-inner {
  display: flex; align-items: center; gap: 24px;
  min-height: 60px; padding-top: 8px; padding-bottom: 8px;
}
.logo { font-size: 1.35rem; font-weight: 800; text-decoration: none; letter-spacing: -0.02em; }
.main-nav { display: flex; gap: 22px; margin-left: auto; }
.main-nav a { text-decoration: none; font-weight: 600; }
.main-nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
#signin-btn { padding: 7px 18px; font-size: .95rem; white-space: nowrap; }

/* ---------- hero / generator ---------- */
.hero { padding: 44px 0 56px; }
.hero h1 { max-width: 820px; }
.subhead { font-size: 1.12rem; color: var(--muted); max-width: 720px; margin: 0 0 28px; }
.subhead strong { color: var(--ink); }

.generator-card {
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--ink);
  padding: 24px;
}
.gen-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 28px; }
.field-label { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; margin: 0 0 6px; }
.field-label .optional { font-weight: 400; color: var(--muted); font-size: .9rem; }
.char-count { font-weight: 400; color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }

textarea, select, input[type="email"] {
  width: 100%;
  background: var(--input-bg);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
}
textarea { resize: vertical; min-height: 110px; margin-bottom: 18px; }
textarea:focus, select:focus, input:focus { outline: 3px solid var(--accent); outline-offset: 0; }

.upload-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.upload-btn {
  display: inline-block; cursor: pointer;
  border: 2px solid var(--ink); border-radius: 999px;
  background: var(--accent); color: var(--ink);
  font-weight: 700; padding: 8px 18px;
}
.upload-hint { color: var(--muted); font-size: .92rem; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumb { position: relative; width: 72px; height: 72px; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; background: var(--input-bg); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button {
  position: absolute; top: 2px; right: 2px;
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--ink); background: var(--white);
  font-size: 12px; line-height: 1; cursor: pointer; padding: 0;
}
.field-error { color: #b3261e; font-weight: 600; margin: 8px 0 0; }

.controls-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 18px 0; }
.model-fixed {
  background: var(--input-bg); border: 2px solid var(--ink); border-radius: 10px;
  padding: 11px 14px; font-weight: 700; font-size: .98rem;
}
.btn-generate { width: 100%; padding: 14px; font-size: 1.1rem; border-radius: 12px; }
.credits-line { color: var(--muted); font-size: .92rem; margin: 12px 0 0; }

.gen-result { display: flex; flex-direction: column; }
.result-frame {
  flex: 1; min-height: 320px;
  background: var(--input-bg);
  border: 2px solid var(--ink); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.result-frame img { width: 100%; height: 100%; object-fit: contain; image-rendering: auto; }
.result-empty { text-align: center; color: var(--muted); padding: 24px; }
.result-empty-gif { font-size: 3rem; margin-bottom: 8px; }
.result-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.watermark-note { font-size: .88rem; color: var(--muted); }
.status { margin: 10px 0 0; font-size: .95rem; min-height: 1.4em; }
.status.error { color: #b3261e; font-weight: 600; }
.status.success { color: #1e7b34; font-weight: 600; }

/* ---------- badges ---------- */
.badge {
  display: inline-block;
  background: var(--accent);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: .78rem; font-weight: 800;
  padding: 2px 10px;
  width: fit-content;
}

/* ---------- gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.example-card {
  margin: 0; background: var(--white);
  border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden; cursor: pointer;
  transition: transform .1s ease;
}
.example-card:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.example-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-bottom: 2px solid var(--ink); }
.example-card figcaption { padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.example-quality { font-size: .85rem; font-weight: 700; color: var(--muted); }
.example-prompt { font-size: .92rem; }
.use-prompt { font-weight: 700; font-size: .92rem; }

/* ---------- features ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card {
  background: var(--white); border: 2px solid var(--ink);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 22px;
}
.feature-icon { font-size: 1.8rem; margin-bottom: 10px; }
.feature-card p { margin: 0; color: var(--muted); }

/* ---------- steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.steps li {
  background: var(--white); border: 2px solid var(--ink);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 22px;
}
.step-num { display: block; font-size: 2rem; font-weight: 800; color: var(--ink); margin-bottom: 8px; }
.steps p { margin: 0; color: var(--muted); }

/* ---------- testimonials (honest shell) ---------- */
.testimonial-shell { display: grid; grid-template-columns: minmax(0, 560px); }
.testimonial-card {
  background: var(--card-testimonial);
  border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 28px;
}
.testimonial-cta-text { font-size: 1.25rem; font-weight: 800; margin: 0 0 8px; }
.testimonial-card p { color: var(--muted); }
.testimonial-card .btn { margin-top: 8px; }

/* ---------- pricing ---------- */
.free-tier {
  background: var(--white); border: 2px solid var(--ink);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 20px 24px; margin-bottom: 24px; max-width: 640px;
}
.free-tier h3 { margin-bottom: 6px; }
.free-tier ul { margin: 0; padding-left: 20px; }
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.pricing-card {
  position: relative;
  background: var(--card-pricing);
  border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.pricing-popular, .pricing-value { box-shadow: 6px 6px 0 var(--ink); }
.pricing-card .badge { position: absolute; top: -13px; left: 16px; }
.price { font-size: 2rem; font-weight: 800; margin: 4px 0; }
.pricing-card ul { margin: 0 0 12px; padding-left: 20px; color: var(--muted); }
.pricing-card .btn { margin-top: auto; width: 100%; }
.credit-explainer {
  margin-top: 28px; background: var(--white);
  border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 22px 24px; max-width: 720px;
}
.credit-explainer ul { margin: 0 0 8px; padding-left: 20px; }
.credit-explainer p { margin: 8px 0; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 760px; }
.faq-list details {
  background: var(--white); border: 2px solid var(--ink);
  border-radius: 12px; margin-bottom: 12px; padding: 16px 20px;
}
.faq-list summary { font-weight: 700; font-size: 1.05rem; cursor: pointer; }
.faq-list summary::marker { color: var(--ink); }
.faq-list p { margin: 10px 0 0; color: var(--muted); }

/* ---------- closing CTA / footer ---------- */
.closing-cta { text-align: center; }
.closing-cta .section-sub { margin-left: auto; margin-right: auto; }
.site-footer { border-top: 2px solid var(--ink); padding: 28px 0 40px; color: var(--muted); font-size: .92rem; }

/* ---------- login modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(18, 19, 19, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal {
  position: relative;
  background: var(--bg); border: 2px solid var(--ink);
  border-radius: var(--radius); box-shadow: 8px 8px 0 var(--ink);
  padding: 28px; width: 100%; max-width: 440px;
}
.modal-close {
  position: absolute; top: 12px; right: 12px;
  border: 2px solid var(--ink); background: var(--white);
  border-radius: 50%; width: 32px; height: 32px; cursor: pointer;
  font-size: 14px; line-height: 1;
}
.modal-sub { color: var(--muted); }
#login-form input { margin-bottom: 14px; }
#login-form .btn { width: 100%; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .gen-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .result-frame { min-height: 280px; }
}
@media (max-width: 560px) {
  .section { padding: 44px 0; }
  .main-nav { display: none; }
  .gallery, .feature-grid, .steps, .pricing-grid { grid-template-columns: 1fr; }
  .controls-row { grid-template-columns: 1fr; }
  .generator-card { padding: 16px; }
  .header-inner { gap: 12px; }
}
