/*
 * Glyph Ribbon: components
 * Built only from tokens.css. Prefix: gr-
 */

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

.gr {
  margin: 0;
  background: var(--gr-aqua);
  color: var(--gr-ink);
  font-family: var(--gr-sans);
  font-size: var(--gr-text-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
.gr img, .gr svg { max-width: 100%; }
.gr :focus-visible { outline: none; box-shadow: var(--gr-focus); border-radius: var(--gr-radius-xs); }

.gr-wrap { width: 100%; max-width: var(--gr-container); margin: 0 auto; padding: 0 var(--gr-space-5); }
.gr-wrap--reading { max-width: calc(var(--gr-reading) + 48px); }

/* Sections */
.gr-section { padding: var(--gr-space-8) 0; }
.gr-section--foam { background: var(--gr-aqua-2); border-top: var(--gr-border-soft); border-bottom: var(--gr-border-soft); }
.gr-section--tight { padding: var(--gr-space-7) 0; }

/* Type */
.gr-hero-title, .gr-h2, .gr-h3 { font-family: var(--gr-display); color: var(--gr-ink); margin: 0; }
.gr-hero-title { font-size: var(--gr-text-hero); font-weight: 700; line-height: 1.05; letter-spacing: var(--gr-tracking-hero); }
.gr-h2 { font-size: var(--gr-text-h2); font-weight: 600; line-height: 1.15; padding-bottom: var(--gr-space-3); border-bottom: var(--gr-border); margin-bottom: var(--gr-space-5); }
.gr-h2--bare { border-bottom: 0; padding-bottom: 0; }
.gr-h3 { font-size: var(--gr-text-h3); font-weight: 600; line-height: 1.25; }
.gr-lead { font-size: var(--gr-text-lead); color: var(--gr-ink-soft); line-height: 1.5; margin: var(--gr-space-4) 0 0; }
.gr-tagline { font-family: var(--gr-sans); font-style: italic; font-weight: 700; color: var(--gr-ink-soft); font-size: var(--gr-text-lead); }
.gr-muted { color: var(--gr-ink-soft); }
.gr-small { font-size: var(--gr-text-small); }
.gr-hint { font-size: var(--gr-text-small); color: var(--gr-faint); }
.gr-mono { font-family: var(--gr-mono); }
.gr-eyebrow { display: inline-flex; align-items: center; gap: var(--gr-space-2); font-family: var(--gr-mono); font-size: var(--gr-text-micro); color: var(--gr-ink-soft); text-transform: lowercase; margin-bottom: var(--gr-space-3); }
.gr-eyebrow::before { content: "◇"; color: var(--gr-violet); font-size: 15px; }

/* Links: teal, underlined, always */
.gr a { color: var(--gr-teal); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.gr a:hover { color: var(--gr-teal-dark); text-decoration-thickness: 2.5px; }

/* Glyph colors */
.g-o { color: var(--gr-orange); } .g-s { color: var(--gr-sun); } .g-l { color: var(--gr-lime); }
.g-k { color: var(--gr-sky); } .g-v { color: var(--gr-violet); } .g-r { color: var(--gr-rose); }

/* Header: logo, italic tagline, small support link, then a centered row of big underlined links */
.gr-header { padding: var(--gr-space-6) 0 var(--gr-space-5); }
.gr-header__top { display: flex; align-items: center; gap: var(--gr-space-5); flex-wrap: wrap; }
.gr-header__top .gr-tagline { flex: 1 1 auto; font-size: var(--gr-text-small); }
.gr-header__aside { font-size: var(--gr-text-micro); }
.gr-logo { display: inline-flex; align-items: center; gap: var(--gr-space-3); font-family: var(--gr-display); font-weight: 600; font-size: 30px; color: var(--gr-ink); text-decoration: none !important; }
.gr .gr-logo { color: var(--gr-ink); }
.gr-logo--sm { font-size: 22px; }
.gr-logo__mark { width: 40px; height: 40px; flex: none; }
.gr-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gr-space-2) var(--gr-space-5); margin-top: var(--gr-space-4); font-size: var(--gr-text-nav); }
.gr-nav a[aria-current="page"] { text-decoration-thickness: 3px; color: var(--gr-teal-dark); }

/* Buttons */
.gr-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--gr-space-2); white-space: nowrap; font-family: var(--gr-display); font-weight: 600; font-size: 17px; line-height: 1; padding: 14px 22px; border-radius: var(--gr-radius-sm); border: var(--gr-border); cursor: pointer; text-decoration: none !important; transition: transform .15s var(--gr-ease), background .15s var(--gr-ease); }
.gr-btn:hover { transform: translateY(-1px); }
.gr .gr-btn--primary { background: var(--gr-teal); border-color: var(--gr-teal-dark); color: var(--gr-white); }
.gr .gr-btn--primary:hover { background: var(--gr-teal-dark); color: var(--gr-white); }
.gr .gr-btn--ghost { background: var(--gr-well); color: var(--gr-ink); }
.gr .gr-btn--ghost:hover { background: var(--gr-white); color: var(--gr-ink); }
.gr-btn--sm { font-size: 15px; padding: 9px 14px; }
.gr-btn--block { width: 100%; }
.gr-actions { display: flex; flex-wrap: wrap; gap: var(--gr-space-3); margin-top: var(--gr-space-5); }

/* Pad: the signature panel. A tab sits on top, glyph ribbon rows, a well, a footer bar */
.gr-pad { position: relative; margin-top: 88px; }
.gr-pad__tab { position: absolute; left: 0; top: -46px; height: 48px; display: flex; align-items: stretch; background: var(--gr-foam); border: var(--gr-border); border-bottom: 0; border-radius: var(--gr-radius-sm) var(--gr-radius-sm) 0 0; overflow: hidden; max-width: 100%; }
.gr-pad__tab button { background: none; border: 0; border-right: var(--gr-border-soft); padding: 0 14px; font: inherit; color: var(--gr-faint); cursor: pointer; }
.gr-pad__tab button:last-child { border-right: 0; border-left: var(--gr-border-soft); color: var(--gr-ink); }
.gr-pad__tab span { display: flex; align-items: center; padding: 0 var(--gr-space-5); min-width: 0; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gr-pad__body { background: var(--gr-foam); border: var(--gr-border); border-radius: 0 var(--gr-radius) var(--gr-radius) var(--gr-radius); overflow: hidden; }
.gr-pad__well { background: var(--gr-well); padding: var(--gr-space-5); font-family: var(--gr-mono); font-size: clamp(17px, 2vw, 22px); line-height: 1.5; min-height: 170px; position: relative; overflow-x: auto; }
.gr-pad__line { display: grid; grid-template-columns: 1.8em minmax(7.5em, max-content) auto; column-gap: var(--gr-space-5); justify-content: start; white-space: pre; letter-spacing: .06em; }
.gr-pad__line i { font-style: normal; color: var(--gr-faint); }
.gr-pad__line b { font-weight: 400; }
.gr-pad__line em { font-style: normal; color: var(--gr-ink-soft); }
.gr-pad__tools { position: absolute; top: var(--gr-space-4); right: var(--gr-space-4); display: flex; gap: var(--gr-space-3); color: var(--gr-faint); font-family: var(--gr-sans); font-size: 18px; }
.gr-pad__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--gr-space-4); padding: var(--gr-space-2) var(--gr-space-2) var(--gr-space-2) var(--gr-space-5); background: var(--gr-aqua-2); border-top: var(--gr-border-soft); font-size: 20px; color: var(--gr-ink-soft); }
.gr-pad__foot .gr-btn { border-width: 1px; }
.gr-pad__notes { display: flex; justify-content: space-between; gap: var(--gr-space-4); flex-wrap: wrap; margin-top: var(--gr-space-2); font-size: var(--gr-text-small); color: var(--gr-faint); }

/* Ribbon: rows of colored glyphs. Wraps on its own; use --scroll for a single clipped row */
.gr-ribbon { display: flex; flex-wrap: wrap; gap: 2px 6px; padding: var(--gr-space-3) var(--gr-space-4); font-family: var(--gr-mono); font-size: var(--gr-text-glyph); line-height: 1.3; border-bottom: var(--gr-border-soft); overflow-x: clip; }
.gr-ribbon > span { display: inline-block; min-width: .8em; text-align: center; cursor: default; border-radius: var(--gr-radius-xs); }
.gr-ribbon > span:hover { background: var(--gr-white); }
.gr-ribbon--scroll { flex-wrap: nowrap; }
.gr-ribbon--bare { border: 0; padding: 0; }
.gr-ribbon--lg { font-size: clamp(24px, 3vw, 34px); gap: 4px 12px; }

/* Glyph chip: a square pale tile with one colored glyph */
.gr-chip { width: 64px; height: 64px; flex: none; display: grid; place-items: center; background: var(--gr-aqua-2); border-radius: var(--gr-radius-sm); font-family: var(--gr-mono); font-size: 30px; line-height: 1; }
.gr-chip--sm { width: 40px; height: 40px; font-size: 20px; border-radius: var(--gr-radius-xs); }

/* Point rows: chip plus a short paragraph, three across */
.gr-points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gr-space-6); margin-top: var(--gr-space-7); }
.gr-point { display: flex; gap: var(--gr-space-4); align-items: flex-start; font-size: 17px; line-height: 1.5; }
.gr-point p { margin: 0; }

/* Two column prose blocks under ruled headings */
.gr-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gr-space-7) var(--gr-space-8); }
.gr-cols p { margin: 0 0 var(--gr-space-4); }

/* Legend: glyph, name, meaning */
.gr-legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--gr-space-3); margin: 0; padding: 0; list-style: none; }
.gr-legend li { display: flex; align-items: center; gap: var(--gr-space-3); background: var(--gr-foam); border: var(--gr-border-soft); border-radius: var(--gr-radius-sm); padding: var(--gr-space-2) var(--gr-space-3); }
.gr-legend b { font-family: var(--gr-display); font-weight: 600; font-size: 16px; }
.gr-legend small { display: block; color: var(--gr-ink-soft); font-size: 14px; }

/* Cards */
.gr-card { background: var(--gr-foam); border: var(--gr-border); border-radius: var(--gr-radius); padding: var(--gr-space-5); }
.gr-card--white { background: var(--gr-well); }
.gr a.gr-card { display: block; color: var(--gr-ink); text-decoration: none; transition: transform .15s var(--gr-ease); }
.gr a.gr-card:hover { transform: translateY(-2px); border-color: var(--gr-teal); }
.gr-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gr-space-5); }
.gr-card .gr-h3 { margin: var(--gr-space-3) 0 var(--gr-space-2); }
.gr-card p { margin: 0; }

/* Badges */
.gr-badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--gr-mono); font-size: var(--gr-text-micro); line-height: 1; padding: 6px 10px; border-radius: var(--gr-radius-pill); background: var(--gr-well); border: var(--gr-border-soft); color: var(--gr-ink-soft); white-space: nowrap; }
.gr-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gr-lime); }
.gr-badge--teal { background: var(--gr-teal); color: var(--gr-white); border-color: var(--gr-teal-dark); }
.gr-badge--teal::before { background: var(--gr-sun); }

/* Stats */
.gr-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gr-space-5); }
.gr-stat b { display: block; font-family: var(--gr-display); font-weight: 700; font-size: clamp(30px, 3.6vw, 44px); line-height: 1.1; }
.gr-stat span { color: var(--gr-ink-soft); font-size: var(--gr-text-small); }

/* Quote */
.gr-quote { margin: var(--gr-space-6) 0; padding: var(--gr-space-5); background: var(--gr-foam); border: var(--gr-border); border-radius: 0 var(--gr-radius) var(--gr-radius) var(--gr-radius); font-family: var(--gr-display); font-weight: 500; font-size: 22px; line-height: 1.4; }
.gr-quote cite { display: block; margin-top: var(--gr-space-3); font-family: var(--gr-sans); font-style: normal; font-weight: 400; font-size: var(--gr-text-small); color: var(--gr-ink-soft); }

/* Toggle */
.gr-toggle { display: inline-flex; border: var(--gr-border); border-radius: var(--gr-radius-sm); overflow: hidden; background: var(--gr-foam); }
.gr-toggle button { font: inherit; font-family: var(--gr-display); font-weight: 500; font-size: 16px; padding: 10px 18px; border: 0; background: none; color: var(--gr-ink-soft); cursor: pointer; white-space: nowrap; }
.gr-toggle button + button { border-left: var(--gr-border-soft); }
.gr-toggle button[aria-pressed="true"] { background: var(--gr-well); color: var(--gr-ink); box-shadow: inset 0 -3px 0 var(--gr-teal); }

/* Pricing */
.gr-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gr-space-5); align-items: start; margin-top: var(--gr-space-8); }
.gr-plan { position: relative; background: var(--gr-foam); border: var(--gr-border); border-radius: var(--gr-radius); padding: var(--gr-space-6) var(--gr-space-5) var(--gr-space-5); }
.gr-plan--pick { background: var(--gr-well); border-color: var(--gr-teal); border-width: 3px; }
.gr-plan__tab { position: absolute; left: -3px; top: -34px; height: 34px; display: flex; align-items: center; padding: 0 14px; background: var(--gr-teal); color: var(--gr-white); font-family: var(--gr-mono); font-size: var(--gr-text-micro); border-radius: var(--gr-radius-sm) var(--gr-radius-sm) 0 0; white-space: nowrap; }
.gr-plan__glyphs { font-family: var(--gr-mono); font-size: 22px; letter-spacing: .12em; }
.gr-plan__price { font-family: var(--gr-display); font-weight: 700; font-size: 44px; line-height: 1; margin: var(--gr-space-4) 0 var(--gr-space-1); }
.gr-plan__price small { font-family: var(--gr-sans); font-weight: 400; font-size: var(--gr-text-small); color: var(--gr-ink-soft); }
.gr-plan ul { list-style: none; padding: 0; margin: var(--gr-space-5) 0; display: grid; gap: var(--gr-space-2); font-size: 16px; }
.gr-plan li { display: flex; gap: var(--gr-space-2); }
.gr-plan li::before { content: "∘"; color: var(--gr-lime); font-family: var(--gr-mono); font-weight: 500; }

/* Table */
.gr-table-wrap { overflow-x: auto; border: var(--gr-border); border-radius: var(--gr-radius); background: var(--gr-well); }
.gr-table { width: 100%; border-collapse: collapse; font-size: 16px; min-width: 520px; }
.gr-table th, .gr-table td { text-align: left; padding: 12px 16px; border-bottom: var(--gr-border-soft); }
.gr-table thead th { font-family: var(--gr-display); font-weight: 600; background: var(--gr-foam); }
.gr-table tr:last-child td { border-bottom: 0; }
.gr-table td:not(:first-child) { font-family: var(--gr-mono); }

/* FAQ */
.gr-faq details { border-bottom: var(--gr-border-soft); padding: var(--gr-space-4) 0; }
.gr-faq summary { cursor: pointer; font-family: var(--gr-display); font-weight: 600; font-size: 19px; list-style: none; display: flex; justify-content: space-between; gap: var(--gr-space-4); }
.gr-faq summary::-webkit-details-marker { display: none; }
.gr-faq summary::after { content: "⊕"; font-family: var(--gr-mono); color: var(--gr-sky); }
.gr-faq details[open] summary::after { content: "⊖"; color: var(--gr-orange); }
.gr-faq p { margin: var(--gr-space-3) 0 0; color: var(--gr-ink-soft); }

/* Forms */
.gr-form { display: grid; gap: var(--gr-space-4); }
.gr-field { display: grid; gap: 6px; }
.gr-label { font-family: var(--gr-display); font-weight: 500; font-size: 16px; }
.gr-input, .gr-select { width: 100%; font: inherit; font-size: 17px; color: var(--gr-ink); background: var(--gr-well); border: var(--gr-border); border-radius: var(--gr-radius-sm); padding: 12px 14px; }
.gr-input::placeholder { color: var(--gr-faint); }
.gr-input:focus, .gr-select:focus { outline: none; border-color: var(--gr-teal); box-shadow: 0 0 0 3px var(--gr-teal-tint); }
.gr-check { display: flex; gap: var(--gr-space-3); align-items: flex-start; font-size: 16px; }
.gr-check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--gr-teal); flex: none; }
.gr-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gr-space-2); }
.gr-choice { position: relative; }
.gr-choice input { position: absolute; opacity: 0; }
.gr-choice span { display: grid; gap: 2px; justify-items: center; text-align: center; padding: var(--gr-space-3) var(--gr-space-2); border: var(--gr-border-soft); border-radius: var(--gr-radius-sm); background: var(--gr-foam); cursor: pointer; font-size: 14px; }
.gr-choice b { font-family: var(--gr-mono); font-size: 24px; font-weight: 500; }
.gr-choice input:checked + span { border: 2px solid var(--gr-teal); background: var(--gr-well); }
.gr-choice input:focus-visible + span { box-shadow: var(--gr-focus); }

/* Article */
.gr-meta { display: flex; align-items: center; gap: var(--gr-space-3); flex-wrap: wrap; color: var(--gr-ink-soft); font-size: var(--gr-text-small); margin-top: var(--gr-space-5); }
.gr-avatar { width: 40px; height: 40px; border-radius: var(--gr-radius-sm); background: var(--gr-aqua-2); border: var(--gr-border-soft); display: grid; place-items: center; font-family: var(--gr-mono); font-size: 20px; }
.gr-article { font-size: 19px; line-height: 1.7; }
.gr-article h2 { font-family: var(--gr-display); font-weight: 600; font-size: 28px; line-height: 1.2; margin: var(--gr-space-7) 0 var(--gr-space-4); padding-bottom: var(--gr-space-2); border-bottom: var(--gr-border); }
.gr-article p { margin: 0 0 var(--gr-space-5); }
.gr-article code { font-family: var(--gr-mono); font-size: .9em; background: var(--gr-foam); border: var(--gr-border-soft); padding: 1px 6px; border-radius: var(--gr-radius-xs); }
.gr-article ul { padding-left: 1.2em; margin: 0 0 var(--gr-space-5); }
.gr-figure { margin: var(--gr-space-6) 0; }
.gr-figure figcaption { margin-top: var(--gr-space-2); font-size: var(--gr-text-small); color: var(--gr-faint); }

/* Footer */
.gr-footer { padding: var(--gr-space-7) 0 var(--gr-space-6); border-top: var(--gr-border); margin-top: var(--gr-space-8); font-size: var(--gr-text-small); }
.gr-footer__grid { display: grid; grid-template-columns: 2fr repeat(3, minmax(0, 1fr)); gap: var(--gr-space-6); }
.gr-footer h4 { font-family: var(--gr-display); font-weight: 600; font-size: 15px; margin: 0 0 var(--gr-space-3); }
.gr-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.gr-footer__base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--gr-space-3); margin-top: var(--gr-space-6); color: var(--gr-faint); }

/* Responsive */
@media (max-width: 860px) {
  .gr-points, .gr-cards, .gr-plans { grid-template-columns: 1fr; }
  .gr-plans { gap: var(--gr-space-8); }
  .gr-cols { grid-template-columns: 1fr; gap: var(--gr-space-5); }
  .gr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gr-footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .gr-wrap { padding: 0 var(--gr-space-4); }
  .gr-section { padding: var(--gr-space-7) 0; }
  .gr-header__top .gr-tagline { flex-basis: 100%; }
  .gr-nav { justify-content: flex-start; gap: var(--gr-space-1) var(--gr-space-4); }
  .gr-ribbon { font-size: 18px; gap: 2px 4px; }
  .gr-pad__tab span { padding: 0 var(--gr-space-3); }
  .gr-pad__tools { display: none; }
  .gr-pad__well { padding: var(--gr-space-4); font-size: 16px; }
  .gr-pad__line { grid-template-columns: 1.2em minmax(5em, max-content) auto; column-gap: var(--gr-space-3); letter-spacing: 0; }
  .gr-pad__foot { font-size: 16px; }
  .gr-choices { grid-template-columns: 1fr; }
  .gr-footer__grid { grid-template-columns: 1fr; }
}
