/* ==========================================================================
   Spring Valley Consulting — components
   Bordered buttons, blue info cards, stats, lists, forms, chat widget.
   ========================================================================== */

/* -------------------------------------------------------------- buttons -- */
/* Bordered rectangles. No pills, no full-radius anywhere. */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  line-height: 1.2;
  white-space: nowrap;
  border: 1.5px solid var(--sv-blue);
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.btn__arrow {
  transition: transform 0.25s var(--ease);
}

.btn:hover .btn__arrow {
  transform: translateX(3px);
}

/* Solid steel blue */
.btn--primary {
  background: var(--sv-blue);
  color: var(--sv-white);
}

.btn--primary:hover {
  background: var(--sv-blue-hover);
  border-color: var(--sv-blue-hover);
}

/* Bordered, transparent fill — the nav button */
.btn--outline {
  background: transparent;
  color: var(--sv-blue);
}

.btn--outline:hover {
  background: var(--sv-blue);
  color: var(--sv-white);
}

/* For use on a blue or navy surface */
.btn--on-blue {
  background: var(--sv-white);
  border-color: var(--sv-white);
  color: var(--sv-blue);
}

.btn--on-blue:hover {
  background: transparent;
  color: var(--sv-white);
}

.btn--on-blue-outline {
  background: transparent;
  border-color: var(--sv-on-blue-line);
  color: var(--sv-white);
}

.btn--on-blue-outline:hover {
  background: var(--sv-white);
  border-color: var(--sv-white);
  color: var(--sv-blue);
}

.btn--sm {
  padding: 0.55rem 1.05rem;
  font-size: 0.87rem;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--sv-blue);
  border-bottom: 1.5px solid var(--sv-blue);
  padding-bottom: 2px;
  transition: gap 0.2s var(--ease), color 0.2s var(--ease);
}

.link-arrow:hover {
  gap: 0.65rem;
  color: var(--sv-navy);
  border-color: var(--sv-navy);
}

.on-blue .link-arrow {
  color: var(--sv-white);
  border-color: var(--sv-on-blue-line);
}

.on-blue .link-arrow:hover {
  color: var(--sv-white);
  border-color: var(--sv-white);
}

/* ---------------------------------------------------------- info cards -- */
/* The core pattern: icon, bold heading with a thin light underline, a short
   description, and a divider rule at the card foot. */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--space-sm);
  background: var(--sv-blue);
  color: var(--sv-on-blue);
  border-radius: var(--radius);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}

.card:hover {
  background: var(--sv-blue-mid);
  transform: translateY(-2px);
}

.card__icon {
  width: 34px;
  height: 34px;
  color: var(--sv-white);
  margin-bottom: 0.85rem;
}

.card__icon svg {
  width: 100%;
  height: 100%;
}

.card h3 {
  color: var(--sv-white);
  font-size: 1.04rem;
  font-weight: 600;
  line-height: 1.3;
  padding-bottom: 0.6rem;
  /* Thin light underline beneath the card heading. */
  border-bottom: 1px solid var(--sv-on-blue-line);
}

.card p {
  color: var(--sv-on-blue-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 0.75rem;
}

.card__num {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.62);
  margin-bottom: 0.5rem;
}

/* Divider rule at the foot of every card. */
.card::after {
  content: "";
  display: block;
  margin-top: auto;
  padding-top: var(--space-sm);
  border-bottom: 1px solid var(--sv-on-blue-line);
  width: 100%;
}

/* Light variant — white card on a tinted or blue band */
.card--light {
  background: var(--sv-white);
  color: var(--sv-text);
  border: 1px solid var(--sv-line);
}

.card--light:hover {
  background: var(--sv-white);
  border-color: var(--sv-line-strong);
  box-shadow: var(--shadow-sm);
}

.card--light h3 {
  color: var(--sv-navy);
  border-bottom-color: var(--sv-line);
}

.card--light p {
  color: var(--sv-text-muted);
}

.card--light .card__icon {
  color: var(--sv-blue);
}

.card--light .card__num {
  color: var(--sv-text-soft);
}

.card--light::after {
  border-bottom-color: var(--sv-line);
}

/* Service card — larger, with sticky label column and feature lists */

.service {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  padding-block: var(--space-lg);
  border-top: 1px solid var(--sv-line);
}

.service:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.service__label {
  position: sticky;
  top: calc(var(--header-h) + 2rem);
  align-self: start;
  padding: var(--space-sm);
  background: var(--sv-blue);
  color: var(--sv-on-blue);
  border-radius: var(--radius);
}

.service__index {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.62);
  margin-bottom: 0.5rem;
}

.service__label h3 {
  color: var(--sv-white);
  font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem);
  font-weight: 600;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--sv-on-blue-line);
}

.service__tag {
  display: inline-block;
  margin-top: 0.85rem;
  padding: 0.24rem 0.6rem;
  border: 1px solid var(--sv-on-blue-line);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--sv-white);
}

.service__body > * + * {
  margin-top: var(--space-sm);
}

.service__body p {
  color: var(--sv-text-muted);
}

.service__sub {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sv-blue);
  margin-top: var(--space-md) !important;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--sv-line);
}

/* ----------------------------------------------------------------- list -- */

.ticks li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--sv-text-muted);
}

.ticks li + li {
  margin-top: 0.6rem;
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 8px;
  height: 8px;
  background: var(--sv-blue);
  border-radius: 1px;
}

.on-blue .ticks li,
.section--blue .ticks li {
  color: var(--sv-on-blue-muted);
}

.on-blue .ticks li::before,
.section--blue .ticks li::before {
  background: var(--sv-white);
}

/* Pale panel used for short scannable lists */
.panel {
  padding: var(--space-md);
  background: var(--sv-blue-pale);
  border: 1px solid var(--sv-line);
  border-radius: var(--radius);
}

.panel--white {
  background: var(--sv-white);
}

.rules {
  border-top: 1px solid var(--sv-line);
}

.rules > li {
  padding-block: var(--space-sm);
  border-bottom: 1px solid var(--sv-line);
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: var(--space-xs) var(--space-md);
}

.rules h3 {
  font-size: 1.1rem;
}

.rules p {
  color: var(--sv-text-muted);
}

/* ---------------------------------------------------------------- stats -- */
/* Blue cards rather than a dark band. */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.stat {
  padding: var(--space-sm) var(--space-xs);
  background: var(--sv-blue);
  color: var(--sv-on-blue);
  border-radius: var(--radius);
  text-align: center;
  display: flex;
  flex-direction: column;
}

.stat__value {
  display: block;
  font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--sv-white);
  font-variant-numeric: tabular-nums;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--sv-on-blue-line);
}

.stat__label {
  display: block;
  margin-top: 0.65rem;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--sv-on-blue-muted);
}

/* --------------------------------------------------------------- byline -- */
/* Small headshot sitting beside a heading. */

.byline {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.byline__photo {
  width: 132px;
  height: 132px;
  flex: none;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--sv-blue-pale);
  border: 1px solid var(--sv-line);
}

.byline__photo img {
  width: 100%;
  height: 100%;
  /* Portrait source cropped to a square: bias upward so the face stays
     centred rather than the torso. */
  object-fit: cover;
  object-position: center 18%;
}

.byline__text {
  min-width: 0;
}

.byline__role {
  margin-top: 0.3rem;
  font-size: 0.92rem;
  color: var(--sv-text-muted);
}

/* ------------------------------------------------------------- callouts -- */

.callout {
  padding: var(--space-md);
  background: var(--sv-blue-pale);
  border-left: 3px solid var(--sv-blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.callout p {
  color: var(--sv-text);
}

.callout--blue {
  background: var(--sv-blue);
  border-left-color: var(--sv-white);
}

.callout--blue p,
.callout--blue strong {
  color: var(--sv-on-blue-muted);
}

.callout--blue strong {
  color: var(--sv-white);
}

.quote {
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.4rem);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -0.008em;
  color: var(--sv-navy);
  text-wrap: balance;
}

/* --------------------------------------------------------------- contact -- */

.contact-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  background: var(--sv-blue);
  color: var(--sv-on-blue);
  border-radius: var(--radius);
}

.contact-card__item h3 {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.66);
  margin-bottom: 0.55rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--sv-on-blue-line);
}

.contact-card__item p,
.contact-card__item a {
  font-size: 0.98rem;
  font-weight: 400;
  color: var(--sv-white);
  line-height: 1.6;
}

.contact-card__item a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ----------------------------------------------------------------- form -- */

.field {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.field input {
  flex: 1 1 180px;
  min-width: 0;
  padding: 0.66rem 0.85rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  color: var(--sv-white);
  font-size: 0.93rem;
}

.field input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.field input:focus {
  border-color: var(--sv-white);
  outline: none;
}

.form-note {
  margin-top: 0.6rem;
  font-size: 0.81rem;
  color: rgba(255, 255, 255, 0.6);
  min-height: 1.2em;
}

.form-note[data-state="ok"] {
  color: var(--sv-white);
}

.form-note[data-state="error"] {
  color: #ffc4c4;
}

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

@media (max-width: 820px) {
  .service {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-sm);
  }

  .service__label {
    position: static;
  }

  .rules > li {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --------------------------------------------------------------- reveal -- */

/* Scoped to .js-anim, which an inline <head> script adds. Without JS — or if
   the script never runs — the rule never applies and content is simply
   visible. Never hide content behind a class only JS can remove. */

.js-anim [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

.js-anim [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js-anim [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   Chat widget
   ========================================================================== */

.sv-chat {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  font-family: var(--font);
}

.sv-chat__launcher {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.72rem 1.15rem;
  background: var(--sv-blue);
  color: var(--sv-white);
  border: 1.5px solid var(--sv-blue);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  transition: background 0.22s var(--ease);
}

.sv-chat__launcher:hover {
  background: var(--sv-blue-hover);
  border-color: var(--sv-blue-hover);
}

.sv-chat__launcher-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sv-white);
  flex: none;
}

.sv-chat__panel {
  width: min(390px, calc(100vw - 2rem));
  height: min(600px, calc(100vh - 7rem));
  display: flex;
  flex-direction: column;
  background: var(--sv-white);
  border: 1px solid var(--sv-line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform-origin: bottom right;
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease),
    visibility 0.24s;
}

.sv-chat.is-open .sv-chat__panel {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.sv-chat.is-open .sv-chat__launcher {
  display: none;
}

.sv-chat__header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  background: var(--sv-blue);
  color: var(--sv-white);
  flex: none;
}

.sv-chat__avatar {
  width: 32px;
  height: 32px;
  flex: none;
}

.sv-chat__title {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  margin-right: auto;
  min-width: 0;
}

.sv-chat__title strong {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--sv-white);
}

.sv-chat__status {
  font-size: 0.73rem;
  color: rgba(255, 255, 255, 0.72);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.sv-chat__status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sv-white);
  flex: none;
}

.sv-chat__close {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.82);
  flex: none;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.sv-chat__close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--sv-white);
}

.sv-chat__log {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  scrollbar-width: thin;
  background: var(--sv-blue-wash);
}

.sv-msg {
  max-width: 88%;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.sv-msg--bot {
  align-self: flex-start;
  background: var(--sv-white);
  border: 1px solid var(--sv-line);
  color: var(--sv-text);
  border-bottom-left-radius: 2px;
}

.sv-msg--user {
  align-self: flex-end;
  background: var(--sv-blue);
  color: var(--sv-white);
  border-bottom-right-radius: 2px;
}

.sv-msg--error {
  align-self: flex-start;
  background: #fdf2f2;
  border: 1px solid #f0cdcd;
  color: #8a2c2c;
  font-size: 0.85rem;
}

.sv-msg a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sv-msg strong {
  font-weight: 600;
  color: inherit;
}

.sv-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  height: 1.2em;
}

.sv-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sv-blue);
  animation: sv-bounce 1.1s infinite ease-in-out;
}

.sv-typing span:nth-child(2) {
  animation-delay: 0.15s;
}
.sv-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes sv-bounce {
  0%,
  70%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  35% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

.sv-chat__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.75rem 1rem 0;
  flex: none;
  background: var(--sv-blue-wash);
}

.sv-chat__chips:empty {
  display: none;
  padding: 0;
}

.sv-chip {
  padding: 0.36rem 0.7rem;
  border: 1px solid var(--sv-line-strong);
  border-radius: var(--radius-sm);
  background: var(--sv-white);
  color: var(--sv-blue);
  font-size: 0.79rem;
  font-weight: 500;
  transition: background 0.18s var(--ease), color 0.18s var(--ease),
    border-color 0.18s var(--ease);
}

.sv-chip:hover {
  background: var(--sv-blue);
  border-color: var(--sv-blue);
  color: var(--sv-white);
}

.sv-chat__form {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  padding: 0.7rem;
  border-top: 1px solid var(--sv-line);
  background: var(--sv-white);
  flex: none;
}

.sv-chat__input {
  flex: 1;
  min-width: 0;
  resize: none;
  max-height: 120px;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--sv-line-strong);
  border-radius: var(--radius-sm);
  background: var(--sv-white);
  color: var(--sv-text);
  font-size: 0.9rem;
  line-height: 1.5;
}

.sv-chat__input:focus {
  outline: none;
  border-color: var(--sv-blue);
}

.sv-chat__send {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--sv-blue);
  color: var(--sv-white);
  transition: background 0.18s var(--ease), opacity 0.18s var(--ease);
}

.sv-chat__send:hover:not(:disabled) {
  background: var(--sv-blue-hover);
}

.sv-chat__send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sv-chat__foot {
  padding: 0 0.7rem 0.65rem;
  font-size: 0.69rem;
  color: var(--sv-text-soft);
  text-align: center;
  flex: none;
  background: var(--sv-white);
}

@media (max-width: 480px) {
  .sv-chat {
    right: 0.75rem;
    bottom: 0.75rem;
    left: 0.75rem;
    align-items: stretch;
  }

  .sv-chat__panel {
    width: 100%;
    height: min(78vh, calc(100vh - 5rem));
  }

  .sv-chat__launcher {
    align-self: flex-end;
  }
}
