@font-face {
  font-family: "Bowlby One SC";
  src: url("/fonts/bowlby-one-sc-latin.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("/fonts/dm-sans-500-700-latin.woff2") format("woff2");
  font-display: swap;
}

:root {
  color-scheme: light;
  --page: oklch(97% 0.009 278);
  --surface: oklch(99% 0.005 278);
  --surface-raised: oklch(99.5% 0.003 278);
  --ink: oklch(20% 0.025 264);
  --muted: oklch(45% 0.025 264);
  --line: oklch(89% 0.018 278);
  --lavender: oklch(94% 0.035 282);
  --lavender-soft: oklch(97% 0.02 282);
  --lavender-control: oklch(94% 0.035 275);
  --navy: oklch(23% 0.095 262);
  --accent: oklch(58% 0.2 270);
  --accent-hover: oklch(51% 0.2 270);
  --accent-ink: oklch(99% 0.005 278);
  --success: oklch(48% 0.15 149);
  --success-strong: oklch(40% 0.135 149);
  --success-soft: oklch(94% 0.055 149);
  --success-chip: oklch(89% 0.075 149);
  --success-control: oklch(91% 0.07 149);
  --error: oklch(50% 0.19 28);
  --focus: oklch(54% 0.2 270);
  --shadow: 0 1.5rem 4rem oklch(41% 0.04 270 / 0.09);
  --radius: 0.5rem;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  font-family: "DM Sans", "Segoe UI", sans-serif;
  font-kerning: normal;
}

:is(a, button, summary, [role="button"]):focus { outline: none !important; }

* { box-sizing: border-box; }

html { min-width: 18rem; }

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
  color: var(--ink);
  background: var(--page);
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: 0;
}

button,
a {
  font: inherit;
  letter-spacing: 0;
}

button { color: inherit; }

h1,
h2,
p { margin: 0; }

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  color: var(--surface);
  background: var(--ink);
  transform: translateY(-180%);
}

.skip-link:focus { transform: translateY(0); }

.account-nav {
  display: flex;
  align-items: center;
  min-height: 4.5rem;
  padding: max(0.75rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) 0.75rem max(1rem, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 2.625rem;
  height: 2.625rem;
  object-fit: contain;
}

.brand span { display: grid; }

.brand strong {
  font-family: "Bowlby One SC", "Arial Black", sans-serif;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.2;
}

.brand small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

main {
  min-height: calc(100vh - 4.5rem);
  padding: var(--space-lg) max(1rem, env(safe-area-inset-right)) var(--space-2xl) max(1rem, env(safe-area-inset-left));
}

.account-shell {
  width: min(100%, 62rem);
  margin: 0 auto;
}

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

.eyebrow,
.plan-status {
  font-size: 0.75rem;
  font-weight: 700;
}

.eyebrow { color: var(--accent); }

.desktop-downloads {
  width: min(100%, 62rem);
  margin: var(--space-md) auto 0;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--line);
  color: var(--ink);
}

.download-content { width: min(100%, 62rem); margin: 0 auto; }

.download-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.download-heading > div { min-width: 0; }

.download-heading h2 {
  font-size: 1.375rem;
  line-height: 1.25;
}

.download-requirement {
  margin-top: var(--space-sm);
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 700;
}

.download-version {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.8125rem;
}

.download-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-md);
  margin: var(--space-lg) 0 0;
  padding: 0;
  list-style: none;
}

.download-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 100%;
  min-height: 3.5rem;
  padding: var(--space-md);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--lavender-soft);
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}

.download-link > [data-lucide],
.download-link svg {
  flex: 0 0 1.25rem;
  width: 1.25rem;
  height: 1.25rem;
  color: currentColor;
}

.download-link span { min-width: 0; overflow-wrap: anywhere; }
.download-link:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.account-skeleton,
.member-view {
  display: grid;
  gap: var(--space-md);
}

.account-skeleton > div,
.identity-row,
.plan-band,
.activation-band,
.signed-out,
.account-error {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.account-skeleton > div {
  padding: var(--space-lg);
  background: var(--surface);
  animation: skeleton-pulse 1.2s cubic-bezier(0.65, 0, 0.35, 1) infinite alternate;
}

.account-skeleton span,
.account-skeleton i {
  display: block;
  border-radius: var(--radius);
  background: oklch(88% 0.018 278);
}

.skeleton-identity {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-height: 7rem;
}

.skeleton-identity i {
  order: -1;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
}

.skeleton-identity span {
  width: min(52%, 17rem);
  height: 2.5rem;
}

.skeleton-plan {
  display: grid;
  gap: 0.75rem;
  min-height: 11rem;
  align-content: center;
}

.skeleton-plan span:first-child { width: 7rem; height: 1.5rem; }
.skeleton-plan span:last-child { width: min(74%, 26rem); height: 2.5rem; }

.skeleton-code { min-height: 8rem; }
.skeleton-code span { width: 100%; height: 4rem; }

@keyframes skeleton-pulse {
  to { opacity: 0.48; }
}

.signed-out {
  display: grid;
  gap: var(--space-lg);
  padding: var(--space-xl);
  background: var(--surface-raised);
}

.account-error {
  display: grid;
  gap: var(--space-lg);
  padding: var(--space-xl);
  background: var(--surface-raised);
}

.account-error > div {
  display: grid;
  gap: var(--space-sm);
}

.account-error h2 {
  font-size: 1.75rem;
  line-height: 1.2;
}

.account-error p {
  max-width: 48ch;
  color: var(--muted);
}

.account-error-icon {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  color: var(--error);
  background: oklch(94% 0.035 28);
}

.account-error-icon svg { width: 1.75rem; height: 1.75rem; }

.signed-out-mark {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  color: var(--surface);
  background: var(--navy);
}

.signed-out-mark svg { width: 1.75rem; height: 1.75rem; }

.signed-out-copy {
  display: grid;
  gap: var(--space-sm);
}

.signed-out h2 {
  font-size: 1.75rem;
  line-height: 1.2;
}

.signed-out p {
  max-width: 48ch;
  color: var(--muted);
}

.identity-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  min-height: 7.5rem;
  padding: 1.25rem;
  background: linear-gradient(105deg, var(--surface-raised), var(--lavender));
}

.identity-copy {
  display: grid;
  min-width: 0;
  gap: 0.125rem;
}

.identity-copy strong,
.identity-copy small { overflow-wrap: anywhere; }

.identity-copy strong {
  font-size: 1.375rem;
  line-height: 1.2;
}

.identity-copy small {
  color: oklch(42% 0.035 268);
  font-size: 0.9375rem;
  overflow-wrap: normal;
  word-break: break-all;
}

.identity-mark {
  display: grid;
  place-items: center;
  flex: 0 0 3rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  color: var(--surface);
  background: var(--navy);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.plan-band {
  display: grid;
  grid-template-areas:
    "copy"
    "benefits"
    "purchase";
  gap: 1.125rem;
  padding: 1.25rem;
  background: var(--surface-raised);
}

.plan-band[data-plan="pro"] {
  border-color: oklch(85% 0.065 149);
  background: oklch(98% 0.018 149);
}

.plan-copy {
  display: grid;
  grid-area: copy;
  gap: 0.625rem;
  min-width: 0;
}

.plan-copy h2 {
  max-width: 24ch;
  font-size: 1.625rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.plan-status {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 0.375rem;
  min-height: 1.75rem;
  padding: 0.25rem 0.625rem;
  border: 1px solid oklch(86% 0.045 275);
  border-radius: 0.375rem;
  color: var(--accent-hover);
  background: var(--lavender-soft);
}

.plan-band[data-plan="pro"] .plan-status {
  border-color: oklch(79% 0.09 149);
  color: var(--success-strong);
  background: var(--success-soft);
}

.plan-status svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.plan-band[data-plan="free"] .pro-only,
.plan-band[data-plan="pro"] .free-only { display: none; }

.plan-benefits {
  display: flex;
  grid-area: benefits;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-benefit {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.25rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.plan-benefit svg {
  flex: 0 0 1rem;
  width: 1rem;
  height: 1rem;
}

.plan-benefit[data-tone="export"] {
  border-color: oklch(86% 0.05 275);
  color: oklch(42% 0.14 270);
  background: oklch(96% 0.035 278);
}

.plan-benefit[data-tone="fx"] {
  border-color: oklch(87% 0.055 12);
  color: oklch(43% 0.14 8);
  background: oklch(97% 0.032 12);
}

.plan-benefit[data-tone="maker"] {
  border-color: oklch(86% 0.07 82);
  color: oklch(42% 0.105 70);
  background: oklch(97% 0.05 88);
}

.plan-benefit[data-tone="multi"] {
  border-color: oklch(84% 0.065 154);
  color: oklch(40% 0.12 151);
  background: oklch(96% 0.045 151);
}

.purchase-block {
  display: flex;
  grid-area: purchase;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--line);
}

.purchase-block .primary-button { white-space: nowrap; }

.purchase-options {
  display: grid;
  min-width: 0;
  gap: 0.75rem;
}

.price { display: grid; }

.price b {
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.price small {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.plan-active {
  display: inline-flex;
  grid-area: purchase;
  align-items: center;
  justify-self: start;
  gap: 0.5rem;
  padding-top: var(--space-md);
  border-top: 1px solid oklch(85% 0.065 149);
  color: var(--success-strong);
  font-size: 0.875rem;
  font-weight: 700;
}

.plan-active svg {
  width: 1.25rem;
  height: 1.25rem;
}

.activation-band {
  display: grid;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: var(--surface-raised);
}

.activation-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
}

.activation-heading > div {
  display: grid;
  min-width: 0;
  gap: 0.25rem;
}

.activation-heading h2 {
  font-size: 1.375rem;
  line-height: 1.2;
}

.activation-heading p {
  display: none;
  max-width: 50ch;
  color: var(--muted);
  font-size: 0.875rem;
}

.activation-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius);
  color: var(--accent-hover);
  background: var(--lavender-control);
}

.activation-icon svg { width: 1.5rem; height: 1.5rem; }

.code-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  min-height: 4.75rem;
  padding: 0.625rem 0.75rem 0.625rem 1rem;
  border: 1px solid oklch(89% 0.025 278);
  border-radius: var(--radius);
  background: var(--lavender-soft);
}

.code-control code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: "DM Sans", "Segoe UI", sans-serif;
  font-size: 0.9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  letter-spacing: 0;
}

.code-control[data-state="unavailable"] code {
  color: var(--muted);
  font-weight: 500;
}

.primary-button,
.icon-button {
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  min-height: 3rem;
  padding: 0.75rem 1.25rem;
  color: var(--accent-ink);
  background: var(--accent);
  font-weight: 700;
}

.icon-button {
  display: grid;
  place-items: center;
  flex: 0 0 2.75rem;
  width: 2.75rem;
  height: 2.75rem;
  background: var(--surface);
}

.identity-sign-out {
  width: 2.75rem;
  height: 2.75rem;
  color: oklch(40% 0.04 268);
  background: var(--lavender-soft);
}

.copy-code-button {
  position: relative;
  color: oklch(40% 0.04 268);
  background: var(--surface-raised);
}

.copy-code-button .copied-icon { display: none; }

.copy-code-button[data-copied="true"] {
  border-radius: 50%;
  color: var(--success);
  background: var(--success-control);
}

.icon-button.copy-code-button:hover { transform: none; }

.icon-button.copy-code-button[data-copied="true"] {
  color: var(--success);
  background: var(--success-control);
}

.copy-code-button[data-copied="true"] .copy-icon { display: none; }
.copy-code-button[data-copied="true"] .copied-icon { display: block; }

.primary-button svg,
.icon-button svg { width: 1.25rem; height: 1.25rem; }

.primary-button:active,
.icon-button:active { transform: translateY(1px); }

.primary-button:focus-visible,
.icon-button:focus-visible,
.brand:focus-visible,
.skip-link:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.copy-code-button:disabled { cursor: not-allowed; }

.account-message {
  min-height: 1.5rem;
  padding: var(--space-md) 0;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

.account-message:empty { visibility: hidden; }
.account-message[data-state="error"] { color: var(--error); }
.account-message[data-state="success"] { color: var(--success-strong); }

[hidden] { display: none !important; }

@media (hover: hover) {
  .primary-button:hover { background: var(--accent-hover); }

  .download-link:hover {
    color: var(--accent-hover);
    border-color: var(--accent-hover);
    background: var(--lavender-control);
  }

  .icon-button:hover {
    color: var(--accent-hover);
    background: var(--lavender-control);
    transform: translateY(-1px);
  }

  .icon-button:active { transform: translateY(1px); }

  .brand:hover { color: var(--accent-hover); }
}

@media (min-width: 42rem) {
  main { padding-top: var(--space-2xl); }

  .download-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .account-skeleton,
  .member-view { gap: var(--space-lg); }

  .signed-out {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    padding: var(--space-2xl);
  }

  .account-error {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    padding: var(--space-2xl);
  }

  .identity-row {
    gap: var(--space-md);
    padding: 1.75rem 2rem;
  }

  .identity-mark {
    width: 4.5rem;
    height: 4.5rem;
    font-size: 2rem;
  }

  .identity-sign-out {
    width: 3rem;
    height: 3rem;
  }

  .identity-copy strong { font-size: 1.75rem; }
  .identity-copy small { font-size: 1rem; }

  .plan-band {
    grid-template-areas:
      "copy purchase"
      "benefits purchase";
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: var(--space-xl);
    row-gap: var(--space-md);
    min-height: 11.5rem;
    padding: var(--space-xl);
  }

  .plan-copy h2 { font-size: 2.125rem; }

  .purchase-block {
    align-self: stretch;
    align-items: stretch;
    justify-content: center;
    flex-direction: column;
    min-width: 12.5rem;
    border-top: 0;
    border-left: 1px solid var(--line);
    padding: 0 0 0 var(--space-xl);
  }

  .purchase-options { width: 100%; }

  .plan-active {
    align-self: stretch;
    justify-self: stretch;
    min-width: 12.5rem;
    border-top: 0;
    border-left: 1px solid oklch(85% 0.065 149);
    padding: 0 0 0 var(--space-xl);
  }

  .activation-band {
    gap: var(--space-lg);
    padding: var(--space-xl);
  }

  .activation-heading h2 { font-size: 1.625rem; }
  .activation-heading p { display: block; }

  .code-control {
    min-height: 5rem;
    padding-left: 1.5rem;
  }

  .code-control code { font-size: 1.125rem; }
}

@media (prefers-contrast: more) {
  .account-skeleton > div,
  .identity-row,
  .plan-band,
  .activation-band,
  .signed-out,
  .account-error,
  .code-control { border-width: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
