:root {
  --bg: #f6f4ee;
  --surface: #ffffff;
  --surface-2: #eef7f4;
  --ink: #15201d;
  --muted: #63706c;
  --line: #d8ded9;
  --teal: #04766f;
  --teal-dark: #03534f;
  --amber: #e0a526;
  --rose: #d45c59;
  --shadow: 0 20px 60px rgba(22, 32, 29, 0.12);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid rgba(21, 32, 29, 0.1);
  background: rgba(246, 244, 238, 0.92);
  backdrop-filter: blur(14px);
}

.brand,
.top-nav,
.hero-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--amber);
  font-size: 22px;
}

.top-nav {
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.top-nav a {
  text-decoration: none;
}

.top-nav a:hover {
  color: var(--ink);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding: clamp(42px, 7vw, 88px) clamp(18px, 4vw, 54px) 38px;
  min-height: calc(100vh - 68px);
}

.hero-copy {
  max-width: 720px;
}

.eyebrow,
.tool-kicker {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(2.6rem, 6vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.18;
}

.hero-text {
  max-width: 660px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.14rem;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}

.button.primary {
  background: var(--ink);
  color: #fff;
}

.button.secondary {
  background: transparent;
}

.section {
  padding: clamp(46px, 7vw, 84px) clamp(18px, 4vw, 54px);
}

.band {
  background: #e9eee8;
}

.section-heading {
  max-width: 820px;
  margin-bottom: 28px;
}

.section-heading p:last-child {
  color: var(--muted);
  font-size: 1.05rem;
}

.tool-grid {
  display: grid;
  gap: 18px;
}

.tool-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.calculator {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.calculator {
  padding: clamp(18px, 3vw, 28px);
  box-shadow: 0 10px 35px rgba(21, 32, 29, 0.06);
}

.hero-tool {
  align-self: stretch;
  box-shadow: var(--shadow);
}

.calculator-wide {
  grid-column: 1 / -1;
}

.tool-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.badge {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--teal-dark);
  font-size: 0.75rem;
  font-weight: 800;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 8px;
  background: #edf0ec;
}

.tab {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 10px rgba(21, 32, 29, 0.08);
}

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

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

.calc-grid.two-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fraction-grid,
.gpa-grid {
  display: grid;
  gap: 12px;
}

.fraction-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.gpa-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cbd4cf;
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  padding: 10px 12px;
}

input:focus,
select:focus,
.button:focus-visible,
.tab:focus-visible {
  outline: 3px solid rgba(4, 118, 111, 0.24);
  outline-offset: 2px;
}

.result {
  display: block;
  min-height: 76px;
  margin-top: 16px;
  padding: 16px;
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: clamp(1.12rem, 2vw, 1.45rem);
  font-weight: 850;
}

.formula {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.chart-panel {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.chart-panel canvas {
  display: block;
  width: 100%;
  height: 320px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chart-legend i {
  display: inline-block;
  width: 22px;
  height: 4px;
  border-radius: 999px;
}

.legend-total {
  background: var(--teal);
}

.legend-contrib {
  background: var(--amber);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 26px clamp(18px, 4vw, 54px);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0;
}

@media (max-width: 940px) {
  .hero,
  .tool-grid,
  .fraction-grid,
  .gpa-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .tabs,
  .calc-grid,
  .calc-grid.three,
  .calc-grid.two-two,
  .fraction-grid,
  .gpa-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 32px;
  }
}
