/* ============================================================
   Riyp — pitch deck
   Presentable in-browser. Arrow keys / space to advance,
   O for overview, F for fullscreen, P for print-to-PDF layout.
   ============================================================ */

:root {
  --ink:      #0d0f12;
  --ink-2:    #14181d;
  --ink-3:    #1c2128;
  --ink-4:    #262d36;
  --green:    #62b146;
  --lime:     #cedd36;
  --yellow:   #f3eb3b;
  --paper:    #f7f7f3;
  --white:    #ffffff;

  --line:  rgba(255, 255, 255, 0.11);
  --muted: rgba(255, 255, 255, 0.60);
  --faint: rgba(255, 255, 255, 0.38);

  --grad: linear-gradient(100deg, var(--yellow) 0%, var(--lime) 38%, var(--green) 100%);

  /* sequential ramp for magnitude — one hue, dim → bright on a dark surface */
  --s1: #1b2519;
  --s2: #26401f;
  --s3: #35602a;
  --s4: #488436;
  --s5: #5fac44;
  --s6: #86cf55;

  --f-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --f-body:    'Inter', ui-sans-serif, system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--white);
  font-family: var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0;
}

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- deck chrome ---------- */

.deck { position: relative; height: 100vh; width: 100vw; }

.slide {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2.5rem, 5vw, 5rem) clamp(2rem, 6vw, 6.5rem);
  overflow: hidden;
}
.slide.active { display: flex; animation: slideIn 0.5s var(--ease); }
@keyframes slideIn {
  from { opacity: 0; transform: translateY(14px); }
}

.slide-inner { width: 100%; max-width: 1180px; margin-inline: auto; }

.kicker {
  display: inline-block;
  font-family: var(--f-display);
  font-size: clamp(0.62rem, 0.78vw, 0.76rem);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 1.1rem;
}

.slide h2 { font-size: clamp(1.9rem, 4vw, 3.3rem); margin-bottom: 1.4rem; }
.slide h1 { font-size: clamp(2.6rem, 6.4vw, 5.4rem); }

.slide p.lede {
  font-size: clamp(0.95rem, 1.2vw, 1.15rem);
  line-height: 1.62;
  color: var(--muted);
  max-width: 62ch;
  margin: 0 0 1rem;
}

/* progress + counter */
.progress {
  position: fixed;
  left: 0; bottom: 0;
  height: 3px;
  background: var(--grad);
  z-index: 60;
  transition: width 0.45s var(--ease);
}
.hud {
  position: fixed;
  right: clamp(1.2rem, 3vw, 2.4rem);
  bottom: clamp(1.2rem, 3vw, 2rem);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--f-display);
  font-size: 0.82rem;
  color: var(--faint);
}
.hud button {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(20, 24, 29, 0.8);
  color: var(--white);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.25s var(--ease);
}
.hud button:hover { border-color: var(--lime); color: var(--lime); }
.hud button:disabled { opacity: 0.3; cursor: default; }

.brandmark {
  position: fixed;
  left: clamp(1.4rem, 3vw, 2.4rem);
  bottom: clamp(1.2rem, 3vw, 2rem);
  z-index: 60;
  height: 20px;
  opacity: 0.5;
  filter: brightness(0) invert(1);
}

.hint {
  position: fixed;
  left: 50%;
  bottom: clamp(1.2rem, 3vw, 2rem);
  transform: translateX(-50%);
  z-index: 60;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.22);
  font-family: var(--f-display);
  letter-spacing: 0.08em;
  transition: opacity 0.5s;
}

/* ---------- generic layout helpers ---------- */

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 4.5vw, 4.5rem);
  align-items: center;
}
.two-col.wide-left { grid-template-columns: 1.25fr 0.75fr; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
  margin-top: 1.5rem;
}
.card {
  padding: 1.6rem;
  border-radius: 14px;
  background: var(--ink-2);
  border: 1px solid var(--line);
}
.card h3 {
  font-size: clamp(1rem, 1.35vw, 1.22rem);
  margin-bottom: 0.55rem;
}
.card p {
  margin: 0;
  font-size: clamp(0.82rem, 1vw, 0.94rem);
  line-height: 1.55;
  color: var(--muted);
}
.card .num {
  font-family: var(--f-display);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  color: var(--lime);
  display: block;
  margin-bottom: 0.7rem;
}

/* good / bad list */
.audit { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; margin-top: 1rem; }
.audit h3 {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}
.audit ul { list-style: none; margin: 0; padding: 0; }
.audit li {
  position: relative;
  padding: 0.6rem 0 0.6rem 1.9rem;
  border-bottom: 1px solid var(--line);
  font-size: clamp(0.85rem, 1.02vw, 0.98rem);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.8);
}
.audit li::before {
  position: absolute;
  left: 0; top: 0.6rem;
  font-family: var(--f-display);
  font-size: 0.95rem;
}
.audit .keep h3 { color: var(--green); }
.audit .keep li::before { content: '✓'; color: var(--green); }
.audit .gap h3 { color: var(--yellow); }
.audit .gap li::before { content: '✕'; color: var(--yellow); }

/* journey */
.journey {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.6rem;
  margin-top: 2rem;
}
.stage {
  padding: 1.1rem 0.9rem;
  border-radius: 12px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  position: relative;
}
.stage .s {
  font-family: var(--f-display);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.5rem;
}
.stage h4 { font-size: clamp(0.82rem, 1vw, 0.96rem); margin-bottom: 0.45rem; }
.stage p { margin: 0; font-size: 0.78rem; line-height: 1.45; color: var(--muted); }
.stage.broken {
  border-color: rgba(243, 235, 59, 0.5);
  background: rgba(243, 235, 59, 0.07);
}
.stage.broken .flag {
  display: block;
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(243, 235, 59, 0.28);
  font-size: 0.73rem;
  color: var(--yellow);
  line-height: 1.4;
}
.stage .flag { display: none; }

/* three layers */
.layers { display: grid; gap: 1rem; margin-top: 1.5rem; }
.layer {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 1.8rem;
  align-items: center;
  padding: 1.5rem 1.8rem;
  border-radius: 14px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-left: 3px solid transparent;
}
.layer:nth-child(1) { border-left-color: var(--yellow); }
.layer:nth-child(2) { border-left-color: var(--lime); }
.layer:nth-child(3) { border-left-color: var(--green); }
.layer h3 { font-size: clamp(1.05rem, 1.5vw, 1.35rem); }
.layer .role {
  font-family: var(--f-display);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 0.3rem;
}
.layer p { margin: 0; font-size: clamp(0.83rem, 1vw, 0.95rem); color: var(--muted); line-height: 1.55; }

/* live demo frame */
.demo-frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ink-2);
  height: min(62vh, 620px);
}
.demo-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
/* sits beside the slide heading, never over the embedded page's own chrome */
.demo-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.demo-head h2 { margin-bottom: 0; }

.live-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  background: rgba(13, 15, 18, 0.88);
  backdrop-filter: blur(8px);
  font-family: var(--f-display);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--line);
}
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--lime);
  animation: blink 2s infinite;
}
@keyframes blink { 50% { opacity: 0.3; } }

/* ============================================================
   Dashboard mockups
   ============================================================ */

.mock {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--ink-2);
  overflow: hidden;
}
.mock-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--ink-3);
}
.mock-bar .tl { display: flex; gap: 5px; margin-right: 0.6rem; }
.mock-bar .tl i {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  display: block;
}
.mock-bar .url {
  font-family: var(--f-display);
  font-size: 0.72rem;
  color: var(--faint);
}
.mock-body { padding: 1.2rem; }

/* CRM pipeline */
.pipeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
}
.col-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--f-display);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  padding-bottom: 0.6rem;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}
.col-head b { color: var(--white); font-size: 0.82rem; letter-spacing: 0; }
.lead {
  padding: 0.75rem 0.85rem;
  border-radius: 9px;
  background: var(--ink-3);
  border: 1px solid var(--line);
  margin-bottom: 0.5rem;
}
.lead .co {
  font-family: var(--f-display);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.18rem;
}
.lead .meta { font-size: 0.7rem; color: var(--faint); line-height: 1.4; }
.lead .tag {
  display: inline-block;
  margin-top: 0.45rem;
  padding: 0.12rem 0.5rem;
  border-radius: 4px;
  font-size: 0.62rem;
  font-family: var(--f-display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(98, 177, 70, 0.16);
  color: #8ed06f;
}
.lead .tag.warm { background: rgba(243, 235, 59, 0.14); color: var(--yellow); }

/* KPI tiles */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
  margin-bottom: 1rem;
}
.kpi {
  padding: 0.95rem 1rem;
  border-radius: 10px;
  background: var(--ink-3);
  border: 1px solid var(--line);
}
.kpi .k {
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.4rem;
}
.kpi .v {
  font-family: var(--f-display);
  font-size: clamp(1.15rem, 1.9vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}
.kpi .d { font-size: 0.68rem; color: #8ed06f; margin-top: 0.3rem; }

/* heatmap — sequential, one hue */
.heat { display: grid; gap: 2px; }
.heat-row { display: grid; grid-template-columns: 92px repeat(7, 1fr); gap: 2px; align-items: center; }
.heat-row .rl {
  font-size: 0.68rem;
  color: var(--muted);
  text-align: right;
  padding-right: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.heat-row.head .rl { color: transparent; }
.heat-row.head span {
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: center;
  padding-bottom: 0.2rem;
}
.cell {
  height: 26px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-family: var(--f-display);
  font-size: 0.66rem;
  color: rgba(255, 255, 255, 0.85);
  cursor: default;
  transition: outline 0.15s;
}
.cell:hover { outline: 2px solid var(--white); outline-offset: -2px; }
.cell.v0 { background: var(--s1); color: rgba(255, 255, 255, 0.3); }
.cell.v1 { background: var(--s2); }
.cell.v2 { background: var(--s3); }
.cell.v3 { background: var(--s4); }
.cell.v4 { background: var(--s5); color: var(--ink); }
.cell.v5 { background: var(--s6); color: var(--ink); }

.legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.9rem;
  font-size: 0.68rem;
  color: var(--faint);
}
.legend .swatches { display: flex; gap: 2px; }
.legend .swatches i {
  width: 22px; height: 10px;
  border-radius: 2px;
  display: block;
}

/* horizontal bars — single series */
.bars { display: grid; gap: 0.55rem; }
.bar-row { display: grid; grid-template-columns: 88px 1fr 46px; gap: 0.7rem; align-items: center; }
.bar-row .bl { font-size: 0.72rem; color: var(--muted); text-align: right; }
.bar-row .bt {
  display: block;
  height: 14px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}
.bar-row .bf { display: block; height: 100%; background: var(--s5); border-radius: 4px; }
.bar-row .bv { font-family: var(--f-display); font-size: 0.72rem; color: var(--white); }

/* funnel */
.funnel { display: grid; gap: 0.4rem; }
.fstep {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 0.6rem 0.9rem;
  border-radius: 7px;
  font-size: 0.78rem;
  margin-inline: auto;
  width: 100%;
}
.fstep .fl { font-family: var(--f-display); }
.fstep .fv { font-family: var(--f-display); font-weight: 600; }

/* roadmap */
.roadmap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.9rem; margin-top: 1.5rem; }
.phase {
  padding: 1.4rem 1.3rem;
  border-radius: 14px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.phase::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad);
  opacity: 0.85;
}
.phase .p {
  font-family: var(--f-display);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 0.55rem;
}
.phase h3 { font-size: clamp(0.95rem, 1.2vw, 1.1rem); margin-bottom: 0.6rem; }
.phase ul { list-style: none; margin: 0; padding: 0; }
.phase li {
  font-size: 0.79rem;
  color: var(--muted);
  padding: 0.26rem 0 0.26rem 0.95rem;
  position: relative;
  line-height: 1.45;
}
.phase li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.72rem;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--green);
}
.phase .when {
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  font-family: var(--f-display);
  font-size: 0.74rem;
  color: var(--faint);
}

/* pricing */
.price-note {
  margin-top: 1.2rem;
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  border: 1px dashed rgba(243, 235, 59, 0.4);
  background: rgba(243, 235, 59, 0.06);
  font-size: 0.82rem;
  color: var(--yellow);
}

/* cover */
.cover { justify-content: center; }
.cover .rule {
  width: 84px; height: 4px;
  background: var(--grad);
  border-radius: 2px;
  margin: 2rem 0;
}
.cover .meta {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
  font-family: var(--f-display);
  font-size: 0.84rem;
  color: var(--faint);
}
.cover .meta b { display: block; color: var(--white); font-weight: 500; margin-top: 0.2rem; }
.cover-bg {
  position: absolute;
  right: -8%; top: 50%;
  transform: translateY(-50%);
  width: 46vw;
  max-width: 700px;
  opacity: 0.9;
  pointer-events: none;
  border-radius: 20px;
  overflow: hidden;
}

/* big statement slide */
.statement { text-align: left; }
.statement h2 {
  font-size: clamp(2.1rem, 5.2vw, 4.4rem);
  line-height: 1.06;
  max-width: 20ch;
}

/* overview grid */
.overview {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 9, 11, 0.97);
  padding: clamp(1.5rem, 4vw, 3rem);
  overflow-y: auto;
  display: none;
}
.overview.open { display: block; }
.ov-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.9rem;
}
.ov-item {
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--ink-2);
  cursor: pointer;
  text-align: left;
  color: var(--white);
  font-family: var(--f-display);
  transition: all 0.25s var(--ease);
}
.ov-item:hover { border-color: var(--lime); transform: translateY(-2px); }
.ov-item .n { font-size: 0.68rem; color: var(--lime); letter-spacing: 0.12em; }
.ov-item .t { font-size: 0.88rem; margin-top: 0.4rem; line-height: 1.3; }
.ov-item.current { border-color: var(--lime); background: rgba(206, 221, 54, 0.09); }

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
  .cards, .pipeline, .kpis, .roadmap { grid-template-columns: repeat(2, 1fr); }
  .journey { grid-template-columns: repeat(3, 1fr); }
  .two-col, .two-col.wide-left { grid-template-columns: 1fr; }
  .cover-bg { display: none; }
  .layer { grid-template-columns: 1fr; gap: 0.8rem; }
}

@media (max-width: 640px) {
  .cards, .pipeline, .kpis, .roadmap, .journey, .audit { grid-template-columns: 1fr; }
  .heat-row { grid-template-columns: 64px repeat(7, 1fr); }
  .hint { display: none; }
}

/* ---------- print / PDF ---------- */

@media print {
  html, body { overflow: visible; height: auto; background: var(--ink); }
  .deck { height: auto; }
  .slide {
    position: relative;
    display: flex !important;
    height: 100vh;
    page-break-after: always;
    break-after: page;
    animation: none;
  }
  .hud, .hint, .progress, .brandmark, .overview { display: none !important; }
  .demo-frame { height: 480px; }
}
