/* ============================================================
   PixToolkit · base.css
   Design tokens, reset, shared layout, header/footer, home page
   ============================================================ */

:root {
  /* surfaces */
  --paper:      #F6F2EA;
  --paper-2:    #FFFFFF;
  --paper-3:    #FBF9F4;
  --stage:      #211D19;
  --stage-2:    #2B2620;

  /* ink */
  --ink:        #1A1511;
  --ink-2:      #6B6157;
  --ink-3:      #9A9087;
  --on-stage:   #EDE7DD;
  --on-stage-2: #A8A096;

  /* brand */
  --accent:     #E4533A;
  --accent-ink: #FFFFFF;
  --accent-deep:#C23C25;
  --accent-soft:#FBE7E1;

  /* category hues */
  --c-optimize: #E4533A;
  --c-edit:     #1F8A70;
  --c-convert:  #2D6CDF;
  --c-secure:   #C98A1B;

  /* lines & states */
  --line:       rgba(26,21,17,.10);
  --line-2:     rgba(26,21,17,.16);
  --ok:         #1F8A70;
  --warn:       #C23C25;

  /* shape */
  --r-sm: 10px;
  --r:    14px;
  --r-lg: 22px;
  --r-xl: 30px;

  /* shadow */
  --sh-1: 0 1px 2px rgba(26,21,17,.05), 0 2px 8px rgba(26,21,17,.04);
  --sh-2: 0 6px 24px rgba(26,21,17,.08), 0 2px 8px rgba(26,21,17,.05);
  --sh-3: 0 18px 50px rgba(26,21,17,.16);

  /* type */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --maxw: 1180px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  /* subtle warm atmosphere */
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(228,83,58,.07), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(31,138,112,.06), transparent 55%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }

::selection { background: var(--accent); color: #fff; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 18px; height: 64px; }

.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: -.02em; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  display: grid; place-items: center; color: #fff; box-shadow: var(--sh-1);
  flex: none;
}
.brand .mark svg { width: 18px; height: 18px; }
.brand .name { font-size: 18px; }
.brand .name b { color: var(--accent); }

.head-spacer { flex: 1; }

.head-link {
  font-size: 14.5px; color: var(--ink-2); font-weight: 600;
  padding: 8px 12px; border-radius: 9px; transition: .18s;
}
.head-link:hover { color: var(--ink); background: rgba(26,21,17,.05); }

.badge-private {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 700; color: var(--ok);
  background: rgba(31,138,112,.10); border: 1px solid rgba(31,138,112,.22);
  padding: 6px 11px; border-radius: 999px;
}
.badge-private svg { width: 14px; height: 14px; }

/* ---------- footer ---------- */
.site-foot {
  margin-top: 90px; border-top: 1px solid var(--line);
  background: var(--paper-3);
}
.site-foot .wrap { padding-block: 40px 30px; }
.foot-top { display: flex; flex-wrap: wrap; gap: 30px 60px; justify-content: space-between; }
.foot-about { max-width: 320px; }
.foot-about .brand { margin-bottom: 12px; }
.foot-about p { font-size: 13.5px; color: var(--ink-2); }
.foot-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.foot-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-3); margin-bottom: 12px; }
.foot-col a { display: block; font-size: 14px; color: var(--ink-2); padding: 4px 0; transition: .15s; }
.foot-col a:hover { color: var(--accent); }
.foot-bottom {
  margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 13px; color: var(--ink-3);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 14.5px; padding: 11px 20px; border-radius: 11px;
  transition: transform .12s, box-shadow .18s, background .18s, opacity .18s;
  white-space: nowrap; user-select: none;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--sh-1); }
.btn-primary:hover { background: var(--accent-deep); box-shadow: var(--sh-2); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { background: var(--ink-3); cursor: not-allowed; box-shadow: none; opacity: .6; }
.btn-ghost { background: var(--paper-2); color: var(--ink); border: 1px solid var(--line-2); }
.btn-ghost:hover { border-color: var(--ink-3); background: var(--paper-3); }
.btn-sm { padding: 8px 14px; font-size: 13.5px; border-radius: 9px; }

/* ---------- home: hero ---------- */
.hero { padding: 70px 0 28px; text-align: center; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); padding: 7px 14px; border-radius: 999px;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(34px, 6vw, 58px); line-height: 1.04; letter-spacing: -.035em;
  font-weight: 850; max-width: 16ch; margin-inline: auto;
}
.hero h1 .hl { color: var(--accent); }
.hero .lead {
  margin: 20px auto 0; max-width: 52ch; font-size: clamp(15px, 2vw, 18px);
  color: var(--ink-2);
}
.hero .trust {
  margin-top: 22px; display: inline-flex; gap: 20px; flex-wrap: wrap; justify-content: center;
  font-size: 13px; color: var(--ink-3); font-weight: 600;
}
.hero .trust span { display: inline-flex; align-items: center; gap: 7px; }
.hero .trust svg { width: 15px; height: 15px; color: var(--ok); }

/* ---------- home: filter tabs ---------- */
.filters { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; margin: 40px 0 30px; }
.filters button {
  font-size: 14px; font-weight: 700; color: var(--ink-2);
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--paper-2); transition: .16s;
}
.filters button:hover { border-color: var(--ink-3); }
.filters button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- home: tool grid ---------- */
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}
.card {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 22px 20px 20px;
  box-shadow: var(--sh-1); transition: transform .18s, box-shadow .2s, border-color .2s;
  overflow: hidden;
}
.card::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--hue, var(--accent)); opacity: 0; transition: opacity .2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--sh-3); border-color: transparent; }
.card:hover::after { opacity: 1; }
.card .ic {
  width: 46px; height: 46px; border-radius: 13px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: var(--hue, var(--accent));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--hue, var(--accent)) 35%, transparent);
}
.card .ic svg { width: 24px; height: 24px; }
.card h3 { font-size: 16.5px; font-weight: 800; letter-spacing: -.01em; }
.card p { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; flex: 1; }
.card .go {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px;
  font-weight: 700; color: var(--hue, var(--accent)); margin-top: 2px;
}
.card .go svg { width: 15px; height: 15px; transition: transform .18s; }
.card:hover .go svg { transform: translateX(4px); }
.card .tag {
  position: absolute; top: 14px; right: 14px; font-size: 10.5px; font-weight: 800;
  letter-spacing: .04em; color: var(--accent); background: var(--accent-soft);
  padding: 4px 9px; border-radius: 999px; text-transform: uppercase;
}
.card.hide { display: none; }

/* strip / cross-sell */
.note-strip {
  margin-top: 56px; padding: 22px 26px; border-radius: var(--r-lg);
  background: linear-gradient(120deg, var(--stage), var(--stage-2));
  color: var(--on-stage); display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  box-shadow: var(--sh-2);
}
.note-strip .ns-ic { width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.10); display: grid; place-items: center; flex: none; }
.note-strip .ns-ic svg { width: 22px; height: 22px; color: var(--on-stage); }
.note-strip h4 { font-size: 16px; font-weight: 800; }
.note-strip p { font-size: 13.5px; color: var(--on-stage-2); max-width: 60ch; }
.note-strip .grow { flex: 1; min-width: 200px; }

/* ---------- toast ---------- */
.toast-host {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 90; display: flex; flex-direction: column; gap: 10px; align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 600;
  padding: 11px 18px; border-radius: 11px; box-shadow: var(--sh-3);
  display: flex; align-items: center; gap: 9px;
  animation: toast-in .26s cubic-bezier(.2,.9,.3,1.2);
}
.toast.ok { background: var(--ok); }
.toast.err { background: var(--warn); }
.toast svg { width: 16px; height: 16px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.96); } }

@media (max-width: 720px) {
  .wrap { padding-inline: 18px; }
  .hero { padding-top: 46px; }
  .head-link.hide-sm { display: none; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
