/* ImageGarage — shared design system (light, modern) */

:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --header-bg: rgba(255,255,255,.85);
  --ink: #1a1c2b;
  --ink-soft: #565a73;
  --muted: #8b90a8;
  --line: #e8eaf2;
  --dropzone: #fafbff;
  --dropzone-hover: #f4f3ff;
  --dropzone-active: #efeaff;
  --dropzone-border: #d3d7e6;
  --seg: #eef0f7;
  --control: #ffffff;
  --thumb: #eceefb;
  --brand: #6d5efc;
  --brand-2: #9b6dff;
  --brand-ink: #ffffff;
  --accent: #14c8b2;
  --warn: #ff9f43;
  --danger: #ff5b6e;
  --ok: #1fbf75;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(28, 30, 60, .08);
  --shadow-hover: 0 16px 40px rgba(109, 94, 252, .18);
  --wrap: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12141f;
  --surface: #1b1e2d;
  --header-bg: rgba(18,20,31,.86);
  --ink: #f2f3fb;
  --ink-soft: #b7bcd4;
  --muted: #8b90a8;
  --line: #2c3148;
  --dropzone: #16192a;
  --dropzone-hover: #1f2340;
  --dropzone-active: #262b4d;
  --dropzone-border: #3a4160;
  --seg: #12141f;
  --control: #12141f;
  --thumb: #2c3148;
  --shadow: 0 10px 30px rgba(0, 0, 0, .28);
  --shadow-hover: 0 16px 40px rgba(109, 94, 252, .28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(109, 94, 252, .45);
  outline-offset: 3px;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 26px; height: 68px; }
.brand { display: flex; align-items: center; gap: 0; font-weight: 800; font-size: 1.2rem; color: var(--ink); letter-spacing: -.02em; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 9px; display: block; margin-right: 10px;
  box-shadow: 0 6px 16px rgba(109,94,252,.35);
}
.brand b { color: var(--brand); }
.nav { display: flex; gap: 22px; margin-left: 8px; }
.nav a { color: var(--ink-soft); font-weight: 600; font-size: .93rem; }
.nav a:hover { color: var(--brand); }
.header-cta { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  width: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto;
  display: inline-grid; place-items: center; cursor: pointer;
  background: transparent; color: var(--ink-soft);
  border: 1.5px solid var(--line);
}
.theme-toggle:hover { color: var(--brand); border-color: var(--brand); }
.theme-toggle .theme-icon { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
html[data-theme="dark"] .theme-toggle .sun { display: none; }
html[data-theme="dark"] .theme-toggle .moon { display: block; }

/* ---------- Buttons ---------- */
.btn {
  font: inherit; font-weight: 700; border: none; border-radius: 12px; cursor: pointer;
  padding: 12px 22px; transition: transform .06s ease, box-shadow .15s, opacity .15s, background .15s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 8px 20px rgba(109,94,252,.28); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 12px 26px rgba(109,94,252,.4); }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-lg { padding: 15px 30px; font-size: 1.05rem; border-radius: 14px; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 72px 0 40px; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.08; letter-spacing: -.03em; margin: 0 0 16px; }
.hero h1 .grad { background: linear-gradient(120deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 1.18rem; color: var(--ink-soft); max-width: 620px; margin: 0 auto; }

/* ---------- Tool grid ---------- */
.tools { padding: 20px 0 80px; }
.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.card {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s;
}
a.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: transparent; }
.card .icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  color: #fff; font-size: 1.5rem;
}
.card h3 { margin: 0; font-size: 1.12rem; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--ink-soft); font-size: .92rem; }
.card.soon { opacity: .72; }
.card.soon:hover { transform: none; box-shadow: var(--shadow); }
.badge {
  position: absolute; top: 16px; right: 16px; font-size: .68rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em; padding: 4px 9px; border-radius: 999px;
}
.badge.new { background: rgba(20,200,178,.14); color: #0e9c8b; }
.badge.soon { background: rgba(139,144,168,.15); color: var(--muted); }

/* per-tool icon colors */
.ic-compress { background: linear-gradient(135deg,#6d5efc,#9b6dff); }
.ic-resize   { background: linear-gradient(135deg,#14c8b2,#0ea5a0); }
.ic-crop     { background: linear-gradient(135deg,#ff9f43,#ff7a45); }
.ic-convert  { background: linear-gradient(135deg,#ff5b6e,#ff3d8b); }
.ic-fromjpg  { background: linear-gradient(135deg,#5b8cff,#3d6bff); }
.ic-editor   { background: linear-gradient(135deg,#a06bff,#7b5bff); }
.ic-upscale  { background: linear-gradient(135deg,#12b3ff,#0e8fe0); }
.ic-bg       { background: linear-gradient(135deg,#2bd67b,#12b36a); }
.ic-watermark{ background: linear-gradient(135deg,#ffbf3f,#f79e1b); }
.ic-meme     { background: linear-gradient(135deg,#ff6bd6,#c44bff); }
.ic-rotate   { background: linear-gradient(135deg,#4fd1c5,#38b2ac); }
.ic-blur     { background: linear-gradient(135deg,#8b90a8,#5f6580); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 40px 0; margin-top: 40px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.site-footer p { color: var(--muted); font-size: .9rem; margin: 0; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--ink-soft); font-size: .9rem; font-weight: 600; }

/* ---------- Section heading ---------- */
.section-title { text-align: center; margin: 10px 0 28px; }
.section-title h2 { font-size: 1.6rem; margin: 0 0 6px; letter-spacing: -.02em; }
.section-title p { color: var(--ink-soft); margin: 0; }

.legal-main { max-width: 820px; padding-top: 56px; padding-bottom: 72px; }
.legal-main h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 8px; letter-spacing: -.03em; }
.legal-main .lead { color: var(--ink-soft); font-size: 1.08rem; margin: 0 0 36px; }
.legal-main article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 5vw, 44px); box-shadow: var(--shadow); }
.legal-main h2 { margin: 30px 0 8px; font-size: 1.25rem; }
.legal-main h2:first-child { margin-top: 0; }
.legal-main p, .legal-main li { color: var(--ink-soft); }
.legal-main ul { padding-left: 22px; }

@media (max-width: 640px) {
  .site-header .wrap { gap: 16px; overflow-x: auto; }
  .brand { flex: 0 0 auto; }
  .nav { gap: 16px; flex: 0 0 auto; margin-left: 0; }
  .nav a { white-space: nowrap; }
  .header-cta .btn { display: none; }
  .hero { padding: 48px 0 28px; }
}
