/*
 * Team Manic membership: the board of three plans (home page and
 * /team/membership.html) and the membership page's own sections.
 *
 * styles.css is the compiled design and is left alone, so everything new
 * lives here under .tm-*. Colours, the brush type and the square 2px lines
 * are the site's own.
 *
 * The idea of the board: the plans differ in one thing, how much of Ryan you
 * get. So the card's size and colour say it before the words do. Rocket Fuel
 * is the big, full-yellow card; Defibrillator is paper; Decaf is drained to
 * an outline.
 */

.tm {
  --tm-ink: #222;
  --tm-canvas: #ffd701;
  --tm-paper: #fff7da;
  --tm-bright: #fffdf5;
  --tm-error: #b3261e;
  --tm-line: 2px;
  --tm-display: "Knewave", system-ui, sans-serif;
  --tm-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.tm [hidden] { display: none !important; }
/* The focus ring takes the colour that shows on the surface it sits on. */
.tm :focus-visible { outline: 3px solid var(--tm-focus, var(--tm-ink)); outline-offset: 3px; }
.tm-light, .tm-tier--top, .tm-tier--mid { --tm-focus: var(--tm-ink); }
.tm-band, .tm-tier--base { --tm-focus: var(--tm-canvas); }

.tm-display,
.tm-title,
.tm-name,
.tm-amount {
  font-family: var(--tm-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0;
}

.tm-wrap { max-width: 1400px; margin-inline: auto; padding: 3.5rem 1rem; }
@media (min-width: 768px) { .tm-wrap { padding: 7rem 2.5rem; } }

.tm-kicker {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.tm-kicker::before { content: "✦"; font-size: 1.3em; line-height: 1; }

.tm-title { font-size: clamp(2.75rem, 7.6vw, 6.75rem); line-height: 0.88; text-wrap: balance; }
.tm-lead { font-size: 1.0625rem; line-height: 1.5; max-width: 34rem; }
@media (min-width: 768px) { .tm-lead { font-size: 1.1875rem; } }
.tm-lead strong { font-weight: 700; }

/* ---- The dark band the board sits in ------------------------------------ */
.tm-band { background: var(--tm-ink); color: var(--tm-paper); }
.tm-band .tm-kicker { color: var(--tm-canvas); }
.tm-band .tm-title { color: var(--tm-canvas); margin-top: 1rem; }

.tm-head { display: grid; gap: 1.5rem; }
@media (min-width: 1024px) {
  .tm-head { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; gap: 4rem; }
  .tm-head .tm-lead { padding-bottom: 0.5rem; }
}

/* ---- The board ---------------------------------------------------------- */
.tm-board { container-type: inline-size; margin-top: 2.5rem; }
@media (min-width: 768px) { .tm-board { margin-top: 4rem; } }

.tm-tiers { display: grid; gap: var(--tm-line); }

.tm-tier {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
  padding: 1.5rem 1.25rem 1.5rem;
}
.tm-tier--top { background: var(--tm-canvas); color: var(--tm-ink); }
.tm-tier--mid { background: var(--tm-paper); color: var(--tm-ink); }
.tm-tier--base { background: var(--tm-ink); color: var(--tm-paper); box-shadow: inset 0 0 0 var(--tm-line) var(--tm-canvas); }

.tm-chip {
  display: inline-flex;
  align-items: center;
  border: var(--tm-line) solid currentColor;
  padding: 0.4em 0.75em;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}
.tm-tier--top .tm-chip { background: var(--tm-ink); border-color: var(--tm-ink); color: var(--tm-canvas); }
.tm-tier--base .tm-chip { color: var(--tm-canvas); }

.tm-name { margin-top: 1.1rem; font-size: clamp(2.1rem, 11.6cqi, 3.5rem); line-height: 0.9; }
.tm-tier--top .tm-name { font-size: clamp(3.9rem, 24cqi, 7rem); line-height: 0.8; }
.tm-tier--base .tm-name { color: var(--tm-canvas); }

.tm-tagline { margin-top: 0.9rem; font-size: 1.125rem; font-weight: 700; line-height: 1.25; }
.tm-tier--top .tm-tagline { font-size: 1.3125rem; }
.tm-pitch { font-size: 1rem; line-height: 1.5; max-width: 30rem; }
.tm-tier--base .tm-pitch { color: rgba(255, 247, 218, 0.82); }

/* The sparkle off the hat, on the top plan only. */
.tm-spark { position: absolute; top: 1rem; right: 1rem; width: 3.25rem; height: 3.25rem; pointer-events: none; }
.tm-spark svg { display: block; width: 100%; height: 100%; overflow: visible; }
@media (prefers-reduced-motion: no-preference) {
  .tm-spark svg { animation: tm-wobble 5s ease-in-out infinite; }
}
@keyframes tm-wobble {
  0%, 100% { transform: rotate(-9deg); }
  50% { transform: rotate(9deg); }
}

/* Strength of Ryan */
.tm-strength-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.tm-strength-value { font-variant-numeric: tabular-nums; }
.tm-bar { margin-top: 0.5rem; height: 22px; border: var(--tm-line) solid var(--tm-ink); background: var(--tm-canvas); padding: 2px; }
.tm-bar > i { display: block; height: 100%; background: var(--tm-ink); transform-origin: left center; }
.tm-tier--top .tm-bar { height: 28px; background: var(--tm-paper); }
.tm-tier--base .tm-bar { border-color: var(--tm-canvas); background: transparent; }
.tm-tier--base .tm-bar > i { background: var(--tm-canvas); }

/* The bars fill the first time the board is seen. tiers.js arms this, so a
   page whose script never runs simply shows them full. */
@media (prefers-reduced-motion: no-preference) {
  .tm-tiers.is-armed .tm-bar > i { transform: scaleX(0); }
  .tm-tiers.is-armed.is-seen .tm-bar > i {
    transform: none;
    transition: transform 1.1s var(--tm-ease) calc(0.2s + var(--tm-i, 0) * 0.16s);
  }
}

/* Price and the way in */
.tm-buy { margin-top: auto; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 1.5rem; padding-top: 0.25rem; }
.tm-price { display: flex; align-items: baseline; gap: 0.5rem; white-space: nowrap; }
.tm-amount { font-size: clamp(2.5rem, 13cqi, 3.25rem); line-height: 0.85; }
.tm-tier--top .tm-amount { font-size: clamp(3.4rem, 19cqi, 5.5rem); }
.tm-per { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.tm-terms { flex-basis: 100%; font-size: 13px; line-height: 1.4; opacity: 0.8; }
.tm-terms b { font-weight: 700; }

.tm-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  border: var(--tm-line) solid var(--tm-ink);
  background: var(--tm-ink);
  color: var(--tm-canvas);
  padding: 0.85rem 1.35rem;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  border-radius: 0;
  transition: background-color 0.18s, color 0.18s, border-color 0.18s, transform 0.2s;
}
.tm-cta svg { width: 1.05em; height: 1.05em; flex: none; transition: transform 0.2s; }
.tm-cta[disabled] { opacity: 0.6; cursor: default; }
.tm-cta--big { padding: 1.1rem 1.6rem; font-size: 1rem; }
.tm-cta--line { background: transparent; color: var(--tm-ink); }
.tm-tier--base .tm-cta { background: transparent; border-color: var(--tm-canvas); color: var(--tm-canvas); }
@media (hover: hover) and (pointer: fine) {
  .tm-cta:hover { background: var(--tm-paper); color: var(--tm-ink); }
  .tm-tier--mid .tm-cta:hover, .tm-light .tm-cta:hover { background: var(--tm-canvas); }
  .tm-cta--line:hover, .tm-light .tm-cta--line:hover { background: var(--tm-ink); color: var(--tm-canvas); }
  .tm-tier--base .tm-cta:hover { background: var(--tm-canvas); color: var(--tm-ink); }
  .tm-cta:hover svg { transform: translate(2px, -2px); }
  @media (prefers-reduced-motion: no-preference) {
    .tm-cta:hover { transform: translateY(-2px); }
  }
}
/* On a phone the button is the full width of the card: an easy target. */
.tm-buy > .tm-cta { flex: 1 1 100%; }

/* Side by side once the board is wide enough: the top plan takes the left
   seven twelfths and the full height, the other two stack beside it. */
@container (min-width: 880px) {
  .tm-tiers { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .tm-tier { padding: 2.25rem 2.25rem 2rem; gap: 1.75rem; }
  .tm-tier--top { grid-row: span 2; padding: 3rem 3rem 2.75rem; gap: 2.25rem; }
  .tm-name { font-size: clamp(2.5rem, 4.3cqi, 3.75rem); }
  .tm-tier--top .tm-name { font-size: clamp(6rem, 12.4cqi, 10.5rem); }
  .tm-tier--top .tm-tagline { font-size: 1.625rem; margin-top: 2rem; }
  .tm-tier--top .tm-pitch { font-size: 1.125rem; max-width: 32rem; }
  .tm-amount { font-size: clamp(2.5rem, 3.9cqi, 3.5rem); }
  .tm-tier--top .tm-amount { font-size: clamp(4.5rem, 7.4cqi, 6.25rem); }
  .tm-spark { top: 1.5rem; right: 1.5rem; width: clamp(3.5rem, 6.4cqi, 5.5rem); height: clamp(3.5rem, 6.4cqi, 5.5rem); }
  .tm-buy > .tm-cta { flex: 0 0 auto; }
  .tm-tier--top .tm-buy > .tm-cta { flex: 1 1 100%; padding-block: 1.35rem; font-size: 1.125rem; }
  .tm-tier--top .tm-buy { gap: 1.5rem; }
  /* A plan off sale: plain equal columns for what is left. */
  .tm-tiers.is-partial { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
  .tm-tiers.is-partial .tm-tier--top { grid-row: auto; }
}

/* The application form a card shows when its plan is sold by application
   (membership page only; team.js sends it). */
.tm-apply { flex-basis: 100%; }
.tm-form-label { display: block; margin-bottom: 0.5rem; font-size: 0.875rem; font-weight: 600; }
.tm-field { display: flex; gap: 0.5rem; }
.tm-input {
  display: block;
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
  border: var(--tm-line) solid var(--tm-ink);
  background: var(--tm-bright);
  color: var(--tm-ink);
  padding: 0.75rem;
  font: inherit;
  font-size: 1rem;
  border-radius: 0;
}
.tm-input::placeholder { color: rgba(34, 34, 34, 0.5); }
.tm-input[aria-invalid="true"] { border-color: var(--tm-error); }
textarea.tm-input { min-height: 8.5rem; resize: vertical; }
.tm-tier--base .tm-input { border-color: var(--tm-canvas); }
.tm-field .tm-cta { flex: none; }
.tm-form .msg { margin-top: 0.6rem; font-size: 0.875rem; font-weight: 600; }
.tm-form .msg:empty { display: none; }
.tm-form .msg.error { color: var(--tm-error); }
.tm-tier--base .tm-form .msg.error { color: #ffb4ab; }
.tm-form .done { font-size: 1rem; font-weight: 500; }
.tm-form .done b { display: block; margin-bottom: 0.25rem; font-family: var(--tm-display); font-size: 1.625rem; font-weight: 400; line-height: 1.1; text-transform: uppercase; }
.tm-privacy { margin-top: 0.6rem; font-size: 0.8125rem; opacity: 0.8; }
.tm-privacy a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.tm-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---- The terms, under the board ----------------------------------------- */
.tm-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 1.25rem; margin-top: 2.5rem; }
.tm-fact { border-top: var(--tm-line) solid var(--tm-canvas); padding-top: 0.9rem; }
.tm-fact dt { font-family: var(--tm-display); font-size: 1.375rem; line-height: 1; text-transform: uppercase; color: var(--tm-canvas); }
.tm-fact dd { margin-top: 0.5rem; font-size: 0.875rem; line-height: 1.45; color: rgba(255, 247, 218, 0.82); }
@media (min-width: 900px) {
  .tm-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.5rem; margin-top: 3.5rem; }
  .tm-fact dt { font-size: clamp(1.25rem, 1.85vw, 1.625rem); }
  .tm-fact dd { font-size: 0.9375rem; }
}

.tm-more { margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.5rem; font-size: 0.9375rem; }
.tm-more a { display: inline-flex; align-items: center; min-height: 2.75rem; gap: 0.4rem; color: var(--tm-canvas); font-weight: 700; text-transform: uppercase; letter-spacing: -0.005em; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.tm-more svg { width: 1em; height: 1em; }

/* ======================================================================== *
 * The membership page's own sections
 * ======================================================================== */

.tm-light { color: var(--tm-ink); }
.tm-section { border-bottom: var(--tm-line) solid var(--tm-ink); }
.tm-section--paper { background: var(--tm-paper); }

/* Hero */
.tm-hero .tm-wrap { padding-block: 2.5rem 3rem; }
.tm-hero-grid { display: grid; gap: 2rem; }
.tm-who { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 1.5rem; }
.tm-who img { width: 3.5rem; height: 3.5rem; border-radius: 9999px; object-fit: cover; background: var(--tm-ink); flex: none; }
.tm-bubble { position: relative; display: inline-flex; align-items: center; border: var(--tm-line) solid var(--tm-ink); border-radius: 1rem; background: var(--tm-paper); padding: 0.5rem 1rem; font-size: 11px; font-weight: 700; letter-spacing: -0.01em; text-transform: uppercase; }
.tm-bubble::before, .tm-bubble::after { content: ""; position: absolute; top: 50%; translate: 0 -50%; width: 0; height: 0; border-style: solid; border-color: transparent; }
.tm-bubble::before { left: -9px; border-width: 8px 8px 8px 0; border-right-color: var(--tm-ink); }
.tm-bubble::after { left: -6px; border-width: 7px 7px 7px 0; border-right-color: var(--tm-paper); }
.tm-hero .tm-title { margin-top: 1rem; font-size: clamp(3.25rem, 14.5vw, 6rem); line-height: 0.84; }
.tm-hero-actions { margin-top: 1.75rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.tm-hero-hat { display: none; }
@media (min-width: 768px) {
  .tm-hero .tm-wrap { padding-block: 4rem 4.5rem; }
  .tm-hero .tm-title { font-size: clamp(4.75rem, 7.3vw, 6.75rem); text-wrap: wrap; }
  .tm-who img { width: 5rem; height: 5rem; }
}
@media (min-width: 1024px) {
  .tm-hero-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; gap: 3rem; }
  .tm-hero-side { padding-bottom: 0.75rem; }
  .tm-hero-hat { display: block; width: clamp(9rem, 14vw, 12.5rem); rotate: -12deg; margin: 0 0 2.5rem auto; }
  .tm-hero-hat img { display: block; width: 100%; height: auto; }
}

/* Section heads on the light sections */
.tm-split { display: grid; gap: 2.5rem; }
@media (min-width: 1024px) { .tm-split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 4rem; } }
.tm-h2 { font-family: var(--tm-display); font-weight: 400; text-transform: uppercase; font-size: clamp(2.25rem, 5.4vw, 4.5rem); line-height: 0.9; margin-top: 1rem; text-wrap: balance; }
.tm-split .tm-lead { margin-top: 1.5rem; }

/* What every member gets / how it works: numbered rows in one frame */
.tm-rows { border: var(--tm-line) solid var(--tm-ink); }
.tm-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.35rem 1rem; padding: 1.25rem 1rem; background: var(--tm-bright); }
.tm-row + .tm-row { border-top: var(--tm-line) solid var(--tm-ink); }
.tm-section--paper .tm-row { background: var(--tm-canvas); }
.tm-row-n { grid-row: span 2; font-family: var(--tm-display); font-size: 1.5rem; line-height: 1.1; width: 2rem; }
.tm-row h3 { font-family: var(--tm-display); font-weight: 400; text-transform: uppercase; font-size: 1.5rem; line-height: 1.05; }
.tm-row p { font-size: 1rem; line-height: 1.5; }
@media (min-width: 768px) {
  .tm-row { gap: 0.5rem 1.5rem; padding: 1.75rem 2rem; }
  .tm-row-n { font-size: 2rem; width: 2.75rem; }
  .tm-row h3 { font-size: 2.125rem; }
}

/* The record */
.tm-record { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--tm-line); border: var(--tm-line) solid var(--tm-ink); background: var(--tm-canvas); margin-top: 3rem; }
.tm-record > div { padding: 1.25rem 1rem; background: var(--tm-ink); color: var(--tm-paper); }
.tm-record dt { font-family: var(--tm-display); font-size: clamp(1.625rem, 3.6vw, 3.25rem); line-height: 0.9; color: var(--tm-canvas); text-transform: uppercase; white-space: nowrap; }
.tm-record dd { margin-top: 0.6rem; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
@media (min-width: 900px) {
  .tm-record { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 4.5rem; }
  .tm-record > div { padding: 2rem; }
}

/* Questions */
.tm-faq { border: var(--tm-line) solid var(--tm-ink); background: var(--tm-bright); }
.tm-faq details + details { border-top: var(--tm-line) solid var(--tm-ink); }
.tm-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem 1rem; font-size: 1.0625rem; font-weight: 700; line-height: 1.3; cursor: pointer; list-style: none; }
.tm-faq summary::-webkit-details-marker { display: none; }
.tm-faq summary:focus-visible { outline-color: currentColor; outline-offset: -6px; }
.tm-faq summary::after {
  content: "";
  flex: none;
  width: 1rem;
  height: 1rem;
  background:
    linear-gradient(currentColor, currentColor) center / 100% 3px no-repeat,
    linear-gradient(currentColor, currentColor) center / 3px 100% no-repeat;
  transition: rotate 0.25s var(--tm-ease);
}
.tm-faq details[open] summary::after { rotate: 45deg; }
.tm-faq details[open] summary { background: var(--tm-ink); color: var(--tm-canvas); }
.tm-faq .tm-answer { padding: 1.1rem 1rem 1.35rem; font-size: 1rem; line-height: 1.55; max-width: 44rem; }
.tm-faq .tm-answer a { text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
@media (hover: hover) and (pointer: fine) { .tm-faq details:not([open]) summary:hover { background: var(--tm-paper); } }
@media (min-width: 768px) {
  .tm-faq summary { padding: 1.4rem 2rem; font-size: 1.1875rem; }
  .tm-faq .tm-answer { padding: 1.35rem 2rem 1.75rem; }
}

/* The last ask, and the free tier beneath it */
.tm-final { text-align: left; }
.tm-final .tm-title { font-size: clamp(2.75rem, 8.4vw, 7.5rem); }
.tm-final .tm-lead { margin-top: 2rem; }
.tm-final-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }
/* On a phone the two buttons are full width and the longer one may wrap. */
@media (max-width: 479.98px) {
  .tm-final-actions .tm-cta { flex: 1 1 100%; max-width: 100%; white-space: normal; text-align: center; }
}
.tm-free { margin-top: 3.5rem; border-top: var(--tm-line) solid var(--tm-ink); padding-top: 1.5rem; max-width: 44rem; }
.tm-free-toggle { display: inline-flex; align-items: center; min-height: 2.75rem; gap: 0.5rem; padding: 0.5rem 0; text-align: left; border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 5px; }
.tm-free-panel { margin-top: 1rem; border: var(--tm-line) solid var(--tm-ink); background: var(--tm-paper); padding: 1.25rem 1rem; }
.tm-free-panel > p { font-size: 1rem; line-height: 1.5; }
.tm-free-panel > p + p { margin-top: 0.6rem; }
.tm-free-panel .tm-form { margin-top: 1.25rem; }
.tm-free-panel .tm-form-label { margin-top: 1rem; }
.tm-free-panel .tm-cta { width: 100%; margin-top: 1rem; }
@media (min-width: 768px) { .tm-free-panel { padding: 1.75rem 2rem; } }

/* The plain legal links the Team Manic pages carry above the footer. */
.tm-legal { display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin-top: 2.25rem; }
.tm-legal a { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; text-underline-offset: 4px; opacity: 0.75; }
.tm-legal a:hover, .tm-legal a:focus-visible { opacity: 1; text-decoration: underline; }
