/* Arka — /addons/: the add-ons overview and one page per add-on (Blender,
   Rhino, ArchiCAD, Revit; src/addons/catalog.ts).
   Loads AFTER /landing.css and only extends it: the palette, the nav, the
   footer, the buttons and .section-label come from there, so this file has no
   brand-token placeholder of its own. It does not lean on /legal.css either:
   that ships only with the pricing pages (build.ts, PUBLISH_PRICING), and these
   pages are published in every build. */

/* ---- Page scaffold ---- */

body.addon-page .nav {
  /* landing.js toggles this border on scroll; this page ships no such JS */
  border-bottom-color: var(--border-subtle);
}

/* The shared nav marks the section these pages are in. */
body.addon-page .nav-links a[href="/addons/"] {
  color: var(--text-primary);
}

.addon-main {
  padding: 120px 32px 80px;
}

.addon-inner {
  max-width: 880px;
  margin: 0 auto;
}

/* ---- The split control: one link per add-on (catalog.ts#addonTabs) ---- */

.addon-tabs {
  display: flex;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 44px;
  padding: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  /* Too narrow a screen scrolls the control, never the page. */
  overflow-x: auto;
  scrollbar-width: thin;
}

.addon-tabs a {
  flex: 0 0 auto;
  min-width: 96px;
  padding: 9px 20px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s, background-color 0.2s;
}

.addon-tabs a:hover {
  color: var(--text-primary);
  background: var(--hover-wash);
}

/* The page you are on: a red ring (--accent-text, 3.9:1 against the strip),
   not only the wash, which is barely darker than the strip. */
.addon-tabs a[aria-current="page"] {
  color: var(--text-primary);
  background: var(--accent-glow);
  box-shadow: inset 0 0 0 1px var(--accent-text);
}

/* Focus is white, never red: a red ring would read as the current page. */
.addon-tabs a:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: -2px;
}

/* ---- Header ---- */

.addon-header {
  margin-bottom: 40px;
}

.addon-title {
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1.05;
  margin-bottom: 18px;
}

.addon-lede {
  max-width: 680px;
  font-size: 19px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.addon-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 18px;
}

.addon-meta {
  font-size: 14px;
  color: var(--text-muted);
}

/* A plug-in that is not out yet: its status, and where to ask, in place of
   the Download button. */
.addon-soon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 18px;
  padding: 10px 18px 10px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  font-size: 15px;
  color: var(--text-secondary);
}

/* "Available now" / "Coming soon" */
.addon-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border: 1px solid var(--border-accent);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  line-height: 1.5;
  color: var(--text-secondary);
  white-space: nowrap;
}

.addon-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

/* White words (red ones were 3.8:1 on the wash); the dot, the border and the
   wash say "available". */
.addon-status--available {
  color: var(--text-primary);
  background: var(--accent-glow);
  border-color: rgba(139, 0, 0, 0.5);
}

.addon-status--available::before {
  background: var(--accent-text);
}

/* The support address: text, selected whole by one click or tap. */
.addon-email {
  color: var(--text-primary);
  font-weight: 500;
  -webkit-user-select: all;
  user-select: all;
}

/* ---- Video (16:9, the shape of the embed; .demo-frame-wrapper is 16:10) ---- */

.addon-video {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-card);
}

.addon-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.addon-video-link {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

/* The same slot while an add-on has no video yet: a plan sheet's grid, faded
   out behind the words. */
.addon-video--soon {
  display: grid;
  place-items: center;
}

.addon-video--soon::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: center;
  -webkit-mask-image: radial-gradient(
    ellipse at center,
    transparent 25%,
    #000 100%
  );
  mask-image: radial-gradient(ellipse at center, transparent 25%, #000 100%);
}

.addon-video-soon {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  text-align: center;
}

.addon-video-soon svg {
  width: 52px;
  height: 52px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.addon-video-soon p {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ---- Section headings ---- */

.addon-h2 {
  font-size: clamp(26px, 4vw, 32px);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin: 72px 0 24px;
  /* below the fixed nav when "How to install" jumps here */
  scroll-margin-top: 96px;
}

.addon-h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 32px 0 12px;
}

/* One line under a heading, before its cards. */
.addon-intro {
  margin: -8px 0 20px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.addon-prose p {
  max-width: 720px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.addon-prose p + p {
  margin-top: 14px;
}

/* ---- Install steps: an ordered list numbered like the landing's
   .step-number (the global reset took the list's own numbers and indent) ---- */

.addon-steps {
  list-style: none;
  counter-reset: addon-step;
  display: grid;
  gap: 14px;
}

.addon-steps li {
  counter-increment: addon-step;
  position: relative;
  padding: 22px 24px 22px 80px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
}

.addon-steps li::before {
  content: counter(addon-step);
  position: absolute;
  left: 24px;
  top: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-glow);
  border: 1px solid rgba(139, 0, 0, 0.25);
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 700;
}

.addon-steps h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
}

.addon-steps p,
.addon-faq p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.addon-main strong {
  color: var(--text-primary);
  font-weight: 600;
}

.addon-main kbd {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 1px 6px;
  border: 1px solid var(--border-accent);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.addon-main p a {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

.addon-main p a:hover {
  text-decoration-color: var(--gradient-end);
}

/* ---- What a plug-in does: cards with an icon where the steps have their
   number ---- */

.addon-features {
  display: grid;
  gap: 14px;
}

.addon-feature {
  position: relative;
  padding: 22px 24px 22px 80px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
}

.addon-feature-icon {
  position: absolute;
  left: 24px;
  top: 20px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-glow);
  border: 1px solid rgba(139, 0, 0, 0.25);
}

.addon-feature-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--accent-text);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.addon-feature h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
}

.addon-feature p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* "Good to know" */
.addon-list {
  list-style: none;
  display: grid;
  gap: 8px;
}

.addon-list li {
  position: relative;
  padding-left: 22px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.addon-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
}

/* What it works with: a two-column list, one column on a phone. */
.addon-facts {
  display: grid;
  grid-template-columns: minmax(110px, 180px) minmax(0, 1fr);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
}

.addon-facts dt,
.addon-facts dd {
  padding: 16px 22px;
  border-top: 1px solid var(--border-subtle);
  font-size: 15px;
  line-height: 1.6;
}

.addon-facts dt:first-of-type,
.addon-facts dt:first-of-type + dd {
  border-top: 0;
}

/* --text-secondary, not --text-muted: on a card's #161616 the muted grey is
   3.2:1, too faint for what these say. */
.addon-facts dt {
  color: var(--text-secondary);
  font-weight: 500;
}

.addon-facts dd {
  color: var(--text-primary);
}

/* ---- Trial and subscription ---- */

.addon-plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.addon-plan {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
}

.addon-plan[data-plan="blender"] {
  border-color: var(--accent);
  background: linear-gradient(
    180deg,
    rgba(139, 0, 0, 0.06) 0%,
    var(--bg-card) 45%
  );
}

.addon-plan h3 {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.addon-plan-price {
  color: var(--text-primary);
}

.addon-plan .addon-plan-seats {
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.addon-plan-seats strong {
  color: var(--accent);
  font-weight: 600;
}

.addon-plan p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.addon-plan .addon-plan-amount {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.addon-note {
  margin-top: 18px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
}

/* ---- Help ---- */

.addon-faq h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 28px 0 8px;
}

.addon-faq h3:first-child {
  margin-top: 0;
}

/* ---- The overview's cards (catalog.ts#addonCards). The name is the link;
   its ::after covers the card, so the whole card is one target. ---- */

.addon-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.addon-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  transition: border-color 0.2s;
}

.addon-card:hover {
  border-color: var(--border-accent);
}

.addon-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 18px;
}

.addon-card-kind {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.addon-card-name {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.25;
  margin-bottom: 6px;
}

.addon-card-name a {
  color: var(--text-primary);
  text-decoration: none;
}

.addon-card-name a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
}

.addon-card-name a:focus-visible {
  outline: none;
}

/* White, as the tabs' focus ring is. */
.addon-card-name a:focus-visible::after {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

.addon-card-runs {
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.addon-card-summary {
  flex: 1;
  margin-bottom: 20px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.addon-card-more {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  transition: color 0.2s;
}

.addon-card:hover .addon-card-more {
  color: var(--accent-text);
}

/* ---- Responsive (breakpoints as landing.css / legal.css) ---- */

@media (max-width: 768px) {
  .addon-plans,
  .addon-cards {
    grid-template-columns: 1fr;
  }

  .addon-h2 {
    margin-top: 56px;
  }
}

@media (max-width: 640px) {
  .addon-main {
    padding: 104px 20px 64px;
  }

  .addon-tabs {
    width: 100%;
    margin-bottom: 32px;
  }

  .addon-tabs a {
    flex: 1 1 0;
    min-width: max-content;
    padding: 9px 8px;
    font-size: 13px;
  }

  .addon-lede {
    font-size: 17px;
  }

  .addon-steps li,
  .addon-feature {
    padding: 18px 18px 18px 66px;
  }

  .addon-steps li::before,
  .addon-feature-icon {
    left: 16px;
    top: 16px;
  }

  .addon-card {
    padding: 22px;
  }

  .addon-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .addon-facts dt {
    padding-bottom: 2px;
  }

  .addon-facts dd {
    padding-top: 0;
    border-top: 0;
  }
}

/* Five tabs on a 320 px screen: tighter, so the strip never has to scroll. */
@media (max-width: 360px) {
  .addon-tabs a {
    padding: 9px 6px;
  }
}
