/**
 * @file
 * Front-page showcase: hero, "what it sniffs" cards and the sample report.
 */

/* Hero */
.hero {
  overflow: hidden;
  isolation: isolate;
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3rem, 7vw, 6rem);
  background-color: var(--hh-navy);
  background-image:
    radial-gradient(rgb(255 244 221 / 7%) 1px, transparent 1.6px),
    linear-gradient(180deg, var(--hh-navy) 0%, var(--hh-navy-deep) 100%);
  background-size: 22px 22px, auto;
}

.hero__glow {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(40rem 30rem at 78% 55%, rgb(143 225 75 / 14%), transparent 60%),
    radial-gradient(30rem 24rem at 10% 0%, rgb(184 93 49 / 18%), transparent 60%);
  pointer-events: none;
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}

@media (min-width: 60rem) {
  .hero__inner {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  }
}

.hero__title {
  margin-bottom: 1.25rem;
  font-size: var(--fs-display);
  font-weight: 850;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

/* "missing": underlined with a red squiggle, like a failed check. */
.hero__title-accent {
  color: var(--hh-green);
  text-decoration: underline wavy var(--hh-red-soft);
  text-decoration-thickness: 0.06em;
  text-decoration-skip-ink: none;
  text-underline-offset: 0.16em;
}

.hero__lede {
  max-width: 36rem;
  margin-bottom: 2rem;
  color: #d8d1c1;
  font-size: var(--fs-lg);
  line-height: 1.6;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.hero__fineprint {
  margin: 0.85rem 0 0 1rem;
  color: #a9a59b;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

/* Audit form, styled as a request line: "GET [url] [Sniff it]".
   Works for the HeaderHound Public form (Drupal markup) and the GET fallback.
   The pill is the form's ::before, placed in the grid's first row, so the
   opt-out checkbox can sit underneath it. */
.hero__form {
  max-width: 36rem;
}

.sniff-form {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem 0.5rem;
  max-width: 36rem;
  margin: 0;
}

.sniff-form::before {
  z-index: -1;
  grid-row: 1;
  grid-column: 1 / -1;
  align-self: stretch;
  content: "";
  background: var(--hh-navy-deep);
  border: 2px solid rgb(255 244 221 / 25%);
  border-radius: 1.6rem;
  box-shadow: 0 18px 40px -20px rgb(0 0 0 / 70%);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sniff-form:focus-within::before {
  border-color: var(--hh-green);
  box-shadow: 0 0 0 4px rgb(143 225 75 / 20%), 0 18px 40px -20px rgb(0 0 0 / 70%);
}

.sniff-form:has(.error)::before {
  border-color: var(--hh-red-soft);
}

.sniff-form .sniff-form__field {
  display: flex;
  grid-row: 1;
  grid-column: 1;
  align-items: center;
  min-width: 0;
  margin: 0;
  padding: 0.45rem 0 0.45rem 0.45rem;
}

.sniff-form .field-prefix {
  flex: none;
  padding-inline: 0.75rem 0.35rem;
  color: var(--hh-green);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
}

.sniff-form input.sniff-form__input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  max-width: none;
  min-height: 2.875rem;
  padding: 0.5rem 0.25rem;
  color: var(--hh-cream);
  background: transparent;
  border: 0;
  box-shadow: none;
  font-family: var(--font-mono);
  font-size: 1rem;
}

.sniff-form input.sniff-form__input:focus-visible {
  outline: none;
  box-shadow: none;
}

.sniff-form input.sniff-form__input::placeholder {
  color: rgb(255 244 221 / 45%);
}

.sniff-form .sniff-form__actions {
  grid-row: 1;
  grid-column: 2;
  margin: 0;
  padding: 0.45rem 0.45rem 0.45rem 0;
}

.sniff-form .sniff-form__actions .button,
.sniff-form .sniff-form__actions .form-submit {
  margin: 0;
}

.sniff-form .sniff-form__options {
  grid-row: 2;
  grid-column: 1 / -1;
  padding-inline: 1rem;
}

.sniff-form .sniff-form__options .form-item {
  margin: 0;
}

.sniff-form .sniff-form__options label {
  color: #c7c3b8;
  font-size: var(--fs-sm);
}

.sniff-form .sniff-form__options input[type="checkbox"] {
  accent-color: var(--hh-green);
}

.sniff-form .form-item--error-message {
  display: none;
}

@media (max-width: 29.99rem) {
  .sniff-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .sniff-form::before {
    border-radius: var(--radius-lg);
  }

  .sniff-form .sniff-form__field {
    padding-inline-end: 0.45rem;
  }

  .sniff-form .sniff-form__actions {
    grid-row: 2;
    grid-column: 1;
    padding: 0;
  }

  .sniff-form .sniff-form__actions .button,
  .sniff-form .sniff-form__actions .form-submit {
    width: 100%;
  }

  .sniff-form .sniff-form__options {
    grid-row: 3;
    padding-inline: 0.25rem;
  }
}

.hero__fineprint a {
  margin-inline-start: 0.35rem;
  white-space: nowrap;
}

/* Mascot art */
.hero__art {
  position: relative;
  justify-self: center;
  width: min(100%, 24rem);
}

@media (min-width: 60rem) {
  .hero__art {
    width: min(100%, 32rem);
  }
}

/* A retro California sun behind the hound. */
.hero__art::before {
  position: absolute;
  z-index: -1;
  inset: 4% 2% 10%;
  content: "";
  background: linear-gradient(
    to bottom,
    rgb(228 173 104 / 34%) 0 34%,
    transparent 34% 38%,
    rgb(184 93 49 / 30%) 38% 50%,
    transparent 50% 55%,
    rgb(184 93 49 / 24%) 55% 64%,
    transparent 64% 70%,
    rgb(143 225 75 / 16%) 70% 77%,
    transparent 77%
  );
  border-radius: 50%;
  -webkit-mask: linear-gradient(to bottom, #000 30%, transparent 92%);
  mask: linear-gradient(to bottom, #000 30%, transparent 92%);
}

.hero__mascot {
  width: 100%;
  filter: drop-shadow(0 22px 28px rgb(0 0 0 / 40%));
}

.hero__chips {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero__chips .chip {
  position: absolute;
}

.hero__chips .chip:nth-child(1) { top: 3%; left: -4%; }
.hero__chips .chip:nth-child(2) { top: 50%; left: -12%; }
.hero__chips .chip:nth-child(3) { bottom: 4%; right: -6%; }
.hero__chips .chip:nth-child(4) { bottom: 18%; left: -2%; }

@media (max-width: 59.99rem) {
  .hero__chips .chip:nth-child(1) { left: 0; }
  .hero__chips .chip:nth-child(2) { left: -2%; }
  .hero__chips .chip:nth-child(3) { right: 0; }
  .hero__chips .chip:nth-child(4) { display: none; }
}

@media (max-width: 29.99rem) {
  .hero__chips .chip:nth-child(1) { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero__mascot {
    animation: hhk-float 7s ease-in-out infinite;
  }

  .hero__chips .chip {
    animation: hhk-bob 5s ease-in-out infinite;
  }

  .hero__chips .chip:nth-child(2) { animation-delay: -1.2s; }
  .hero__chips .chip:nth-child(3) { animation-delay: -2.5s; }
  .hero__chips .chip:nth-child(4) { animation-delay: -3.7s; }

  .hero__copy > * {
    animation: hhk-rise 0.8s var(--ease-out) both;
  }

  .hero__copy > :nth-child(2) { animation-delay: 0.08s; }
  .hero__copy > :nth-child(3) { animation-delay: 0.16s; }
  .hero__copy > :nth-child(4) { animation-delay: 0.24s; }
  .hero__copy > :nth-child(5) { animation-delay: 0.32s; }
}

@keyframes hhk-float {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-10px) rotate(-0.6deg); }
}

@keyframes hhk-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@keyframes hhk-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* Feature cards */
.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15.5rem), 1fr));
  gap: clamp(1.25rem, 2.5vw, 1.75rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature {
  display: flex;
  flex-direction: column;
}

.feature__icon {
  display: grid;
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 1.1rem;
  place-items: center;
  color: var(--hh-green);
  background: var(--hh-navy);
  border-radius: 0.95rem;
  box-shadow: 3px 3px 0 var(--hh-tan);
  transform: rotate(-4deg);
  transition: transform 0.3s var(--ease-out);
}

.feature:hover .feature__icon {
  transform: rotate(3deg) scale(1.05);
}

.feature__title {
  margin-bottom: 0.5rem;
}

.feature__text {
  color: var(--c-text-muted);
  font-size: 0.97rem;
}

.feature__headers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: auto 0 0;
  padding: 0.5rem 0 0;
  list-style: none;
}

.feature__headers code {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.72rem;
  border-radius: var(--radius-pill);
}

/* Scroll reveal (JavaScript adds the classes; nothing is hidden without it). */
.is-reveal-pending {
  opacity: 0;
  transform: translateY(18px);
}

.is-reveal-pending.is-revealed {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease var(--reveal-delay, 0ms), transform 0.7s var(--ease-out) var(--reveal-delay, 0ms);
}

/* How it works + sample report */
.report-band__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: clamp(2.5rem, 5vw, 4.5rem);
}

@media (min-width: 60rem) {
  .report-band__inner {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  }
}

.steps {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps__item {
  position: relative;
  padding: 0 0 1.5rem 3.75rem;
  counter-increment: step;
}

.steps__item::before {
  position: absolute;
  top: -0.15rem;
  left: 0;
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  content: counter(step, decimal-leading-zero);
  color: var(--hh-green);
  background: var(--hh-navy);
  border-radius: 0.7rem;
  box-shadow: 3px 3px 0 var(--hh-russet);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
}

/* A dashed trail joins the steps, like a scent. */
.steps__item:not(:last-child)::after {
  position: absolute;
  top: 2.75rem;
  bottom: 0.25rem;
  left: 1.2rem;
  content: "";
  border-left: 2px dashed rgb(184 93 49 / 45%);
}

.steps__item h3 {
  margin-bottom: 0.25rem;
  font-size: 1.15rem;
}

.steps__item p {
  margin: 0;
  color: var(--c-text-muted);
}

/* Terminal card */
.terminal {
  margin: 0;
  overflow: hidden;
  color: var(--hh-cream);
  background: var(--hh-navy-deep);
  border: 2px solid var(--hh-navy);
  border-radius: var(--radius-lg);
  box-shadow: 8px 8px 0 var(--hh-russet), 0 30px 60px -30px rgb(18 36 58 / 60%);
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1rem;
  background: var(--hh-navy);
  border-bottom: 1px solid rgb(255 244 221 / 10%);
}

.terminal__bar > span {
  width: 0.75rem;
  height: 0.75rem;
  background: var(--hh-red-soft);
  border-radius: 50%;
}

.terminal__bar > span:nth-child(2) { background: var(--hh-tan); }
.terminal__bar > span:nth-child(3) { background: var(--hh-green); }

.terminal__bar code {
  margin-inline: auto;
  padding: 0;
  color: #a9a59b;
  background: none;
  font-size: 0.78rem;
}

.terminal__body {
  padding: clamp(1rem, 3vw, 1.5rem);
}

.report__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed rgb(255 244 221 / 18%);
}

.report__summary p {
  margin: 0;
}

.report__request {
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.report__method {
  margin-inline-end: 0.35rem;
  padding: 0.1rem 0.45rem;
  color: var(--hh-navy);
  background: var(--hh-green);
  border-radius: 0.3rem;
  font-weight: 700;
}

.report__status {
  margin-top: 0.35rem !important;
  color: #a9a59b;
  font-size: 0.78rem;
}

.grade {
  position: relative;
  display: grid;
  flex: none;
  width: 4.25rem;
  height: 4.25rem;
  place-items: center;
  background: conic-gradient(var(--hh-green) 0 74%, rgb(255 244 221 / 12%) 74% 100%);
  border-radius: 50%;
}

.grade::before {
  position: absolute;
  inset: 6px;
  content: "";
  background: var(--hh-navy-deep);
  border-radius: 50%;
}

.grade span {
  position: relative;
  color: var(--hh-cream);
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1;
}

.report__table {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.report__table tbody tr:nth-child(even) {
  background: none;
}

.report__table th,
.report__table td {
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid rgb(255 244 221 / 8%);
  vertical-align: middle;
}

.report__row:last-child th,
.report__row:last-child td {
  border-bottom: 0;
}

.report__state {
  width: 2rem;
}

.report__name {
  color: var(--hh-cream);
  font-weight: 600;
  white-space: nowrap;
}

.report__value {
  color: #b8b3a6;
  overflow-wrap: anywhere;
}

.report__row--fail .report__value { color: var(--hh-red-soft); font-weight: 600; }
.report__row--warn .report__value { color: var(--hh-tan); }

/* On narrow screens each finding stacks its value under its name. */
@media (max-width: 35.99rem) {
  .report__table tr {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    padding-block: 0.4rem;
    border-bottom: 1px solid rgb(255 244 221 / 8%);
  }

  .report__row:last-child {
    border-bottom: 0;
  }

  .report__table th,
  .report__table td {
    padding: 0.1rem 0.25rem;
    border: 0;
  }

  .report__state {
    grid-row: span 2;
  }

  .report__name {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* Findings appear one by one, as if typed. */
.terminal.is-reveal-pending .report__row {
  opacity: 0;
  transform: translateX(-8px);
}

.terminal.is-revealed .report__row {
  opacity: 1;
  transform: none;
  transition: opacity 0.35s ease, transform 0.35s var(--ease-out);
}

.terminal.is-revealed .report__row:nth-child(1) { transition-delay: 0.35s; }
.terminal.is-revealed .report__row:nth-child(2) { transition-delay: 0.5s; }
.terminal.is-revealed .report__row:nth-child(3) { transition-delay: 0.65s; }
.terminal.is-revealed .report__row:nth-child(4) { transition-delay: 0.8s; }
.terminal.is-revealed .report__row:nth-child(5) { transition-delay: 0.95s; }
.terminal.is-revealed .report__row:nth-child(6) { transition-delay: 1.1s; }
.terminal.is-revealed .report__row:nth-child(7) { transition-delay: 1.25s; }

.terminal__caption {
  padding: 0 clamp(1rem, 3vw, 1.5rem) 1rem;
  color: #a9a59b;
  font-size: 0.78rem;
}

/* Blocks placed in the feature regions sit in the same grid. */
.features__grid > .region {
  display: contents;
}
