/* GP Tools: the shared theme of every tool on guruprakashmp.github.io.
 *
 * Loaded from the main site (/assets/css/gp-tools.css) by every tool, with
 * /assets/js/gp-bar.js, so one edit here restyles them all. Two ways to use it:
 *   - a full page (the paper indexes): <body class="gp-page"> gets the colours, the font,
 *     the slim bar (.gp-bar), the starfield header band (.gp-hero) and the footer (.gp-footer);
 *   - a full-screen app (PaperMol, Paper into Structures): only the Tools menu (.gp-tools)
 *     inside the app's own header, coloured by the app through the --gp-menu-* variables.
 * Every rule is scoped to a gp- class, so the apps are not restyled.
 * No external fonts or scripts: Inter is self-hosted under /assets/fonts/inter/
 * (SIL Open Font License, see OFL.txt there); system fonts are the fallback. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter/inter-greek-wght-normal.woff2") format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}

:root {
  --gp-navy: #0f172a;
  --gp-navy-2: #122040;
  --gp-blue: #3b82f6;
  --gp-indigo: #818cf8;
  --gp-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gp-max: 1180px;
}

/* ------------------------------------------------------------ full page */
/* Reading colours: a plain, high-contrast ground (light: navy on white; dark: near-white
   on navy). #3b82f6 is an accent only: as text on white it is 3.7:1, so links use blue-700. */
body.gp-page {
  --gp-bg: #f7f8fa;
  --gp-surface: #ffffff;
  --gp-surface-2: #f1f4f8;
  --gp-text: #0f172a;
  --gp-text-2: #4b5567;
  --gp-line: #e3e7ee;
  --gp-line-2: #cdd4df;
  --gp-link: #1d4ed8;
  --gp-accent: #2563eb;
  --gp-accent-ink: #ffffff;
  --gp-accent-soft: #eef4ff;
  --gp-accent-line: #c7d8fb;
  --gp-focus: #3b82f6;
  --gp-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 1px rgba(15, 23, 42, 0.03);
  --gp-shadow-2: 0 4px 14px rgba(15, 23, 42, 0.08);
  margin: 0;
  background: var(--gp-bg);
  color: var(--gp-text);
  font-family: var(--gp-font);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (prefers-color-scheme: dark) {
  body.gp-page {
    --gp-bg: #0b1222;
    --gp-surface: #101a2e;
    --gp-surface-2: #15213a;
    --gp-text: #e5eaf2;
    --gp-text-2: #a7b3c6;
    --gp-line: #1e2b45;
    --gp-line-2: #2c3c5c;
    --gp-link: #93c5fd;
    --gp-accent: #60a5fa;
    --gp-accent-ink: #0b1222;
    --gp-accent-soft: #14233f;
    --gp-accent-line: #284a7e;
    --gp-focus: #60a5fa;
    --gp-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    --gp-shadow-2: 0 6px 18px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
/* :where() keeps these defaults at the lowest specificity, so a page's own classes win. */
:where(body.gp-page) *, :where(body.gp-page) *::before, :where(body.gp-page) *::after { box-sizing: border-box; }
:where(body.gp-page) a { color: var(--gp-link); }
:where(body.gp-page) :focus-visible { outline: 2px solid var(--gp-focus); outline-offset: 2px; }
.gp-wrap { max-width: var(--gp-max); margin: 0 auto; padding: 0 20px; }

/* the slim bar */
.gp-bar {
  position: sticky; top: 0; z-index: 50;
  background: var(--gp-navy);
  color: #e2e8f0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 1px 0 rgba(2, 6, 23, 0.4);
  font-family: var(--gp-font);
}
.gp-bar-in {
  max-width: var(--gp-max); margin: 0 auto; padding: 0 20px;
  min-height: 56px; display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap;
}
.gp-home { display: inline-flex; flex: none; border-radius: 8px; }
.gp-home img { display: block; width: 30px; height: 30px; border-radius: 7px; }
.gp-bar-title {
  color: #fff !important; text-decoration: none; font-weight: 650; font-size: 0.97rem;
  letter-spacing: -0.01em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 4px 2px 4px 12px; border-left: 1px solid rgba(148, 163, 184, 0.28);
}
.gp-bar-title:hover { color: #bfdbfe !important; }
.gp-bar-nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 2px; }
.gp-bar-nav a {
  color: #cbd5e1 !important; text-decoration: none; font-size: 0.875rem; font-weight: 500;
  padding: 7px 11px; border-radius: 7px; white-space: nowrap;
}
.gp-bar-nav a:hover { color: #fff !important; background: rgba(148, 163, 184, 0.12); }
.gp-bar-nav a[aria-current="page"] { color: #fff !important; background: rgba(148, 163, 184, 0.18); box-shadow: inset 0 -2px 0 var(--gp-blue); }
@media (max-width: 860px) {
  .gp-bar { position: static; }
  .gp-bar-nav { order: 3; width: 100%; margin: 0 -8px; padding: 0 0 8px; }
  .gp-bar-nav a { padding: 5px 8px; font-size: 0.85rem; }
  .gp-bar-title { border-left: 0; padding-left: 4px; }
}

/* the starfield header band: stars only here, never behind the reading area */
.gp-hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(160deg, var(--gp-navy) 0%, var(--gp-navy-2) 60%, #0d1526 100%);
  color: #f8fafc; font-family: var(--gp-font);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}
.gp-hero > canvas.starfield {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: -1;
}
.gp-hero-in { max-width: var(--gp-max); margin: 0 auto; padding: 36px 20px 32px; }
.gp-hero-kicker {
  margin: 0 0 8px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: #a5b4fc;
}
.gp-hero-kicker a { color: inherit !important; text-decoration: none; }
.gp-hero-kicker a:hover { color: #c7d2fe !important; }
.gp-hero-title {
  margin: 0; font-size: clamp(1.6rem, 3.6vw, 2.25rem); line-height: 1.15;
  font-weight: 700; letter-spacing: -0.02em; color: #fff; overflow-wrap: anywhere;
}
.gp-hero-sub { margin: 10px 0 0; max-width: 68ch; color: #cbd5e1; font-size: 1rem; }
.gp-stats {
  margin: 24px 0 0; display: grid; gap: 1px; max-width: 860px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  background: rgba(148, 163, 184, 0.22); border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px; overflow: hidden;
}
.gp-stat { padding: 12px 16px; background: rgba(11, 18, 34, 0.78); }
.gp-stat dt {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: #94a3b8;
}
.gp-stat dd {
  margin: 4px 0 0; font-size: 1.2rem; font-weight: 650; color: #fff;
  font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
}
.gp-stat dd a { color: #fff !important; text-decoration: none; border-bottom: 1px dotted rgba(255, 255, 255, 0.5); }
.gp-hero.gp-slim .gp-hero-in { padding: 18px 20px 17px; }
.gp-hero.gp-slim .gp-hero-kicker { margin-bottom: 4px; text-transform: none; letter-spacing: 0; font-size: 0.85rem; }
.gp-hero.gp-slim .gp-hero-title { font-size: clamp(1.3rem, 2.6vw, 1.6rem); font-weight: 650; }
@media (max-width: 600px) {
  .gp-hero-in { padding: 26px 16px 22px; }
  .gp-stat { padding: 10px 12px; }
  .gp-stat dd { font-size: 1.05rem; }
}

/* the footer */
.gp-footer {
  margin-top: 64px; background: var(--gp-navy); color: #94a3b8;
  font-family: var(--gp-font); font-size: 0.875rem; line-height: 1.55;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}
.gp-footer-in {
  max-width: var(--gp-max); margin: 0 auto; padding: 36px 20px 28px;
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 28px;
}
.gp-footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 28px 36px; }
.gp-footer-col h2 {
  margin: 2px 0 10px; font-size: 0.75rem; font-weight: 650; letter-spacing: 0.08em;
  text-transform: uppercase; color: #e2e8f0;
}
.gp-footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.gp-footer-col p { margin: 10px 0 0; max-width: 46ch; }
.gp-footer-col strong { color: #e2e8f0; font-weight: 600; }
.gp-footer a { color: #cbd5e1; text-decoration: none; }
.gp-footer a:hover { color: #fff; text-decoration: underline; }
.gp-footer a[aria-current="page"] { color: #fff; font-weight: 600; }
.gp-footer-made {
  display: inline-flex; align-items: center; gap: 10px; color: #fff !important;
  font-weight: 650; text-decoration: none !important; font-size: 0.95rem;
}
.gp-footer-made img { display: block; width: 26px; height: 26px; border-radius: 6px; }
.gp-footer-made:hover span { text-decoration: underline; }
.gp-footer-note { margin: 0; flex: 1 1 320px; }
.gp-footer-base {
  max-width: var(--gp-max); margin: 0 auto; padding: 14px 20px 22px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px;
  border-top: 1px solid rgba(148, 163, 184, 0.14); font-size: 0.8rem; color: #8392a8;
}
@media (max-width: 860px) {
  .gp-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gp-footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .gp-footer-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------ the Tools menu */
/* Colours come from --gp-tools-* / --gp-menu-* so an app can match its own theme; the
   defaults suit the navy bar. */
.gp-tools { position: relative; display: inline-flex; flex: none; font-family: inherit; }
.gp-tools-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px;
  margin: 0; border-radius: 8px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600;
  line-height: 1; color: var(--gp-tools-text, #e2e8f0);
  background: var(--gp-tools-bg, transparent);
  border: 1px solid var(--gp-tools-line, rgba(148, 163, 184, 0.38));
}
.gp-tools-btn:hover { background: var(--gp-tools-hover, rgba(148, 163, 184, 0.16)); }
.gp-tools-btn:focus-visible { outline: 2px solid var(--gp-blue); outline-offset: 2px; }
.gp-tools-btn[aria-expanded="true"] { background: var(--gp-tools-hover, rgba(148, 163, 184, 0.16)); }
.gp-tools-btn .gp-ic { width: 15px; height: 15px; fill: currentColor; opacity: 0.9; flex: none; }
.gp-tools-btn .gp-caret {
  width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; opacity: 0.75; flex: none;
}
.gp-tools-btn[aria-expanded="true"] .gp-caret { transform: rotate(180deg); }
.gp-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 1000;
  width: 330px; max-width: calc(100vw - 16px); max-height: min(72vh, 560px); overflow: auto;
  padding: 6px; border-radius: 12px; text-align: left;
  background: var(--gp-menu-bg, #0f172a);
  color: var(--gp-menu-text, #e2e8f0);
  border: 1px solid var(--gp-menu-line, rgba(129, 140, 248, 0.36));
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.34);
  font-size: 14px; line-height: 1.35;
}
.gp-menu[hidden] { display: none; }
.gp-tools[data-align="end"] .gp-menu { left: auto; right: 0; }
.gp-tools.gp-flip-r .gp-menu { left: auto; right: 0; }
.gp-tools.gp-flip-l .gp-menu { right: auto; left: 0; }
.gp-menu-h {
  margin: 8px 10px 4px; font-size: 11px; font-weight: 650; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--gp-menu-muted, #94a3b8);
}
.gp-menu ul { list-style: none; margin: 0; padding: 0; }
.gp-menu-a, .gp-menu-all {
  display: block; padding: 7px 10px; border-radius: 8px; text-decoration: none !important;
  color: inherit !important;
}
.gp-menu-a:hover, .gp-menu-a:focus-visible, .gp-menu-all:hover, .gp-menu-all:focus-visible {
  background: var(--gp-menu-hover, rgba(59, 130, 246, 0.18)); outline: none;
}
.gp-menu-a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--gp-menu-accent, #818cf8); }
.gp-menu-n { display: block; font-weight: 600; }
.gp-menu-d { display: block; margin-top: 1px; font-size: 12.5px; color: var(--gp-menu-muted, #94a3b8); }
.gp-menu-here {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px; vertical-align: 1px;
  font-size: 10.5px; font-weight: 600; color: var(--gp-menu-accent, #a5b4fc);
  border: 1px solid currentColor;
}
.gp-menu-all {
  margin-top: 4px; border-top: 1px solid var(--gp-menu-line, rgba(129, 140, 248, 0.24));
  border-radius: 0 0 8px 8px; font-size: 13px; color: var(--gp-menu-muted, #94a3b8) !important;
}
@media (max-width: 520px) {
  .gp-tools-btn { padding: 0 8px; }
  .gp-tools[data-compact] .gp-tools-lbl { display: none; }
}
