/* =========================================================
   Political Idioms — reset, typography, layout primitives
   ========================================================= */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(0.98rem, 0.94rem + 0.2vw, 1.06rem);
  line-height: 1.65;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  cursor: default;
}

/* Pushes the footer to the bottom of the viewport even while a page's
   content is still loading (e.g. the account dashboard's initial fetch). */
body > main { flex: 1 0 auto; }

/* Headings/copy stay selectable, they just don't flash the I-beam
   cursor on hover; links, buttons and form fields keep their own cursor. */
h1, h2, h3, h4, h5, h6, p, span, li { cursor: inherit; }


/* ---------------------------------------------------------
   Iridescent page wash
   A single fixed layer of blurred colour fields. No canvas, no
   JS, no animation — it costs one composited layer and nothing else.
   --------------------------------------------------------- */
.pi-wash {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(58vw 48vw at 82% -8%, rgba(184, 166, 242, 0.5), transparent 62%),
    radial-gradient(46vw 42vw at 6% 6%, rgba(245, 168, 200, 0.42), transparent 64%),
    radial-gradient(52vw 44vw at 96% 46%, rgba(158, 200, 245, 0.34), transparent 66%),
    radial-gradient(50vw 46vw at 12% 78%, rgba(163, 228, 208, 0.3), transparent 68%),
    radial-gradient(40vw 36vw at 60% 104%, rgba(255, 203, 164, 0.34), transparent 66%);
}

/* A soft paper vignette so the wash never fights the copy. */
.pi-wash::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(246, 244, 241, 0.28), rgba(246, 244, 241, 0.86) 62%, var(--bg));
}

img, svg, canvas, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
p { margin: 0; }
ul, ol { list-style: none; margin: 0; padding: 0; }

/* Components below set display on the same elements JS toggles [hidden] on,
   which would otherwise win over the user-agent rule. */
[hidden] { display: none !important; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--text);
  text-wrap: balance;
}

::selection { background: var(--iris-lilac); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------------------------------------------------------
   Skip link
   --------------------------------------------------------- */
.pi-skip {
  position: absolute;
  left: 0.75rem;
  top: -100px;
  z-index: 3000;
  padding: 0.7rem 1.1rem;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  color: var(--text);
  font-weight: 600;
  transition: top 0.25s var(--ease-out);
}

.pi-skip:focus { top: 0.75rem; }

/* ---------------------------------------------------------
   Layout
   --------------------------------------------------------- */
.pi-section {
  position: relative;
  width: var(--shell);
  margin-inline: auto;
  padding: clamp(4.5rem, 10vw, 8.5rem) 0;
}

.pi-section--tight { padding: clamp(2.6rem, 6vw, 4.5rem) 0; }

.pi-section--alt::before {
  content: '';
  position: absolute;
  inset: 0 calc(50% - 50vw);
  background: rgba(255, 255, 255, 0.62);
  border-block: 1px solid var(--line-soft);
  z-index: -1;
}

.pi-section__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: clamp(1.4rem, 4vw, 4rem);
  align-items: end;
  margin-bottom: clamp(2.4rem, 5vw, 3.8rem);
}

.pi-section__head h1,
.pi-section__head h2 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  max-width: 17ch;
}

.pi-section__desc {
  color: var(--text-2);
  max-width: 54ch;
  font-size: 1.01rem;
}

.pi-prose { max-width: 68ch; color: var(--text-2); }
.pi-prose h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin: 2.6rem 0 0.9rem; }
.pi-prose h3 { font-size: 1.14rem; margin: 1.8rem 0 0.6rem; }
.pi-prose p { margin-bottom: 1rem; }
.pi-prose ul { margin: 0 0 1rem; padding-left: 1.1rem; list-style: disc; }
.pi-prose li { margin-bottom: 0.4rem; }
.pi-prose a { color: var(--violet); text-decoration: underline; text-underline-offset: 3px; }
.pi-prose strong { color: var(--text); font-weight: 600; }

/* Long-form legal and policy pages sit on a raised sheet. */
.pi-sheet {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  padding: clamp(1.6rem, 5vw, 3.6rem);
}

/* ---------------------------------------------------------
   Type utilities
   --------------------------------------------------------- */
.pi-grad {
  color: var(--violet);
  font-style: normal;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .pi-grad {
    background-image: var(--grad-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  .pi-grad--warm { background-image: var(--grad-warm); }
}

.pi-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 1.1rem;
}

.pi-eyebrow::before {
  content: '';
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.pi-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.66rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
}

.pi-chip--accent { color: var(--violet); border-color: rgba(107, 79, 216, 0.32); background: rgba(107, 79, 216, 0.07); }
.pi-chip--warm { color: var(--amber); border-color: rgba(180, 113, 29, 0.32); background: rgba(180, 113, 29, 0.07); }

.pi-sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */
.pi-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.92rem 1.7rem;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.94rem;
  letter-spacing: -0.01em;
  overflow: hidden;
  isolation: isolate;
  text-align: center;
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s var(--ease-out), border-color 0.3s, background 0.3s;
}

.pi-btn--primary {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-md);
}

/* The iridescent sweep sits under the label and brightens on hover,
   which keeps the resting state readable at AA. */
.pi-btn--primary::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--grad-iris);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}

.pi-btn--primary::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, 0.45) 48%, transparent 64%);
  transform: translateX(-130%);
  transition: transform 0.75s var(--ease-out);
}

.pi-btn--primary:hover::after { transform: translateX(130%); }
.pi-btn--primary:hover { box-shadow: var(--shadow-lg); }

.pi-btn--iris {
  background: var(--grad-iris);
  color: var(--ink);
  box-shadow: var(--shadow-md);
}

.pi-btn--iris:hover { box-shadow: var(--shadow-lg); }

.pi-btn--ghost {
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
}

.pi-btn--ghost:hover {
  border-color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.pi-btn--block { width: 100%; }
.pi-btn--sm { padding: 0.62rem 1.15rem; font-size: 0.85rem; }

.pi-btn[disabled],
.pi-btn[aria-disabled='true'] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

.pi-btn span { position: relative; z-index: 2; }
.pi-btn__arrow { position: relative; z-index: 2; transition: transform 0.4s var(--ease-spring); }
.pi-btn:hover .pi-btn__arrow { transform: translateX(4px); }

/* ---------------------------------------------------------
   Forms
   --------------------------------------------------------- */
.pi-field { display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 1.1rem; }

.pi-field label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
}

.pi-input,
.pi-textarea,
.pi-select {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition: border-color 0.25s, background 0.25s;
}

.pi-textarea { min-height: 150px; resize: vertical; }

.pi-input:focus,
.pi-textarea:focus,
.pi-select:focus {
  border-color: var(--violet);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(107, 79, 216, 0.14);
  outline: none;
}

.pi-input::placeholder,
.pi-textarea::placeholder { color: var(--text-3); }

.pi-form__note { font-size: 0.82rem; color: var(--text-3); }

.pi-alert {
  padding: 0.85rem 1.05rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  font-size: 0.9rem;
  margin-bottom: 1.1rem;
}

.pi-alert--ok { border-color: rgba(20, 125, 77, 0.35); color: var(--ok); background: rgba(20, 125, 77, 0.08); }
.pi-alert--error { border-color: rgba(198, 47, 57, 0.35); color: var(--danger); background: rgba(198, 47, 57, 0.07); }
.pi-alert[hidden] { display: none; }

/* Honeypot — hidden from humans, visible to naive bots. */
.pi-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
@media (max-width: 860px) {
  .pi-section__head { grid-template-columns: 1fr; align-items: start; }
}
