/* ============================================================
   santosh-optimized.css
   
   Author:          Santosh Pandit
   Date:            2026-03-06
   Base:            simple.css by Kevin (simplecss.org)
   Enhancements:    Accessibility, responsive images, print,
                    dark mode, quantum theme, CSP-compliant
   Typography:      Space Grotesk + IBM Plex Serif Variable
   
   SECTION INDEX
   ─────────────────────────────────────────────────────────
    1.  Font Files (@font-face declarations)
    2.  Custom Properties (CSS variables)
    3.  Reset & Base Styles
    4.  Layout & Grid System
    5.  Typography
    6.  Navigation & Navbar
    7.  Buttons
    8.  Forms & Inputs
    9.  Tables & Table Scroll
   10.  Cards (article element)
   11.  Alerts & Notices
   12.  Badges
   13.  Accordion (details/summary)
   14.  Tooltips
   15.  Dropdowns
   16.  Utility Classes
   17.  Quantum Theme Enhancements
   18.  Dark Mode
   19.  Accessibility & Motion
   20.  Print Styles
   ============================================================ */


/* ============================================================
   1. FONT FILES (@font-face declarations)
   ============================================================ */

/* ── Space Grotesk (Display/Headings) ──────────────────── */
@font-face {
  font-family: 'Space Grotesk';
  src: url('/assets/fonts/SpaceGrotesk-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Space Grotesk';
  src: url('/assets/fonts/SpaceGrotesk-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Space Grotesk';
  src: url('/assets/fonts/SpaceGrotesk-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── IBM Plex Serif Variable (Body text) ───────────────── */
@font-face {
  font-family: 'IBM Plex Serif';
  src: url('/assets/fonts/IBMPlexSerif-Variable.woff2') format('woff2');
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Serif';
  src: url('/assets/fonts/IBMPlexSerif-Variable-Italic.woff2') format('woff2');
  font-weight: 100 700;
  font-style: italic;
  font-display: swap;
}


/* ============================================================
   2. CUSTOM PROPERTIES (CSS Variables)
   ============================================================ */

:root {
  /* ── Font Families ───────────────────────────────────── */
  --sans-font:    'IBM Plex Serif', ui-serif, Georgia, Cambria, 
                  "Times New Roman", Times, serif;
  
  --display-font: 'Space Grotesk', -apple-system, BlinkMacSystemFont,
                  "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  
  --serif-font:   'IBM Plex Serif', ui-serif, Georgia, Cambria, 
                  "Times New Roman", Times, serif;
  
  --mono-font:    'IBM Plex Serif', Consolas, Menlo, Monaco, 
                  "Andale Mono", "Ubuntu Mono", monospace;

  /* ── Font Weights ────────────────────────────────────── */
  --weight-light:    300;
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  /* ── Letter Spacing ──────────────────────────────────── */
  --tracking-tight:  -0.02em;
  --tracking-normal:  0;
  --tracking-wide:    0.025em;
  --tracking-wider:   0.05em;

  /* ── Geometry ────────────────────────────────────────── */
  --standard-border-radius: 5px;
  --border-width:           1px;

  /* ── Base Palette (Light Mode) ───────────────────────── */
  --bg:           #fff;
  --accent-bg:    #f5f7ff;
  --text:         #212121;
  --text-light:   #565656;
  --border:       #898ea4;
  --accent:       #0d47a1;
  --accent-hover: #1266e2;
  --accent-text:  var(--bg);

  /* ── Semantic Colors ─────────────────────────────────── */
  --code:          #d81b60;
  --preformatted:  #444;
  --marked:        #fd3;
  --disabled:      #e0e0e0;

  /* ── Alert/Badge Palette ─────────────────────────────── */
  --success:       #1b5e20;
  --success-bg:    #e8f5e9;
  --success-border:#388e3c;
  --warning:       #e65100;
  --warning-bg:    #fff3e0;
  --warning-border:#f57c00;
  --danger:        #b71c1c;
  --danger-bg:     #ffebee;
  --danger-border: #e53935;
  --info:          #01579b;
  --info-bg:       #e1f5fe;
  --info-border:   #0288d1;

  /* ── Quantum Theme Colors ────────────────────────────── */
  --quantum-blue:      #0a4f8f;
  --quantum-cyan:      #00d4ff;
  --quantum-electric:  #00ffcc;
  --quantum-purple:    #6e3fff;
  --quantum-dark:      #0d1b2a;
  --crypto-gold:       #ffd700;
  --crypto-amber:      #ff9500;

  /* ── Gradients ───────────────────────────────────────── */
  --gradient-quantum:  linear-gradient(135deg, var(--quantum-blue) 0%, var(--quantum-purple) 100%);
  --gradient-cyber:    linear-gradient(135deg, var(--quantum-cyan) 0%, var(--quantum-electric) 100%);
  --gradient-crypto:   linear-gradient(135deg, var(--crypto-amber) 0%, var(--crypto-gold) 100%);

  /* ── Effects ─────────────────────────────────────────── */
  --card-shadow:    0 2px 8px rgba(0,0,0,0.10);
  --dropdown-shadow: 0 4px 12px rgba(0,0,0,0.15);
  --glow-cyan:      0 0 20px rgba(0, 212, 255, 0.3);
  --glow-electric:  0 0 20px rgba(0, 255, 204, 0.3);

  /* ── Tooltip ─────────────────────────────────────────── */
  --tooltip-bg:   #212121;
  --tooltip-text: #fff;
}


/* ============================================================
   3. RESET & BASE STYLES
   ============================================================ */

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

textarea,
select,
input,
progress {
  appearance: none;
  -webkit-appearance: none;
}

html {
  font-family: var(--sans-font);
  scroll-behavior: smooth;
}

body {
  color: var(--text);
  background-color: var(--bg);
  font-size: 1.15rem;
  line-height: 1.5;
  display: grid;
  grid-template-columns: 1fr min(45rem, 90%) 1fr;
  margin: 0;
}

body > * {
  grid-column: 2;
}

/* ── Text Selection ──────────────────────────────────────── */
::selection {
  background-color: var(--accent);
  color: var(--accent-text);
}

/* ── Horizontal Rule ─────────────────────────────────────── */
hr {
  border: none;
  height: 2px;
  margin: 3rem auto;
  max-width: 200px;
  background: var(--gradient-cyber);
  border-radius: 2px;
}

/* ── Abbreviations ───────────────────────────────────────── */
abbr[title] {
  cursor: help;
  text-decoration-line: underline;
  text-decoration-style: dotted;
}

/* ── Superscript / Subscript ─────────────────────────────── */
sup,
sub {
  vertical-align: baseline;
  position: relative;
}

sup { top: -0.4em; }
sub { top:  0.3em; }

/* ── Mark / Highlight ────────────────────────────────────── */
mark {
  background: linear-gradient(120deg, rgba(0, 212, 255, 0.15) 0%, rgba(0, 255, 204, 0.15) 100%);
  color: var(--text);
  padding: 0.1em 0.3em;
  border-radius: 3px;
  font-weight: var(--weight-semibold);
  border-bottom: 2px solid var(--quantum-cyan);
}

mark a {
  color: var(--accent);
}

/* ── Cite / Definition Term ──────────────────────────────── */
cite {
  font-size: 0.9rem;
  color: var(--text-light);
  font-style: normal;
}

dt {
  color: var(--text-light);
}


/* ============================================================
   4. LAYOUT & GRID SYSTEM
   ============================================================ */

/* ── Page Header ─────────────────────────────────────────── */
body > header {
  position: relative;
  background: var(--gradient-quantum);
  color: #fff;
  border-bottom: var(--border-width) solid var(--border);
  text-align: center;
  padding: 3rem 1rem;
  grid-column: 1 / -1;
  overflow: hidden;
}

/* Animated gradient background */
body > header::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.1) 0%, transparent 70%);
  animation: quantum-pulse 15s ease-in-out infinite;
  z-index: 0;
}

@keyframes quantum-pulse {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.5; }
  50% { transform: translate(10%, 10%) scale(1.1); opacity: 0.3; }
}

body > header > * {
  position: relative;
  z-index: 1;
}

body > header > :only-child {
  margin-block-start: 2rem;
}

body > header h1 {
  max-width: 1200px;
  margin: 1rem auto;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body > header p {
  max-width: 40rem;
  margin: 1rem auto;
}

body > header blockquote {
  border-color: var(--quantum-cyan);
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.3rem;
  font-style: italic;
  max-width: 40rem;
  margin: 2rem auto;
  padding-left: 2rem;
  border-left-width: 4px;
}

/* ── Main Content ────────────────────────────────────────── */
main {
  padding-top: 1.5rem;
}

/* ── Page Footer ─────────────────────────────────────────── */
body > footer {
  margin-top: 4rem;
  padding: 2rem 1rem 1.5rem;
  color: var(--text-light);
  font-size: 0.9rem;
  text-align: center;
  border-top: var(--border-width) solid var(--border);
}

/* ── Section ─────────────────────────────────────────────── */
section {
  border-top: var(--border-width) solid var(--border);
  border-bottom: var(--border-width) solid var(--border);
  padding: 2rem 1rem;
  margin: 3rem 0;
}

section + section,
section:first-child {
  border-top: 0;
  padding-top: 0;
}

section + section {
  margin-top: 0;
}

section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

/* Enhanced sections in main */
main > section {
  position: relative;
  background: linear-gradient(to right, transparent, var(--accent-bg) 10%, var(--accent-bg) 90%, transparent);
  border-left: 3px solid var(--quantum-cyan);
  padding-left: 1.5rem;
  margin: 2.5rem 0;
}

main > section h2 {
  color: var(--quantum-blue);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ── Aside ───────────────────────────────────────────────── */
aside {
  background-color: var(--accent-bg);
  border: var(--border-width) solid var(--border);
  border-radius: var(--standard-border-radius);
  width: 30%;
  padding: 0 15px;
  margin-inline-start: 15px;
  float: right;
  font-size: 1rem;
  margin-bottom: 1rem;
}

[dir="rtl"] aside {
  float: left;
}

@media only screen and (width <= 720px) {
  aside {
    width: 100%;
    float: none;
    margin-inline-start: 0;
  }
}

/* ── Reusable Grid System ────────────────────────────────── */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.auto   { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }

@media only screen and (width <= 720px) {
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: 1fr;
  }
}

/* ── Article / Fieldset / Dialog ─────────────────────────── */
article,
fieldset,
dialog {
  border: var(--border-width) solid var(--border);
  padding: 1rem;
  border-radius: var(--standard-border-radius);
  margin-bottom: 1rem;
}

article h2:first-child,
section h2:first-child,
article h3:first-child,
section h3:first-child {
  margin-top: 1rem;
}

/* ── Dialog (Native Modal) ───────────────────────────────── */
dialog {
  max-width: 40rem;
  margin: auto;
  background-color: var(--bg);
}

dialog::backdrop {
  background-color: var(--bg);
  opacity: 0.8;
}

@media only screen and (width <= 720px) {
  dialog {
    max-width: calc(100vw - 2rem);
  }
}

/* ── Images & Video ──────────────────────────────────────── */
img,
video {
  max-width: 100%;
  max-height: 80vh;
  height: auto;
  border-radius: var(--standard-border-radius);
  object-fit: contain;
}

@media only screen and (width > 720px) {
  img:not(.full-width),
  video:not(.full-width) {
    max-width: 600px;
  }

  figure > img,
  figure > picture > img {
    max-width: 700px;
  }
}

/* ── Figure ──────────────────────────────────────────────── */
figure {
  position: relative;
  margin: 2rem 0;
  text-align: center;
  display: block;
  border-radius: calc(var(--standard-border-radius) * 2);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

figure::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
    rgba(0, 212, 255, 0.05) 0%,
    transparent 50%,
    rgba(0, 255, 204, 0.05) 100%);
  pointer-events: none;
}

figure > img,
figure > picture > img {
  display: block;
  margin-inline: auto;
  transition: transform 0.3s ease;
}

figure:hover img {
  transform: scale(1.02);
}

figcaption {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-block: 1rem;
  text-align: center;
  position: sticky;
  left: 0;
}


/* ============================================================
   5. TYPOGRAPHY
   ============================================================ */

/* ── Headings ────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--display-font);
  font-weight: var(--weight-bold);
  line-height: 1.1;
  letter-spacing: var(--tracking-tight);
  overflow-wrap: break-word;
}

h1 { 
  font-size: 3rem; 
  font-weight: var(--weight-bold);
}

h2 { 
  font-size: 2.6rem; 
  margin-top: 3rem;
  font-weight: var(--weight-semibold);
}

h3 { 
  font-size: 2rem;
  margin-top: 3rem;
  font-weight: var(--weight-semibold);
}

h4 { 
  font-size: 1.44rem;
  font-weight: var(--weight-semibold);
}

h5 { 
  font-size: 1.15rem;
  font-weight: var(--weight-semibold);
}

h6 { 
  font-size: 0.96rem;
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

/* Responsive heading scale */
@media only screen and (width <= 720px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2.1rem; }
  h3 { font-size: 1.75rem; }
  h4 { font-size: 1.25rem; }
}

/* ── CTA Section Headings ────────────────────────────────── */
main > h3 {
  color: var(--quantum-blue);
  text-align: center;
  margin-top: 4rem;
  font-size: 2.2rem;
}

main > h3 + p {
  text-align: center;
  font-size: 1.2rem;
  max-width: 50rem;
  margin: 1.5rem auto;
  color: var(--text-light);
}

main > h3 + p + hr + a.button {
  display: block;
  max-width: 300px;
  margin: 2rem auto;
  text-align: center;
}

/* ── Body Text ───────────────────────────────────────────── */
p {
  margin: 1.5rem 0;
  font-family: var(--sans-font);
}

/* Lead paragraph */
.lead {
  font-size: 1.35rem;
  line-height: 1.6;
  color: var(--text-light);
  font-family: var(--sans-font);
}

/* Small text */
.small,
small {
  font-size: 0.875rem;
}

/* ── Links ───────────────────────────────────────────────── */
a,
a:visited {
  color: var(--accent);
  font-weight: var(--weight-medium);
  position: relative;
  transition: all 0.2s ease;
}

a:hover {
  text-decoration: none;
}

a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-cyber);
  transition: width 0.3s ease;
}

a:hover::after {
  width: 100%;
}

/* ── Blockquote ──────────────────────────────────────────── */
blockquote {
  margin-inline: 2rem 0;
  margin-block: 2rem;
  padding: 0.4rem 0.8rem;
  border-inline-start: 0.35rem solid var(--accent);
  color: var(--text-light);
  font-style: italic;
  font-family: var(--sans-font);
}

/* ── Lists ───────────────────────────────────────────────── */
ul,
ol {
  padding-inline-start: 2rem;
  margin: 1rem 0;
  font-family: var(--sans-font);
}

ul li,
ol li {
  margin-bottom: 0.35rem;
}

/* Enhanced list items in details */
details ul li {
  padding-left: 0.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

details ul li::marker {
  color: var(--quantum-cyan);
  font-weight: var(--weight-bold);
}

/* ── Code & Pre ──────────────────────────────────────────── */
code,
pre,
pre span,
kbd,
samp {
  font-family: var(--mono-font);
  color: var(--code);
}

code {
  font-weight: var(--weight-medium);
  font-style: italic;
}

kbd {
  color: var(--preformatted);
  border: var(--border-width) solid var(--preformatted);
  border-bottom: 3px solid var(--preformatted);
  border-radius: var(--standard-border-radius);
  padding: 0.1rem 0.4rem;
  font-weight: var(--weight-semibold);
  font-style: normal;
}

pre {
  background-color: var(--accent-bg);
  border: var(--border-width) solid var(--border);
  border-radius: var(--standard-border-radius);
  padding: 1rem 1.4rem;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  color: var(--preformatted);
  margin-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
}

pre code {
  color: var(--preformatted);
  background: none;
  margin: 0;
  padding: 0;
  font-weight: var(--weight-regular);
  font-style: normal;
}

/* ── Progress Bar ────────────────────────────────────────── */
progress {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--accent-bg);
  border: var(--border-width) solid var(--border);
  border-radius: var(--standard-border-radius);
  width: 100%;
  margin-bottom: 1rem;
}

progress:indeterminate {
  background-color: var(--accent-bg);
}

progress::-webkit-progress-bar {
  border-radius: var(--standard-border-radius);
  background-color: var(--accent-bg);
}

progress::-webkit-progress-value {
  border-radius: var(--standard-border-radius);
  background-color: var(--accent);
}

progress::-moz-progress-bar {
  border-radius: var(--standard-border-radius);
  background-color: var(--accent);
  transition-property: width;
  transition-duration: 0.3s;
}

progress:indeterminate::-moz-progress-bar {
  background-color: var(--accent-bg);
}


/* ============================================================
   6. NAVIGATION & NAVBAR
   ============================================================ */

/* ── Generic Navigation ──────────────────────────────────── */
nav {
  font-size: 1rem;
  line-height: 2;
  padding: 1rem 0 0;
  font-family: var(--display-font);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
}

nav ul,
nav ol {
  align-items: center;
  display: flex;
  flex-flow: wrap;
  list-style-type: none;
  margin: 0;
  padding: 0;
  place-content: space-around center;
}

nav ul li,
nav ol li {
  display: inline-block;
}

nav a,
nav a:visited {
  border: var(--border-width) solid var(--border);
  border-radius: var(--standard-border-radius);
  color: var(--text);
  display: inline-block;
  margin: 0 0.5rem 1rem;
  padding: 0.1rem 1rem;
  text-decoration: none;
  font-family: var(--display-font);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: var(--tracking-wider);
}

nav a:hover,
nav a.current,
nav a[aria-current="page"],
nav a[aria-current="true"] {
  border-color: var(--accent);
  color: var(--accent);
  cursor: pointer;
}

@media only screen and (width <= 720px) {
  nav a {
    border: none;
    padding: 0;
    text-decoration: underline;
    line-height: 1;
  }

  nav a.current {
    background: transparent;
  }
}

/* ── Sticky Navbar ───────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  background-color: var(--bg);
  border-bottom: var(--border-width) solid var(--border);
  padding: 0.5rem 1.5rem;
  grid-column: 1 / -1;
  font-family: var(--display-font);
}

.navbar-brand {
  font-size: 1.2rem;
  font-weight: var(--weight-bold);
  color: var(--text);
  text-decoration: none;
  font-family: var(--display-font);
  letter-spacing: var(--tracking-tight);
}

.navbar-brand:hover {
  color: var(--accent);
}

.navbar nav {
  padding: 0;
  line-height: 1;
}

.navbar nav ul {
  gap: 0.25rem;
  place-content: flex-start center;
}

.navbar nav a {
  margin: 0 0.25rem;
  padding: 0.25rem 0.75rem;
}


/* ============================================================
   7. BUTTONS
   ============================================================ */

/* ── Base Button ─────────────────────────────────────────── */
button,
.button,
a.button,
input[type="submit"],
input[type="reset"],
input[type="button"] {
  background: var(--gradient-quantum);
  border: none;
  color: #fff;
  padding: 0.85rem 2rem;
  text-decoration: none;
  line-height: normal;
  font-size: 1.2rem;
  font-family: var(--display-font);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  border-radius: var(--standard-border-radius);
  box-shadow: 0 4px 15px rgba(10, 79, 143, 0.3);
  display: inline-block;
  cursor: pointer;
  margin-bottom: 0.5rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

/* ── Hover ───────────────────────────────────────────────── */
button:enabled:hover,
.button:not([aria-disabled="true"]):hover,
input[type="submit"]:enabled:hover,
input[type="reset"]:enabled:hover,
input[type="button"]:enabled:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-cyan), 0 6px 20px rgba(10, 79, 143, 0.4);
}

.button:hover::before {
  width: 300px;
  height: 300px;
}

/* ── Focus ───────────────────────────────────────────────── */
.button:focus-visible,
button:focus-visible:where(:enabled),
input:enabled:focus-visible:where(
  [type="submit"],
  [type="reset"],
  [type="button"]
) {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ── Disabled ────────────────────────────────────────────── */
.button[aria-disabled="true"],
button[disabled],
input:disabled {
  cursor: not-allowed;
  background-color: var(--disabled);
  border-color: var(--disabled);
  color: var(--text-light);
  background: var(--disabled);
  box-shadow: none;
}

/* ── Button Variants ─────────────────────────────────────── */
.button-outline {
  background-color: transparent;
  background: transparent;
  color: var(--accent);
  border: var(--border-width) solid var(--accent);
}

.button-outline:hover {
  background: var(--accent);
  color: var(--accent-text);
}

.button-sm {
  padding: 0.25rem 0.65rem;
  font-size: 0.875rem;
}

.button-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1.2rem;
}

.button-success {
  background-color: var(--success);
  border-color: var(--success);
  background: var(--success);
}

.button-success:hover {
  background-color: var(--success-border);
  border-color: var(--success-border);
}

.button-danger {
  background-color: var(--danger);
  border-color: var(--danger);
  background: var(--danger);
}

.button-danger:hover {
  background-color: var(--danger-border);
  border-color: var(--danger-border);
}


/* ============================================================
   8. FORMS & INPUTS
   ============================================================ */

textarea,
select,
input {
  color: var(--text);
  background-color: var(--bg);
  border: var(--border-width) solid var(--border);
  font-size: inherit;
  font-family: var(--sans-font);
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  border-radius: var(--standard-border-radius);
  box-shadow: none;
  max-width: 100%;
  display: inline-block;
}

label {
  display: block;
  margin-bottom: 0.25rem;
  font-family: var(--sans-font);
}

textarea:not([cols]) {
  width: 100%;
}

/* ── Custom Select Arrow ─────────────────────────────────── */
select:not([multiple]) {
  background-image:
    linear-gradient(45deg,  transparent 49%, var(--text) 51%),
    linear-gradient(135deg, var(--text) 51%, transparent 49%);
  background-position: calc(100% - 15px), calc(100% - 10px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-inline-end: 25px;
}

[dir="rtl"] select:not([multiple]) {
  background-position: 10px, 15px;
}

/* ── Checkbox & Radio ────────────────────────────────────── */
input[type="checkbox"],
input[type="radio"] {
  vertical-align: middle;
  position: relative;
  width: min-content;
}

input[type="checkbox"] + label,
input[type="radio"]    + label {
  display: inline-block;
}

input[type="radio"] {
  border-radius: 100%;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background-color: var(--accent);
}

input[type="checkbox"]:checked::after {
  content: " ";
  width: 0.2em;
  height: 0.4em;
  border-radius: 0;
  position: absolute;
  top: 0.04em;
  left: 0.18em;
  background-color: transparent;
  border-right:  solid var(--bg) 0.08em;
  border-bottom: solid var(--bg) 0.08em;
  font-size: 1.8em;
  transform: rotate(45deg);
}

input[type="radio"]:checked::after {
  content: " ";
  width: 0.3em;
  height: 0.3em;
  border-radius: 100%;
  position: absolute;
  top: 0.125em;
  left: 0.125em;
  background-color: var(--bg);
  font-size: 1.8em;
}

/* ── Range, Color, File ──────────────────────────────────── */
input[type="range"] { padding: 0; }

input[type="color"] {
  height: 2.5rem;
  padding: 0.2rem;
}

input[type="file"] {
  border: 0;
}

/* ── Disabled ────────────────────────────────────────────── */
input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
  background-color: var(--disabled);
  border-color: var(--disabled);
  color: var(--text-light);
}

/* ── Focus ───────────────────────────────────────────────── */
a:focus-visible,
summary:focus-visible,
textarea:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Validation States ───────────────────────────────────── */
input.is-valid,
textarea.is-valid,
select.is-valid {
  border-color: var(--success-border);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23388e3c' d='M10.28 2.28L4 8.56 1.72 6.28A1 1 0 0 0 .28 7.72l3 3a1 1 0 0 0 1.44 0l7-7a1 1 0 0 0-1.44-1.44z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-inline-end: 2.25rem;
}

input.is-invalid,
textarea.is-invalid,
select.is-invalid {
  border-color: var(--danger-border);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Ccircle cx='6' cy='6' r='6' fill='%23e53935'/%3E%3Cpath fill='%23fff' d='M5 3h2v4H5zm0 5h2v2H5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-inline-end: 2.25rem;
}

.field-hint {
  font-size: 0.875rem;
  margin-top: -0.25rem;
  margin-bottom: 0.5rem;
}

.field-hint.is-valid   { color: var(--success); }
.field-hint.is-invalid { color: var(--danger); }

/* ── Responsive ──────────────────────────────────────────── */
@media only screen and (width <= 720px) {
  textarea,
  select,
  input {
    width: 100%;
  }
}


/* ============================================================
   9. TABLES & TABLE SCROLL
   ============================================================ */

/* ── Base Table Styles ───────────────────────────────────── */
table {
  border-collapse: collapse;
  margin: 1.5rem 0;
  width: 100%;
  font-family: var(--sans-font);
}

td,
th {
  border: var(--border-width) solid var(--border);
  text-align: start;
  padding: 0.5rem;
}

th {
  background-color: var(--accent-bg);
  font-weight: var(--weight-semibold);
  font-family: var(--display-font);
}

tr:nth-child(even) {
  background-color: var(--accent-bg);
}

table caption {
  font-weight: var(--weight-semibold);
  margin-bottom: 0.5rem;
  text-align: start;
  font-family: var(--display-font);
}

/* ── Table Variants ──────────────────────────────────────── */
.table-hover tbody tr:hover {
  background-color: color-mix(in srgb, var(--accent) 10%, transparent);
  cursor: default;
}

.table-sm td,
.table-sm th {
  padding: 0.25rem 0.4rem;
  font-size: 0.9rem;
}

.table-borderless td,
.table-borderless th {
  border: none;
}

/* ── Table Scroll Container ──────────────────────────────── */
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border: var(--border-width) solid var(--border);
  border-radius: var(--standard-border-radius);
}

.table-scroll table {
  width: 100%;
  margin: 0;
  border: none;
}

.table-scroll td:first-child,
.table-scroll th:first-child {
  border-left: none;
}

.table-scroll td:last-child,
.table-scroll th:last-child {
  border-right: none;
}

.table-scroll tr:first-child th {
  border-top: none;
}

.table-scroll tr:last-child td {
  border-bottom: none;
}

/* ── Scrollbar Styling ───────────────────────────────────── */
.table-scroll::-webkit-scrollbar {
  height: 14px;
}

.table-scroll::-webkit-scrollbar-track {
  background: var(--accent-bg);
  border-radius: 8px;
}

.table-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 8px;
  border: 2px solid var(--accent-bg);
}

.table-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.table-scroll {
  scrollbar-width: auto;
  scrollbar-color: var(--border) var(--accent-bg);
}

/* ── Special: Figure Tables ──────────────────────────────── */
figure > table {
  width: max-content;
  margin: 0;
}


/* ============================================================
   10. CARDS (article element)
   ============================================================ */

.card {
  box-shadow: var(--card-shadow);
  padding: 0;
  overflow: hidden;
}

.card-header {
  background-color: var(--accent-bg);
  border-bottom: var(--border-width) solid var(--border);
  padding: 0.65rem 1rem;
  font-weight: var(--weight-bold);
  font-family: var(--display-font);
  letter-spacing: var(--tracking-normal);
}

.card-body {
  padding: 1rem;
}

.card-footer {
  background-color: var(--accent-bg);
  border-top: var(--border-width) solid var(--border);
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

.card-img-top {
  width: 100%;
  max-width: 100%;
  max-height: 16rem;
  object-fit: cover;
  border-radius: 0;
  display: block;
}


/* ============================================================
   11. ALERTS & NOTICES
   ============================================================ */

.notice {
  background: var(--accent-bg);
  border: var(--border-width) solid var(--border);
  border-radius: var(--standard-border-radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-inline-start-width: 4px;
}

.notice p:first-of-type { margin-top: 0; }
.notice p:last-of-type  { margin-bottom: 0; }

.notice-success {
  background-color: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}

.notice-warning {
  background-color: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning);
}

.notice-danger {
  background-color: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}

.notice-info {
  background-color: var(--info-bg);
  border-color: var(--info-border);
  color: var(--info);
}


/* ============================================================
   12. BADGES
   ============================================================ */

.badge {
  display: inline-block;
  padding: 0.2em 0.55em;
  font-size: 0.78em;
  font-weight: var(--weight-bold);
  font-family: var(--display-font);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  line-height: 1;
  border-radius: calc(var(--standard-border-radius) * 2);
  background-color: var(--border);
  color: var(--bg);
  vertical-align: middle;
  white-space: nowrap;
}

.badge-success { background-color: var(--success);       color: #fff; }
.badge-warning { background-color: var(--warning-border); color: #fff; }
.badge-danger  { background-color: var(--danger);         color: #fff; }
.badge-info    { background-color: var(--info);            color: #fff; }
.badge-accent  { background-color: var(--accent);          color: var(--accent-text); }


/* ============================================================
   13. ACCORDION (details / summary)
   ============================================================ */

details {
  background: linear-gradient(135deg, var(--accent-bg) 0%, rgba(var(--accent-bg), 0.3) 100%);
  border: var(--border-width) solid var(--border);
  border-left: 3px solid var(--quantum-cyan);
  border-radius: var(--standard-border-radius);
  padding: 0.7rem 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

details:hover {
  box-shadow: var(--glow-cyan);
  border-left-color: var(--quantum-electric);
}

details[open] {
  background: var(--accent-bg);
  box-shadow: var(--glow-cyan);
}

summary {
  cursor: pointer;
  font-weight: var(--weight-semibold);
  font-family: var(--display-font);
  padding: 0.7rem 1rem;
  margin: -0.7rem -1rem;
  word-break: break-word;
  list-style: none;
  color: var(--quantum-blue);
  font-size: 1.15rem;
  user-select: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "▶";
  float: right;
  font-size: 0.75em;
  transition: transform 0.2s ease;
  margin-top: 0.2em;
  color: var(--quantum-cyan);
  font-weight: var(--weight-bold);
}

details[open] > summary::after {
  transform: rotate(90deg);
}

details[open] > summary + * { margin-top: 0; }
details[open] > summary      { margin-bottom: 0.5rem; }
details[open] > :last-child  { margin-bottom: 0; }

/* ── Accordion Group ─────────────────────────────────────── */
.accordion details {
  border-radius: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.accordion details:first-child {
  border-radius: var(--standard-border-radius)
                 var(--standard-border-radius) 0 0;
}

.accordion details:last-child {
  border-radius: 0 0
                 var(--standard-border-radius)
                 var(--standard-border-radius);
  border-bottom: var(--border-width) solid var(--border);
}


/* ============================================================
   14. TOOLTIPS
   ============================================================ */

[data-tooltip] {
  position: relative;
  cursor: help;
  text-decoration-line: underline;
  text-decoration-style: dotted;
}

[data-tooltip]::before,
[data-tooltip]::after {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 200;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  bottom: calc(100% + 8px);
  background-color: var(--tooltip-bg);
  color: var(--tooltip-text);
  padding: 0.35rem 0.65rem;
  border-radius: var(--standard-border-radius);
  font-size: 0.82rem;
  font-style: normal;
  white-space: nowrap;
  max-width: 220px;
  text-overflow: ellipsis;
  overflow: hidden;
  transform: translateX(-50%) translateY(4px);
}

[data-tooltip]::after {
  content: "";
  bottom: calc(100% + 2px);
  border: 5px solid transparent;
  border-top-color: var(--tooltip-bg);
  transform: translateX(-50%) translateY(4px);
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::before,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  transform: translateX(-50%) translateY(0);
}

[data-tooltip].tooltip-below::before {
  bottom: auto;
  top: calc(100% + 8px);
  transform: translateX(-50%) translateY(-4px);
}

[data-tooltip].tooltip-below::after {
  bottom: auto;
  top: calc(100% + 2px);
  border-top-color: transparent;
  border-bottom-color: var(--tooltip-bg);
  transform: translateX(-50%) translateY(-4px);
}

[data-tooltip].tooltip-below:hover::before,
[data-tooltip].tooltip-below:focus-visible::before {
  transform: translateX(-50%) translateY(0);
}

[data-tooltip].tooltip-below:hover::after,
[data-tooltip].tooltip-below:focus-visible::after {
  transform: translateX(-50%) translateY(0);
}


/* ============================================================
   15. DROPDOWNS
   ============================================================ */

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 150;
  min-width: 12rem;
  background-color: var(--bg);
  border: var(--border-width) solid var(--border);
  border-radius: var(--standard-border-radius);
  box-shadow: var(--dropdown-shadow);
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.dropdown:hover > .dropdown-menu,
.dropdown:focus-within > .dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.dropdown-menu li a {
  display: block;
  padding: 0.45rem 1rem;
  color: var(--text);
  text-decoration: none;
  border: none;
  border-radius: 0;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  font-family: var(--sans-font);
}

.dropdown-menu li a:hover,
.dropdown-menu li a:focus-visible {
  background-color: var(--accent-bg);
  color: var(--accent);
  outline: none;
}

.dropdown-divider {
  height: var(--border-width);
  background-color: var(--border);
  margin: 0.35rem 0;
}

.dropdown.dropdown-end > .dropdown-menu {
  left: auto;
  right: 0;
}


/* ============================================================
   16. UTILITY CLASSES
   ============================================================ */

/* ── Background Utilities ────────────────────────────────── */
.bg-cover {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bg-cover.bg-overlay {
  position: relative;
}

.bg-cover.bg-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 0;
}

.bg-cover.bg-overlay > * {
  position: relative;
  z-index: 1;
}

.bg-fixed {
  background-attachment: fixed;
}

/* ── Typography Utilities ────────────────────────────────── */
.font-display { font-family: var(--display-font); }
.font-sans    { font-family: var(--sans-font); }
.font-serif   { font-family: var(--serif-font); }
.font-mono    { font-family: var(--mono-font); }

.tech-term {
  font-family: var(--display-font);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  font-size: 0.95em;
  position: relative;
}

.heading-display {
  font-family: var(--display-font);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
}

/* ── Text Color Utilities ────────────────────────────────── */
.text-primary  { color: var(--accent); }
.text-muted    { color: var(--text-light); }
.text-success  { color: var(--success); }
.text-warning  { color: var(--warning); }
.text-danger   { color: var(--danger); }
.text-info     { color: var(--info); }
.text-light    { color: #f5f5f5; }
.text-dark     { color: #212121; }

/* ── Text Alignment ──────────────────────────────────────── */
.text-start  { text-align: start; }
.text-center { text-align: center; }
.text-end    { text-align: end; }

/* ── Display Utilities ───────────────────────────────────── */
.d-none   { display: none; }
.d-block  { display: block; }
.d-flex   { display: flex; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }

/* ── Width Utilities ─────────────────────────────────────── */
.w-100 { width: 100%; }
.w-75  { width: 75%; }
.w-50  { width: 50%; }
.w-25  { width: 25%; }

/* ── Image Utilities ─────────────────────────────────────── */
img.full-width,
video.full-width {
  max-width: 100%;
  max-height: none;
}


/* ============================================================
   17. QUANTUM THEME ENHANCEMENTS
   ============================================================ */

/* ── Section Icon Styling ────────────────────────────────── */
.section-icon {
  color: var(--quantum-cyan);
  flex-shrink: 0;
  vertical-align: middle;
}

/* ── Tech Term Hover Effects ─────────────────────────────── */
a:hover .tech-term,
mark:hover {
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

/* ── Strong Elements ─────────────────────────────────────── */
strong {
  position: relative;
  font-weight: var(--weight-semibold);
}


/* ============================================================
   18. DARK MODE
   ============================================================ */

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --bg:          #212121;
    --accent-bg:   #2b2b2b;
    --text:        #dcdcdc;
    --text-light:  #ababab;
    --accent:      #ffc94d;
    --accent-hover:#ffe099;
    --accent-text: var(--bg);
    --code:        #f06292;
    --preformatted:#ccc;
    --disabled:    #111;

    --success-bg:    #1b2e1b;
    --warning-bg:    #2e1f0a;
    --danger-bg:     #2e0f0f;
    --info-bg:       #0a1e2e;

    --tooltip-bg:    #f5f5f5;
    --tooltip-text:  #212121;

    --card-shadow: 0 2px 10px rgba(0,0,0,0.4);

    --quantum-blue:     #1a7fd6;
    --quantum-cyan:     #00e5ff;
    --quantum-electric: #00ffdd;
  }

  img,
  video {
    opacity: 0.85;
  }

  mark {
    background: linear-gradient(120deg, rgba(0, 212, 255, 0.2) 0%, rgba(0, 255, 204, 0.2) 100%);
    border-bottom-color: var(--quantum-electric);
  }

  .section-icon {
    color: var(--quantum-electric);
  }
}


/* ============================================================
   19. ACCESSIBILITY & MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration:       0.01ms !important;
    animation-iteration-count: 1     !important;
    transition-duration:      0.01ms !important;
    scroll-behavior:          auto   !important;
  }

  body > header::before,
  figure img,
  .button::before,
  a::after {
    animation: none !important;
    transition: none !important;
  }
}


/* ============================================================
   20. PRINT STYLES
   ============================================================ */

@media print {
  @page {
    margin: 1cm;
  }

  *,
  *::before,
  *::after {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  pre,
  code,
  kbd {
    background: #f5f5f5 !important;
    border: 1px solid #ddd !important;
    color: #000 !important;
  }

  body {
    display: block;
    font-size: 12pt;
    line-height: 1.5;
  }

  body > header {
    background: none !important;
    color: #000 !important;
    border: none;
  }

  body > header::before,
  figure::after,
  .button::before {
    display: none !important;
  }

  body > header nav,
  body > footer,
  .navbar,
  .dropdown,
  button,
  .button,
  input,
  select,
  textarea,
  aside {
    display: none !important;
  }

  h1, h2, h3,
  h4, h5, h6 {
    page-break-after:  avoid;
    page-break-inside: avoid;
  }

  h1 { font-size: 24pt; }
  h2 { font-size: 18pt; }
  h3 { font-size: 14pt; }

  p {
    widows:  3;
    orphans: 3;
  }

  a {
    text-decoration: underline;
    color: #000;
  }

  a[href^="http"]::after {
    content: " <" attr(href) ">";
    font-size: 90%;
    color: #666;
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  article {
    border:  none;
    padding: 0;
  }

  hr {
    border-top: var(--border-width) solid var(--border);
  }

  mark {
    background: #f0f0f0 !important;
    border: none !important;
  }

  table {
    border-collapse: collapse;
    width: 100%;
  }

  thead {
    display: table-header-group;
  }

  tr {
    page-break-inside: avoid;
  }

  pre,
  table,
  figure,
  img,
  svg,
  blockquote,
  ul,
  ol {
    page-break-inside: avoid;
  }

  pre code {
    white-space: pre-wrap;
  }

  img {
    max-width: 100%;
  }

  .bg-cover,
  .bg-overlay::before {
    background-image: none !important;
    min-height: auto;
  }

  .badge {
    border: 1px solid #000;
    background: white;
    color: black;
  }

  .notice {
    border: 1px solid #000;
  }

  details {
    border: 1px solid #000;
  }

  details[open] summary::after {
    content: "";
  }

  .table-scroll {
    border: none;
    overflow: visible;
  }
}
