/* AIPet Tools — design system matched to aipet.video
   (#0a0a0a bg, #ededed fg, white pill CTAs, 12px cards, tight tracking) */
:root {
  --bg: #0a0a0a;
  --fg: #ededed;
  --muted: rgba(237, 237, 237, 0.6);
  --muted-2: rgba(237, 237, 237, 0.4);
  --card: #141414;
  --card-2: #191919;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: #ffd75e;
  --radius: 12px;
  --maxw: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--fg); text-decoration: none; }
img, canvas, video { max-width: 100%; height: auto; }
::selection { background: rgba(255, 215, 94, 0.3); }

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

h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; margin: 0; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; gap: 28px; height: 56px; }
.logo { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
.logo span { color: var(--muted); font-weight: 500; }
.nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav a { color: var(--muted); font-size: 13.5px; transition: color .15s; }
.nav a:hover { color: var(--fg); }
.nav .nav-cta {
  color: #0a0a0a; background: #fff; border-radius: 999px;
  padding: 7px 15px; font-weight: 500; font-size: 13.5px;
}
.nav .nav-cta:hover { background: #e2e2e2; color: #0a0a0a; }
@media (max-width: 760px) { .nav a:not(.nav-cta) { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; padding: 10px 20px;
  font: 500 14px/1.2 var(--font); cursor: pointer;
  border: 1px solid transparent; transition: all .15s ease;
  white-space: nowrap;
}
.btn-primary { background: #fff; color: #0a0a0a; }
.btn-primary:hover { background: #e2e2e2; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-outline { background: transparent; color: var(--fg); border-color: var(--line-strong); }
.btn-outline:hover { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.04); }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ---------- hero ---------- */
.hero { padding: 72px 0 30px; }
.hero.center { text-align: center; }
.hero h1 {
  font-size: clamp(32px, 5.4vw, 56px);
  line-height: 1.06; letter-spacing: -0.03em;
  max-width: 820px; margin: 0 0 16px;
}
.hero.center h1 { margin-left: auto; margin-right: auto; }
.hero p.sub { color: var(--muted); max-width: 620px; margin: 0 0 24px; font-size: 16.5px; line-height: 1.65; }
.hero.center p.sub { margin-left: auto; margin-right: auto; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.hero.center .badges { justify-content: center; }
.badge {
  font-size: 12.5px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px;
  background: rgba(255, 255, 255, 0.03);
}
.badge.accent { color: var(--accent); border-color: rgba(255, 215, 94, 0.25); background: rgba(255, 215, 94, 0.06); }

/* ---------- editor ---------- */
.tool-section { padding: 20px 0 48px; }
.editor {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden;
}
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; }
@media (max-width: 940px) { .editor-grid { grid-template-columns: 1fr; } }

.stage-col { padding: 20px; border-right: 1px solid var(--line); min-width: 0; }
@media (max-width: 940px) { .stage-col { border-right: none; border-bottom: 1px solid var(--line); } }

.dropzone {
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  background: var(--bg);
  min-height: 420px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; text-align: center;
  transition: border-color .15s, background .15s;
}
.dropzone.over, .dropzone:hover { border-color: rgba(255, 255, 255, 0.45); background: #0f0f0f; }
.dz-inner { display: flex; flex-direction: column; gap: 10px; align-items: center; padding: 32px; }
.dz-icon {
  width: 52px; height: 52px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.dz-inner strong { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.dz-inner .or { color: var(--muted-2); font-size: 12.5px; }
.dz-inner small { color: var(--muted-2); font-size: 12.5px; max-width: 300px; line-height: 1.55; }

.canvas-shell { position: relative; }
.canvas-wrap {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  background: #0f0f0f;
  display: flex; justify-content: center;
  position: relative;
}
.canvas-wrap.checker {
  background:
    linear-gradient(45deg, rgba(255,255,255,.06) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.06) 75%),
    linear-gradient(45deg, rgba(255,255,255,.06) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.06) 75%);
  background-size: 22px 22px; background-position: 0 0, 11px 11px;
}
.canvas-wrap canvas { display: block; max-height: 68vh; width: auto; max-width: 100%; }
.canvas-wrap.brushing { cursor: none; }
.brush-cursor {
  position: absolute; pointer-events: none; border: 1.5px solid #fff; border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.6); transform: translate(-50%, -50%); display: none; z-index: 5;
}

.progress-overlay {
  position: absolute; inset: 0; z-index: 6;
  background: rgba(10, 10, 10, 0.82); backdrop-filter: blur(4px);
  display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center;
  border-radius: var(--radius); text-align: center; padding: 20px;
}
.progress-overlay p { margin: 0; color: var(--fg); font-size: 14px; font-weight: 500; }
.progress-overlay small { color: var(--muted); font-size: 12.5px; }
.progress-bar { width: 200px; height: 3px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
.progress-bar i {
  display: block; height: 100%; width: 40%; border-radius: 99px; background: #fff;
  animation: slide 1.2s ease-in-out infinite;
}
@keyframes slide { 0% { transform: translateX(-110%);} 100% { transform: translateX(320%);} }

.stage-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.status { color: var(--accent); font-size: 13px; margin: 10px 0 0; }

.after-download {
  margin-top: 16px; padding: 14px 16px; border-radius: var(--radius);
  background: rgba(255, 215, 94, 0.06); border: 1px solid rgba(255, 215, 94, 0.2);
  font-size: 14px; color: var(--fg); line-height: 1.6;
}
.after-download a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- controls panel ---------- */
.controls-col { padding: 20px; }
.panel-title { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); margin: 0 0 10px; }

.tpl-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.tpl {
  position: relative; border-radius: 10px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); padding: 0; background: var(--card-2);
  aspect-ratio: 1; transition: border-color .15s;
}
.tpl canvas { display: block; width: 100%; height: 100%; }
.tpl:hover { border-color: rgba(255,255,255,.35); }
.tpl.active { border-color: #fff; box-shadow: 0 0 0 1px #fff inset; }
.tpl .tpl-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-size: 10px; font-weight: 500; color: #fff; text-align: center;
  background: linear-gradient(transparent, rgba(0,0,0,.72)); padding: 14px 2px 4px;
  pointer-events: none;
}

.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.field input[type="text"], .field input[type="tel"], .field input[type="date"], .field input[type="number"], .field select, .field textarea {
  width: 100%; padding: 9px 12px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--bg); color: var(--fg);
  font: inherit; font-size: 14px; outline: none; transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(255,255,255,.35); }
.field input[type="range"] { width: 100%; accent-color: #fff; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); cursor: pointer; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.seg { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button {
  flex: 1; padding: 7px 8px; border-radius: 7px; border: none; cursor: pointer;
  background: transparent; color: var(--muted); font: 500 13px var(--font);
  transition: all .12s;
}
.seg button.active { background: #fff; color: #0a0a0a; }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 30px; height: 30px; border-radius: 999px;
  border: 1px solid var(--line-strong); cursor: pointer; padding: 0;
}
.swatch.active { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px #fff; }

details.adv { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
details.adv summary {
  cursor: pointer; font-size: 12px; font-weight: 500; color: var(--muted);
  list-style: none; display: flex; align-items: center; gap: 6px; user-select: none;
}
details.adv summary::after { content: "+"; margin-left: auto; color: var(--muted-2); font-size: 14px; }
details.adv[open] summary::after { content: "–"; }
details.adv .adv-body { padding-top: 12px; }

.brush-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.brush-tools .seg { flex: 1; min-width: 150px; }

/* ---------- generic content ---------- */
section.content { padding: 44px 0; border-top: 1px solid var(--line); }
section.content h2 { font-size: clamp(21px, 3vw, 28px); margin-bottom: 20px; }
section.content > .container > p, section.content p.lead { color: var(--muted); max-width: 720px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.step .n { font-size: 12px; font-weight: 600; color: var(--muted-2); display: block; margin-bottom: 10px; }
.step h3 { font-size: 15.5px; margin-bottom: 6px; }
.step p { font-size: 13.5px; margin: 0; color: var(--muted); line-height: 1.6; }

.ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-top: 8px; }
.idea { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.idea strong { color: var(--fg); display: block; margin-bottom: 4px; font-weight: 600; }

.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 500; font-size: 15px; list-style: none; display: flex; }
.faq summary::after { content: "+"; margin-left: auto; color: var(--muted-2); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 10px 0 2px; font-size: 14px; color: var(--muted); max-width: 700px; line-height: 1.65; }

/* ---------- tool directory (hub) ---------- */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.tool-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px; display: block; transition: border-color .15s, transform .15s;
}
.tool-card:hover { border-color: rgba(255,255,255,.3); transform: translateY(-2px); }
.tool-card .ico {
  width: 40px; height: 40px; border-radius: 10px; margin-bottom: 14px;
  background: rgba(255,255,255,.05); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.tool-card h3 { font-size: 15.5px; margin-bottom: 5px; }
.tool-card p { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.55; }
.tool-card .tag { display: inline-block; margin-top: 12px; font-size: 11.5px; color: var(--muted-2); }
.tool-card.soon { opacity: .55; pointer-events: none; }

/* ---------- CTA band ---------- */
.cta-banner {
  margin: 48px 0; padding: 44px 32px; text-align: center;
  border-radius: 18px;
  background:
    radial-gradient(560px 200px at 15% 0%, rgba(255, 215, 94, 0.08), transparent),
    radial-gradient(560px 220px at 85% 100%, rgba(255, 255, 255, 0.05), transparent),
    var(--card);
  border: 1px solid var(--line);
}
.cta-banner h2 { font-size: clamp(22px, 3.4vw, 34px); margin-bottom: 12px; letter-spacing: -0.03em; }
.cta-banner p { color: var(--muted); max-width: 540px; margin: 0 auto 22px; font-size: 15px; }

/* ---------- blog ---------- */
.post-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.post-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: block; transition: border-color .15s; }
.post-card:hover { border-color: rgba(255,255,255,.3); }
.post-card h3 { font-size: 16.5px; line-height: 1.35; margin-bottom: 8px; }
.post-card p { color: var(--muted); font-size: 13.5px; margin: 0; line-height: 1.6; }
.post-card .meta { font-size: 12px; color: var(--muted-2); margin-top: 14px; display: block; }

article.post { max-width: 700px; margin: 0 auto; padding: 56px 24px 40px; }
article.post h1 { font-size: clamp(28px, 4.4vw, 42px); line-height: 1.12; letter-spacing: -0.03em; margin-bottom: 14px; }
article.post .post-meta { color: var(--muted-2); font-size: 13px; margin-bottom: 34px; }
article.post h2 { font-size: 23px; margin: 38px 0 12px; letter-spacing: -0.02em; }
article.post h3 { font-size: 17.5px; margin: 26px 0 8px; }
article.post p { color: #c7c7c7; line-height: 1.78; font-size: 15.5px; margin: 0 0 16px; }
article.post ul, article.post ol { color: #c7c7c7; line-height: 1.75; font-size: 15.5px; padding-left: 22px; margin: 0 0 16px; }
article.post li { margin-bottom: 6px; }
article.post a { text-decoration: underline; text-underline-offset: 3px; }
article.post strong { color: var(--fg); }

/* ---------- print pages ---------- */
@media print {
  .site-header, .site-footer, .no-print { display: none !important; }
  body { background: #fff; color: #111; }
}

/* ---------- tool-specific ---------- */
.seg.seg-wrap button { font-size: 11.5px; line-height: 1.25; padding: 6px 4px; }

.age-results { text-align: center; padding: 26px 8px; }
.age-who { color: var(--muted); font-size: 15px; margin: 0 0 4px; }
.age-big { font-size: clamp(72px, 12vw, 120px); font-weight: 700; letter-spacing: -0.045em; line-height: 1; }
.age-big .age-unit { display: block; font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--muted-2); margin-top: 8px; }
.compare-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 26px auto 18px; max-width: 560px; }
@media (max-width: 640px) { .compare-grid { grid-template-columns: 1fr; } }
.num-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 10px; display: flex; flex-direction: column; gap: 3px; }
.num-card .num { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; }
.num-card .lbl { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.num-card .src { font-size: 10.5px; color: var(--muted-2); }
.num-card.strike .num { text-decoration: line-through; text-decoration-color: rgba(255, 107, 107, 0.85); text-decoration-thickness: 3px; color: var(--muted-2); }
.stage-badge-row { margin: 6px 0 8px; }
.age-tip { color: var(--muted); font-size: 13.5px; max-width: 460px; margin: 6px auto 0; }
.age-empty { min-height: 220px; display: flex; align-items: center; justify-content: center; }

.breed-results { margin-top: 18px; max-width: 620px; }
.breed-row { margin-bottom: 14px; }
.breed-row .breed-head { display: flex; justify-content: space-between; font-size: 14.5px; margin-bottom: 6px; }
.breed-row.top .breed-head strong { color: var(--accent); }
.bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: #fff; }
.breed-row.top .bar i { background: var(--accent); }
.fine-note { font-size: 12.5px; color: var(--muted-2); line-height: 1.6; margin: 14px 0 0; }

.record-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 128px; height: 128px; border-radius: 999px; margin: 8px auto 0;
  background: #fff; color: #0a0a0a; border: none; cursor: pointer;
  font: 600 12.5px var(--font); transition: transform .15s, box-shadow .3s;
}
.record-btn:hover { transform: scale(1.04); }
.record-btn.rec { background: #ffd75e; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,215,94,.35);} 50% { box-shadow: 0 0 0 18px rgba(255,215,94,0);} }
.mood-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 560px; margin: 0 auto; }
.translate-card {
  max-width: 560px; margin: 24px auto 0; padding: 26px 24px; text-align: center;
  background: var(--bg); border: 1px solid rgba(255, 215, 94, 0.25); border-radius: 16px;
}
.translate-top { display: flex; justify-content: center; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.translate-top .conf { font-size: 11.5px; color: var(--muted-2); }
.translate-quote { font: 600 24px/1.4 Georgia, "Times New Roman", serif; color: var(--fg); margin: 0 0 10px; min-height: 68px; }
.translate-by { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }

.health-record { background: #fff; color: #16181d; border-radius: var(--radius); padding: 26px 28px; }
.hr-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #16181d; padding-bottom: 10px; margin-bottom: 16px; }
.hr-brand { font-size: 11px; color: #9a9a9a; }
.hr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
@media (max-width: 640px) { .hr-grid { grid-template-columns: 1fr; } }
.hr-grid label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #8a8a8a; display: flex; flex-direction: column; gap: 3px; }
.health-record input { border: none; border-bottom: 1px solid #d9d9d9; padding: 5px 2px; font: 500 14px var(--font); color: #16181d; background: transparent; outline: none; width: 100%; }
.health-record input:focus { border-bottom-color: #16181d; }
.hr-sub { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; margin: 20px 0 8px; color: #16181d; }
.hr-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.hr-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: #8a8a8a; padding: 4px 6px; border-bottom: 1.5px solid #16181d; }
.hr-table td { padding: 2px 6px; border-bottom: 1px solid #e7e7e7; }
.health-record .btn { margin: 4px 0 0; }
@media print {
  .editor, .stage-col { border: none !important; background: #fff !important; padding: 0 !important; }
  .health-record { border-radius: 0; padding: 0; }
  main { padding: 0; }
  .hero, .content, .cta-banner, .tool-section { padding: 0 !important; }
  section.hero, section.content { display: none; }
}

/* ---------- AI portraits ---------- */
.style-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.style-card {
  position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--bg); cursor: pointer; padding: 0 0 8px; text-align: left;
  transition: border-color .15s; font: inherit; color: var(--fg);
}
.style-card:hover { border-color: rgba(255,255,255,.35); }
.style-card.active { border-color: #fff; box-shadow: 0 0 0 1px #fff inset; }
.style-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; margin-bottom: 7px; }
.style-card .sc-name { display: block; font-size: 12.5px; font-weight: 600; padding: 0 9px; }
.style-card .sc-hint { display: block; font-size: 10.5px; color: var(--muted-2); padding: 1px 9px 0; }
.auth-box .quota-line { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.auth-note { font-size: 12px; color: var(--muted-2); line-height: 1.55; margin: 10px 0 0; }
.auth-note a { text-decoration: underline; text-underline-offset: 2px; }
.auth-tabs { margin-bottom: 10px; }
.gen-status { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.gen-status p { margin: 0; font-size: 13.5px; color: var(--accent); }
.gen-status .progress-bar { width: 100%; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--muted); font-size: 13px; margin-top: 40px; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; }
@media (max-width: 820px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } }
.site-footer h4 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted-2); margin: 0 0 12px; }
.site-footer nav { display: flex; flex-direction: column; gap: 8px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--fg); }
.site-footer .fine { margin-top: 28px; font-size: 12px; color: var(--muted-2); line-height: 1.6; }
