/* ==========================================================================
   Inner page styles (services, approach, insights, contact)
   ========================================================================== */

.phero {
  position: relative;
  padding-top: calc(74px + clamp(2.5rem, 7vw, 5rem));
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
  overflow: hidden;
}
.phero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70ch 45ch at 85% 0%, rgba(34,211,238,0.10), transparent 62%),
    radial-gradient(60ch 40ch at 5% 100%, rgba(168,85,247,0.08), transparent 60%);
  pointer-events: none;
}
.phero .wrap { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 1.15rem; }
.phero h1 { max-width: 18ch; }
.phero .lede { max-width: 56ch; }
.phero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.8rem; }

/* --- breadcrumbs --- */
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5em;
  font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.06em; color: var(--ink-3);
  margin-bottom: 0.4rem;
}
.crumbs a { color: var(--ink-3); transition: color 0.2s var(--ease); }
.crumbs a:hover { color: var(--ember); }
.crumbs .sep { color: var(--ink-4); }
.crumbs [aria-current] { color: var(--ink-2); }

/* --- prose ---------------------------------------------------------------
   Two columns on desktop: a sticky section index in the left margin, the
   reading column on the right. The alternative is a ~480px void beside every
   paragraph, because body text must not exceed ~75 characters per line and
   the container is wider than that.
   ------------------------------------------------------------------------ */

.prose .wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.35rem;
  align-items: start;
}

@media (min-width: 1000px) {
  .prose .wrap {
    grid-template-columns: 210px minmax(0, 1fr);
    column-gap: clamp(2.5rem, 5vw, 4.5rem);
    row-gap: 1.35rem;
  }
  .prose .wrap > *:not(.toc) { grid-column: 2; }
}

.toc { display: none; }

@media (min-width: 1000px) {
  .toc {
    display: block;
    grid-column: 1;
    /* 1 / -1 spans to the last real row. A numeric end line like 1 / 999
       makes the grid create 998 tracks, and row-gap is applied between every
       one of them, which adds thousands of pixels of empty space below the
       content. */
    grid-row: 1 / -1;
    position: sticky;
    top: 108px;
    align-self: start;
    border-left: 1px solid var(--line);
    padding-left: 1.1rem;
  }
  .toc h4 {
    font-family: var(--mono); font-size: 0.64rem;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink-4); margin: 0 0 0.9rem;
  }
  .toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; }
  .toc a {
    font-size: 0.83rem; line-height: 1.4; color: var(--ink-3);
    display: block; transition: color 0.2s var(--ease), transform 0.2s var(--ease);
  }
  .toc a:hover { color: var(--ink-2); transform: translateX(2px); }
  .toc a.active { color: var(--ember); }
}

.prose h2 {
  font-size: var(--step-2);
  margin-top: clamp(1.6rem, 4vw, 2.8rem);
  max-width: 24ch;
  position: relative;
  padding-left: 0.9rem;
  scroll-margin-top: 100px;
}
.prose h2::before {
  content: "";
  position: absolute; left: 0; top: 0.12em; bottom: 0.12em;
  width: 2px; border-radius: 2px;
  background: linear-gradient(180deg, var(--ember), var(--signal));
}
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--ink-2); max-width: 66ch; }
.prose ul { display: flex; flex-direction: column; gap: 0.85rem; padding-left: 0; list-style: none; max-width: 68ch; }
.prose ul li {
  color: var(--ink-2); padding-left: 1.5rem; position: relative; line-height: 1.6;
}
.prose ul li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 6px; height: 6px; border-radius: 1px;
  background: var(--ember); transform: rotate(45deg);
}
.prose ul li strong { color: var(--ink); }
.prose a:not(.btn) {
  color: var(--ember);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s var(--ease);
}
.prose a:not(.btn):hover { color: var(--ember-hi); }

/* --- stat strip --- */
.pstats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  overflow: hidden;
  margin-block: 0.6rem;
}
.pstat {
  background: var(--bg); padding: 1.25rem 1.15rem;
  display: flex; flex-direction: column; gap: 0.35rem;
}
.pstat .k {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-3);
}
.pstat .v {
  font-family: var(--mono); font-size: clamp(1.3rem, 3vw, 1.75rem);
  line-height: 1.1; color: var(--ember); word-break: break-word;
}
.pstat .d { font-size: 0.82rem; color: var(--ink-3); line-height: 1.45; }

/* --- callout --- */
.pcallout {
  border-left: 2px solid var(--ember);
  background: var(--surface);
  padding: 1rem 1.15rem;
  border-radius: 0 var(--r) var(--r) 0;
  color: var(--ink-2);
  font-size: 0.94rem;
  max-width: 66ch;
}
.pcallout strong { color: var(--ink); }

/* --- table --- */
.ptable-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
.ptable { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 34rem; }
.ptable th {
  text-align: left; padding: 0.8rem 1rem;
  font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink-3); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.ptable td {
  padding: 0.8rem 1rem; border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2); vertical-align: top;
}
.ptable tbody tr:last-child td { border-bottom: none; }
.ptable td:first-child { color: var(--ink); font-weight: 550; white-space: nowrap; }
.ptable td:nth-child(2) { font-family: var(--mono); color: var(--ember); white-space: nowrap; }

/* --- related services --- */
.rel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  gap: 1px; background: var(--line-soft);
  border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden;
}
.rel {
  background: var(--bg); padding: 1.15rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  font-size: 0.95rem; color: var(--ink-2);
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.rel:hover { background: var(--surface-2); color: var(--ember); }
.rel .arw { transition: transform 0.25s var(--ease); color: var(--ink-4); }
.rel:hover .arw { transform: translateX(4px); color: var(--ember); }

@media (max-width: 560px) {
  .phero-cta { flex-direction: column; align-items: stretch; }
  .phero-cta .btn { justify-content: center; padding-block: 1em; }
  .prose h2 { padding-left: 0.7rem; }
}

/* ==========================================================================
   Reading progress rail
   ========================================================================== */

.progress-rail {
  position: fixed; inset: 0 0 auto 0; height: 2px;
  z-index: 90; background: transparent; pointer-events: none;
}
.progress-rail > i {
  display: block; height: 100%; width: 100%;
  transform: scaleX(0); transform-origin: left;
  background: linear-gradient(90deg, var(--ember), var(--signal));
  transition: transform 0.08s linear;
}

/* ==========================================================================
   Copilot calculator
   ========================================================================== */

.calc {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  overflow: hidden;
  max-width: 100%;
}
.calc-head {
  display: flex; align-items: center; gap: 0.7em; flex-wrap: wrap;
  padding: 0.8rem 1.1rem; border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 0.7rem;
  letter-spacing: 0.11em; text-transform: uppercase; color: var(--ink-3);
}
.calc-live {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ember);
  box-shadow: 0 0 8px var(--ember); flex-shrink: 0;
}
.calc-src { margin-left: auto; text-transform: none; letter-spacing: 0.03em; color: var(--ink-4); }

.calc-body { padding: 1.3rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: 1.3rem; }

.calc-controls {
  display: grid; gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
}
.calc-field { display: flex; flex-direction: column; gap: 0.55rem; }
.calc-field label {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  font-family: var(--mono); font-size: 0.7rem;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3);
}
.calc-field output {
  font-size: 1.05rem; color: var(--ember); letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.calc-hint { font-size: 0.72rem; color: var(--ink-4); }

.calc input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 3px; border-radius: 2px;
  background: var(--surface-3); outline-offset: 6px; cursor: pointer;
}
.calc input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--ember); border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--ember), 0 0 14px var(--ember-glow);
  cursor: grab; transition: transform 0.15s var(--ease);
}
.calc input[type=range]::-webkit-slider-thumb:active { transform: scale(1.15); cursor: grabbing; }
.calc input[type=range]::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--ember); border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--ember); cursor: grab;
}

.calc-out {
  display: grid; gap: 1px; background: var(--line-soft);
  border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
}
.calc-stat {
  background: var(--bg); padding: 1rem 1.05rem;
  display: flex; flex-direction: column; gap: 0.3rem;
}
.calc-stat .k {
  font-family: var(--mono); font-size: 0.63rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3);
}
.calc-stat .v {
  font-family: var(--mono); font-size: clamp(1.4rem, 3.4vw, 1.9rem);
  line-height: 1.05; color: var(--ink); font-variant-numeric: tabular-nums;
}
.calc-stat.waste .v { color: var(--warn); }
.calc-stat .d { font-size: 0.74rem; color: var(--ink-4); }

.calc-bar {
  position: relative; height: 26px; border-radius: 3px;
  background: var(--surface-3); overflow: hidden;
}
.calc-bar > i {
  position: absolute; inset: 0 auto 0 0; width: 0;
  background: linear-gradient(90deg, rgba(34,211,238,0.35), rgba(34,211,238,0.16));
  border-right: 2px solid var(--ember);
  transition: width 0.25s var(--ease-out);
}
.calc-bar-label {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: 0.06em; color: var(--ink-2);
}

.calc-foot { font-size: 0.76rem; color: var(--ink-4); line-height: 1.55; max-width: 62ch; }
