:root {
  --bg: #ffffff;
  --page: #fbfbfe;
  --surface: #f3f3fb;
  --text: #131a2e;
  --muted: #4c5875;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-dark: #3b34c4;
  --border: #e0e3f0;
  --radius: 18px;
  --grad: linear-gradient(120deg, #4f46e5, #7c3aed);
  --shadow-sm: 0 1px 2px rgba(19, 26, 46, 0.05), 0 4px 14px rgba(19, 26, 46, 0.05);
  --shadow-md: 0 2px 4px rgba(19, 26, 46, 0.06), 0 14px 34px rgba(64, 55, 180, 0.13);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--page);
  line-height: 1.6;
}

::selection { background: #dcd8fb; }

a { color: var(--accent); }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.45);
  outline-offset: 2px;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
  box-shadow: 0 1px 12px rgba(19, 26, 46, 0.04);
}
.header-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.logo { font-size: 1.4rem; font-weight: 800; color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.logo span {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.nav-toggle { display: none; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 8px 14px; font-size: 1rem; cursor: pointer; color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }
.main-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.main-nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.98rem; padding: 4px 2px; border-radius: 6px; }
.main-nav a:hover { color: var(--accent); }

/* Hero */
.hero {
  padding: 84px 0 56px; text-align: center;
  background:
    radial-gradient(560px 260px at 12% -40px, rgba(124, 58, 237, 0.16), transparent 70%),
    radial-gradient(640px 300px at 88% -60px, rgba(79, 70, 229, 0.18), transparent 70%),
    linear-gradient(180deg, #f2f1fe 0%, var(--page) 100%);
  border-bottom: 1px solid var(--border);
}
.hero h1 { font-size: clamp(2.1rem, 5.4vw, 3.3rem); line-height: 1.12; margin: 0 0 16px; letter-spacing: -0.025em; font-weight: 800; }
.hero h1 em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero p { font-size: 1.16rem; color: var(--muted); max-width: 640px; margin: 0 auto 30px; }
.badge { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); color: var(--muted); border-radius: 999px; padding: 5px 14px; font-size: 0.85rem; font-weight: 600; margin-bottom: 22px; box-shadow: var(--shadow-sm); }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); }

.btn { display: inline-block; background: var(--grad); color: #fff; text-decoration: none; font-weight: 700; padding: 13px 28px; border-radius: 12px; border: 0; cursor: pointer; font-size: 1rem; box-shadow: 0 8px 20px rgba(79, 70, 229, 0.28); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(79, 70, 229, 0.34); }
.btn.secondary { background: #fff; color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }

/* Sections */
.section { padding: 52px 0; }
.section h2 { font-size: 1.75rem; margin: 0 0 8px; letter-spacing: -0.015em; font-weight: 800; }
.section .lead { color: var(--muted); margin: 0 0 30px; max-width: 640px; font-size: 1.05rem; }

/* Tool cards */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.tool-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; background: var(--bg); display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-sm); transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; }
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #c9c5f5; }
.tool-card .icon { font-size: 1.55rem; width: 54px; height: 54px; display: flex; align-items: center; justify-content: center; border-radius: 15px; background: linear-gradient(135deg, #eceafd, #f3eafd); border: 1px solid #e2defc; }
.tool-card h3 { margin: 0; font-size: 1.16rem; letter-spacing: -0.01em; }
.tool-card p { margin: 0; color: var(--muted); font-size: 0.97rem; flex: 1; }
.tool-card a { font-weight: 700; text-decoration: none; }
.tool-card a:hover { text-decoration: underline; }
.status { display: inline-block; font-size: 0.78rem; font-weight: 700; color: var(--accent-dark); background: #eceafd; border-radius: 999px; padding: 3px 11px; width: fit-content; }
.status.live { color: #166534; background: #dcf5e5; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.step { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.step h3 { margin: 0 0 6px; font-size: 1.06rem; }
.step p { margin: 0; color: var(--muted); font-size: 0.97rem; }

/* Inner pages */
.page-head {
  padding: 58px 0 10px;
  background:
    radial-gradient(520px 220px at 90% -40px, rgba(124, 58, 237, 0.13), transparent 70%),
    linear-gradient(180deg, #f2f1fe, var(--page));
  border-bottom: 1px solid var(--border);
}
.page-head h1 { font-size: clamp(1.85rem, 4.4vw, 2.6rem); margin: 0 0 10px; letter-spacing: -0.02em; font-weight: 800; line-height: 1.18; }
.page-head p { color: var(--muted); font-size: 1.09rem; max-width: 680px; margin: 0; }
.page-head .badge::before { display: none; }
.content { padding: 14px 0 60px; }
.content h2 { font-size: 1.32rem; margin: 34px 0 10px; letter-spacing: -0.01em; }
.content h2::after { content: ""; display: block; width: 44px; height: 3px; border-radius: 3px; background: var(--grad); margin-top: 7px; }
.content p, .content li { color: var(--muted); }
.content ul { padding-left: 20px; }
.soon-panel { border: 1px solid #d9d4fa; background: linear-gradient(135deg, #f4f3fe, #faf5ff); border-radius: var(--radius); padding: 26px; margin: 28px 0; box-shadow: var(--shadow-sm); }
.soon-panel h2 { margin-top: 0; }
.soon-panel h2::after { display: none; }
.soon-panel p { color: var(--muted); margin: 0; }

/* Footer */
.site-footer { border-top: 1px solid #232a4a; background: #121830; margin-top: 24px; color: #b9c0e0; }
.site-footer .logo { color: #fff; }
.footer-in { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; padding: 40px 0 34px; }
.footer-in nav { display: flex; flex-direction: column; gap: 9px; }
.footer-in nav strong { color: #fff; margin-bottom: 4px; }
.footer-in nav a { color: #b9c0e0; text-decoration: none; font-size: 0.95rem; }
.footer-in nav a:hover { color: #fff; }
.footer-in p { color: #8f97bd !important; }
.footer-base { border-top: 1px solid rgba(255, 255, 255, 0.12); padding: 18px 0; color: #8f97bd; font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; flex-direction: column; gap: 12px; padding: 12px 0 16px; }
  .main-nav.open { display: flex; }
  .header-in { flex-wrap: wrap; }
  .hero { padding: 54px 0 38px; }
  .section { padding: 40px 0; }
}

/* Tool UI */
.muted { color: var(--muted); }
.mode-switch { display: inline-flex; gap: 4px; flex-wrap: wrap; margin: 28px 0 20px; background: var(--surface); border: 1px solid var(--border); padding: 4px; border-radius: 999px; }
.mode-switch button { border: 0; background: transparent; color: var(--muted); font-weight: 700; padding: 10px 20px; border-radius: 999px; cursor: pointer; font-size: 0.98rem; transition: all 0.15s ease; }
.mode-switch button.active { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3); }
.tool-form { border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; background: var(--bg); box-shadow: var(--shadow-sm); }
.tool-form .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tool-form label { display: block; font-weight: 600; font-size: 0.95rem; margin: 0 0 14px; }
.tool-form input, .tool-form textarea { display: block; width: 100%; margin-top: 6px; padding: 12px 13px; border: 1px solid #d5d9ea; border-radius: 10px; font: inherit; font-size: 1rem; background: #fcfcfe; color: var(--text); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.tool-form input:focus, .tool-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); outline: none; background: #fff; }
.tool-form textarea { min-height: 110px; resize: vertical; }
.tool-form .hint { display: block; font-weight: 400; color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.tool-form button[type="submit"] { background: var(--grad); color: #fff; border: 0; font-weight: 700; padding: 14px 30px; border-radius: 12px; cursor: pointer; font-size: 1rem; box-shadow: 0 8px 20px rgba(79, 70, 229, 0.28); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.tool-form button[type="submit"]:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(79, 70, 229, 0.34); }
.tool-form button[type="submit"]:disabled { opacity: 0.6; cursor: wait; transform: none; }
.error-box { border: 1px solid #e5b4b4; background: #fdf0f0; color: #7a1f1f; border-radius: 12px; padding: 14px 18px; margin: 18px 0; }
.result-panel { border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; margin: 26px 0; background: var(--bg); box-shadow: var(--shadow-sm); }
.result-panel h3 { margin: 20px 0 8px; font-size: 1.08rem; }
.result-panel h3:first-child { margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px 12px; font-size: 0.88rem; font-weight: 600; }
.chip.ok { background: #e9f7ee; border-color: #bfe6cc; color: #14532d; }
.chip.miss { background: #fdf0f0; border-color: #efc5c5; color: #7a1f1f; }
.score-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.score-big { font-size: 3.2rem; font-weight: 800; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.score-big span { font-size: 1.2rem; font-weight: 600; -webkit-text-fill-color: var(--muted); color: var(--muted); }
.score-verdict { font-size: 1.08rem; max-width: 520px; margin: 0; }
.resume-doc { border: 1px solid var(--border); border-radius: 12px; padding: 34px; background: #fff; color: #17203a; box-shadow: var(--shadow-sm); }
.resume-doc .r-name { font-size: 1.7rem; margin: 0; }
.resume-doc .r-role { color: var(--accent-dark); font-weight: 700; margin: 2px 0 0; font-size: 1.05rem; }
.resume-doc .r-contact { color: var(--muted); margin: 4px 0 0; font-size: 0.93rem; }
.resume-doc h3 { border-bottom: 2px solid var(--border); padding-bottom: 4px; margin: 22px 0 10px; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.04em; }
.resume-doc p { margin: 0 0 8px; }
.resume-doc ul { margin: 0 0 10px; padding-left: 20px; }
.resume-doc .r-period { color: var(--muted); font-weight: 400; }
.output-actions { margin: 16px 0 0; display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .tool-form .grid { grid-template-columns: 1fr; }
  .tool-form { padding: 20px; }
  .tool-form button[type="submit"] { width: 100%; }
  .mode-switch { display: flex; width: 100%; }
  .mode-switch button { flex: 1; }
  .resume-doc { padding: 22px; }
}
@media print {
  .site-header, .site-footer, .tool-ui, .page-head, .no-print { display: none !important; }
  .result-panel { border: 0; padding: 0; margin: 0; box-shadow: none; }
  .resume-doc { border: 0; padding: 0; box-shadow: none; }
  #ats-output, #build-tips { display: none !important; }
}

/* Letter writer */
.tool-form select { display: block; width: 100%; margin-top: 6px; padding: 12px 13px; border: 1px solid #d5d9ea; border-radius: 10px; font: inherit; font-size: 1rem; background: #fcfcfe; color: var(--text); }
.letter-subject { font-weight: 700; font-size: 1.05rem; margin: 0 0 12px; }
.letter-body { white-space: pre-wrap; font-size: 1.02rem; line-height: 1.65; color: var(--text); background: #fcfcfe; border: 1px solid var(--border); border-radius: 12px; padding: 22px; }

/* PDF tool */
.upload-box { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; border: 2px dashed #c9c5f5; background: linear-gradient(135deg, #f6f5fe, #fbf8ff); border-radius: 14px; padding: 28px 18px; cursor: pointer; margin: 0 0 14px; }
.upload-box:hover { border-color: var(--accent); }
.upload-icon { font-size: 2rem; }
.upload-title { font-weight: 800; font-size: 1.1rem; color: var(--text); }
.doc-info { color: var(--muted); font-size: 0.95rem; margin: 4px 0 14px; min-height: 1.2em; }
.term-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.term-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; }
.term-card strong { font-size: 1rem; }
.term-card span { color: var(--muted); font-size: 0.93rem; }
.chat-log { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.qa { border-radius: 14px; padding: 12px 16px; max-width: 92%; line-height: 1.55; }
.qa-q { background: var(--grad); color: #fff; font-weight: 600; align-self: flex-end; border-bottom-right-radius: 4px; }
.qa-a { background: var(--surface); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; white-space: pre-wrap; }
.chat-form { display: flex; gap: 10px; }
.chat-form input { flex: 1; padding: 12px 13px; border: 1px solid #d5d9ea; border-radius: 10px; font: inherit; font-size: 1rem; background: #fcfcfe; color: var(--text); }
.chat-form button { background: var(--grad); color: #fff; border: 0; font-weight: 700; padding: 12px 22px; border-radius: 10px; cursor: pointer; font-size: 1rem; }
.chat-form button:disabled { opacity: 0.6; cursor: wait; }
@media (max-width: 720px) {
  .qa { max-width: 100%; }
}

/* Motion polish (light, transform/opacity only) + loading state */
[hidden] { display: none !important; }
@keyframes wm-spin { to { transform: rotate(360deg); } }
@keyframes wm-blink { 0%, 60%, 100% { opacity: 0.15; } 30% { opacity: 1; } }
@keyframes wm-fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.spinner { display: inline-block; width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(140, 140, 160, 0.35); border-top-color: currentColor; animation: wm-spin 0.7s linear infinite; vertical-align: -2px; margin-right: 8px; }
.dots i { font-style: normal; animation: wm-blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: 0.2s; }
.dots i:nth-child(3) { animation-delay: 0.4s; }
button.is-loading { cursor: wait; opacity: 0.9; }
.result-panel:not([hidden]), .qa { animation: wm-fade-up 0.35s ease both; }
.tool-card, .btn, .tool-form button[type="submit"], .chat-form button { transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease; }
.btn:active, .tool-form button[type="submit"]:active, .chat-form button:active { transform: scale(0.98); }
.chat-form button { flex-shrink: 0; white-space: nowrap; }
.upload-box .upload-icon { transition: transform 0.2s ease; }
.upload-box:hover .upload-icon { transform: translateY(-3px); }
.qa-general { background: #fff9e8; border: 1px solid #ecd9a0; }
.qa-tag { display: block; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: #8a6d1a; margin-bottom: 4px; }
.anyway-btn { margin: 2px 0 4px auto; display: block; background: #fff; border: 1.5px solid #d9c26a; color: #7a5f10; font-weight: 700; font-size: 0.9rem; padding: 9px 16px; border-radius: 999px; cursor: pointer; }
.anyway-btn:hover { background: #fff6da; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
