/* ============================================================
   OMR Sheet Generator — design system
   Palette: Paper #F6F3EC · Ink #1B1F23 · Graphite #6B7280
            Cobalt #1F3D7A · Signal Red #B3232A · Mint #2F6F4E
   Type: Space Grotesk (display) / Inter (body) / IBM Plex Mono (data)
   ============================================================ */

:root {
  --paper: #F6F3EC;
  --paper-raised: #FFFFFF;
  --ink: #1B1F23;
  --graphite: #6B7280;
  --graphite-light: #E4E1D8;
  --cobalt: #1F3D7A;
  --cobalt-deep: #142B58;
  --signal-red: #B3232A;
  --mint: #2F6F4E;
  --radius: 14px;
  --shadow-sm: 0 2px 8px rgba(27, 31, 35, 0.06);
  --shadow-md: 0 12px 30px rgba(27, 31, 35, 0.10);
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
}

h1, h2, h3 { font-family: var(--font-display); color: var(--ink); margin: 0 0 12px; line-height: 1.2; }
p { margin: 0 0 14px; color: #33383D; }

a { color: var(--cobalt); }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--cobalt); color: #fff;
  padding: 10px 16px; z-index: 100; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--graphite-light);
}
.header-inner {
  max-width: 1320px; margin: 0 auto; padding: 14px 24px; min-height: 58px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap; flex: 0 0 auto; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--ink); }
.brand-mark {
  width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--cobalt);
  display: inline-flex; align-items: center; justify-content: center; position: relative;
}
.brand-mark span:first-child {
  position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--cobalt);
}
.brand-mark span:last-child { display: none; }

.site-nav { display: flex; gap: 14px; flex-wrap: nowrap; white-space: nowrap; }
.site-nav a {
  text-decoration: none; color: var(--ink); font-weight: 600; font-size: 13.5px;
  padding-bottom: 3px; border-bottom: 2px solid transparent; transition: border-color 0.2s, color 0.2s;
}
.site-nav a:hover { color: var(--cobalt); border-bottom-color: var(--cobalt); }

.nav-toggle-input { display: none; }
.nav-toggle { display: none; flex-direction: column; gap: 4px; cursor: pointer; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; }

@media (max-width: 1239px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0; background: var(--paper-raised);
    flex-direction: column; gap: 0; max-height: 0; overflow: hidden;
    border-bottom: 1px solid var(--graphite-light); box-shadow: var(--shadow-sm);
    transition: max-height 0.25s ease;
  }
  .site-nav a { padding: 12px 24px; border-bottom: 1px solid var(--graphite-light); }
  .nav-toggle-input:checked ~ .site-nav { max-height: 600px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 64px 24px 56px;
  text-align: center;
}
.hero-pattern {
  position: absolute; inset: 0;
  background-image: radial-gradient(var(--cobalt) 1.4px, transparent 1.6px);
  background-size: 26px 26px;
  opacity: 0.06;
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 720px; margin: 0 auto; }
.eyebrow {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.04em;
  color: var(--cobalt); text-transform: uppercase; margin-bottom: 14px;
}
.hero h1 { font-size: clamp(28px, 4.4vw, 44px); margin-bottom: 16px; }
.hero-sub { font-size: 17px; max-width: 560px; margin: 0 auto 26px; color: #444; }
.hero-cta {
  display: inline-block; background: var(--cobalt); color: #fff; text-decoration: none;
  font-weight: 600; padding: 13px 28px; border-radius: 50px; box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}
.hero-cta:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ---------- Generator ---------- */
.generator-section { padding: 10px 24px 60px; }
.generator-layout {
  max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: 400px 1fr; gap: 28px; align-items: start;
}
@media (max-width: 960px) {
  .generator-layout { grid-template-columns: 1fr; }
}

.generator-card {
  background: var(--paper-raised); border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow-md); border-top: 4px solid var(--cobalt);
  position: sticky; top: 88px;
}
@media (max-width: 960px) { .generator-card { position: static; } }

.card-title { font-size: 20px; margin-bottom: 18px; }

.form-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 22px; }

.input-group { display: flex; flex-direction: column; }
.input-group label { font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--graphite); }
.input-group input, .input-group select {
  padding: 11px 13px; border: 1.5px solid var(--graphite-light); border-radius: 8px;
  font-size: 15px; font-family: var(--font-body); outline: none; background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-group input:focus, .input-group select:focus {
  border-color: var(--cobalt); box-shadow: 0 0 0 3px rgba(31, 61, 122, 0.12);
}
#studentName, #rollNumber { font-family: var(--font-mono); }

.button-group { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  flex: 1 1 auto; padding: 12px 18px; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; font-family: var(--font-body); color: #fff;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; box-shadow: var(--shadow-sm);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-generate { background: var(--cobalt); }
.btn-print { background: var(--mint); }
.btn-pdf { background: var(--signal-red); }

.form-note { font-size: 12.5px; color: var(--graphite); margin-top: 14px; margin-bottom: 0; }

/* ---------- OMR preview (classes generated by script.js) ---------- */
.preview-pane { min-width: 0; }
#omrSheetContainer {
  background: var(--paper-raised); border-radius: var(--radius); padding: 26px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; align-items: center;
}
.omr-sheet {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%;
  border: 2px solid var(--ink); padding: 16px; background: #fff;
  position: relative; overflow: hidden; border-radius: 6px;
}
.watermark-text {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-38deg);
  font-size: 68px; color: rgba(31, 61, 122, 0.05); font-weight: 700; text-transform: uppercase;
  white-space: nowrap; pointer-events: none; z-index: 0;
}
.column { border-right: 1px dashed var(--graphite-light); padding: 2px 6px; position: relative; z-index: 2; }
.column:last-child { border-right: none; }
.question { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 13px; position: relative; z-index: 2; }
.question span { font-weight: 700; width: 20px; font-size: 12px; font-family: var(--font-mono); }
.bubble {
  display: inline-flex; width: 14px; height: 14px; border: 1.4px solid var(--ink);
  border-radius: 50%; align-items: center; justify-content: center; font-size: 8.5px;
  margin-left: 4px; font-weight: 600; line-height: 1;
}
.signature-section { width: 100%; margin-top: 26px; display: flex; justify-content: space-between; padding: 0 10px; font-weight: 600; font-size: 13px; flex-wrap: wrap; gap: 12px; }

/* ---------- Features ---------- */
.features { padding: 50px 24px; background: var(--paper-raised); }
.features-inner { max-width: 1100px; margin: 0 auto; }
.features h2 { text-align: center; margin-bottom: 34px; font-size: 26px; }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
@media (max-width: 880px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .feature-grid { grid-template-columns: 1fr; } }
.feature { padding: 4px; }
.bubble-icon {
  display: inline-flex; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--cobalt);
  align-items: center; justify-content: center; font-family: var(--font-mono); font-weight: 700;
  color: var(--cobalt); margin-bottom: 12px; font-size: 14px;
}
.feature h3 { font-size: 16.5px; margin-bottom: 6px; }
.feature p { font-size: 14px; color: var(--graphite); margin-bottom: 0; }

/* ---------- Steps ---------- */
.steps { padding: 54px 24px; }
.steps-inner { max-width: 720px; margin: 0 auto; }
.steps h2 { text-align: center; margin-bottom: 30px; font-size: 26px; }
.step-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.step-list li { display: flex; gap: 16px; align-items: flex-start; }
.step-bubble {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--cobalt); color: #fff;
  display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-weight: 700; font-size: 13px;
}
.step-list div { padding-top: 3px; font-size: 15px; color: #333; }

/* ---------- Why offline ---------- */
.why-offline { padding: 54px 24px; background: var(--paper-raised); border-top: 1px solid var(--graphite-light); border-bottom: 1px solid var(--graphite-light); }
.why-inner { max-width: 700px; margin: 0 auto; }
.why-inner h2 { font-size: 24px; margin-bottom: 16px; }
.why-inner p { font-size: 15.5px; }

/* ---------- FAQ ---------- */
.faq { padding: 54px 24px 70px; }
.faq-inner { max-width: 720px; margin: 0 auto; }
.faq h2 { text-align: center; margin-bottom: 26px; font-size: 26px; }
.faq-item {
  background: var(--paper-raised); border-radius: 10px; padding: 4px 18px; margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.faq-item summary {
  cursor: pointer; padding: 16px 0; font-weight: 600; font-size: 15.5px; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; font-size: 20px; color: var(--cobalt); font-weight: 400; margin-left: 12px;
}
.faq-item[open] summary::after { content: '–'; }
.faq-item p { padding-bottom: 16px; font-size: 14.5px; color: var(--graphite); margin: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--paper); color: var(--ink); padding: 50px 24px 0; border-top: 1px solid var(--graphite-light); }
.footer-grid {
  max-width: 1180px; margin: 0 auto; display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 36px;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-bottom: 10px; }
.footer-brand .brand-mark { border-color: var(--cobalt); }
.footer-brand .brand-mark span:first-child { background: var(--cobalt); }
.footer-brand-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--ink); }
.footer-tagline { color: var(--graphite); font-size: 13.5px; max-width: 240px; margin: 0; }

.footer-col h4 {
  font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--graphite); margin: 0 0 14px; font-weight: 600;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--ink); opacity: 0.8; text-decoration: none; font-size: 14px; }
.footer-col a:hover { color: var(--cobalt); opacity: 1; text-decoration: underline; }

.footer-bottom {
  max-width: 1180px; margin: 0 auto; padding: 18px 0 22px;
  border-top: 1px solid var(--graphite-light);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
}
.footer-bottom p { color: var(--graphite); font-size: 13px; margin: 0; }
.footer-bottom nav { display: flex; gap: 16px; }
.footer-bottom a { color: var(--graphite); text-decoration: none; font-size: 13px; }
.footer-bottom a:hover { color: var(--cobalt); text-decoration: underline; }

/* ---------- Article / Blog pages ---------- */
.breadcrumb {
  max-width: 760px; margin: 22px auto 0; padding: 0 24px;
  font-size: 13px; color: var(--graphite); font-family: var(--font-mono);
}
.breadcrumb a { color: var(--graphite); text-decoration: none; }
.breadcrumb a:hover { color: var(--cobalt); text-decoration: underline; }

.article-header { max-width: 760px; margin: 18px auto 0; padding: 0 24px; }
.article-eyebrow {
  display: inline-block; font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.03em;
  color: var(--cobalt); background: rgba(31,61,122,0.08); padding: 4px 10px; border-radius: 20px;
  text-transform: uppercase; margin-bottom: 14px;
}
.article-header h1 { font-size: clamp(26px, 4vw, 38px); margin-bottom: 10px; }
.article-meta { font-size: 13.5px; color: var(--graphite); font-family: var(--font-mono); }

.toc {
  max-width: 760px; margin: 26px auto 0; padding: 18px 22px;
  background: var(--paper-raised); border: 1px solid var(--graphite-light); border-radius: 10px;
}
.toc p { font-family: var(--font-mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--graphite); margin-bottom: 10px; }
.toc ol { margin: 0; padding-left: 20px; }
.toc a { text-decoration: none; font-size: 14.5px; }
.toc a:hover { text-decoration: underline; }

.article-body { max-width: 760px; margin: 0 auto; padding: 30px 24px 10px; font-size: 16.5px; }
.article-body h2 { font-size: 24px; margin-top: 38px; }
.article-body h3 { font-size: 18.5px; margin-top: 26px; }
.article-body p { color: #33383D; }
.article-body ul, .article-body ol { padding-left: 22px; }
.article-body li { margin-bottom: 8px; }
.article-body strong { color: var(--ink); }

.callout {
  background: rgba(31,61,122,0.06); border-left: 4px solid var(--cobalt);
  border-radius: 8px; padding: 16px 20px; margin: 26px 0; font-size: 15px;
}
.callout strong { color: var(--cobalt); }

.cta-box {
  max-width: 760px; margin: 40px auto; padding: 26px 28px; border-radius: var(--radius);
  background: var(--cobalt); color: #fff; text-align: center;
}
.cta-box h3 { color: #fff; margin-bottom: 8px; font-size: 20px; }
.cta-box p { color: rgba(255,255,255,0.85); margin-bottom: 18px; }
.cta-box a {
  display: inline-block; background: #fff; color: var(--cobalt); text-decoration: none;
  font-weight: 700; padding: 11px 24px; border-radius: 50px; font-size: 14.5px;
}

.related-links { max-width: 760px; margin: 0 auto 50px; padding: 0 24px; }
.related-links p { font-family: var(--font-mono); font-size: 12.5px; text-transform: uppercase; color: var(--graphite); margin-bottom: 10px; }
.related-links ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.related-links a { font-size: 14.5px; text-decoration: none; }
.related-links a:hover { text-decoration: underline; }

/* ---------- Print ---------- */
@media print {
  body * { visibility: hidden; }
  #omrSheetContainer, #omrSheetContainer * { visibility: visible; }
  #omrSheetContainer {
    position: absolute; left: 0; top: 0; width: 100%; margin: 0; padding: 0; box-shadow: none;
  }
  .omr-sheet { border: 2px solid #000; }
}

/* About page: founder card */
.founder-card { display: flex; gap: 22px; align-items: flex-start; background: var(--paper-raised); border: 1px solid var(--graphite-light); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px; margin: 26px 0 8px; }
.founder-photo { position: relative; flex: 0 0 112px; width: 112px; height: 112px; border-radius: 50%; overflow: hidden; }
.founder-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.founder-initials { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--cobalt); border-radius: 50%; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 34px; letter-spacing: 1px; }
.founder-text h2 { margin: 0; font-size: 22px; }
.founder-role { margin: 2px 0 10px; color: var(--graphite) !important; font-size: 14px; font-weight: 600; }
.founder-text p:last-child { margin-bottom: 0; }
@media (max-width: 560px) { .founder-card { flex-direction: column; align-items: center; text-align: center; } }

/* Count pages and PDF hub */
.fact-table { width: 100%; border-collapse: collapse; margin: 18px 0 24px; font-size: 15px; }
.fact-table th, .fact-table td { border: 1px solid var(--graphite-light); padding: 9px 12px; text-align: left; vertical-align: top; }
.fact-table th { background: var(--paper-raised); font-family: var(--font-mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--graphite); }
.pdf-table td:nth-child(2) { white-space: nowrap; }
.dl-link { font-weight: 600; white-space: nowrap; }
@media (max-width: 640px) { .pdf-table { display: block; overflow-x: auto; } }
.pdf-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0 8px; }
.pdf-btn { display: inline-flex; flex-direction: column; gap: 2px; padding: 13px 20px; border-radius: 8px; background: var(--cobalt); color: #fff !important; font-weight: 600; text-decoration: none !important; box-shadow: var(--shadow-sm); }
.pdf-btn small { font-weight: 400; font-size: 12px; opacity: 0.85; }
.pdf-btn.alt { background: #fff; color: var(--cobalt) !important; border: 1.5px solid var(--cobalt); }
.pdf-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.page-gen { padding-top: 30px; }
.ready-sheets { padding: 50px 24px; background: var(--paper-raised); }
.ready-inner { max-width: 1100px; margin: 0 auto; }
.ready-inner h2 { margin-bottom: 8px; font-size: 26px; }
.ready-inner > p { color: var(--graphite); max-width: 760px; }
.ready-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 22px; }
@media (max-width: 880px) { .ready-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .ready-grid { grid-template-columns: 1fr; } }
.ready-card { display: block; padding: 16px 18px; border: 1px solid var(--graphite-light); border-radius: var(--radius); background: #fff; text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); }
.ready-card strong { display: block; font-family: var(--font-display); font-size: 17px; color: var(--cobalt); }
.ready-card span { font-size: 13.5px; color: var(--graphite); }
.ready-card:hover { box-shadow: var(--shadow-md); }
