/* Appily Ninetyseven — Patchwork Desk (company-info)
   Medallion mission · stitched history squares · embroidered value patches
   Not stats-card steppers · topo about · Foundry Codex blueprint/dial/sector/ledger
   · Graftline · Almanac · Indenture · Comic Frame splash/strip/stickers */

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

html { scroll-behavior: smooth; }

body.a97-patchwork {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--pw-ink);
  background:
    radial-gradient(ellipse 55% 40% at 5% 0%, rgba(255, 20, 147, 0.1), transparent 55%),
    radial-gradient(ellipse 50% 35% at 100% 8%, rgba(0, 201, 167, 0.12), transparent 50%),
    linear-gradient(168deg, var(--pw-batting) 0%, var(--pw-calico) 52%, #E4F2EE 100%);
  -webkit-font-smoothing: antialiased;
}

.pw-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--pw-ink);
  color: #fff;
  padding: 8px 12px;
  z-index: 100;
}
.pw-skip:focus { left: 8px; top: 8px; }

/* —— Hop —— */
.pw-hop {
  position: relative;
  top: 0;
  z-index: 40;
  background: var(--pw-ink);
  color: #fff;
  border-bottom: 3px solid var(--pw-stitch);
}
.pw-hop-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px var(--space-page);
}
.pw-hop-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.pw-hop-brand strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}
.pw-hop-mark {
  width: 18px;
  height: 18px;
  background:
    linear-gradient(45deg, var(--pw-stitch) 25%, transparent 25%),
    linear-gradient(-45deg, var(--pw-aqua) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--pw-amber) 75%),
    linear-gradient(-45deg, transparent 75%, var(--pw-stitch) 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0;
  border-radius: 3px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}
.pw-hop-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-left: auto;
}
.pw-hop-links a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 220ms ease, border-color 220ms ease;
}
.pw-hop-links a:hover,
.pw-hop-links a:focus-visible {
  color: #fff;
  border-bottom-color: var(--pw-aqua);
  outline: none;
}
.pw-hop-links a[aria-current="page"] {
  color: #fff;
  border-bottom-color: var(--pw-stitch);
}
.pw-hop-toggle {
  display: none;
  margin-left: auto;
  min-height: 42px;
  min-width: 5.5rem;
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  padding: 8px 14px;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.pw-hop-toggle:hover,
.pw-hop-toggle:focus-visible {
  background: var(--pw-aqua);
  color: var(--pw-ink);
  border-color: var(--pw-aqua);
  outline: 3px solid var(--pw-stitch);
  outline-offset: 2px;
}
.pw-hop-sheet a:focus-visible {
  outline: 3px solid var(--pw-aqua);
  outline-offset: 2px;
}
.pw-hop-sheet {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 8px var(--space-page) 14px;
  background: var(--pw-void);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.pw-hop-sheet a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 700;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.pw-hop-sheet a[aria-current="page"] { color: var(--pw-amber); }
.pw-hop.is-open .pw-hop-sheet { display: flex; }

@media (max-width: 760px) {
  .pw-hop-links { display: none; }
  .pw-hop-toggle { display: inline-flex; }
}

/* —— Stage —— */
.pw-stage {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 40px) var(--space-page) 48px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.pw-section-head {
  margin-bottom: 16px;
}
.pw-section-head .pw-kicker {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pw-stitch);
}
.pw-section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  font-weight: 400;
  margin: 0 0 6px;
  line-height: 1.15;
}
.pw-section-head p {
  margin: 0;
  color: var(--pw-mute);
  max-width: 36rem;
  line-height: 1.5;
}

/* —— Mission medallion —— */
.pw-medallion {
  position: relative;
  margin: 8px auto 0;
  max-width: 720px;
  padding: 8px;
  background:
    repeating-linear-gradient(
      90deg,
      var(--pw-stitch) 0 6px,
      transparent 6px 14px
    ),
    repeating-linear-gradient(
      0deg,
      var(--pw-aqua) 0 6px,
      transparent 6px 14px
    );
  background-color: var(--pw-ink);
  border-radius: 20px;
  box-shadow: var(--shadow-block);
  opacity: 0;
  transform: scale(0.94) translateY(16px);
  transition: opacity var(--motion-sew), transform var(--motion-sew);
}
.pw-medallion.is-live {
  opacity: 1;
  transform: scale(1) translateY(0);
}
.pw-medallion-inner {
  background: var(--pw-plate);
  border-radius: 14px;
  padding: clamp(24px, 5vw, 40px) clamp(20px, 4vw, 36px);
  text-align: center;
  position: relative;
}
.pw-medallion-brand {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1;
  margin: 0 0 8px;
  color: var(--pw-ink);
  font-weight: 400;
}
.pw-medallion-brand span { color: var(--pw-stitch); }
.pw-medallion h1 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 400;
  margin: 0 0 12px;
  color: var(--pw-aqua-deep);
}
.pw-medallion-lede {
  margin: 0 auto 14px;
  max-width: 34rem;
  color: var(--pw-mute);
  font-size: 1.02rem;
  line-height: 1.55;
}
.pw-medallion-mission {
  margin: 0 auto;
  max-width: 36rem;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.55;
  color: var(--pw-ink);
  position: relative;
  display: inline-block;
  padding-bottom: 10px;
}
.pw-medallion-mission::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 0;
  height: 3px;
  background: repeating-linear-gradient(
    90deg,
    var(--pw-stitch) 0 8px,
    transparent 8px 14px
  );
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--motion-stitch);
}
.pw-medallion.is-live .pw-medallion-mission::after {
  transform: scaleX(1);
}

/* —— Stitched history path —— */
.pw-path {
  position: relative;
  padding-top: 8px;
}
.pw-thread {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 72px;
  height: 3px;
  background: repeating-linear-gradient(
    90deg,
    var(--pw-amber) 0 10px,
    transparent 10px 18px
  );
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}
.pw-squares {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.pw-square {
  background: var(--pw-plate);
  border: 2px solid var(--pw-ink);
  border-radius: 4px;
  padding: 18px 14px 16px;
  box-shadow: 4px 4px 0 var(--pw-aqua);
  opacity: 0;
  transform: translateY(24px) rotate(-2deg);
}
.pw-path.is-live .pw-square {
  animation: pw-sew-in var(--motion-sew) var(--ease-spring) forwards;
}
.pw-square:nth-child(1) { animation-delay: 60ms; box-shadow: 4px 4px 0 var(--pw-stitch); }
.pw-square:nth-child(2) { animation-delay: 160ms; transform: translateY(24px) rotate(1.5deg); box-shadow: 4px 4px 0 var(--pw-amber); }
.pw-square:nth-child(3) { animation-delay: 260ms; }
.pw-square:nth-child(4) { animation-delay: 360ms; transform: translateY(24px) rotate(2deg); box-shadow: 4px 4px 0 var(--pw-stitch); }

@keyframes pw-sew-in {
  to { opacity: 1; transform: translateY(0) rotate(var(--pw-tilt, -1deg)); }
}
.pw-square:nth-child(1) { --pw-tilt: -1.5deg; }
.pw-square:nth-child(2) { --pw-tilt: 1.2deg; }
.pw-square:nth-child(3) { --pw-tilt: -0.8deg; }
.pw-square:nth-child(4) { --pw-tilt: 1.6deg; }

.pw-square:hover,
.pw-square:focus-within {
  transform: translateY(-4px) rotate(0deg) !important;
  box-shadow: 5px 8px 0 var(--pw-ink);
  z-index: 2;
  transition: transform var(--motion-patch), box-shadow var(--motion-patch);
}
.pw-square-num {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pw-stitch);
  margin-bottom: 6px;
}
.pw-square strong {
  display: block;
  font-size: 1.02rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.pw-square p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--pw-mute);
  line-height: 1.4;
}

/* —— Value patches —— */
.pw-patches {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 8px 0 0;
}
.pw-patch {
  flex: 1 1 200px;
  max-width: 240px;
  background: var(--pw-plate);
  border: 3px solid var(--pw-ink);
  border-radius: 50% 12% 40% 12% / 40% 12% 50% 12%;
  padding: 28px 18px 22px;
  text-align: center;
  box-shadow: 5px 5px 0 var(--pw-amber);
  opacity: 0;
  transform: rotate(-8deg) scale(0.85);
  position: relative;
}
.pw-patches.is-live .pw-patch {
  animation: pw-patch-settle var(--motion-patch) var(--ease-spring) forwards;
}
.pw-patch:nth-child(1) { animation-delay: 80ms; box-shadow: 5px 5px 0 var(--pw-stitch); }
.pw-patch:nth-child(2) { animation-delay: 160ms; border-radius: 12% 50% 12% 40% / 12% 40% 12% 50%; box-shadow: 5px 5px 0 var(--pw-aqua); }
.pw-patch:nth-child(3) { animation-delay: 240ms; }
.pw-patch:nth-child(4) { animation-delay: 320ms; border-radius: 40% 12% 50% 12% / 50% 12% 40% 12%; box-shadow: 5px 5px 0 var(--pw-stitch); }

@keyframes pw-patch-settle {
  to { opacity: 1; transform: rotate(var(--pw-prot, -3deg)) scale(1); }
}
.pw-patch:nth-child(1) { --pw-prot: -4deg; }
.pw-patch:nth-child(2) { --pw-prot: 3deg; }
.pw-patch:nth-child(3) { --pw-prot: -2deg; }
.pw-patch:nth-child(4) { --pw-prot: 5deg; }

.pw-patch:hover,
.pw-patch:focus-within {
  transform: rotate(0deg) scale(1.04) !important;
  box-shadow: 6px 6px 0 var(--pw-ink);
  z-index: 2;
  transition: transform var(--motion-patch), box-shadow var(--motion-patch);
}
.pw-patch::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: var(--pw-stitch);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}
.pw-patch:nth-child(2)::before { background: var(--pw-aqua); }
.pw-patch:nth-child(3)::before { background: var(--pw-amber); }
.pw-patch strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  margin-bottom: 6px;
  line-height: 1.2;
}
.pw-patch p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--pw-mute);
  line-height: 1.4;
  font-weight: 600;
}

/* —— Aisle thread labels —— */
.pw-aisles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pw-aisle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--pw-plate);
  border: 2px dashed var(--pw-aqua);
  border-radius: var(--radius-pill);
  color: var(--pw-ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  transition: background 220ms ease, border-color 220ms ease, transform 220ms var(--ease-spring);
}
.pw-aisle span {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--pw-stitch);
}
.pw-aisle:hover,
.pw-aisle:focus-visible {
  background: var(--pw-amber);
  border-style: solid;
  border-color: var(--pw-ink);
  transform: translateY(-3px);
  outline: none;
}

/* —— Registry label sheet —— */
.pw-registry {
  background: var(--pw-plate);
  border: 2px solid var(--pw-ink);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 8px 8px 0 rgba(0, 201, 167, 0.25);
}
.pw-registry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 20px;
  background: linear-gradient(90deg, rgba(255, 20, 147, 0.08), rgba(0, 201, 167, 0.1));
  border-bottom: 2px dashed var(--pw-line);
}
.pw-registry-head .pw-kicker {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pw-stitch);
}
.pw-registry-head h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  margin: 2px 0 0;
}
.pw-registry-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--pw-ink);
  color: var(--pw-amber);
}
.pw-registry table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.pw-registry th,
.pw-registry td {
  padding: 10px 20px;
  text-align: left;
  border-bottom: 1px solid rgba(168, 200, 192, 0.45);
  vertical-align: top;
}
.pw-registry th {
  width: 38%;
  font-weight: 800;
  color: var(--pw-mute);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pw-registry tr:last-child th,
.pw-registry tr:last-child td { border-bottom: none; }
.pw-registry tr:hover td { background: rgba(0, 201, 167, 0.06); }

/* —— Contact notes —— */
.pw-contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.pw-note {
  background: var(--pw-plate);
  border: 2px solid var(--pw-ink);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 3px 3px 0 var(--pw-amber);
}
.pw-note:nth-child(2) { box-shadow: 3px 3px 0 var(--pw-aqua); }
.pw-note:nth-child(3) { box-shadow: 3px 3px 0 var(--pw-stitch); }
.pw-note h3 {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pw-stitch);
}
.pw-note p { margin: 0; font-weight: 700; font-size: 0.95rem; word-break: break-word; }
.pw-note a {
  color: var(--pw-ink);
  text-decoration: none;
  border-bottom: 2px solid var(--pw-aqua);
}
.pw-note a:hover { border-bottom-color: var(--pw-stitch); }

/* —— CTAs —— */
.pw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.pw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  min-width: 9rem;
  padding: 14px 26px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  text-decoration: none;
  border: 2px solid var(--pw-ink);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 220ms var(--ease-spring), box-shadow 220ms ease, background 220ms ease, color 220ms ease;
}
.pw-btn--primary {
  background: var(--pw-stitch-deep);
  color: #fff;
  border-color: var(--pw-stitch-deep);
  box-shadow: 0 5px 0 #7A0848;
}
.pw-btn--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    105deg,
    transparent 0 12px,
    rgba(255, 184, 0, 0.45) 12px 16px,
    transparent 16px 28px
  );
  transform: translateX(-120%);
  transition: transform 360ms var(--ease-out);
}
.pw-btn--primary:hover,
.pw-btn--primary:focus-visible {
  background: var(--pw-stitch);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 8px 0 var(--pw-stitch-deep);
  outline: 3px solid var(--pw-aqua);
  outline-offset: 3px;
}
.pw-btn--primary:hover::after,
.pw-btn--primary:focus-visible::after {
  transform: translateX(120%);
}
.pw-btn--ghost {
  background: var(--pw-plate);
  color: var(--pw-ink);
  box-shadow: 0 4px 0 var(--pw-aqua);
}
.pw-btn--ghost:hover,
.pw-btn--ghost:focus-visible {
  background: var(--pw-aqua-deep);
  color: #fff;
  transform: translateY(-2px);
  outline: none;
}

.pw-colo {
  text-align: center;
  color: var(--pw-mute);
  font-size: 0.85rem;
  margin: 8px 0 0;
}
.pw-colo a {
  color: var(--pw-ink);
  font-weight: 800;
  text-decoration: none;
  border-bottom: 2px solid var(--pw-stitch);
}
.pw-colo a:hover { border-bottom-color: var(--pw-aqua); }

@media (max-width: 800px) {
  .pw-squares { grid-template-columns: 1fr 1fr; }
  .pw-thread { display: none; }
  .pw-contact { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .pw-squares { grid-template-columns: 1fr; }
  .pw-patch { max-width: none; }
  .pw-actions { flex-direction: column; }
  .pw-btn { width: 100%; }
  .pw-registry th { width: 42%; font-size: 0.7rem; }
  .pw-registry th,
  .pw-registry td { padding: 10px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .pw-medallion,
  .pw-square,
  .pw-patch {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
  .pw-medallion-mission::after { transform: scaleX(1) !important; }
  .pw-btn--primary::after { display: none; }
}
