/* =============================================================================
   HAIWAVE Marketing Site — site-wide CSS
   Imports brand tokens, then layers in marketing page styles.
   ============================================================================= */

@import url("./colors_and_type.css");

/* Resets + base */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg-page); color: var(--fg-2); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; }

/* ---- Display type for marketing surfaces (larger than PDF scale) ---- */
.hw-display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg-1);
  line-height: 1.06;
  margin: 0;
  text-wrap: balance;
}
.hw-display--xxl { font-size: clamp(40px, 5.6vw, 76px); }
.hw-display--xl  { font-size: clamp(36px, 4.4vw, 60px); }
.hw-display--lg  { font-size: clamp(30px, 3.4vw, 48px); }
.hw-display--md  { font-size: clamp(24px, 2.4vw, 36px); }

.hw-subhead {
  font-family: var(--font-text);
  font-size: clamp(18px, 1.4vw, 22px);
  line-height: 1.55;
  font-weight: 400;
  color: var(--fg-2);
  max-width: 56ch;
  text-wrap: pretty;
}
.hw-supporting {
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg-3);
  max-width: 56ch;
  text-wrap: pretty;
}

/* Eyebrow / section label */
.hw-eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hw-teal-dark);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.hw-eyebrow::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--hw-teal);
  flex-shrink: 0;
}

/* Section-heading: small caps teal-dark label (per PDF spec) */
.hw-kicker {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hw-teal-dark);
}

/* ---- Layout ---- */
.hw-shell { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.hw-section { padding: clamp(64px, 8vw, 120px) 0; }
.hw-section--tight { padding: clamp(48px, 6vw, 80px) 0; }
.hw-section--bg-subtle { background: var(--bg-subtle); }
.hw-section--bg-alt { background: var(--bg-alt); }
.hw-section--bg-dark { background: var(--bg-dark); color: var(--fg-on-dark); }
.hw-section--bg-dark .hw-display,
.hw-section--bg-dark h1, .hw-section--bg-dark h2, .hw-section--bg-dark h3 { color: var(--fg-on-dark); }
.hw-section--bg-dark .hw-subhead { color: var(--fg-on-dark-muted); }
.hw-section--bg-dark .hw-body,
.hw-section--bg-dark .hw-body p,
.hw-section--bg-dark p { color: var(--fg-on-dark-muted); }
.hw-section--bg-dark .hw-body strong,
.hw-section--bg-dark .hw-body b { color: var(--fg-on-dark); }
.hw-section--bg-dark .hw-kicker { color: var(--hw-teal); }

.hw-grid-2 {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(40px, 5vw, 72px);
  align-items: start;
}
.hw-grid-2--text-right { grid-template-columns: 1fr 1.05fr; }
.hw-grid-2--center { align-items: center; }
@media (max-width: 880px) {
  .hw-grid-2, .hw-grid-2--text-right { grid-template-columns: 1fr; gap: 40px; }
}

/* ---- Buttons ---- */
.hw-btn {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  padding: 8px 18px;
  border-radius: 5px;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  line-height: 1.5;
  transition: background-color var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.hw-btn--primary { background: var(--hw-teal-dark); color: var(--fg-on-dark); }
.hw-btn--primary:hover { background: var(--hw-deep-navy); color: var(--fg-on-dark); }
.hw-btn--ghost {
  background: transparent;
  color: var(--hw-teal-dark);
  padding: 8px 0;
  border-radius: 0;
  border-bottom: 1px solid currentColor;
}
.hw-btn--ghost:hover { color: var(--hw-teal); }
.hw-btn--on-dark { background: var(--hw-teal); color: var(--hw-deep-navy); }
.hw-btn--on-dark:hover { background: var(--hw-aqua); color: var(--hw-deep-navy); }

/* Inline link with arrow */
.hw-link-arrow {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--hw-teal-dark);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.hw-link-arrow:hover { color: var(--hw-teal); border-bottom-color: currentColor; }
.hw-link-arrow .arrow { transition: transform var(--dur-base) var(--ease-out); display: inline-block; }
.hw-link-arrow:hover .arrow { transform: translateX(3px); }

/* ---- Card / tile ---- */
.hw-card {
  background: var(--hw-white);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-1);
  transition: box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}
.hw-card:hover { box-shadow: var(--shadow-2); border-color: var(--hw-divider); }

.hw-tile {
  background: var(--hw-white);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
  position: relative;
  overflow: hidden;
}
.hw-tile:hover { box-shadow: var(--shadow-2); border-color: var(--hw-teal); }
.hw-tile::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 32px; height: 3px;
  background: var(--tile-accent, var(--hw-teal));
}
.hw-tile-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.005em;
  color: var(--fg-1);
  margin: 0;
}
.hw-tile-desc {
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg-3);
  margin: 0;
  flex: 1;
}
.hw-tile-cta {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--hw-teal-dark);
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 4px;
}

/* ---- Pull-quote / callout ---- */
.hw-pull {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.18;
  letter-spacing: -0.015em;
  color: var(--fg-1);
  text-wrap: balance;
  margin: 0;
}
.hw-pull--teal { color: var(--hw-teal-dark); }
.hw-pull-block {
  border-top: 3px solid var(--hw-teal);
  padding-top: 28px;
  max-width: 880px;
}

/* The marquee three-line cadence */
.hw-cadence {
  text-align: center;
  margin: clamp(40px, 5vw, 64px) auto;
  max-width: 720px;
}
.hw-cadence-line {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.4;
  color: var(--fg-1);
  margin: 0;
  letter-spacing: -0.01em;
}
.hw-cadence-line + .hw-cadence-line { margin-top: 8px; }
.hw-cadence-line.is-final { font-weight: 700; color: var(--hw-teal-dark); }
.hw-cadence::before, .hw-cadence::after {
  content: "";
  display: block;
  width: 64px;
  height: 1px;
  background: var(--hw-teal);
  margin: 0 auto 24px;
}
.hw-cadence::after { margin: 24px auto 0; }

/* ---- Nav (two rows: utility on top, primary links margin-to-margin below) ---- */
.hw-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.94);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border-hairline);
}

/* Top row — logo + utility */
.hw-nav-top {
  border-bottom: 1px solid var(--border-hairline);
}
.hw-nav-top-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 6px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.hw-nav-logo { height: 24px; width: auto; display: block; }
.hw-nav-logo-link { display: flex; align-items: center; padding: 2px 0; }

.hw-nav-utility {
  display: flex;
  align-items: center;
  gap: 18px;
}
.hw-nav-utility-link {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-3);
  text-decoration: none;
  padding: 2px 0;
  border-bottom: 1px solid transparent;
  transition: color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.hw-nav-utility-link:hover, .hw-nav-utility-link[data-active="true"] {
  color: var(--hw-teal-dark);
  border-bottom-color: currentColor;
}
.hw-nav-utility-sep {
  width: 1px;
  height: 14px;
  background: var(--border-hairline);
  display: inline-block;
}
.hw-nav-cta {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 5px;
  background: var(--hw-teal-dark);
  color: var(--fg-on-dark);
  text-decoration: none;
  border: 0;
  cursor: pointer;
  line-height: 1.6;
  transition: background var(--dur-base) var(--ease-out);
}
.hw-nav-cta:hover { background: var(--hw-deep-navy); }

/* Bottom row — primary nav, spread margin-to-margin */
.hw-nav-primary-row { }
.hw-nav-primary-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 5px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.hw-nav-link {
  position: relative;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  color: var(--fg-2);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
  white-space: nowrap;
}
.hw-nav-link:hover, .hw-nav-link[data-active="true"] {
  color: var(--hw-teal-dark);
  border-bottom-color: currentColor;
}
.hw-nav-link .caret { margin-left: 4px; font-size: 10px; opacity: 0.6; }

/* Dropdown */
.hw-nav-item { position: relative; }
.hw-nav-flyout {
  position: absolute;
  top: 100%;
  left: -24px;
  min-width: 360px;
  background: var(--hw-white);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  padding: 16px;
  margin-top: 12px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 60;
}
/* Bridge the gap between the trigger and the flyout so hover stays continuous */
.hw-nav-flyout::before {
  content: "";
  position: absolute;
  top: -16px;
  left: 0;
  right: 0;
  height: 16px;
  background: transparent;
}
.hw-nav-item:hover .hw-nav-flyout,
.hw-nav-item:focus-within .hw-nav-flyout { display: flex; }
.hw-nav-flyout-link {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background var(--dur-base) var(--ease-out);
}
.hw-nav-flyout-link:hover { background: var(--bg-subtle); }
.hw-nav-flyout-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-1);
  display: block;
}
.hw-nav-flyout-desc {
  font-size: 13px;
  color: var(--fg-3);
  margin-top: 3px;
  line-height: 1.4;
}

/* Right-aligned flyout — for nav items near the right edge of the page,
   so the dropdown stays inside the viewport instead of clipping off-screen. */
.hw-nav-item--right-align .hw-nav-flyout {
  left: auto;
  right: -24px;
}

/* ---- Skip-to-content link (a11y) ---------------------------------------- */
.hw-skip-link {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--hw-deep-navy);
  color: var(--fg-on-dark);
  padding: 10px 16px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  z-index: 100;
  transform: translateY(-100%);
  transition: transform var(--dur-base) var(--ease-out);
  border-bottom-right-radius: var(--radius-md);
}
.hw-skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--hw-teal);
  outline-offset: 2px;
}

/* ---- Mobile nav (burger + drawer) --------------------------------------- */
.hw-nav-burger {
  display: none;
  background: none;
  border: 0;
  padding: 8px;
  margin: -8px;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.hw-nav-burger:focus-visible {
  outline: 2px solid var(--hw-teal);
  outline-offset: 2px;
}
.hw-nav-burger-icon {
  display: block;
  width: 22px;
  height: 18px;
  position: relative;
}
.hw-nav-burger-icon span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--hw-deep-navy);
  border-radius: 2px;
  transition: transform var(--dur-base) var(--ease-out),
              opacity var(--dur-base) var(--ease-out),
              top var(--dur-base) var(--ease-out);
}
.hw-nav-burger-icon span:nth-child(1) { top: 0; }
.hw-nav-burger-icon span:nth-child(2) { top: 8px; }
.hw-nav-burger-icon span:nth-child(3) { top: 16px; }
.hw-nav-burger-icon[data-open="true"] span:nth-child(1) { top: 8px; transform: rotate(45deg); }
.hw-nav-burger-icon[data-open="true"] span:nth-child(2) { opacity: 0; }
.hw-nav-burger-icon[data-open="true"] span:nth-child(3) { top: 8px; transform: rotate(-45deg); }

/* The drawer itself is rendered on every page but hidden via [hidden].
   The [data-open="true"] flag is set when it's actually visible. */
.hw-mobile-drawer { display: none; }
.hw-mobile-drawer[data-open="true"] { display: block; }
.hw-mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 31, 54, 0.55);
  z-index: 70;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.hw-mobile-drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 92vw);
  background: var(--hw-white);
  z-index: 71;
  box-shadow: 0 0 32px rgba(0,0,0,0.18);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.hw-mobile-drawer-inner {
  padding: 24px 20px 32px;
  display: flex;
  flex-direction: column;
}

.hw-mobile-link {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--fg-1);
  text-decoration: none;
  padding: 14px 8px;
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
}
.hw-mobile-link::-webkit-details-marker { display: none; }
.hw-mobile-link[data-active="true"] { color: var(--hw-teal-dark); }
.hw-mobile-link:focus-visible { outline: 2px solid var(--hw-teal); outline-offset: 2px; }

.hw-mobile-group { border-bottom: 1px solid var(--border-hairline); }
.hw-mobile-group > summary { border-bottom: 0; }
.hw-mobile-group-title {
  color: inherit;
  text-decoration: none;
  flex: 1;
}
.hw-mobile-caret {
  font-size: 12px;
  color: var(--hw-teal-dark);
  margin-left: 8px;
  transition: transform var(--dur-base) var(--ease-out);
}
.hw-mobile-group[open] .hw-mobile-caret { transform: rotate(180deg); }

.hw-mobile-sublist {
  padding: 4px 8px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hw-mobile-sublink {
  padding: 10px 8px;
  text-decoration: none;
  color: var(--fg-2);
  border-radius: var(--radius-sm);
}
.hw-mobile-sublink:hover, .hw-mobile-sublink:focus-visible {
  background: var(--bg-subtle);
  outline: none;
}
.hw-mobile-sublink-name {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14.5px;
  color: var(--fg-1);
}
.hw-mobile-sublink-desc {
  display: block;
  font-size: 12.5px;
  color: var(--fg-3);
  margin-top: 2px;
  line-height: 1.4;
}

.hw-mobile-utility {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hw-mobile-utility-link {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-3);
  text-decoration: none;
  padding: 6px 0;
}
.hw-mobile-utility-link:hover { color: var(--hw-teal-dark); }
.hw-mobile-cta {
  align-self: flex-start;
  margin-top: 4px;
}

/* Mobile: hide primary row entirely (replace with simple menu trigger later);
   keep top row visible so brand + CTA are accessible. */
@media (max-width: 900px) {
  .hw-nav-primary-row { display: none; }
  .hw-nav-utility-link { display: none; }
  .hw-nav-utility-sep { display: none; }
  .hw-nav-cta { display: none; }
  .hw-nav-burger { display: inline-flex; align-items: center; justify-content: center; }
}

/* ---- Footer ---- */
/* Logo strip — white background, centered, sits above the navy footer */
.hw-footer-logo-strip {
  background: var(--hw-white);
  border-top: 1px solid var(--border-hairline);
  border-bottom: 2px solid var(--hw-teal);
  padding: 18px 0 16px;
}
.hw-footer-logo-strip-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.hw-footer-logo { height: 44px; width: auto; display: block; }
.hw-footer-logo-tag {
  margin: 0;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--fg-3);
  text-align: center;
}

.hw-footer {
  background: var(--hw-deep-navy);
  color: var(--fg-on-dark-muted);
  padding: 28px 0 18px;
}
.hw-footer-inner { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.hw-footer-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
@media (max-width: 760px) {
  .hw-footer-cols { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}
.hw-footer-col-h {
  color: var(--hw-teal);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.hw-footer-link {
  display: block;
  font-size: 13px;
  color: var(--fg-on-dark-muted);
  text-decoration: none;
  margin-bottom: 6px;
  transition: color var(--dur-base) var(--ease-out);
}
.hw-footer-link:hover { color: var(--hw-aqua); }
.hw-footer-bottom {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--hw-light-slate);
  gap: 16px;
  flex-wrap: wrap;
}
.hw-footer-legal { display: flex; gap: 18px; flex-wrap: wrap; }
.hw-footer-legal a { color: var(--hw-light-slate); text-decoration: none; }
.hw-footer-legal a:hover { color: var(--hw-aqua); }

/* ---- Mini-tile (three-up inline on Home Pillar 2) ---- */
.hw-mini-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 32px;
}
@media (max-width: 720px) { .hw-mini-tiles { grid-template-columns: 1fr; } }
.hw-mini-tile {
  border-left: 2px solid var(--hw-teal);
  padding: 4px 0 4px 16px;
}
.hw-mini-tile-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--fg-1); margin: 0 0 6px; }
.hw-mini-tile-desc { font-size: 14px; line-height: 1.5; color: var(--fg-3); margin: 0; }

/* ---- Pricing cards ---- */
.hw-pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}
@media (max-width: 880px) { .hw-pricing-grid { grid-template-columns: 1fr; } }
.hw-pricing-card {
  background: var(--hw-white);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hw-pricing-card[data-tier="free"] { border-color: var(--hw-teal); }
.hw-pricing-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hw-teal-dark);
}
.hw-pricing-head {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--fg-1);
  margin: 4px 0 0;
}
.hw-pricing-body { font-size: 14px; line-height: 1.55; color: var(--fg-3); }

/* ---- Capability cycle ring (D-6) helper text ---- */
.hw-cycle-legend { font-size: 13px; color: var(--fg-3); text-align: center; max-width: 540px; margin: 16px auto 0; }

/* ---- Highlight emphasis on key brand phrases ---- */
.hw-wavepool {
  font-weight: 700;
  color: var(--hw-teal-dark);
  position: relative;
  white-space: nowrap;
}
.hw-wavepool::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--hw-aqua) 30%, var(--hw-teal) 70%, transparent);
  border-radius: 4px;
  opacity: 0.55;
}

/* Inline bold body emphasis */
.hw-body strong, .hw-body b { color: var(--fg-1); font-weight: 700; }
.hw-body { font-size: 17px; line-height: 1.7; color: var(--fg-2); text-wrap: pretty; max-width: 64ch; background: transparent; }
.hw-body p { margin: 0 0 1.1em; }
.hw-body p:last-child { margin-bottom: 0; }
.hw-body--wide { max-width: 72ch; }
.hw-body--center { margin-inline: auto; }

/* ---- Section header (kicker + title pattern) ---- */
.hw-section-head { margin-bottom: 40px; max-width: 760px; }
.hw-section-head .hw-display { margin-top: 14px; }
.hw-section-head.is-centered { margin-inline: auto; text-align: center; }
.hw-section-head.is-centered .hw-eyebrow { justify-content: center; }

/* ---- Support — search bar (used on /support and /support/docs) ---- */
.hw-support-search {
  position: relative;
  max-width: 640px;
  margin-top: 32px;
}
.hw-support-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}
.hw-support-search-input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  font-family: var(--font-text);
  font-size: 15px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--hw-white);
  color: var(--fg-1);
}
.hw-support-search-input:focus {
  outline: none;
  border-color: var(--hw-teal);
  box-shadow: 0 0 0 3px rgba(41,176,195,0.15);
}

/* Inline form error style — used by /join and /support/contact */
.hw-form-error {
  margin: 6px 0 0;
  padding: 12px 14px;
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.35);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.5;
  color: #B91C1C;
}

/* ---- Reduced motion (a11y) ----------------------------------------------
   Respect the user's OS-level preference for less motion. We collapse
   transitions and animations to near-instant, suppress decorative transforms,
   and disable smooth scroll. Functional motion (focus rings, opacity toggles
   used to convey state) is preserved at a shorter duration so users still
   get the feedback. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* Suppress decorative hover/scroll translations specifically. */
  .hw-link-arrow:hover .arrow { transform: none; }
  .hw-tile:hover, .hw-card:hover, .hw-partner-path:hover, .hw-resource-tile:hover { transform: none; }
  .hw-faq-icon { transition: none; }
  details[open] .hw-faq-icon { transform: rotate(45deg); }
  .hw-mobile-caret { transition: none; }
}

/* ---- Legal pages (terms / privacy / BSL) ---- */
.hw-legal-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
@media (max-width: 880px) {
  .hw-legal-layout { grid-template-columns: 1fr; gap: 24px; }
}
.hw-legal-toc {
  position: sticky;
  top: 120px;
  align-self: start;
  font-family: var(--font-display);
}
@media (max-width: 880px) {
  .hw-legal-toc {
    position: static;
    background: var(--bg-subtle);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-md);
    padding: 18px 20px;
  }
}
.hw-legal-toc-h {
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hw-teal-dark);
  margin-bottom: 14px;
}
.hw-legal-toc-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  counter-reset: legal-toc;
}
.hw-legal-toc-list li {
  counter-increment: legal-toc;
}
.hw-legal-toc-list li a {
  display: block;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--fg-3);
  text-decoration: none;
  padding: 4px 0 4px 26px;
  border-left: 2px solid transparent;
  position: relative;
  transition: color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.hw-legal-toc-list li a::before {
  content: counter(legal-toc, decimal-leading-zero);
  position: absolute;
  left: 8px;
  top: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--hw-light-slate);
}
.hw-legal-toc-list li a:hover {
  color: var(--hw-teal-dark);
  border-left-color: var(--hw-teal);
}
.hw-legal-toc-also { padding-top: 22px; border-top: 1px solid var(--border-hairline); }
.hw-legal-toc-also-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hw-legal-toc-also-list a {
  font-size: 13px;
  color: var(--fg-2);
  text-decoration: none;
  font-weight: 500;
}
.hw-legal-toc-also-list a:hover { color: var(--hw-teal-dark); }

/* Prose column */
.hw-legal-prose {
  max-width: 72ch;
  color: var(--fg-2);
  font-family: var(--font-text);
  font-size: 15.5px;
  line-height: 1.75;
}
.hw-legal-prose .hw-legal-h1 { display: none; }
.hw-legal-prose .hw-legal-h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--fg-1);
  letter-spacing: -0.005em;
  margin: 40px 0 14px;
  padding-top: 12px;
  scroll-margin-top: 120px;
  border-top: 1px solid var(--border-hairline);
}
.hw-legal-prose .hw-legal-h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.hw-legal-prose .hw-legal-h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--fg-1);
  margin: 26px 0 8px;
  letter-spacing: 0;
}
.hw-legal-prose p { margin: 0 0 1em; text-wrap: pretty; }
.hw-legal-prose strong { color: var(--fg-1); font-weight: 700; }
.hw-legal-prose em { font-style: italic; }
.hw-legal-prose a {
  color: var(--hw-teal-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.hw-legal-prose a:hover { color: var(--hw-teal); }
.hw-legal-prose .hw-legal-ul {
  margin: 0 0 1em;
  padding: 0;
  list-style: none;
}
.hw-legal-prose .hw-legal-ul li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 6px;
}
.hw-legal-prose .hw-legal-ul li::before {
  content: "";
  position: absolute;
  left: 0; top: 12px;
  width: 10px; height: 1.5px;
  background: var(--hw-teal);
}
.hw-legal-prose .hw-legal-hr {
  border: 0;
  border-top: 1px solid var(--border-hairline);
  margin: 28px 0;
}


/* =============================================================================
   MOBILE SWEEP — universal phone optimizations
   Layered as the last block so it overrides earlier rules where needed.
   Breakpoints used:
     880px — handled per-block earlier (hw-grid-2, pricing, legal)
     720px — large phones & small tablets
     640px — phones (portrait)
     480px — narrow phones
   ============================================================================= */

/* ---- 720px and below: large phones / small tablets ---- */
@media (max-width: 720px) {
  /* Tighten shell padding so content gets every pixel */
  .hw-shell { padding: 0 22px; }

  /* Section vertical padding — keep airy but reclaim space */
  .hw-section { padding: 56px 0; }
  .hw-section--tight { padding: 40px 0; }

  /* Collapse 3-up content grids that have no breakpoint of their own */
  .hw-econ-strip,
  .hw-step-grid,
  .hw-positions,
  .hw-profile-index,
  .hw-compose-with {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* Collapse coordination grid (Home pillar 1) */
  .hw-coord-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
}

/* ---- 640px and below: phones (portrait) ---- */
@media (max-width: 640px) {
  /* Shell gets even tighter */
  .hw-shell { padding: 0 18px; }

  /* Collapse 2-up content grids */
  .hw-personas,
  .hw-support-topics,
  .hw-docs-nav-grid,
  .hw-contact-grid,
  .hw-busywork-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Buttons — full-width on phones reads as intentional, not stretched */
  .hw-btn { padding: 12px 18px; font-size: 13.5px; }

  /* Form inputs — 16px minimum prevents iOS zoom on focus */
  .hw-join-input,
  .hw-support-search-input,
  input, textarea, select {
    font-size: 16px !important;
  }

  /* Forms — drop padding so the card doesn't crowd input edges */
  .hw-join-form { padding: 22px 18px !important; }

  /* Cards — slightly less internal padding */
  .hw-card { padding: 20px; }

  /* Section padding floor */
  .hw-section { padding: 44px 0; }
  .hw-section--tight { padding: 32px 0; }

  /* Footer — stack legal/copyright vertically below 2-col footer */
  .hw-footer-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  /* Eyebrows / kickers slightly smaller */
  .hw-eyebrow, .hw-kicker { font-size: 11.5px; }

  /* Long code/pre blocks should scroll horizontally rather than break layout */
  pre, code, .hw-code-block {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  /* SVG diagrams inside narrow containers — guard against horizontal overflow */
  svg { max-width: 100%; height: auto; }
}

/* ---- 480px and below: narrow phones ---- */
@media (max-width: 480px) {
  .hw-shell { padding: 0 16px; }

  /* Footer goes single-column at the narrowest */
  .hw-footer-cols { grid-template-columns: 1fr !important; gap: 28px !important; }

  /* Hero-style display headings — let clamp do most of the work but force a tighter floor */
  .hw-display--xxl { font-size: clamp(32px, 9vw, 44px); line-height: 1.1; }
  .hw-display--xl  { font-size: clamp(28px, 8vw, 38px); line-height: 1.12; }
  .hw-display--lg  { font-size: clamp(24px, 7vw, 32px); line-height: 1.18; }

  /* Subhead shrink to match */
  .hw-subhead { font-size: 16px; line-height: 1.55; }

  /* Cards even tighter */
  .hw-card { padding: 18px; border-radius: 8px; }
  .hw-pricing-card { padding: 22px !important; }

  /* Buttons easily tappable, full-width-feeling */
  .hw-btn { width: 100%; justify-content: center; }
  /* But don't force-stretch the inline arrow-link button */
  .hw-btn--ghost { width: auto; }
}
