/* ---------------------------------------------------------------
   Tier Cards (PricingThree), la sección de precios de Scrolltide
   (sep-2026), portada sin React para Programas y Matrícula del sitio
   Marca. Es la plantilla tal cual: el mismo lienzo de 1600x900, las
   mismas capas de luz y las mismas tarjetas de vidrio. El azul
   profundo del original ya es el navy de la marca, así que no se tocó.

   Lo que cambió, y nada más:
   - SectionFrame es CSS más un ResizeObserver (tier-cards.js).
   - El logo es el rombo Tesla y la ficha de «cerrar», que no hacía
     nada, lleva de vuelta al inicio.
   - Bajo 1024 px el lienzo se suelta y las tarjetas se apilan: escalado
     entero, en un celular el texto quedaría en 4 px (la plantilla lo
     dice: «give narrow screens a different treatment»).
   - Todo va dentro de .tier, así .frame y compañía no pisan al sitio.
--------------------------------------------------------------- */

/* ---------- SectionFrame ---------- */

.tier .frame {
  --s: 1;
  position: relative;
  width: 100%;
  /* Height comes from the design canvas's own ratio, so the block reserves the
     right space before any JavaScript runs. */
  aspect-ratio: 1600 / 900;
  overflow: hidden;
  background: #01040a;
}

.tier .frame__canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 1600px;
  height: 900px;
  /* Top-left rather than center: the canvas is scaled down from the container's
     own origin, so no translate is needed to keep it registered to the corner. */
  transform-origin: top left;
  transform: scale(var(--s));
  will-change: transform;
}

.tier :where(.frame),
.tier :where(.frame) *,
.tier :where(.frame) *::before,
.tier :where(.frame) *::after {
  box-sizing: border-box;
}

.tier :where(.frame) button,
.tier :where(.frame) input {
  font: inherit;
  color: inherit;
}

.tier p { margin: 0; }

/* ---------------------------------------------------------------
   PricingThree — glass pricing over a blue orb.
   Authored on the 1600x900 canvas.
--------------------------------------------------------------- */

.tier .p3 {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #01040a;
  color: #fff;
  font-family: "Inter", system-ui, sans-serif;
  isolation: isolate;
  line-height: normal;
}

/* ---------- atmosphere ----------
   A dark navy sphere rising from the bottom edge with a bright blue
   crescent on its upper-left, plus a wide bloom behind it. */

.tier .p3__haze {
  position: absolute;
  top: -260px;
  left: -180px;
  width: 1100px;
  height: 900px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(28, 84, 186, 0.3) 0%, rgba(14, 44, 104, 0.16) 44%, rgba(0, 0, 0, 0) 72%);
  filter: blur(30px);
}

.tier .p3__orbBloom {
  position: absolute;
  left: 50%;
  top: 300px;
  width: 1500px;
  height: 1100px;
  transform: translateX(-48%);
  background: radial-gradient(50% 50% at 50% 50%, rgba(46, 132, 246, 0.5) 0%, rgba(24, 82, 186, 0.26) 34%, rgba(10, 36, 92, 0.12) 56%, rgba(0, 0, 0, 0) 74%);
  filter: blur(70px);
}

.tier .p3__orb {
  position: absolute;
  left: 50%;
  top: 372px;
  width: 1140px;
  height: 1140px;
  transform: translateX(-46%);
  border-radius: 50%;
  background:
    radial-gradient(38% 34% at 30% 24%, rgba(126, 190, 255, 0.55) 0%, rgba(126, 190, 255, 0) 68%),
    radial-gradient(circle at 44% 30%, #2f7ce6 0%, #1a51b0 14%, #0e2f72 32%, #071a42 52%, #03091c 74%, #01050f 100%);
  box-shadow: 0 0 180px rgba(38, 116, 232, 0.35);
}

.tier .p3__bokeh {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #7fc0ff 0%, #2c72d8 45%, rgba(20, 60, 140, 0) 78%);
  filter: blur(1.5px);
}

.tier .p3__bokeh--a { top: 176px; left: 1288px; width: 34px; height: 34px; opacity: 0.9; }
.tier .p3__bokeh--b { top: 236px; left: 1372px; width: 22px; height: 22px; opacity: 0.75; }

.tier .p3__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 60%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.6) 78%, rgba(0, 0, 0, 0.95) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0) 26%);
}

.tier .p3__grain {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  mix-blend-mode: overlay;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- oversized type behind the cards ---------- */

.tier .p3__watermark {
  position: absolute;
  top: 74px;
  left: 196px;
  z-index: 1;
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 212px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.035em;
  white-space: nowrap;
  color: rgba(86, 148, 236, 0.26);
  user-select: none;
}

.tier .p3__brandline {
  position: absolute;
  top: 96px;
  left: 940px;
  z-index: 2;
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 62px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 6px 40px rgba(0, 0, 0, 0.6);
  user-select: none;
}

/* ---------- nav ---------- */

.tier .p3__logo {
  position: absolute;
  top: 46px;
  left: 66px;
  z-index: 5;
  display: block;
  width: 40px;
  color: #fff;
}

.tier .p3__logo img { width: 100%; height: auto; display: block; }

.tier .p3__nav {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 5px 5px 5px 5px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 16, 30, 0.55);
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tier .p3__close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #d9dde4;
  color: #10141c;
  cursor: pointer;
  transition: background 0.18s ease;
}

.tier .p3__close:hover { background: #fff; }
.tier .p3__close svg { width: 18px; height: 18px; }

.tier .p3__links {
  display: flex;
  align-items: center;
  gap: 26px;
  margin: 0 14px;
  padding: 0;
  list-style: none;
}

.tier .p3__link {
  position: relative;
  display: inline-block;
  padding: 6px 0 10px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.008em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s ease;
}

.tier .p3__link:hover { color: #fff; }
.tier .p3__link[data-active="true"] { color: #fff; }

.tier .p3__link[data-active="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.75);
}

.tier .p3__download {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 26px;
  border-radius: 999px;
  background: #fff;
  color: #0b0f18;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.012em;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s ease, transform 0.18s ease;
}

.tier .p3__download:hover { background: #e6e9ee; transform: translateY(-1px); }

/* ---------- plan cards ---------- */

.tier .p3__plans {
  position: absolute;
  top: 235px;
  left: 157px;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, 428px);
  gap: 17px;
}

.tier .p3__card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 436px;
  padding: 28px 28px 26px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.045) 34%, rgba(255, 255, 255, 0.02) 100%);
  backdrop-filter: blur(26px);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

/* the leftmost card sits off the orb, so it reads darkest;
   the rightmost sits on the bright rim and picks up blue */
.tier .p3__card[data-plan="free"] {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.075) 0%, rgba(255, 255, 255, 0.03) 40%, rgba(255, 255, 255, 0.012) 100%);
  border-color: rgba(255, 255, 255, 0.1);
}

.tier .p3__card[data-plan="pro"] {
  background: linear-gradient(160deg, rgba(150, 200, 255, 0.16) 0%, rgba(90, 150, 235, 0.075) 42%, rgba(40, 90, 180, 0.035) 100%);
  border-color: rgba(180, 214, 255, 0.24);
}

.tier .p3__cardName {
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.82);
}

.tier .p3__price {
  margin: 6px 0 0;
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 36px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #fff;
}

.tier .p3__period {
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.86);
}

.tier .p3__blurb {
  margin: 16px 0 0;
  max-width: 300px;
  font-size: 12.5px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  color: rgba(255, 255, 255, 0.55);
}

.tier .p3__features {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.tier .p3__feature {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 13px;
  letter-spacing: -0.005em;
  color: rgba(255, 255, 255, 0.9);
}

.tier .p3__check { flex: 0 0 auto; width: 19px; height: 19px; }

.tier .p3__choose {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: auto auto 0;
  width: 194px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #0b0f18;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.012em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.tier .p3__choose:hover { background: #e6e9ee; transform: translateY(-1px); }

/* ---------- billing toggle ---------- */

.tier .p3__billing {
  position: absolute;
  top: 706px;
  left: 157px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 16px;
}

.tier .p3__toggle {
  position: relative;
  width: 66px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
}

.tier .p3__knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #0b1220;
  transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}

.tier .p3__toggle[data-on="true"] .p3__knob { transform: translateX(32px); }

.tier .p3__billingLabel {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #fff;
}

/* ---------- next-section peek ---------- */

.tier .p3__peek {
  position: absolute;
  left: 157px;
  right: 157px;
  top: 838px;
  height: 120px;
  z-index: 3;
  border-radius: 30px 30px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 100%);
  backdrop-filter: blur(20px);
}

/* ---------- agregado: nota al pie y pantallas angostas ---------- */

.tier .p3__nota {
  position: absolute;
  top: 712px;
  left: 470px;
  right: 157px;
  z-index: 3;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.62);
}

.tier .p3--cambia { animation: p3-cambia 0.32s ease-out; }
@keyframes p3-cambia { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tier .p3--cambia { animation: none; } }

@media (max-width: 1023px) {
  .tier .frame { aspect-ratio: auto; }
  .tier .frame__canvas { position: relative; width: 100%; height: auto; transform: none; }
  .tier .p3 { height: auto; padding: 36px 18px 40px; display: flex; flex-direction: column; gap: 18px; }
  .tier .p3__nav, .tier .p3__logo, .tier .p3__peek, .tier .p3__bokeh { display: none; }
  .tier .p3__watermark { position: relative; top: auto; left: auto; font-size: clamp(64px, 20vw, 150px); margin-bottom: -0.55em; }
  .tier .p3__brandline { position: relative; top: auto; left: auto; font-size: clamp(30px, 8vw, 52px); white-space: normal; }
  .tier .p3__plans { position: relative; top: auto; left: auto; grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .tier .p3__card { height: auto; min-height: 0; }
  .tier .p3__choose { margin-top: 22px; }
  .tier .p3__billing { position: relative; top: auto; left: auto; order: 1; }
  .tier .p3__plans { order: 2; }
  .tier .p3__nota { position: relative; top: auto; left: auto; right: auto; order: 3; }
  .tier .p3__orb { top: 60%; }
}
@media (min-width: 700px) and (max-width: 1023px) {
  .tier .p3__plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
