/* Pega Match — landing. Overrides base.css tokens with the dealt direction
   ("Night and cornflower" + "Stack Sans Light") and builds every section. */

:root {
  --bg: #0a0d14;
  --surface: #131824;
  --ink: #e9edf3;
  --muted: #8891a1;
  --accent: #5a9bfc;
  --accent-ink: #0a0d14;

  --font-display: "Stack Sans Headline", system-ui, sans-serif;
  --font-text: "Stack Sans Text", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);

  --radius: 0px;
  --glow: rgba(90, 155, 252, .16);
}

body {
  background:
    radial-gradient(1100px 650px at 82% 0%, var(--glow), transparent 60%),
    radial-gradient(900px 600px at 6% 85%, rgba(90, 155, 252, .09), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  font-family: var(--font-text);
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 300; letter-spacing: -0.022em; }

/* ============ data-ui scope: the real Pega Match interface tokens ============ */
[data-ui] {
  --ground: #f8fafd; --surface: #ffffff; --raised: #f2f6fc; --active: #eaf1fd;
  --border: #e3e9f1; --rule: #edf1f6; --control: #cdd7e3;
  --text: #111827; --muted: #5f6672; --faint: #7b8291;
  --accent: #2f6fe0; --primary: #111827; --primary-ink: #ffffff;
  --positive: #1f7a4d; --negative: #c23b2f; --warning: #92610e;
  --pill-positive-bg: #e1f5e9; --pill-positive-ink: #15532f;
  --pill-warning-bg: #fdf0db; --pill-warning-ink: #8a5a0a;
  --pill-negative-bg: #fce8e6; --pill-negative-ink: #8f2a20;
  --pill-neutral-bg: #eef1f5; --pill-neutral-ink: #3d4451;
  --font-ui: "DM Sans", system-ui, sans-serif;
  --radius-card: 10px; --radius-control: 6px; --control-height: 34px;
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--surface);
  font-size: 14px;
  line-height: 1.45;
}
[data-ui] .num { font-variant-numeric: tabular-nums; }
[data-ui] .panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
[data-ui] .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--control-height); padding: 0 14px; border-radius: var(--radius-control); border: 1px solid var(--control); background: var(--surface); font-weight: 500; font-size: 13px; cursor: pointer; transition: background-color .15s ease, transform .12s cubic-bezier(.22,1,.36,1); color: var(--text); }
[data-ui] .btn:hover { background: var(--raised); }
[data-ui] .btn:active { transform: translateY(1px); }
[data-ui] .btn.primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
[data-ui] .btn.ghost { border-color: transparent; background: transparent; }
[data-ui] .field { display: grid; gap: 6px; }
[data-ui] .field label { font-weight: 500; font-size: 13px; }
[data-ui] .field .hint { color: var(--faint); font-size: 12px; }
[data-ui] .input, [data-ui] textarea.input { width: 100%; min-height: 34px; padding: 8px 10px; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); font: inherit; color: var(--text); }
[data-ui] textarea.input { resize: none; }
[data-ui] .input::placeholder { color: var(--faint); }
[data-ui] .pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); white-space: nowrap; }
[data-ui] .pill.pos { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }
[data-ui] .pill.warn { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }
[data-ui] .pill.neg { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
[data-ui] .pill.accent { background: var(--active); color: #1b3a66; }
[data-ui] .rows { display: grid; }
[data-ui] .row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 9px 0; }
[data-ui] .row + .row { border-top: 1px solid var(--rule); }
[data-ui] .chip-group { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--raised); }
[data-ui] .chip-group button { height: 28px; padding: 0 11px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
[data-ui] .chip-group button[aria-pressed="true"] { background: var(--surface); color: var(--text); }
[data-ui] .keyword { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--raised); color: var(--text); font-size: 12px; border: 1px solid var(--border); }
[data-ui] .keyword.exclude { background: #fce8e6; color: #8f2a20; border-color: transparent; }
[data-ui] .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-ui] .file-chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--raised); font-size: 13px; }
[data-ui] .file-chip .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--positive); flex: none; }

/* ============ layout shell ============ */
header.hero { position: relative; min-height: 100svh; display: grid; grid-template-columns: 1fr 1fr; background: transparent; overflow: hidden; }
header.hero::after { content: ""; position: absolute; inset: 0; left: 50%; background: var(--surface); z-index: 0; }
.hero-half { position: relative; z-index: 1; padding: 40px clamp(1.5rem, 3vw, 2.5rem); display: flex; flex-direction: column; }
.hero-left { justify-content: center; gap: clamp(3rem, 14vh, 7rem); }
.hero-right { align-items: center; justify-content: center; }
.hero-logo { display: flex; align-items: center; gap: 10px; }
.hero-logo img { width: 30px; height: 30px; border-radius: 7px; }
.hero-logo span { font-family: var(--font-text); font-weight: 500; font-size: 15px; color: var(--ink); }
.hero-copy { max-width: 46ch; }
.hero-copy h1 { font-size: clamp(1.875rem, 2.6vw, 2.75rem); line-height: 1.1; color: var(--ink); }
.hero-copy .lines { margin-top: 2px; }
.hero-copy p { margin-top: 18px; font-size: 17px; line-height: 1.5; color: var(--ink); max-width: 44ch; }
.hero-cta { margin-top: 28px; display: flex; align-items: center; gap: 20px; }
.hero-toplink { position: absolute; top: 40px; right: clamp(1.5rem, 3vw, 2.5rem); z-index: 2; font-size: 15px; color: var(--ink); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: .2em; transition: text-decoration-color .18s ease; }
.hero-toplink:hover { text-decoration-color: currentColor; }
.hero-fragment { width: min(450px, 86%); }

@media (max-width: 860px) {
  header.hero { grid-template-columns: 1fr; min-height: auto; }
  header.hero::after { display: none; }
  .hero-right { order: -1; min-height: 58svh; background: var(--surface); padding-top: 72px; }
  .hero-left { min-height: 42svh; justify-content: flex-end; padding-bottom: 36px; }
  .hero-logo { position: absolute; top: 20px; left: 20px; }
  .hero-logo span { display: none; }
  .hero-copy h1 { font-size: 8.8vw; }
  .hero-toplink { display: none; }
  .hero-fragment { width: 78vw; }
}

main { background: transparent; color: var(--ink); }
main section { padding-block: clamp(5rem, 12vw, 9rem); }
.wrap { max-width: 1320px; margin-inline: auto; padding-inline: clamp(1.5rem, 3vw, 2.5rem); }
.section-head { font-size: clamp(1.5rem, 2vw, 2rem); color: var(--ink); font-weight: 300; }

/* ============ how it works: pinned fragment ============ */
.how { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(2rem, 4vw, 4rem); align-items: stretch; }
.how-stmts { display: flex; flex-direction: column; }
.how-stmt { min-height: 75vh; display: flex; flex-direction: column; justify-content: center; opacity: .55; transition: opacity .4s ease; }
.how-stmt.is-active { opacity: 1; }
.how-stmt .step { display: block; font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .06em; color: var(--accent); margin-bottom: 10px; }
.how-stmt .order { font-size: clamp(1.5rem, 2.2vw, 2rem); line-height: 1.25; color: var(--ink); font-family: var(--font-display); font-weight: 300; }
.how-stmt .sub { margin-top: 10px; font-size: 16px; color: var(--ink); max-width: 36ch; }
.how-stage-wrap { position: sticky; top: 0; height: 100vh; display: flex; align-items: center; }
#pm-gl { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.how-stage { position: relative; z-index: 1; width: min(520px, 100%); margin-inline: auto; background: #eef2f7; padding: clamp(1.5rem, 3vw, 2.5rem); border-radius: 4px; min-height: 460px; display: flex; flex-direction: column; justify-content: center; }
.how-head { margin-bottom: clamp(2rem, 6vh, 3.5rem); }
.how-state { display: none; }
.how-state.is-active { display: block; }

@media (max-width: 860px) {
  .how { grid-template-columns: 1fr; }
  .how-stage-wrap { position: sticky; top: 0; height: 46svh; display: flex; align-items: center; z-index: 1; background: var(--bg); padding-block: 12px; }
  #pm-gl { display: none; }
  .how-stage { padding: 1.25rem; }
  .how-stmt { min-height: 60svh; opacity: 1; }
  .how-stmt .step { font-size: 11.5px; margin-bottom: 6px; }
  .how-stmt .order { font-size: 22px; max-width: 92%; }
  .how-stmt .sub { font-size: 14px; max-width: 60ch; }
}

@media (max-width: 480px) {
  #how-stage .pill-source { display: none; }
}

/* ============ features: panel with margin notes ============ */
.features-row { display: grid; grid-template-columns: 4fr 4fr 4fr; gap: clamp(1.5rem, 3vw, 2.5rem); align-items: start; }
.features-head { grid-column: 1 / 5; text-align: right; font-size: clamp(2rem, 3.2vw, 2.5rem); color: var(--ink); }
.features-grid { position: relative; display: grid; grid-template-columns: 4fr 4fr 4fr; gap: clamp(1.5rem, 3vw, 2.5rem); margin-top: clamp(2.5rem, 5vw, 4rem); }
.feat-notes-left, .feat-notes-right { position: relative; }
.feat-note { position: absolute; width: 24ch; max-width: 100%; transition: opacity .25s ease; }
.feat-notes-left .feat-note { text-align: right; right: 0; }
.feat-notes-right .feat-note { text-align: left; left: 0; }
.feat-note .name { font-size: 18px; font-weight: 500; color: var(--ink); }
.feat-note p { margin-top: 6px; font-size: 15px; color: var(--muted); line-height: 1.4; }
.features-grid.dim-others .feat-note:not(:hover):not(.is-focus) { opacity: .3; }
.feat-panel-col { display: flex; justify-content: center; }
.feat-panel { width: 380px; min-height: 660px; display: flex; flex-direction: column; transition: opacity .25s ease; }
.features-grid.dim-others .feat-panel.is-dim { opacity: .3; }

@media (max-width: 860px) {
  .features-head { text-align: left; grid-column: 1; font-size: 26px; }
  .features-grid { grid-template-columns: 1fr; margin-top: 2rem; }
  .feat-note { position: static; width: auto; text-align: left !important; margin-bottom: 16px; }
  .feat-panel { width: 100%; min-height: auto; }
  .feat-slice { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
}

/* ============ stats: real ratio (466 of 2.450 ofertas calzan) ============ */
.stats-inner { min-height: 58svh; display: flex; flex-direction: column; justify-content: center; }
.stats-q { font-size: clamp(2.25rem, 3.6vw, 2.75rem); color: var(--ink); max-width: 20ch; font-family: var(--font-display); font-weight: 300; }
.stats-gap { height: clamp(3rem, 10vh, 7rem); }
.stats-figure-row { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 1.5rem; }
.stats-figure { font-size: clamp(8.75rem, 19vw, 20rem); line-height: .8; font-weight: 500; color: var(--ink); font-family: var(--font-display); letter-spacing: -0.02em; }
.stats-figure .unit { display: block; font-size: 1.35rem; font-weight: 300; color: var(--muted); line-height: 1.3; margin-top: .6em; letter-spacing: normal; }
.stats-note { font-size: 17px; color: var(--muted); max-width: 30ch; align-self: flex-end; padding-bottom: .5em; }

@media (max-width: 860px) {
  .stats-figure { font-size: 30vw; }
  .stats-note { align-self: flex-start; padding-bottom: 0; margin-top: 10px; }
}

/* ============ faq ============ */
.faq-row { display: grid; grid-template-columns: 4fr 8fr; gap: clamp(1.5rem, 3vw, 2.5rem); align-items: start; }
.faq-head-sticky { position: sticky; top: 96px; font-size: clamp(1.75rem, 4vw, 2.25rem); color: var(--ink); }
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-tile { background: var(--surface); border-radius: var(--radius); overflow: hidden; transition: background-color .2s ease; }
.faq-tile[open] { background: var(--accent); }
.faq-tile summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; padding: 0 24px; font-size: 20px; font-weight: 500; color: var(--ink); }
.faq-tile[open] summary { color: var(--accent-ink); }
.faq-tile summary::-webkit-details-marker { display: none; }
.faq-plus { position: relative; width: 16px; height: 16px; flex: none; }
.faq-plus::before, .faq-plus::after { content: ""; position: absolute; background: currentColor; border-radius: 2px; }
.faq-plus::before { top: 7px; left: 0; width: 16px; height: 3px; }
.faq-plus::after { top: 0; left: 7px; width: 3px; height: 16px; transition: transform .2s ease; }
.faq-tile[open] .faq-plus::after { transform: rotate(90deg) scaleX(0); }
.faq-ans { padding: 0 24px 28px; }
.faq-ans p { font-size: 17px; max-width: 52ch; color: var(--ink); opacity: .92; }
.faq-tile[open] .faq-ans p { color: var(--accent-ink); }

@media (max-width: 860px) {
  .faq-row { grid-template-columns: 1fr; }
  .faq-head-sticky { position: static; font-size: 9vw; }
  .faq-tile summary { font-size: 18px; min-height: 64px; padding: 0 20px; }
  .faq-ans p { max-width: none; }
  .faq-ans { padding: 0 20px 24px; }
  .faq-ans p { font-size: 16px; }
}

/* ============ cta: first step already open ============ */
.cta-section { background: var(--accent); color: var(--accent-ink); min-height: 90svh; display: flex; align-items: stretch; }
.cta-grid { display: grid; grid-template-columns: 5fr 2fr 5fr; width: 100%; align-items: end; padding-block: 48px; }
.cta-close { grid-column: 1; align-self: end; margin-bottom: 40px; }
.cta-close .line { font-size: clamp(3.5rem, 7vw, 7rem); line-height: .92; font-family: var(--font-display); font-weight: 300; }
.cta-close p { margin-top: 18px; font-size: 17px; max-width: 32ch; opacity: .85; }
.cta-dialog-col { grid-column: 3; display: flex; align-items: center; justify-content: center; }
.cta-dialog { width: 440px; box-shadow: 0 24px 60px -20px rgba(10,13,20,.35); } /* taste-skill-ignore: real open dialog, data-ui */
.cta-dialog .panel-head { padding: 20px 20px 4px; }
.cta-dialog .panel-head h3 { font-size: 16px; font-weight: 600; }
.cta-dialog-body { padding: 16px 20px 20px; display: grid; gap: 14px; }
.cta-caption { grid-column: 1 / -1; text-align: center; margin-top: 24px; font-size: 14px; opacity: .75; }

@media (max-width: 860px) {
  .cta-grid { grid-template-columns: 1fr; padding-block: 36px; }
  .cta-close { margin-bottom: 28px; }
  .cta-close .line { font-size: 13vw; }
  .cta-dialog-col { grid-column: 1; }
  .cta-dialog { width: 100%; }
}

/* ============ footer ============ */
footer.site-foot { background: transparent; color: var(--muted); padding-block: 40px; }
footer.site-foot .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer.site-foot .mark { color: var(--ink); font-family: var(--font-display); font-size: 20px; font-weight: 300; }
footer.site-foot small { font-size: 13px; }

/* ============ motion extras beyond base.css ============ */
.js [data-rise-img] { opacity: 0; transform: scale(1.03); }
.js [data-reveal].is-in [data-rise-img] { opacity: 1; transform: none; transition: opacity 900ms var(--ease-out) 120ms, transform 1100ms var(--ease-soft) 120ms; }
