/* =========================================================
   GPACal — shared page components (section shell, hero grid,
   calculator card, stats, cards, knowledge base, FAQ, CTA band).
   Used by the home page (.gc-home) and every inner page (.gc-page).
   Tokens & primitives: gc.css · Home-only sections: home.css
   ========================================================= */

:is(.gc-home, .gc-page) {
  background: var(--gc-bg);
}

:is(.gc-home, .gc-page) p {
  margin: 0;
}

.gc-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Section shell ---------- */
.gc-section {
  border-top: var(--gc-rule);
}

.gc-section--band {
  background: var(--gc-surface);
}

.gc-section__inner {
  padding-block: var(--gc-section-y);
}

:is(.gc-home, .gc-page) h2 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.035em;
  margin: 0;
  text-wrap: balance;
}

:is(.gc-home, .gc-page) .gc-kicker + h2 {
  margin-top: 12px;
}

/* Section header: kicker + H2 left, description right, bottom-aligned */
.gc-shead {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 16px 48px;
  align-items: end;
  margin-bottom: 40px;
}

.gc-shead--lg {
  margin-bottom: 48px;
}

.gc-shead > p {
  font-size: 16px;
  color: var(--gc-neutral-700);
  max-width: 54ch;
  text-wrap: pretty;
}

/* ---------- Hero ---------- */
.gc-hero__grid {
  padding-top: clamp(40px, 7vw, 88px);
  padding-bottom: clamp(40px, 6vw, 72px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: clamp(40px, 5vw, 72px);
  align-items: center;
}

.gc-hero__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.gc-hero__tag {
  font-weight: 600;
  margin-bottom: 24px;
}

:is(.gc-home, .gc-page) .gc-hero__title {
  font-size: clamp(42px, 6.4vw, 80px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  margin: 0 0 24px;
  text-wrap: balance;
}

.gc-hero__title span {
  color: var(--gc-accent);
}

:is(.gc-home, .gc-page) .gc-hero__lead {
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.55;
  color: var(--gc-neutral-700);
  max-width: 50ch;
  margin-bottom: 32px;
  text-wrap: pretty;
}

.gc-hero__lead strong {
  color: var(--gc-text);
  font-weight: 600;
}

.gc-hero__cta {
  min-width: 200px;
}

:is(.gc-home, .gc-page) .gc-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 28px;
  font-size: 13px;
  color: var(--gc-neutral-700);
}

/* ---------- Hero mini calculator ---------- */
.gc-calc {
  background: var(--gc-surface);
  box-shadow: var(--gc-shadow-md);
  border-top: 4px solid var(--gc-accent);
  min-width: 0;
}

.gc-calc__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 20px;
  border-bottom: var(--gc-rule);
}

.gc-calc__title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.gc-calc__sub {
  font-size: 13px;
  color: var(--gc-neutral-700);
}

.gc-calc__result {
  text-align: right;
}

.gc-calc__gpa {
  display: block;
  font-size: 44px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--gc-accent);
  font-variant-numeric: tabular-nums;
}

.gc-calc__gpa-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gc-neutral-700);
  margin-top: 6px;
}

.gc-calc__body {
  padding: 16px 24px 0;
}

.gc-calc__cols,
.gc-calc__row {
  display: grid;
  grid-template-columns: var(--gc-calc-cols, minmax(0, 1fr) 64px 96px 36px);
  gap: 8px;
}

.gc-calc__cols {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gc-neutral-700);
  padding-bottom: 8px;
}

.gc-calc__rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gc-calc__row {
  align-items: center;
}

.gc-input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 6px 10px;
  font-family: var(--gc-font);
  font-size: 14px;
  color: var(--gc-text);
  caret-color: var(--gc-accent);
  background: var(--gc-bg);
  border: 1px solid var(--gc-divider);
  transition: border-color var(--gc-dur);
}

.gc-input:hover {
  border-color: rgba(32, 30, 29, 0.45);
}

.gc .gc-input:focus-visible {
  border-color: var(--gc-accent);
  outline-offset: 0;
}

.gc-input--tight {
  padding: 6px 8px;
}

.gc-input[type="number"]::-webkit-inner-spin-button {
  opacity: 0.4;
}

.gc-select {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  padding-right: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23605d5d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
}

.gc-calc__remove {
  display: grid;
  place-items: center;
  width: 36px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--gc-neutral-700);
  cursor: pointer;
  transition: color var(--gc-dur), background-color var(--gc-dur);
}

.gc-calc__remove:hover {
  color: var(--gc-accent);
  background: var(--gc-accent-100);
}

.gc-calc__foot {
  padding: 16px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.gc-calc__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.gc-calc__add {
  justify-content: flex-start;
  gap: 8px;
}

.gc-calc__bar {
  position: relative;
  height: 6px;
  background: var(--gc-neutral-300);
}

.gc-calc__bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--gc-accent);
  transition: width 240ms ease;
}

.gc-calc__status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--gc-neutral-700);
}

.gc-calc__open {
  padding: 0 18px;
}

/* ---------- Tool calculators (<x-gc-calc>) ----------
   The hero card above, plus labelled form fields, a clear action,
   a summary strip, and stacked rows when the card is narrow. */
.gc-calc--tool {
  container-type: inline-size;
}

.gc-calc--tool .gc-calc__actions {
  justify-content: flex-start;
}

.gc-calc__clear {
  margin-left: auto;
  justify-content: flex-start;
  gap: 8px;
  padding-inline: 12px;
}

.gc-calc--tool .gc-calc__status {
  flex-wrap: wrap;
}

.gc-calc__status [data-error] {
  color: var(--gc-text);
  font-weight: 600;
}

.gc-calc__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 16px;
  padding-top: 4px;
}

.gc-calc__fields--settings {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--gc-neutral-300);
}

.gc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.gc-field__label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gc-neutral-700);
}

.gc-field__control {
  position: relative;
}

.gc-field__control .gc-input {
  min-height: 48px;
  font-size: 16px;
}

.gc-field__control--suffix .gc-input {
  padding-right: 32px;
}

.gc-field__suffix {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--gc-neutral-700);
  pointer-events: none;
}

.gc-field__hint {
  font-size: 12px;
  color: var(--gc-neutral-700);
}

.gc-calc__summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border-top: var(--gc-rule);
}

.gc-calc__summary > div {
  padding: 14px 12px 0;
  min-width: 0;
}

.gc-calc__summary > div:first-child {
  padding-left: 0;
}

.gc-calc__summary > div + div {
  border-left: var(--gc-rule);
}

.gc-calc__summary dt {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gc-neutral-700);
}

.gc-calc__summary dd {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.gc-calc--tool.is-empty .gc-calc__gpa,
.gc-calc--tool.is-empty .gc-calc__summary dd {
  color: var(--gc-neutral-700);
}

/* Narrow card: the name takes its own line beside the remove button,
   the other columns sit underneath. The header stacks the same way. */
@container (max-width: 440px) {
  .gc-calc--tool .gc-calc__head {
    padding: 20px 16px 16px;
  }

  .gc-calc--tool .gc-calc__body {
    padding: 16px 16px 0;
  }

  .gc-calc--tool .gc-calc__foot {
    padding: 16px 16px 20px;
  }

  .gc-calc--tool .gc-calc__cols,
  .gc-calc--tool .gc-calc__row {
    grid-template-columns: var(--gc-calc-cols-sm);
  }

  .gc-calc--tool .gc-calc__cols > :first-child,
  .gc-calc--tool .gc-calc__row > :first-child {
    grid-column: 1 / -2;
  }

  .gc-calc--tool .gc-calc__cols > :last-child,
  .gc-calc--tool .gc-calc__row > :last-child {
    grid-column: -2;
    grid-row: 1;
  }

  .gc-calc--tool .gc-calc__cols {
    row-gap: 2px;
  }

  .gc-calc--tool .gc-calc__rows {
    gap: 12px;
  }

  .gc-calc--tool .gc-calc__row {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gc-neutral-300);
  }

  .gc-calc--tool .gc-calc__gpa {
    font-size: 38px;
  }

  .gc-calc__summary dd {
    font-size: 18px;
  }
}

/* ---------- Stats ---------- */
.gc-stats {
  border-top: var(--gc-rule);
}

/* 2×2 on phones, one row of 4 from 560px */
.gc-stats__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gc-stats__cell {
  padding: clamp(20px, 3vw, 32px) 16px;
}

.gc-stats__cell:nth-child(odd) {
  padding-left: 0;
}

.gc-stats__cell:nth-child(even) {
  border-left: var(--gc-rule);
}

.gc-stats__cell:nth-child(n+3) {
  border-top: var(--gc-rule);
}

@media (min-width: 560px) {
  .gc-stats__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .gc-stats__cell:nth-child(n+3) {
    border-top: 0;
  }

  .gc-stats__cell + .gc-stats__cell {
    padding-left: 16px;
    border-left: var(--gc-rule);
  }
}

.gc-stats__num {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.gc-stats__label {
  font-size: clamp(12px, 1.2vw, 14px);
  color: var(--gc-neutral-700);
  margin-top: 8px;
}

/* ---------- Top tools ---------- */
.gc-tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 16px;
}

.gc-tool-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
  padding: 24px;
  background: var(--gc-surface);
  color: var(--gc-text);
  text-decoration: none;
  transition: box-shadow var(--gc-dur), transform var(--gc-dur);
}

.gc-tool-card:hover {
  color: var(--gc-text);
  box-shadow: var(--gc-shadow-md);
  transform: translateY(-2px);
}

.gc-tool-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gc-tool-card__index {
  font-size: 13px;
  font-weight: 800;
  color: var(--gc-accent);
}

:is(.gc-home, .gc-page) .gc-tool-card__title {
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: normal;
  margin: 20px 0 0;
}

:is(.gc-home, .gc-page) .gc-tool-card__desc {
  flex: 1;
  font-size: 14px;
  color: var(--gc-neutral-700);
}

.gc-tool-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: var(--gc-rule);
  font-size: 14px;
  font-weight: 600;
}

.gc-tools__more {
  margin-top: 24px;
}

/* ---------- Categories (ruled grid) ---------- */
.gc-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 2px;
  background: var(--gc-divider);
  background-clip: padding-box;
  border: var(--gc-rule);
}

.gc-cat {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 320px;
  padding: 28px;
  background: var(--gc-bg);
  transition: background-color var(--gc-dur);
}

.gc-cat:hover {
  background: var(--gc-accent-100);
}

.gc-cat__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.gc-cat__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  background: var(--gc-accent);
  color: var(--gc-bg);
}

.gc-cat__count {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  color: var(--gc-neutral-700);
}

.gc-cat__count span {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--gc-text);
}

:is(.gc-home, .gc-page) .gc-cat__name {
  font-size: 23px;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

:is(.gc-home, .gc-page) .gc-cat__desc {
  font-size: 14px;
  color: var(--gc-neutral-700);
  text-wrap: pretty;
}

.gc-cat__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.gc-cat__chips a {
  display: block;
  font-size: 13px;
  line-height: 1.4;
  padding: 6px 10px;
  border: 1px solid var(--gc-divider);
  background: var(--gc-bg);
  color: var(--gc-text);
  text-decoration: none;
  transition: color var(--gc-dur), border-color var(--gc-dur);
}

.gc-cat__chips a:hover {
  border-color: var(--gc-accent);
  color: var(--gc-accent);
}

.gc-cat__more {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: var(--gc-rule);
  font-size: 14px;
  font-weight: 600;
  color: var(--gc-text);
  text-decoration: none;
  transition: color var(--gc-dur);
}

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


/* ---------- Blog ---------- */
.gc-blog__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 48px;
  margin-bottom: 40px;
}

.gc-blog__head > div {
  max-width: 640px;
}

:is(.gc-home, .gc-page) .gc-blog__head h2 {
  margin-bottom: 12px;
}

.gc-blog__head p {
  font-size: 16px;
  color: var(--gc-neutral-700);
  text-wrap: pretty;
}

.gc-blog__all {
  height: 44px;
  padding: 0 18px;
  gap: 16px;
}

.gc-blog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 16px;
}

.gc-blog-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: var(--gc-surface);
  color: var(--gc-text);
  text-decoration: none;
  transition: box-shadow var(--gc-dur);
}

.gc-blog-card:hover {
  color: var(--gc-text);
  box-shadow: var(--gc-shadow-md);
}

.gc-blog-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: -24px -24px 8px;
  background: var(--gc-neutral-300);
  overflow: hidden;
}

.gc-blog-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gc-blog-card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gc-neutral-700);
}

.gc-blog-card__meta > span:first-child {
  color: var(--gc-accent-700);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
}

:is(.gc-home, .gc-page) .gc-blog-card__title {
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: normal;
  margin: 8px 0 0;
  text-wrap: balance;
}

:is(.gc-home, .gc-page) .gc-blog-card__excerpt {
  flex: 1;
  font-size: 14px;
  color: var(--gc-neutral-700);
}

.gc-blog-card__read {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gc-accent-700);
}

/* ---------- Knowledge base ---------- */
.gc-kb {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 48px clamp(40px, 6vw, 96px);
  align-items: start;
}

.gc-kb__intro {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

:is(.gc-home, .gc-page) .gc-kb__intro h2 {
  margin-bottom: 16px;
}

:is(.gc-home, .gc-page) .gc-kb__lead {
  font-size: 16px;
  color: var(--gc-neutral-700);
  max-width: 52ch;
  text-wrap: pretty;
}

.gc-formula {
  background: var(--gc-text);
  color: var(--gc-bg);
  padding: 28px;
}

.gc-formula__label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--gc-accent-400);
  margin-bottom: 16px;
}

:is(.gc-home, .gc-page) .gc-formula__body {
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.gc-kb__item {
  border-top: var(--gc-rule);
  padding: 24px 0;
}

.gc-kb__item:last-child {
  border-bottom: var(--gc-rule);
}

:is(.gc-home, .gc-page) .gc-kb__item h3 {
  font-size: 19px;
  margin: 0 0 8px;
}

:is(.gc-home, .gc-page) .gc-kb__item p {
  font-size: 15px;
  color: var(--gc-neutral-700);
  text-wrap: pretty;
}


/* ---------- FAQ ---------- */
.gc-faq {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 40px clamp(40px, 6vw, 96px);
  align-items: start;
}

:is(.gc-home, .gc-page) .gc-faq__intro h2 {
  margin-bottom: 16px;
}

.gc-faq__intro > p {
  font-size: 16px;
  color: var(--gc-neutral-700);
  max-width: 44ch;
  text-wrap: pretty;
}

.gc-faq__list {
  border-bottom: var(--gc-rule);
}

.gc-faq__item {
  border-top: var(--gc-rule);
}

:is(.gc-home, .gc-page) .gc-faq__q {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.gc-faq__q button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0;
  background: transparent;
  border: 0;
  font: inherit;
  text-align: left;
  color: var(--gc-text);
  cursor: pointer;
  transition: color var(--gc-dur);
}

.gc-faq__q button:hover {
  color: var(--gc-accent);
}

.gc-faq__toggle {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border: 1px solid var(--gc-divider);
}

.gc-faq__minus,
[aria-expanded="true"] .gc-faq__plus {
  display: none;
}

[aria-expanded="true"] .gc-faq__minus {
  display: block;
}

:is(.gc-home, .gc-page) .gc-faq__a p {
  padding: 0 56px 24px 0;
  font-size: 15px;
  color: var(--gc-neutral-700);
  text-wrap: pretty;
}

/* ---------- CTA band ---------- */
.gc-cta {
  background: var(--gc-accent);
  color: var(--gc-bg);
}

.gc-cta__inner {
  padding-block: clamp(64px, 9vw, 120px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.gc-cta .gc-kicker {
  color: var(--gc-bg);
}

:is(.gc-home, .gc-page) .gc-cta h2 {
  font-size: clamp(40px, 7vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.05em;
  max-width: 14ch;
}

:is(.gc-home, .gc-page) .gc-cta p {
  font-size: clamp(16px, 1.5vw, 19px);
  max-width: 56ch;
  text-wrap: pretty;
}

.gc-cta .gc-btn-row {
  margin-top: 8px;
}

/* An accent focus ring would vanish on the accent band. */
.gc .gc-cta :focus-visible {
  outline-color: var(--gc-bg);
}
