/* The About page's Editions and comparison table (index.html #editions,
   #compare). Same house style as about.css: white cards on the tint, one warm
   colour for Pro, motion that settles without overshoot, and with reduced
   motion everything is simply there. */

.title-soft {
  color: var(--ink-3);
}

/* ---- Monthly or yearly: a thumb that slides under the choice ----------------------- */
.period {
  position: relative;
  display: inline-grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  margin-top: 36px;
  padding: 4px;
  border-radius: 999px;
  background: var(--card-2);
  box-shadow: inset 0 0 0 1px var(--line);
}

.period button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
  transition: color 200ms ease;
}

.period button[aria-checked="true"] {
  color: var(--ink);
}

.period button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.period-save {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(228, 87, 46, 0.12);
  color: var(--warm);
  font-size: 0.75rem;
  font-weight: 600;
}

.period-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: var(--bg);
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.08), 0 4px 14px rgba(17, 17, 19, 0.08);
  transition: transform 460ms var(--settle);
}

.period[data-on="year"] .period-thumb {
  transform: translateX(100%);
}

/* ---- The four editions ---------------------------------------------------------------- */
.eds {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
  margin-top: 28px;
}

/* One transition list for coming into view (opacity and blur wait their turn)
   and for the hover lift (at once). */
.ed {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px 24px 28px;
  border-radius: 24px;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line);
  overflow: hidden;
  transition: opacity 900ms var(--settle) var(--delay, 0ms), transform 600ms var(--settle), filter 900ms var(--settle) var(--delay, 0ms), box-shadow 500ms var(--settle);
}

@media (hover: hover) and (pointer: fine) {
  .ed:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 0 1px var(--line), 0 24px 54px rgba(17, 17, 19, 0.09);
  }
}

/* Pro: a warm ring that slowly turns round the card. */
@property --ring {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.ed-pick {
  box-shadow: 0 18px 50px rgba(17, 17, 19, 0.1);
}

.ed-pick::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1.5px;
  border-radius: inherit;
  background: conic-gradient(from var(--ring), var(--warm), var(--warm-2) 18%, rgba(17, 17, 19, 0.1) 34%, rgba(17, 17, 19, 0.1) 66%, var(--warm-2) 82%, var(--warm));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: ed-ring 8s linear infinite;
  pointer-events: none;
}

@keyframes ed-ring {
  to {
    --ring: 360deg;
  }
}

.is-paused .ed-pick::before {
  animation-play-state: paused;
}

.ed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ed-head h3 {
  font-size: 1.375rem;
  font-weight: 620;
  letter-spacing: -0.02em;
}

.ed-tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.ed-tag-warm {
  background: rgba(228, 87, 46, 0.12);
  color: var(--warm);
}

.ed-pitch {
  min-height: 4.5em;
  margin-top: 10px;
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.ed-price {
  display: flex;
  align-items: baseline;
  margin-top: 14px;
}

.ed-cur {
  align-self: flex-start;
  margin-top: 0.3em;
  font-size: 1.25rem;
  font-weight: 560;
}

.ed-price b {
  font-size: 3rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.ed-unit {
  margin-left: 8px;
  color: var(--ink-3);
  font-size: 0.9375rem;
}

.ed-sub {
  min-height: 1.45em;
  margin-top: 6px;
  color: var(--ink-3);
  font-size: 0.8125rem;
}

.ed-sub.is-swap,
.ed-unit.is-swap {
  animation: ed-swap 460ms var(--settle);
}

@keyframes ed-swap {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}

.ed-cta {
  width: 100%;
  height: 44px;
  margin-top: 20px;
}

.ed-cta-note {
  margin-top: 10px;
  color: var(--ink-3);
  font-size: 0.75rem;
  line-height: 1.45;
}

.ed-list {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  font-size: 0.9375rem;
}

.ed-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.4;
}

.ed-plus {
  color: var(--ink-3);
  font-size: 0.8125rem;
  font-weight: 600;
}

.ck {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  fill: none;
  stroke: var(--good);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ed-pick .ck {
  stroke: var(--warm);
}

/* ---- What paying changes: Free above, paid below, joined by a line that draws ------- */
.shift-title {
  margin-top: 72px;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.shift {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.shift-item {
  padding: 22px;
  border-radius: 20px;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line);
}

.shift-k {
  font-weight: 620;
  letter-spacing: -0.01em;
}

.shift-free,
.shift-paid {
  display: grid;
  gap: 4px;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.shift-free {
  margin-top: 14px;
  padding-bottom: 14px;
  color: var(--ink-3);
}

.shift-paid {
  position: relative;
  padding-top: 14px;
  border-top: 1px dashed var(--line-2);
  color: var(--ink);
}

.shift-paid::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1.5px;
  background: linear-gradient(90deg, var(--warm), var(--warm-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1000ms var(--settle) 350ms;
}

.shift-item.is-seen .shift-paid::before,
html:not(.js-ok) .shift-paid::before {
  transform: scaleX(1);
}

.shift-free span,
.shift-paid span {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.shift-paid span {
  color: var(--warm);
}

/* ---- Familiar from the first task: the section's one dark note ---------------------- */
.familiar {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-top: 40px;
  padding: 26px 28px;
  border-radius: 22px;
  background: var(--dark);
  color: var(--on-dark);
}

.familiar-mark {
  flex: none;
  box-sizing: content-box;
  width: 22px;
  height: 22px;
  padding: 9px;
  border-radius: 12px;
  background: var(--dark-3);
  fill: none;
  stroke: var(--on-dark);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.familiar-k {
  font-size: 1.0625rem;
  font-weight: 620;
}

.familiar-t {
  max-width: 780px;
  margin-top: 6px;
  color: var(--on-dark-2);
}

.familiar-fine {
  margin-top: 12px;
  color: var(--on-dark-3);
  font-size: 0.8125rem;
}

.eds-fine {
  max-width: 880px;
  margin-top: 28px;
  color: var(--ink-3);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.eds-fine a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.eds-fine a.eds-compare {
  margin-left: 4px;
  color: var(--ink);
  font-weight: 600;
}

/* ---- Compare: every edition, side by side ---------------------------------------------- */
.compare {
  padding-top: 24px;
}

.cmp-wrap {
  margin-top: 40px;
  border-radius: 24px;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line);
  overflow-x: auto;
}

.cmp {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.cmp col.cmp-feat {
  width: 27%;
}

.cmp col.cmp-pick {
  background: rgba(228, 87, 46, 0.045);
}

.cmp th,
.cmp td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.cmp thead th {
  padding: 24px 18px 18px;
  vertical-align: bottom;
}

.cmp-name {
  display: block;
  font-size: 1.0625rem;
  font-weight: 620;
}

.cmp-price {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.cmp-price b {
  font-weight: 600;
}

.cmp tbody th[scope="row"] {
  color: var(--ink);
  font-weight: 500;
  text-align: left;
}

.cmp-group th {
  padding-top: 28px;
  border-bottom-color: var(--line-2);
  color: var(--ink-3);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

/* The group's name stays in view while a narrow table scrolls sideways. */
.cmp-group th span {
  position: sticky;
  left: 18px;
}

.cmp td {
  color: var(--ink-2);
}

.cmp td.y .ck {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin: 0;
  vertical-align: middle;
}

.cmp td.y:nth-child(3) .ck {
  stroke: var(--warm);
}

.cmp .no {
  color: var(--ink-3);
  opacity: 0.6;
}

.cmp tbody:last-of-type tr:last-child > * {
  border-bottom: 0;
}

@media (hover: hover) and (pointer: fine) {
  .cmp tbody tr:not(.cmp-group):hover {
    background: var(--bg-2);
  }
}

.cmp-fine {
  max-width: none;
}

.cmp-actions {
  margin-top: 28px;
}

/* ---- Motion: ticks draw themselves, rows arrive in turn, once each is in view.
   Without scripting, or with less motion, everything is simply there. -------------- */
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .ed-list li {
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 500ms var(--settle), transform 600ms var(--settle);
    transition-delay: calc(380ms + var(--i, 0) * 65ms);
  }

  .ed-list .ck path,
  .cmp td.y .ck path {
    stroke-dasharray: 14;
    stroke-dashoffset: 14;
    transition: stroke-dashoffset 560ms var(--settle);
  }

  .ed-list .ck path {
    transition-delay: calc(460ms + var(--i, 0) * 65ms);
  }

  .ed.is-seen .ed-list li,
  html:not(.js-ok) .ed-list li {
    opacity: 1;
    transform: none;
  }

  .ed.is-seen .ed-list .ck path,
  .cmp-wrap.is-seen .cmp td.y .ck path,
  html:not(.js-ok) .ck path {
    stroke-dashoffset: 0;
  }

  .cmp tbody tr {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 600ms var(--settle), transform 700ms var(--settle);
    transition-delay: calc(180ms + var(--r, 0) * 32ms);
  }

  .cmp td.y .ck path {
    transition-delay: calc(420ms + var(--r, 0) * 32ms);
  }

  .cmp-wrap.is-seen .cmp tbody tr,
  html:not(.js-ok) .cmp tbody tr {
    opacity: 1;
    transform: none;
  }
}

@media (scripting: enabled) {
  /* A big surface: it rises and fades, without a blur to redraw. */
  .cmp-wrap[data-reveal] {
    filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ed-pick::before,
  .ed-sub.is-swap,
  .ed-unit.is-swap {
    animation: none;
  }
}

/* ---- Narrow screens ---------------------------------------------------------------- */
@media (max-width: 1100px) {
  .eds,
  .shift {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .eds,
  .shift {
    grid-template-columns: minmax(0, 1fr);
  }

  .ed-pitch {
    min-height: 0;
  }

  .period {
    display: grid;
    width: 100%;
  }

  .period button {
    padding: 0 10px;
  }

  .familiar {
    flex-direction: column;
    padding: 24px;
  }

  /* The table scrolls sideways; the feature names stay in place. */
  .cmp tbody th[scope="row"],
  .cmp thead th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--bg);
  }
}
