/* App Garden — support, legal and checkout pages.
   Master copy. Mirrored to hardcoded-value-detector/site.css, the apex
   site.css, and each add-in repo's site/site.css. Styles the existing markup
   only, so the Paddle checkout on the buy page and the key handover on the
   claim page keep their structure untouched.

   Direction D — "Showcase": warm off-white ground, near-black ink, Schibsted
   Grotesk throughout with IBM Plex Mono kept for anything that names a cell,
   a key or a price mechanism. Magenta means one thing and one thing only: a
   defect.

   Both colour schemes are designed, not derived. In light, the panel is the
   dark band. In dark, the panel INVERTS its role and becomes the raised
   surface — flipping ink and paper alone would collapse it into the ground and
   lose the alternation the design rests on. Shadows are near-invisible on a
   dark ground, so every raised surface also carries a hairline border.

   Webfonts are progressive enhancement. Every family has a system fallback of
   similar proportion, so these pages still render correctly with no network
   fetch — a reviewer's machine, an offline check, or a blocked font CDN all get
   a complete page. */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Schibsted+Grotesk:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light dark;

  --paper: #f7f6f3;
  --ink: #101311;
  --panel: #101311;
  --panel-ink: #f7f6f3;
  --card: #ffffff;
  --band: #eceae4;
  --rule: #e6e4de;
  --hair: #f0efeb;
  --muted: #5c625b;
  --faint: #6f756e;

  --flag: #c41e5c;
  --flag-ink: #ffffff;
  --flag-wash: #fdf2f6;
  --link: #1f6b4f;

  --pill: 980px;
  --lift: 0 18px 44px -30px rgba(16, 19, 17, 0.28);
  /* A scrim always darkens. Never derive it from --ink, which inverts. */
  --scrim: rgba(16, 19, 17, 0.55);

  --display: "Schibsted Grotesk", "Segoe UI", system-ui, sans-serif;
  --body: "Schibsted Grotesk", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1412;
    --ink: #e8ebe6;
    --panel: #19201d;
    --panel-ink: #e8ebe6;
    --card: #1e2622;
    --band: #141a17;
    --rule: #28322d;
    --hair: #232c28;
    --muted: #a2aaa1;
    --faint: #8e968d;

    --flag: #ff7ba4;
    --flag-ink: #0f1412;
    --flag-wash: #2c1a22;
    --link: #86d0a6;

    /* No usable shadow on a dark ground; raised surfaces carry a border. */
    --lift: none;
    --scrim: rgba(0, 0, 0, 0.7);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 4rem) clamp(1.25rem, 5vw, 2rem) 4rem;
}

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

h1 {
  margin: 0 0 0.9rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.1rem, 6vw, 3.2rem);
  line-height: 1.04;
  letter-spacing: -0.032em;
  text-wrap: balance;
}

/* Section rules were the old direction's device. D separates with space and
   weight instead, so an h2 is a heading, not a ruled band. */
h2 {
  margin: 2.75rem 0 0.75rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1.2;
  letter-spacing: -0.022em;
}

h3 {
  margin: 0 0 0.6rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.25;
  letter-spacing: -0.018em;
}

/* The standfirst under the page title. */
.lead {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1.45;
  text-wrap: pretty;
}

p {
  margin: 0 0 1.1rem;
  text-wrap: pretty;
}

strong {
  font-weight: 600;
  color: var(--ink);
}

em {
  font-style: italic;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--flag);
}

:focus-visible {
  outline: 2px solid var(--flag);
  outline-offset: 2px;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 0.08em 0.34em;
}

/* ---- lists ------------------------------------------------------------ */

ul {
  margin: 0 0 1.1rem;
  padding-left: 1.3rem;
}

li {
  margin-bottom: 0.6rem;
}

li::marker {
  color: var(--faint);
}

/* ---- buy page: billing cycle switch ----------------------------------- */

.cycle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  margin-bottom: 1.75rem;
  padding: 0.9rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  box-shadow: var(--lift);
  font-size: 0.92rem;
}

.cycle label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}

.cycle input {
  accent-color: var(--flag);
}

/* ---- buy page: plans --------------------------------------------------- */

.plans {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
  align-items: start;
  margin-bottom: 1.75rem;
}

@media (min-width: 44rem) {
  .plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.plan {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 20px;
  box-shadow: var(--lift);
  padding: 1.75rem;
}

.plan ul {
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--hair);
  font-size: 0.95rem;
}

.plan li {
  margin: 0;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--hair);
  line-height: 1.45;
  color: var(--muted);
}

.price {
  margin: 0 0 1.25rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  color: var(--faint);
  font-size: 0.95rem;
}

.price strong {
  font-family: var(--display);
  font-weight: 700;
  font-size: 2.6rem;
  letter-spacing: -0.035em;
  line-height: 1;
}

/* ---- controls ---------------------------------------------------------- */

button {
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--pill);
  padding: 0.85rem 1.6rem;
  cursor: pointer;
}

button:hover {
  background: var(--flag);
  border-color: var(--flag);
  color: var(--flag-ink);
}

input[type="number"] {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: inherit;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  width: 4.8rem;
}

.plan label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---- notes and errors --------------------------------------------------- */

.status {
  color: var(--faint);
  font-size: 0.9rem;
  line-height: 1.5;
}

.error {
  color: var(--flag);
  background: var(--flag-wash);
  border: 1px solid var(--flag);
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* The buy page toggles #failed with the hidden attribute; never let a
   display rule above outrank it. */
[hidden] {
  display: none !important;
}

/* ---- claim page --------------------------------------------------------- */

#claim {
  margin-bottom: 1.5rem;
}

/* The key itself, once claim.js writes it in. Unscoped as well as scoped: the
   script sets className="key" on an element it appends to #claim, but the class
   is the contract, not its position.

   user-select: all is load-bearing — one click takes the whole key, which is how
   it gets typed into the pane on a second machine without dropping a
   character. */
.key,
#claim code,
#claim .key {
  display: block;
  font-family: var(--mono);
  font-size: 1.05rem;
  margin: 0 0 1.1rem;
  padding: 1rem 1.1rem;
  word-break: break-all;
  user-select: all;
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--flag);
  border-radius: 14px;
}

/* ---- footer -------------------------------------------------------------- */

footer {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  color: var(--faint);
  font-size: 0.9rem;
}

footer p {
  margin: 0;
}

footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

footer a:hover {
  color: var(--flag);
  border-bottom-color: var(--flag);
}

/* ---- masthead and index drawer ------------------------------------------ */

/* Every page wears the same top row. The homepage keeps its own inline copy:
   it is deliberately self-contained and loads no stylesheet, so a change here
   has to be made there too. */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.75rem;
  max-width: 66rem;
  margin: 0 auto;
  padding: 0.9rem clamp(1.25rem, 5vw, 2rem);
  border-bottom: 1px solid var(--rule);
}

.masthead-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.logo {
  display: block;
  line-height: 0;
}

.logo img {
  display: block;
  height: clamp(24px, 4vw, 30px);
  width: auto;
}

.masthead-note {
  margin: 0;
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--faint);
}

/* Without JS the drawer is a plain list in the flow, so the toggle would
   control nothing. Only reveal it once we know scripting is on. */
.nav-toggle {
  display: none;
}

.js .nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-width: 44px;
  min-height: 44px;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 12px;
  color: inherit;
  font-family: var(--display);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
}

.js .nav-toggle:hover {
  border-color: var(--ink);
  background: none;
  color: inherit;
}

/* Three stacked worksheet rows, not a hamburger. The one piece of the old
   identity worth carrying into D. */
.rows {
  display: grid;
  gap: 2px;
  width: 0.95rem;
}

.rows span {
  height: 2px;
  background: currentColor;
}

.rows span:nth-child(2) {
  background: var(--flag);
}

/* ---- the Add-ins menu in the top row ------------------------------------ */

/* Five add-ins is too many for a flat row of links. On wide screens the top
   row carries an Add-ins button that opens a panel; below that width the row
   hides it and the drawer does the same job. Both are plain markup: with no
   JS the button is hidden and the drawer's list is still there. */

.site-nav {
  display: none;
}

.js .site-nav {
  display: none;
}

@media (min-width: 60rem) {
  .js .site-nav {
    display: flex;
    align-items: center;
    gap: 1.6rem;
    font-size: 0.95rem;
  }

  .js .site-nav a {
    color: var(--muted);
    text-decoration: none;
  }

  .js .site-nav a:hover {
    color: var(--flag);
  }
}

.addins {
  position: relative;
}

.addins-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.4rem 0.2rem;
  background: none;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}

.addins-toggle:hover {
  background: none;
  border: 0;
  color: var(--flag);
}

.addins-toggle svg {
  transition: transform 0.18s ease;
}

.addins-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.addins-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: min(44rem, 92vw);
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 18px;
  box-shadow: 0 28px 60px -30px rgba(16, 19, 17, 0.35);
}

.addins-menu[hidden] {
  display: none !important;
}

.addins-menu ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.addins-menu li {
  margin: 0;
}

.addins-menu a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 0.9rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
}

.addins-menu a:hover,
.addins-menu a:focus-visible {
  background: var(--hair);
  color: inherit;
}

.addins-name {
  font-size: 0.95rem;
  font-weight: 600;
}

.addins-what {
  font-size: 0.85rem;
  color: var(--muted);
}

.addins-price {
  grid-row: span 2;
  align-self: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--faint);
  white-space: nowrap;
}

/* ---- drawer -------------------------------------------------------------- */

.drawer {
  background: var(--card);
}

.js .drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  width: min(21rem, 86vw);
  overflow-y: auto;
  border-right: 1px solid var(--rule);
  transform: translateX(-100%);
  transition: transform 0.28s ease;
}

.js .drawer[data-open="true"] {
  transform: none;
}

.drawer-inner {
  padding: 1.5rem 1.5rem 3rem;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

/* The drawer's own heading is a label, not a section heading. */
.drawer-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.drawer-close {
  display: none;
  background: none;
  border: 0;
  border-radius: 12px;
  color: inherit;
  font-size: 1.35rem;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
}

.js .drawer-close {
  display: block;
}

.drawer-close:hover {
  background: none;
  border: 0;
  color: var(--flag);
}

.drawer-group {
  margin-top: 1.6rem;
}

.drawer-group h3 {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  text-transform: none;
}

.drawer-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.drawer-group li {
  margin: 0;
}

.drawer-group a {
  display: block;
  padding: 0.5rem 0 0.5rem 0.8rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
}

.drawer-group a:hover,
.drawer-group a:focus-visible {
  border-left-color: var(--flag);
  color: var(--flag);
}

.drawer-group a[aria-current="page"] {
  border-left-color: var(--ink);
  color: var(--ink);
  font-weight: 600;
}

.drawer-backdrop {
  display: none;
}

.js .drawer-backdrop {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 35;
  background: var(--scrim);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s;
}

.js .drawer-backdrop[data-open="true"] {
  opacity: 1;
  visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
  .js .drawer,
  .js .drawer-backdrop,
  .addins-toggle svg {
    transition: none;
  }
}
