/*
 * The 3-Year No Moss Guarantee page, /no-moss-guarantee/ (owner, 2026-10-20, prototype C "The
 * certificate"), linked after styles.css and guides.css (the breadcrumb) by
 * src/pages/no-moss-guarantee/index.astro. The seal (GuaranteeSeal.astro) is styled here too.
 *
 * Written against tokens.css only: the page is the light theme (body), the seal and the closing
 * band carry data-theme="teal", so their --surface is the brand teal and their --ink the white on
 * it. Mobile-first; nothing here may make a 320px page scroll sideways.
 *
 * Width: the wrapper pads by max(--gutter, (100% - 1120px) / 2) and has NO max-width. From 1280px
 * the site's --gutter is max(80px, (100vw - 1320px) / 2); a fixed max-width on top of that padding
 * double-subtracts (the prototype's sheet shrank to 520px at 1920px). This way the content is
 * 1120px wide on large screens, as on the roof-town pages. The sheet's two-column layouts switch
 * on the sheet's own width (container queries on .gpc-cert__inner), never the viewport, and every
 * grid child holding text has min-width: 0.
 */

/* ---------- Ground: the rooftop tint with the roof-tile scallop pattern ---------- */

.gpc {
  background-color: var(--rooftop);
  background-image: radial-gradient(
    circle at 50% 0,
    transparent 15px,
    color-mix(in srgb, var(--on-aqua) 7%, transparent) 16px,
    transparent 17px
  );
  background-size: 32px 18px;
  padding-block: 28px 64px;
}

.gpc__wrap {
  width: 100%;
  padding-inline: max(var(--gutter), calc((100% - 1120px) / 2));
}

/* The page sets its own spacing with gaps: no UA margins on its text blocks. */
.gpc p,
.gpc ul {
  margin: 0;
}

.gpc h1,
.gpc h2 {
  margin: 0;
  text-wrap: balance;
}

.gpc__stack {
  display: grid;
  gap: 24px;
  margin-top: 28px;
}

.gpc__stack > * {
  min-width: 0;
}

/* ---------- The certificate sheet ---------- */

.gpc-cert {
  position: relative;
  background: var(--surface-raised);
  border-radius: 6px;
  padding: 10px;
  box-shadow: 0 2px 0 color-mix(in srgb, var(--on-aqua) 8%, transparent);
}

/* The double frame: a teal border, then (inside it) a raised-surface gap and an aqua hairline,
   both drawn with inset box-shadows (not `outline`, which can't follow a radius everywhere and
   sits outside the box). The sheet's text lays out against this box's width (container). */
.gpc-cert__inner {
  border: 2px solid var(--on-aqua);
  box-shadow:
    inset 0 0 0 5px var(--surface-raised),
    inset 0 0 0 6px var(--aqua);
  border-radius: 2px;
  padding: clamp(32px, 5vw, 56px) clamp(20px, 5vw, 64px) clamp(28px, 4vw, 44px);
  display: grid;
  gap: clamp(22px, 3vw, 30px);
  min-width: 0;
  overflow-wrap: break-word;
  container-type: inline-size;
}

.gpc-cert__inner > * {
  min-width: 0;
}

/* The seal, stamped on the top right corner, overhanging the sheet's top edge. */
.gpc-cert__seal {
  position: absolute;
  right: clamp(10px, 4vw, 48px);
  top: -30px;
  z-index: 1;
  width: clamp(92px, 13vw, 128px);
  height: auto;
  transform: rotate(8deg);
}

/* The heading block keeps clear of the seal on its right. */
.gpc-head {
  display: grid;
  gap: 14px;
  padding-right: clamp(70px, 12vw, 140px);
}

.gpc-head__title {
  font: var(--text-display-m);
  font-size: clamp(28px, 4.6vw, 48px);
  line-height: 1.04;
  text-transform: uppercase;
}

/* "3-Year" never breaks at its hyphen. */
.gpc-nowrap {
  white-space: nowrap;
}

.gpc-head__tag {
  color: var(--aqua-ink);
}

.gpc-rule {
  height: 0;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--border);
}

/* Body: one column, then (when the SHEET is 720px or wider) copy and promise on the left, "Why
   choose" on the right after a hairline. */
.gpc-body {
  display: grid;
  gap: 32px;
}

.gpc-body > * {
  min-width: 0;
}

@container (min-width: 720px) {
  .gpc-body {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 56px;
  }

  .gpc-why {
    border-left: 1px solid var(--border);
    padding-left: 48px;
  }
}

.gpc-left {
  display: grid;
  gap: 26px;
  align-content: start;
}

.gpc-copy {
  display: grid;
  gap: 14px;
}

.gpc-copy__lede {
  font-weight: 700;
}

/* The promise: a sunken box with a sun bar down its left edge. */
.gpc-promise {
  display: grid;
  gap: 10px;
  padding: 18px 20px;
  border-left: 4px solid var(--sun);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface-sunken);
}

.gpc-promise h2,
.gpc-why h2 {
  font: var(--text-title);
}

.gpc-why {
  display: grid;
  gap: 18px;
  align-content: start;
}

/* The six lines, each with a drawn aqua tick (no emoji). */
.gpc-ticks {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 12px;
}

.gpc-ticks li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin: 0;
}

.gpc-ticks svg {
  display: block;
}

.gpc-ticks__disc {
  fill: var(--aqua);
}

.gpc-ticks__tick {
  fill: none;
  stroke: var(--on-aqua);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Foot row: the small print, then the logo and the signature line (side by side on a wide sheet). */
.gpc-foot {
  display: grid;
  gap: 24px;
}

.gpc-foot > * {
  min-width: 0;
}

@container (min-width: 720px) {
  .gpc-foot {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 48px;
  }
}

.gpc-fine {
  max-width: 75ch;
  color: var(--ink-muted);
}

.gpc-sign {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: end;
}

.gpc-sign__line {
  min-width: 170px;
  padding-top: 6px;
  border-top: 1px solid var(--ink-muted);
  color: var(--ink-muted);
}

/* ---------- The closing band (teal, under the sheet) ---------- */

.gpc-close {
  display: grid;
  gap: 14px 40px;
  align-items: center;
  padding: clamp(24px, 4vw, 36px) clamp(20px, 4vw, 40px);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
}

@media (min-width: 720px) {
  .gpc-close {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

.gpc-close__text {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.gpc-close__title {
  font: var(--text-title);
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.15;
}

.gpc-close__text p {
  max-width: 60ch;
  color: var(--ink-muted);
}

/* The button's words may wrap on a narrow phone rather than widen the page. */
.gpc-close__cta {
  justify-content: center;
  text-align: center;
  padding-block: var(--space-2);
}

/* ---------- The seal (GuaranteeSeal.astro; data-theme="teal" on the SVG) ---------- */

.guarantee-seal {
  display: block;
}

.guarantee-seal__disc {
  fill: var(--surface);
}

.guarantee-seal__edge {
  fill: none;
  stroke: var(--aqua);
  stroke-width: 2;
}

.guarantee-seal__word {
  fill: var(--aqua);
  font: 700 12.5px var(--font-sans);
  letter-spacing: 2.6px;
}

.guarantee-seal__num {
  fill: var(--ink);
  font: 400 64px var(--font-display);
}

.guarantee-seal__yrs {
  fill: var(--aqua);
  font: 700 13px var(--font-sans);
  letter-spacing: 3px;
}

.guarantee-seal__roof {
  fill: none;
  stroke: var(--sun);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* One turn-in of the ring text on load, for people who haven't asked for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .guarantee-seal__spin {
    transform-origin: 100px 100px;
    animation: guarantee-seal-turn 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
}

@keyframes guarantee-seal-turn {
  from {
    transform: rotate(-120deg);
    opacity: 0;
  }

  to {
    transform: rotate(0);
    opacity: 1;
  }
}
