/* FreeGPACalculator — shared fresh-sky style (subpages)
   Restyles existing markup only; no structural or SEO changes. */

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

:root {
  --primary:#0EA5E9; --primary-dk:#0284C7; --secondary:#38BDF8;
  --cta:#FB7185; --cta-dk:#F43F5E;
  --bg:#F4F9FE; --surface:#FFFFFF; --surface2:#F9FCFF;
  --border:#E4EFF9; --border-md:#C9E1F5;
  --text:#0F2E46; --body:#3C5A72; --muted:#6E93AE;
  --danger:#DC2626; --warn:#D97706; --success:#059669;
  --radius:14px; --shadow:4px 5px 0 rgba(14,165,233,0.07);
  --shadow-sm:3px 3px 0 rgba(14,165,233,0.09);
  --shadow-lg:8px 10px 0 rgba(14,165,233,0.16);
  --bw:1.5px; --transition:160ms ease;
  --yellow:#E8F4FD; --red:#FB7185; --blue:#0EA5E9; --green:#DCFCE7;
  --pink:#FFE7DF; --cyan:#E6F2FC; --purple:#EFEBFE;
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { transition:none !important; animation:none !important; }
}

html { scroll-behavior:smooth; }
body {
  font-family:'Atkinson Hyperlegible', system-ui, sans-serif;
  background:var(--bg);
  background-image:radial-gradient(#DDEBF7 1px, transparent 1.2px);
  background-size:22px 22px;
  color:var(--body); min-height:100vh; line-height:1.6;
  text-wrap:pretty; -webkit-font-smoothing:antialiased;
  padding:0 0 64px;
}
body::before, body::after { content:none !important; display:none !important; }

a { color:var(--primary); }
a:hover { color:var(--primary-dk); }

h1, h2, h3, h4, .page-title, .gauge-info .value {
  font-family:'Bricolage Grotesque', system-ui, sans-serif;
  color:var(--text); letter-spacing:-0.5px; line-height:1.15;
}

.container { max-width:1120px; margin:0 auto; padding:22px 20px 0; position:relative; z-index:1; }

/* ── Site header (identical to homepage) ── */
.site-header {
  position:sticky; top:0; z-index:50;
  background:rgba(255,255,255,0.92); backdrop-filter:blur(8px);
  border-bottom:1px solid var(--border-md);
}
.site-header .wrap {
  max-width:1120px; margin:0 auto; padding:0 20px;
  display:flex; align-items:center; gap:24px; height:60px;
}
.site-header .brand {
  display:flex; align-items:center; gap:8px;
  font-family:'Bricolage Grotesque', system-ui, sans-serif;
  font-size:1.15rem; font-weight:800; color:var(--text);
  text-decoration:none; white-space:nowrap; letter-spacing:-0.3px;
  padding:0; background:none; border:none; box-shadow:none;
}
.site-header .brand:hover { color:var(--primary-dk); }
.brand-mark {
  width:26px; height:26px; border-radius:7px;
  background:var(--primary); color:#fff;
  display:grid; place-items:center;
  font-family:'Atkinson Hyperlegible', sans-serif;
  font-size:0.72rem; font-weight:700; letter-spacing:-0.02em;
}
.site-nav {
  display:flex; align-items:center; gap:4px; margin-left:auto;
  overflow-x:auto; scrollbar-width:none;
}
.site-nav::-webkit-scrollbar { display:none; }
.site-nav a {
  padding:7px 12px; border-radius:7px;
  font-family:'Atkinson Hyperlegible', sans-serif;
  font-size:0.86rem; font-weight:700; color:var(--muted);
  text-decoration:none; white-space:nowrap;
  transition:background var(--transition), color var(--transition);
}
.site-nav a:hover { background:var(--surface2); color:var(--primary); }
.site-nav a[aria-current="page"] { color:var(--primary); background:#E8F4FD; }

/* ── Page hero ── */
.page-hero, header.page { margin:8px 0 30px; }
.page-hero h1, .page-title {
  font-size:clamp(1.9rem, 4.4vw, 2.8rem); font-weight:800;
  letter-spacing:-1px; margin-bottom:14px;
}
.page-hero h1 .hl, .page-title span {
  position:relative; background:none; border:none; box-shadow:none;
  padding:0; display:inline; color:var(--text);
}
.page-hero h1 .hl::after, .page-title span::after {
  content:''; position:absolute; left:-3px; right:-3px; bottom:0.06em;
  height:0.32em; background:#FFD6C9; border-radius:4px;
  transform:rotate(-0.7deg); z-index:-1;
}
.page-hero p, .lede { font-size:1.02rem; color:var(--muted); max-width:44em; }
.page-hero p strong, .lede strong { background:none; color:var(--text); font-weight:700; }

/* ── Cards & panels ── */
.scale-bar, .gauge-card, .semester, .content-section table, .related,
.cta-box, .converter, .gpa-table, details.faq, .stat, .planner-card {
  background:var(--surface); border:var(--bw) solid var(--border-md);
  border-radius:var(--radius); box-shadow:var(--shadow);
}

.scale-bar {
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  padding:14px 18px; margin-bottom:20px;
}
.scale-bar label {
  font-size:0.7rem; font-weight:700; letter-spacing:0.07em;
  text-transform:uppercase; color:var(--muted);
}
.scale-bar select, .conv-field select, .conv-field input {
  flex:1; min-width:200px; background:var(--surface2);
  border:1px solid var(--border-md); border-radius:8px;
  padding:9px 11px; font-family:inherit; font-size:0.9rem; font-weight:400;
  color:var(--text); outline:none; box-shadow:none; cursor:pointer;
  transition:border-color var(--transition);
}
.scale-bar select:focus, .conv-field select:focus, .conv-field input:focus {
  border-color:var(--primary); background:#fff;
}

/* ── Gauges ── */
.gauges { display:grid; grid-template-columns:repeat(auto-fit, minmax(300px,1fr)); gap:14px; margin-bottom:18px; }
.gauge-wrap { margin-bottom:20px; }
.gauge-card { padding:20px 24px; display:flex; align-items:center; gap:22px; }
.gauge-svg { flex-shrink:0; width:132px; height:132px; }
.gauge-outline { stroke:var(--border-md); fill:none; }
.gauge-track { stroke:#E9F3FB; fill:none; }
.gauge-fill { fill:none; stroke-linecap:butt; transition:stroke-dasharray .4s ease, stroke .25s ease; }
.gauge-bg-fill { fill:#fff; }
.gauge-svg text { fill:var(--text) !important; }
.gauge-info { flex:1; min-width:0; }
.gauge-info .label {
  font-family:'Atkinson Hyperlegible', sans-serif;
  font-size:0.7rem; font-weight:700; letter-spacing:0.09em;
  text-transform:uppercase; color:var(--muted); margin-bottom:4px;
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
}
.gauge-info .label .pill {
  background:#E8F4FD; color:var(--primary-dk); border-radius:999px;
  padding:2px 9px; font-size:0.6rem; letter-spacing:0.06em;
}
.gauge-info .value {
  font-size:clamp(2.3rem, 6vw, 3rem); font-weight:800;
  line-height:1; letter-spacing:-1.4px; color:var(--primary);
  font-variant-numeric:tabular-nums;
}
.gauge-info .scale { font-size:0.78rem; font-weight:700; color:var(--muted); margin-top:6px; }

/* ── Stats ── */
.stats { display:flex; gap:8px; margin-bottom:24px; flex-wrap:wrap; }
.stat {
  padding:8px 14px; font-size:0.84rem; font-weight:700; color:var(--text);
  box-shadow:var(--shadow-sm);
}
.stat strong { color:var(--primary); font-variant-numeric:tabular-nums; }
.stat.credits, .stat.semesters, .stat.ap, .stat.honors { background:var(--surface); }

/* ── Semester blocks ── */
.semester { margin-bottom:14px; overflow:hidden; }
.semester-header {
  display:flex; align-items:center; gap:10px;
  padding:13px 16px; background:var(--surface2);
  border-bottom:1px solid var(--border);
}
.semester-header input.sem-name, .semester-header input {
  flex:1; min-width:0; background:transparent; border:none; outline:none;
  font-family:'Bricolage Grotesque', system-ui, sans-serif;
  font-size:1rem; font-weight:700; color:var(--text);
  letter-spacing:-0.3px; border-radius:6px; padding:3px 6px; margin-left:-6px;
  transition:background var(--transition);
}
.semester-header input:focus { background:#fff; box-shadow:inset 0 0 0 1px var(--border-md); }

.icon-btn {
  background:none; border:none; box-shadow:none !important;
  width:28px; height:28px; border-radius:7px; cursor:pointer;
  display:grid; place-items:center; color:#A6C8E0; flex-shrink:0;
  transform:none !important;
  transition:color var(--transition), background var(--transition);
}
.icon-btn:hover { background:#FEF2F2; color:var(--danger); }

.course-table { width:100%; border-collapse:collapse; }
.course-table th {
  font-family:'Atkinson Hyperlegible', sans-serif;
  font-size:0.66rem; font-weight:700; letter-spacing:0.08em;
  text-transform:uppercase; color:var(--muted);
  padding:9px 8px; text-align:left; background:var(--surface);
  border-bottom:1px solid var(--border);
}
.course-table th:first-child { padding-left:16px; }
.course-table td { padding:6px 8px; border-bottom:1px solid var(--border); }
.course-table tr:last-child td { border-bottom:none; }
.course-table td:first-child { padding-left:16px; }
.course-table td:last-child { padding-right:12px; width:40px; text-align:center; }
.course-table input, .course-table select {
  width:100%; background:var(--surface2); border:1px solid transparent;
  border-radius:7px; padding:8px 10px; color:var(--text);
  font-family:inherit; font-size:0.88rem; font-weight:400; outline:none;
  box-shadow:none !important;
  transition:border-color var(--transition), background var(--transition);
}
.course-table input::placeholder { color:#9FBDD2; }
.course-table input:hover, .course-table select:hover { border-color:var(--border-md); }
.course-table input:focus, .course-table select:focus { border-color:var(--primary); background:#fff; }
.col-pts {
  color:var(--muted); font-family:'Atkinson Hyperlegible', sans-serif;
  font-size:0.85rem; font-weight:700; text-align:center;
  font-variant-numeric:tabular-nums;
}

.semester-footer {
  padding:11px 16px; border-top:1px solid var(--border);
  background:var(--surface2);
  display:flex; gap:8px; flex-wrap:wrap; align-items:center;
}
.sem-gpa-tag { font-size:0.82rem; font-weight:700; color:var(--body); }
.sem-gpa-tag b {
  background:#DAEDFB; color:var(--primary-dk); padding:3px 10px;
  border-radius:999px; font-weight:700; font-variant-numeric:tabular-nums;
}

/* ── Buttons ── */
.btn {
  display:inline-flex; align-items:center; gap:7px; cursor:pointer;
  padding:9px 18px; border-radius:9px; border:1px solid transparent;
  font-family:'Atkinson Hyperlegible', sans-serif;
  font-size:0.88rem; font-weight:700; text-decoration:none;
  box-shadow:none; transform:none !important;
  transition:background var(--transition), color var(--transition), border-color var(--transition);
}
.btn:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
.btn-primary { background:var(--cta); color:#fff; }
.btn-primary:hover { background:var(--cta-dk); color:#fff; }
.btn-outline { background:#fff; border-color:var(--border-md); color:var(--body); }
.btn-outline:hover { border-color:var(--primary); color:var(--primary); background:#fff; }
.btn-ai { background:#fff; border-color:var(--border-md); color:var(--primary); }
.btn-ai:hover { background:#F0F8FE; border-color:var(--primary); color:var(--primary-dk); }
.add-semester-wrap { text-align:left; margin:6px 0 44px; }

/* ── Content sections ── */
.content-section, section { margin-top:44px; }
.content-section h2, section > h2 {
  font-size:1.7rem; font-weight:800; letter-spacing:-0.6px; margin-bottom:14px;
}
.content-section h2 .hl, section > h2 .hl {
  position:relative; background:none; border:none; box-shadow:none; padding:0; display:inline;
}
.content-section h2 .hl::after, section > h2 .hl::after {
  content:''; position:absolute; left:-3px; right:-3px; bottom:0.06em;
  height:0.3em; background:#FFD6C9; border-radius:4px; z-index:-1;
}
.content-section p, section > p { margin-bottom:12px; color:var(--body); }
.content-section p strong { background:none; color:var(--text); font-weight:700; }
.content-section ul { margin:14px 0; padding-left:0; list-style:none; display:flex; flex-direction:column; gap:7px; }
.content-section li {
  padding:11px 15px; background:var(--surface);
  border:var(--bw) solid var(--border-md); border-radius:10px;
  box-shadow:none; color:var(--body);
}
.content-section li strong { color:var(--text); }

.content-section table, .gpa-table {
  width:100%; border-collapse:collapse; margin:18px 0;
  overflow:hidden; font-size:0.92rem;
}
.content-section thead, .gpa-table thead { background:var(--surface2); }
.content-section th, .gpa-table th {
  font-family:'Atkinson Hyperlegible', sans-serif;
  font-size:0.7rem; font-weight:700; letter-spacing:0.08em;
  text-transform:uppercase; color:var(--muted);
  padding:12px 14px; text-align:left; border-bottom:1px solid var(--border-md);
}
.content-section td, .gpa-table td {
  padding:11px 14px; border-bottom:1px solid var(--border);
  font-weight:400; color:var(--body);
}
.content-section tr:last-child td, .gpa-table tr:last-child td { border-bottom:none; }
.content-section tr:nth-child(even), .gpa-table tr:nth-child(even) { background:var(--surface2); }
.content-section td strong, .gpa-table td strong { color:var(--text); font-weight:700; }

.callout {
  background:#F0F8FE; border:var(--bw) solid var(--border-md);
  border-radius:12px; box-shadow:none; padding:16px 20px; margin:16px 0;
  font-family:'Bricolage Grotesque', system-ui, sans-serif;
  font-weight:700; font-size:1.02rem; color:var(--text); letter-spacing:-0.2px;
}
.callout strong { background:none; color:var(--primary-dk); }

/* ── FAQ ── */
details.faq { margin-bottom:8px; box-shadow:var(--shadow); }
details.faq[open] { background:var(--surface); box-shadow:var(--shadow); }
details.faq summary {
  cursor:pointer; padding:15px 19px; list-style:none;
  font-family:'Atkinson Hyperlegible', sans-serif;
  font-weight:700; font-size:0.96rem; color:var(--text);
  display:flex; justify-content:space-between; align-items:center; gap:12px;
}
details.faq summary::-webkit-details-marker { display:none; }
details.faq summary:hover { color:var(--primary); }
details.faq summary .arr {
  flex-shrink:0; width:22px; height:22px; background:none; border:none !important;
  color:var(--primary); display:grid; place-items:center;
  font-size:0; font-weight:700; line-height:1;
}
details.faq summary .arr::before { content:'+'; font-size:1.25rem; }
details.faq[open] summary .arr::before { content:'\2212'; }
details.faq .body { padding:0 19px 17px; color:var(--body); line-height:1.7; font-size:0.93rem; }

/* ── Converter (gpa-scale) ── */
.converter { padding:22px 24px; margin:6px 0 26px; }
.converter h3 { font-size:1.2rem; font-weight:700; margin-bottom:6px; }
.converter .hint { font-size:0.86rem; color:var(--muted); margin-bottom:16px; }
.conv-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(180px,1fr)); gap:13px; }
.conv-field label {
  display:block; font-size:0.7rem; font-weight:700; letter-spacing:0.06em;
  text-transform:uppercase; color:var(--muted); margin-bottom:6px;
}
.conv-field select, .conv-field input { width:100%; min-width:0; }

/* ── CTA + related ── */
.cta-box {
  display:flex; align-items:center; justify-content:space-between;
  gap:20px; flex-wrap:wrap; padding:24px 26px; margin:34px 0;
  background:linear-gradient(170deg,#E4F6FD 0%,#EAF4FF 62%,#F3F6FF 100%);
}
.cta-box h3 { font-size:1.3rem; font-weight:800; letter-spacing:-0.4px; }
.cta-box p { color:var(--muted); font-size:0.92rem; margin-top:4px; }

.related { padding:22px 24px; margin-top:38px; }
.related h3 { font-size:1.25rem; font-weight:800; margin-bottom:14px; letter-spacing:-0.3px; }
.related ul { list-style:none; padding:0; margin:0;
  display:grid; grid-template-columns:repeat(auto-fit, minmax(240px,1fr)); gap:10px; }
.related li {
  padding:13px 16px; background:var(--surface2);
  border:var(--bw) solid var(--border-md); border-radius:11px; box-shadow:none;
  transition:border-color var(--transition), background var(--transition);
}
.related li:hover { background:#fff; border-color:var(--primary); transform:none; }
.related a { color:var(--text); text-decoration:none; font-weight:700; display:block; font-size:0.93rem; }
.related a small { display:block; margin-top:3px; font-weight:400; font-size:0.79rem; color:var(--muted); }

/* ── Footer ── */
footer.site-footer {
  max-width:1120px; margin:60px auto 0; padding:26px 20px 0;
  border-top:1px solid var(--border-md);
  text-align:left; font-size:0.84rem; color:var(--muted);
  position:relative; z-index:1;
}
footer.site-footer nav {
  margin-bottom:14px; display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-start;
}
footer.site-footer nav a {
  color:var(--body); text-decoration:none; font-weight:700;
  padding:6px 12px; background:none; border:none; border-radius:8px;
}
footer.site-footer nav a:hover { background:var(--surface2); color:var(--primary); }

/* ── AI overlay ── */
#ai-overlay {
  display:none; position:fixed; inset:0; z-index:200;
  background:rgba(15,46,70,0.45);
  align-items:center; justify-content:center; padding:20px;
}
#ai-overlay.show { display:flex; }
.ai-modal {
  background:#fff; border:none; border-radius:14px;
  box-shadow:0 24px 64px rgba(0,0,0,0.25);
  padding:34px 40px 28px; text-align:center; max-width:330px; width:100%;
}
.ai-spinner {
  width:40px; height:40px; border:3px solid #DAEDFB;
  border-top-color:var(--primary); border-radius:50%;
  animation:spin .75s linear infinite; margin:0 auto 16px;
}
@keyframes spin { to { transform:rotate(360deg); } }
.ai-modal p {
  font-family:'Atkinson Hyperlegible', sans-serif;
  font-weight:700; font-size:0.95rem; color:var(--text); margin-bottom:5px;
}
.ai-modal small { color:var(--muted); font-size:0.79rem; }

@media (max-width:720px) {
  .gauge-card { flex-direction:column; gap:14px; text-align:center; }
  .gauge-info .label { justify-content:center; }
  .cta-box { flex-direction:column; align-items:flex-start; }
}
@media (max-width:640px) {
  .container { padding:0 14px; }
  .page-hero h1, .page-title { font-size:1.85rem; }
  .content-section h2, section > h2 { font-size:1.4rem; }
  .course-table th, .course-table td { padding-left:6px; padding-right:6px; }
  .course-table th:first-child, .course-table td:first-child { padding-left:12px; }
  .course-table input, .course-table select { padding:7px 8px; font-size:0.82rem; }
  .semester-footer { align-items:stretch; }
  .semester-footer .btn { justify-content:center; }
  .related ul { grid-template-columns:1fr; }
}

/* dimmed empty state for large GPA numbers */
.gauge-info .value.empty { color:#BBD7EA; }
.gauge-info .value .dim, .gauge-info .value.dim { color:#BBD7EA; }

@media (max-width:640px) {
  .site-header .wrap { padding:0 14px; gap:12px; }
  .site-nav a { padding:7px 9px; font-size:0.8rem; }
}
