:root {
  color-scheme: dark;
  --bg: #11100e;
  --surface: #191816;
  --surface-2: #211f1b;
  --border: rgba(255, 255, 255, 0.1);
  --text: #f4f0e8;
  --muted: #aaa49a;
  --gold: #e9b949;
  --gold-soft: #ffd777;
  --high: #ff6b5f;
  --medium: #f0ad4e;
  --low: #69a7ff;
  --clear: #63d6a0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -20%, rgba(233, 185, 73, 0.12), transparent 34rem),
    var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

button, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.ambient {
  position: fixed;
  z-index: -1;
  width: 26rem;
  height: 26rem;
  border-radius: 999px;
  filter: blur(100px);
  opacity: 0.08;
  pointer-events: none;
}
.ambient-one { top: 12%; left: -14rem; background: var(--gold); }
.ambient-two { right: -15rem; top: 52%; background: #576bff; }

.site-header {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(233, 185, 73, 0.7);
  color: var(--gold-soft);
  border-radius: 10px;
  background: rgba(233, 185, 73, 0.07);
}
.header-badge {
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

main, footer { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }
.hero { padding: 96px 0 72px; max-width: 880px; }
.eyebrow, .section-kicker {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  font-size: clamp(50px, 8vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.065em;
  font-weight: 850;
}
.hero h1 span { color: var(--gold-soft); }
.mobile-break { display: none; }
.hero-copy { max-width: 680px; margin: 32px 0 0; color: var(--muted); font-size: clamp(17px, 2vw, 21px); }
.trust-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.trust-row span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  color: #cbc5bb;
  font-size: 13px;
}

.workspace, .results, .ads, .how-it-works {
  margin-bottom: 26px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(31, 29, 25, 0.96), rgba(22, 21, 19, 0.96));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.24);
}
.workspace { padding: clamp(24px, 5vw, 52px); }
.workspace-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.workspace-heading > div { min-width: 0; }
.workspace h2, .section-intro h2, .result-copy h2 { margin: 0; font-size: clamp(24px, 3.2vw, 38px); letter-spacing: -0.04em; line-height: 1.2; }
.text-button { border: 0; background: transparent; color: var(--gold-soft); cursor: pointer; padding: 8px; white-space: nowrap; }
.text-button:hover { text-decoration: underline; text-underline-offset: 4px; }

.editor-shell { display: block; position: relative; }
textarea {
  width: 100%;
  min-height: 260px;
  padding: 24px 24px 48px;
  resize: vertical;
  color: var(--text);
  background: #12110f;
  border: 1px solid var(--border);
  border-radius: 18px;
  outline: none;
  line-height: 1.8;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
textarea:focus { border-color: rgba(233, 185, 73, 0.65); box-shadow: 0 0 0 4px rgba(233, 185, 73, 0.08); }
textarea::placeholder { color: #69645c; }
.char-counter { position: absolute; right: 18px; bottom: 15px; color: #777168; font-size: 12px; }
.char-counter strong { color: #a69f95; }
.action-row { display: flex; justify-content: flex-end; gap: 12px; margin-top: 18px; }
.button {
  min-height: 48px;
  border-radius: 14px;
  padding: 0 20px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 750;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: 0.65; transform: none; }
.button-secondary { color: var(--muted); background: transparent; border-color: var(--border); }
.button-secondary:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.22); }
.button-primary { min-width: 170px; display: inline-flex; align-items: center; justify-content: space-between; color: #17130a; background: var(--gold-soft); }
.button-primary:hover { background: #ffe197; }
.button-arrow { font-size: 19px; }
.status-message { min-height: 24px; margin: 12px 0 -12px; color: var(--high); text-align: right; font-size: 13px; }

.results { padding: clamp(24px, 5vw, 52px); }
.is-hidden { display: none; }
.result-summary { display: flex; align-items: center; gap: clamp(24px, 5vw, 56px); }
.score-gauge {
  --score-color: var(--clear);
  position: relative;
  flex: 0 0 140px;
  width: 140px;
  height: 140px;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 999px;
  background: radial-gradient(circle at center, var(--surface) 60%, transparent 61%), conic-gradient(var(--score-color) var(--score-angle, 0deg), rgba(255,255,255,0.08) 0);
}
.score-gauge strong { font-size: 46px; line-height: 1; letter-spacing: -0.06em; }
.score-gauge span { color: var(--muted); font-size: 12px; }
.result-copy { max-width: 650px; }
.result-copy p:last-child { margin: 12px 0 0; color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 38px; }
.metric { padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: rgba(255,255,255,0.025); }
.metric span { color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin-top: 4px; font-size: 28px; }
.metric.high strong { color: var(--high); }
.metric.medium strong { color: var(--medium); }
.metric.low strong { color: var(--low); }
.findings-heading { display: flex; justify-content: space-between; align-items: center; margin-top: 38px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.findings-heading h3 { margin: 0; }
.findings-heading span { color: var(--muted); font-size: 13px; }
.finding-list { display: grid; gap: 10px; margin-top: 14px; }
.finding {
  display: grid;
  grid-template-columns: minmax(90px, 130px) 1fr;
  gap: 18px;
  padding: 18px;
  border-radius: 15px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
}
.finding-term { font-weight: 800; overflow-wrap: anywhere; }
.finding-term.high { color: var(--high); }
.finding-term.medium { color: var(--medium); }
.finding-term.low { color: var(--low); }
.finding-body strong { font-size: 14px; }
.finding-body p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.empty-result { padding: 26px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: 15px; }

.ads { padding: clamp(24px, 5vw, 52px); }
.section-intro > p:last-child { color: var(--muted); margin: 10px 0 0; }
.ad-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 30px; }
.ad-card {
  position: relative;
  min-height: 330px;
  padding: clamp(24px, 4vw, 38px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--border);
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease;
}
.ad-card:hover { transform: translateY(-3px); border-color: rgba(233,185,73,0.42); }
.network-ad { background: radial-gradient(circle at 86% 10%, rgba(89,111,255,0.3), transparent 43%), #14151b; }
.apple-ad { background: radial-gradient(circle at 86% 10%, rgba(233,185,73,0.24), transparent 43%), #191713; }
.cooperation-ad {
  grid-column: 1 / -1;
  min-height: 250px;
  background:
    radial-gradient(circle at 88% 12%, rgba(139, 92, 246, 0.28), transparent 40%),
    radial-gradient(circle at 6% 100%, rgba(89, 111, 255, 0.18), transparent 42%),
    #15141b;
}
.cooperation-ad h3 { max-width: 760px; }
.stream-text {
  color: transparent !important;
  background-image: linear-gradient(
    100deg,
    #fff6cf 0%,
    #e9b949 24%,
    #ffffff 44%,
    #a78bfa 62%,
    #7dd3fc 78%,
    #fff6cf 100%
  );
  background-size: 260% 100%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: stream-shimmer 4.8s linear infinite;
}
@keyframes stream-shimmer {
  to { background-position: 260% 50%; }
}
.ad-label { color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: 0.14em; }
.ad-icon { position: absolute; top: 24px; right: 26px; color: rgba(255,255,255,0.3); font-size: 52px; line-height: 1; }
.ad-card h3 { margin: auto 0 12px; font-size: clamp(31px, 4.6vw, 54px); line-height: 1.05; letter-spacing: -0.055em; }
.ad-card p { max-width: 480px; margin: 0; color: var(--muted); font-size: 14px; }
.ad-action { display: inline-flex; justify-content: space-between; align-items: center; margin-top: 24px; color: var(--gold-soft); font-weight: 750; font-size: 14px; }

.how-it-works { padding: clamp(24px, 5vw, 52px); }
.steps { list-style: none; margin: 30px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.steps li { padding: 20px; border-top: 1px solid var(--border); display: flex; gap: 16px; }
.steps li > span { color: var(--gold); font-size: 12px; font-weight: 800; }
.steps strong { display: block; margin-bottom: 6px; }
.steps p { margin: 0; color: var(--muted); font-size: 13px; }

footer { padding: 48px 0 64px; color: #777168; font-size: 12px; }
footer p { margin: 6px 0; }
footer a { color: #aaa49a; text-underline-offset: 3px; }

@media (max-width: 720px) {
  .site-header, main, footer { width: min(100% - 24px, 1160px); }
  .site-header { padding: 18px 0; }
  .header-badge { display: none; }
  .hero { padding: 64px 4px 48px; }
  .hero h1 { font-size: clamp(44px, 13vw, 62px); overflow-wrap: anywhere; }
  .mobile-break { display: block; }
  .hero-copy { font-size: 16px; }
  .workspace, .results, .ads, .how-it-works { border-radius: 21px; }
  .workspace-heading { flex-direction: column; align-items: start; gap: 8px; }
  .workspace-heading h2 { max-width: 100%; font-size: 21px; overflow-wrap: anywhere; word-break: break-word; }
  .workspace-heading .text-button { align-self: flex-start; padding-left: 0; }
  textarea { min-height: 220px; padding: 18px 18px 44px; }
  .action-row { display: grid; grid-template-columns: 1fr 2fr; }
  .button-primary { min-width: 0; }
  .result-summary { align-items: flex-start; }
  .score-gauge { flex-basis: 104px; width: 104px; height: 104px; }
  .score-gauge strong { font-size: 34px; }
  .metric-grid, .ad-grid, .steps { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .metric { padding: 14px 10px; }
  .metric strong { font-size: 22px; }
  .ad-card { min-height: 290px; }
  .cooperation-ad { grid-column: auto; min-height: 250px; }
  .finding { grid-template-columns: 1fr; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .stream-text {
    animation: none !important;
    background-position: 52% 50%;
  }
}
