/* ============================================================
   TELL ME MY GPA — Stylesheet v2
   Aesthetic : Scholarly Precision
   Headings  : Cormorant Garamond (high-contrast editorial serif)
   Body      : Jost (geometric, airy sans-serif)
   Palette   : Charcoal · Parchment · Gold · White
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Jost:wght@300;400;500;600&display=swap');

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --ink:           #141414;
  --ink-mid:       #2a2a2a;
  --ink-soft:      #454545;
  --parchment:     #f6f3ee;
  --parchment-2:   #ede9e1;
  --gold:          #c07c0a;
  --gold-bright:   #e8980e;
  --gold-pale:     #fdf3dc;
  --white:         #ffffff;
  --text:          #1f1f1f;
  --muted:         #6a6560;
  --border:        #dbd5ca;
  --border-light:  #ece8e1;
  --green:         #1a6b3a;
  --green-bg:      #edf8f2;
  --green-border:  #a3d9b8;
  --font-serif:    'Cormorant Garamond', Georgia, serif;
  --font-sans:     'Jost', system-ui, sans-serif;
  --r-sm:          8px;
  --r-md:          12px;
  --r-lg:          18px;
  --r-full:        999px;
  --shadow-xs:     0 1px 3px rgba(20,20,20,0.07);
  --shadow-sm:     0 2px 10px rgba(20,20,20,0.08);
  --shadow-md:     0 6px 24px rgba(20,20,20,0.10);
  --shadow-lg:     0 16px 48px rgba(20,20,20,0.14);
  --ease:          cubic-bezier(0.22, 1, 0.36, 1);
  --dur:           0.22s;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 16.5px;
  font-weight: 400;
  line-height: 1.75;
  color: var(--text);
  background: var(--parchment);
  min-height: 100vh;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(30px, 5vw, 46px); }
h2 { font-size: clamp(22px, 3.5vw, 32px); }
h3 { font-size: clamp(17px, 2.5vw, 21px); }
h4 {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

p { margin-bottom: 1em; color: var(--text); }
p:last-child { margin-bottom: 0; }
ol, ul { padding-left: 1.4em; margin-bottom: 1em; }
li { margin-bottom: 0.3em; }

a:link, a:visited {
  color: var(--gold);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}
a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 44px 28px 60px;
}

section { animation: reveal 0.45s var(--ease) both; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Page heading with gold underline rule */
.container > h2:first-child,
section .container > h2:first-child {
  position: relative;
  padding-bottom: 16px;
  margin-bottom: 28px;
  text-decoration: none !important;
}
.container > h2:first-child::after,
section .container > h2:first-child::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 44px; height: 3px;
  background: var(--gold);
  border-radius: 2px;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-nav {
  position: sticky;
  top: 0; z-index: 1000;
  background: var(--ink);
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 2px 14px rgba(20,20,20,0.20);
}

.site-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
  height: 60px;
}

.site-nav__logo-link {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 500;
  color: var(--white) !important;
  text-decoration: none !important;
  white-space: nowrap;
  flex-shrink: 0;
}
.logo-accent { color: #f5c842; }

.site-nav__list {
  display: flex;
  list-style: none;
  gap: 2px;
  align-items: center;
}

.site-nav__link {
  display: block;
  padding: 6px 15px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.70) !important;
  border-radius: var(--r-sm);
  text-decoration: none !important;
  transition: background var(--dur), color var(--dur);
}
.site-nav__link:hover {
  background: rgba(255,255,255,0.09);
  color: var(--white) !important;
  text-decoration: none !important;
}

/* Install button */
#installBtn {
  display: none;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  background: #f5c842;
  border: none;
  border-radius: var(--r-sm);
  padding: 7px 15px;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: background var(--dur);
  animation: navPulse 2.4s infinite;
  flex-shrink: 0;
}
#installBtn:hover { background: #ffe066; }

@keyframes navPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(245,200,66,0.45); }
  55%      { box-shadow: 0 0 0 8px rgba(245,200,66,0); }
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 4px;
  width: 32px; height: 32px;
}
.nav-toggle__bar {
  display: block;
  width: 22px; height: 2px;
  background: rgba(255,255,255,0.80);
  border-radius: 2px;
  transition: transform 0.32s var(--ease), opacity 0.22s;
}
.nav-toggle.is-open .nav-toggle__bar:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.nav-toggle.is-open .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle.is-open .nav-toggle__bar:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .site-nav__list {
    position: absolute;
    top: 62px; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    background: var(--ink-mid);
    padding: 10px 16px 18px;
    gap: 2px;
    display: none;
    border-bottom: 2px solid var(--gold);
    box-shadow: var(--shadow-md);
    z-index: 999;
  }
  .site-nav__list.is-open { display: flex; }
  .site-nav__item { width: 100%; }
  .site-nav__link { padding: 11px 14px; font-size: 15px; }
  #installBtn { font-size: 11.5px; padding: 6px 11px; }
}

/* ============================================================
   SEARCH (new class names — JS targets #search & #suggestions)
   ============================================================ */
#search {
  display: block;
  width: 100%;
  max-width: 520px;
  margin: 0 auto 8px;
  padding: 13px 20px 13px 46px;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text);
  background: var(--white)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236a6560' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E")
    no-repeat 15px center;
  border: 1.5px solid var(--border);
  border-radius: var(--r-full);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur), box-shadow var(--dur);
  -webkit-appearance: none;
}
#search:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(192,124,10,0.12);
}
#search::placeholder { color: var(--muted); }

#suggestions {
  max-width: 520px;
  margin: 0 auto 22px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
#suggestions:empty { display: none; }

#suggestions div {
  border-bottom: 1px solid var(--border-light);
  transition: background var(--dur);
}
#suggestions div:last-child { border-bottom: none; }
#suggestions div:hover { background: var(--gold-pale); }
#suggestions div a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 18px;
  color: var(--text) !important;
  font-size: 14.5px;
  font-weight: 400;
  text-decoration: none !important;
}
#suggestions div a::after {
  content: '→';
  font-size: 13px;
  color: var(--gold);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity var(--dur), transform var(--dur);
}
#suggestions div:hover a::after { opacity: 1; transform: translateX(0); }

/* ============================================================
   FORM CONTROLS
   ============================================================ */
select, input[type="text"], input[type="number"] {
  font-family: var(--font-sans);
  font-size: 14.5px;
  color: var(--text);
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 9px 13px;
  transition: border-color var(--dur), box-shadow var(--dur);
  -webkit-appearance: none;
}
select:focus, input[type="text"]:focus, input[type="number"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(192,124,10,0.10);
}

button {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 10px 22px;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  background: var(--ink);
  color: var(--white);
  transition: background var(--dur), transform var(--dur), box-shadow var(--dur);
}
button:hover {
  background: var(--ink-soft);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
button:active { transform: translateY(0); }

.course { margin-bottom: 12px; }

/* ============================================================
   TABLE
   ============================================================ */
.table-container {
  overflow-x: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  margin: 18px 0;
}

table { border-collapse: collapse; width: 100%; font-size: 14.5px; background: var(--white); }

td, th {
  padding: 11px 16px;
  text-align: center;
  border: none;
  border-bottom: 1px solid var(--border-light);
}

thead th {
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  position: sticky; top: 0; z-index: 2;
  border-bottom: 2px solid var(--gold);
}

tbody tr { transition: background var(--dur); }
tbody tr:nth-child(even) td { background: var(--parchment); }
tbody tr:hover td { background: var(--gold-pale); }
tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   RESULT BOXES
   ============================================================ */
#result, #cgpaResult, #gpaResult, #gpaResultUnique, #cgpaResultUnique {
  background: var(--green-bg);
  color: var(--green);
  border: 1.5px solid var(--green-border);
  border-radius: var(--r-sm);
  padding: 13px 18px;
  margin-top: 12px;
  font-weight: 600;
  font-size: 18px;
}

#calculationResult, #calculationResultUnique, #calculation {
  background: var(--ink);
  color: rgba(255,255,255,0.75);
  border-radius: var(--r-sm);
  padding: 14px 18px;
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.9;
  font-family: 'Courier New', monospace;
}

/* ============================================================
   FAQ
   ============================================================ */
.faq {
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--white);
  margin: 10px 0;
  overflow: hidden;
  transition: border-color var(--dur), box-shadow var(--dur);
  cursor: pointer;
}
.faq:hover, .faq.active {
  border-color: var(--gold);
  box-shadow: 0 3px 14px rgba(192,124,10,0.11);
}

.question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
  user-select: none;
  gap: 14px;
}
.question::after {
  content: '';
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M5 1v8M1 5h8' stroke='%23c07c0a' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E")
    center/10px no-repeat;
  transition: transform 0.3s var(--ease), border-color 0.2s, background-color 0.2s;
}
.faq.active .question::after {
  transform: rotate(45deg);
  border-color: var(--gold);
  background-color: var(--gold-pale);
}

.answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.38s var(--ease);
  font-size: 15px;
  color: var(--muted);
  line-height: 1.8;
}

/* ============================================================
   SOCIAL SHARE
   ============================================================ */
.social-share {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 0 6px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--border-light);
  margin-top: 10px;
}
.social-share i { font-style: normal; font-weight: 500; }
.social-share strong { font-weight: 600; }

.social-share a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--parchment-2);
  border: 1px solid var(--border);
  transition: background var(--dur), border-color var(--dur), transform var(--dur);
  text-decoration: none !important;
}
.social-share a:hover {
  background: var(--gold-pale);
  border-color: var(--gold);
  transform: scale(1.13);
}
.social-share a img { width: 17px; height: 17px; display: block; max-width: none; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--ink);
  padding: 48px 28px 22px;
}

.footer-container {
  max-width: 1000px;
  margin: 0 auto 36px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 2.4rem;
}

.footer-section h3 {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #f5c842;
  margin-bottom: 16px;
}

.footer-section ul { list-style: none; padding: 0; margin: 0; }
.footer-section li { padding: 4px 0; }

.footer-section a:link,
.footer-section a:visited {
  color: rgba(255,255,255,0.58) !important;
  font-size: 14px;
  font-weight: 400;
  transition: color var(--dur);
  text-decoration: none !important;
}
.footer-section a:hover { color: #f5c842 !important; text-decoration: none !important; }

.footer-section p {
  color: rgba(255,255,255,0.38);
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
}

.url-select {
  font-family: var(--font-sans);
  font-size: 13.5px;
  width: 100%;
  padding: 9px 12px;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.16);
  border-radius: var(--r-sm);
  color: rgba(255,255,255,0.72);
  cursor: pointer;
  transition: border-color var(--dur);
  -webkit-appearance: none;
}
.url-select option { background: var(--ink-mid); color: var(--white); }
.url-select:focus { outline: none; border-color: #f5c842; }

.footer-bottom {
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.30);
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  max-width: 1000px;
  margin: 0 auto;
}
.footer-bottom a:link, .footer-bottom a:visited { color: rgba(255,255,255,0.58) !important; }
.footer-bottom a:hover { color: #f5c842 !important; }
.footer-bottom span[style*="orange"] { color: #f5c842 !important; }

hr { border: none; border-top: 1px solid rgba(255,255,255,0.08); }
.statcounter { display: none; }

/* ============================================================
   COOKIE BANNER
   ============================================================ */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9999;
  background: var(--ink-mid);
  border-top: 2px solid var(--gold);
  padding: 14px 24px;
  box-shadow: 0 -4px 24px rgba(20,20,20,0.22);
  animation: cookieSlide 0.4s var(--ease);
}
@keyframes cookieSlide {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.cookie-banner-content {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.cookie-banner-content p { font-size: 13.5px; color: rgba(255,255,255,0.70); margin: 0; }
.cookie-banner-content a { color: #f5c842 !important; text-decoration: underline !important; }

.cookie-buttons { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }

.cookie-buttons button {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 18px;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: background var(--dur), transform var(--dur);
}

#accept-cookies  { background: var(--gold-bright); color: var(--ink); }
#accept-cookies:hover  { background: #f5c842; transform: translateY(-1px); box-shadow: none; }

#reject-cookies  { background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.78); }
#reject-cookies:hover  { background: rgba(255,255,255,0.17); transform: none; box-shadow: none; }

#manage-cookies  { background: transparent; color: rgba(255,255,255,0.44);
                   border: 1px solid rgba(255,255,255,0.20); }
#manage-cookies:hover  { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.70);
                          transform: none; box-shadow: none; }

/* ============================================================
   COOKIE MODAL
   ============================================================ */
.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(20,20,20,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fadeIn 0.25s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.cookie-modal-content {
  background: var(--white);
  border-radius: var(--r-lg);
  border-top: 4px solid var(--gold);
  padding: 32px;
  width: 90%; max-width: 440px;
  box-shadow: var(--shadow-lg);
  animation: modalUp 0.3s var(--ease);
}
@keyframes modalUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cookie-modal-content h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--ink);
  font-weight: 500;
  margin-bottom: 22px;
}

.cookie-category {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--parchment);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 10px;
}
.cookie-category label {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 14.5px;
  color: var(--text);
  cursor: pointer;
  width: 100%;
}
.cookie-category input[type="checkbox"] {
  width: 16px; height: 16px;
  flex-shrink: 0;
  accent-color: var(--gold);
  cursor: pointer;
  padding: 0; border: none; box-shadow: none;
}

.cookie-modal-actions { margin-top: 22px; text-align: right; }

#save-preferences {
  background: var(--gold);
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  padding: 11px 26px;
  letter-spacing: 0.03em;
}
#save-preferences:hover { background: var(--gold-bright); }

/* ============================================================
   PWA INSTALL (legacy class)
   ============================================================ */
.btn-pulse {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  background: #f5c842;
  border: none;
  border-radius: var(--r-sm);
  padding: 7px 15px;
  cursor: pointer;
  animation: navPulse 2.4s infinite;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .container { padding: 28px 18px 44px; }
  footer { padding-left: 18px; padding-right: 18px; }
  .cookie-banner { padding: 12px 16px; }
  .cookie-banner-content { flex-direction: column; align-items: flex-start; gap: 10px; }
  .footer-container { gap: 1.8rem; }
}