/* ==========================================================================
   THE SHARMA DISPATCH - Core Stylesheet
   Version: 1.0.0
   Author: Ajitesh Sharma
   Description: A newspaper-style editorial design system.
   ========================================================================== */

/* ==========================================================================
   1. CSS Reset & Base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  text-rendering: optimizeSpeed;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  overflow-x: hidden;
  position: relative;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Paper Grain Texture Overlay */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
  background-image: repeating-radial-gradient(
    circle at center,
    rgba(0, 0, 0, 0.03) 0,
    rgba(0, 0, 0, 0.03) 1px,
    transparent 1px,
    transparent 100%
  );
  background-size: 3px 3px;
  mix-blend-mode: multiply;
}

[data-theme='dark'] body::before {
  opacity: 0.2;
  mix-blend-mode: overlay;
  background-image: repeating-radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.05) 0,
    rgba(255, 255, 255, 0.05) 1px,
    transparent 1px,
    transparent 100%
  );
}

ul, ol {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

a:not([class]) {
  text-decoration-skip-ink: auto;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  border-radius: 0; /* Strict print aesthetic */
}

button {
  cursor: pointer;
  background: transparent;
  border: none;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* ==========================================================================
   2. Google Fonts Import
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400;1,700&family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ==========================================================================
   3. CSS Custom Properties (Design Tokens)
   ========================================================================== */
:root {
  /* Colors - Light Theme (Default) */
  --paper: #F9F8F4;
  --paper-warm: #F4F1EA;
  --paper-bright: #FFFFFF;
  --ink: #1A1A1A;
  --ink-soft: #555555;
  --ink-faint: #999999;
  --stamp: #C41E3A;
  --rule: #E0E0E0;
  --rule-dark: #1A1A1A;
  --highlight: rgba(196, 30, 58, 0.1);
  
  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-text: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Spacing */
  --max-width: 1180px;
  --gutter: 30px;
  --section-pad: 80px;
  
  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 0.2s;
  --dur-med: 0.4s;
  --dur-slow: 0.8s;
}

[data-theme='dark'] {
  /* Colors - Dark Theme */
  --paper: #121212;
  --paper-warm: #1A1A1A;
  --paper-bright: #222222;
  --ink: #E8E6E0;
  --ink-soft: #A0A0A0;
  --ink-faint: #666666;
  --stamp: #FF4D6A;
  --rule: #333333;
  --rule-dark: #E8E6E0;
  --highlight: rgba(255, 77, 106, 0.15);
}

::selection {
  background-color: var(--ink);
  color: var(--paper);
}

[data-theme='dark'] ::selection {
  background-color: var(--ink);
  color: var(--paper);
}

/* ==========================================================================
   4. Typography Scale & Flourishes
   ========================================================================== */
/* Display Sizes (Fluid) */
.display-xl {
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 80px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.display-lg {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.5vw, 64px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.display-md {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
}

.display-sm {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.3vw, 32px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

/* Heading Sizes (Fixed for predictability in grids) */
.heading-lg {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

.heading-md {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

/* Body Text */
.body-lg {
  font-family: var(--font-text);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
}

.body {
  font-family: var(--font-text);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink-soft);
}

.body-sm {
  font-family: var(--font-text);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* Meta & Utility */
.caption {
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink-faint);
}

.kicker {
  font-family: var(--font-text);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
}

.meta {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Typography Flourishes */
.dropcap::first-letter {
  font-family: var(--font-display);
  font-size: 4.5rem;
  font-weight: 900;
  color: var(--ink);
  float: left;
  line-height: 0.8;
  padding-top: 4px;
  padding-right: 8px;
  padding-left: 3px;
  margin-bottom: -5px;
}

.pull-quote {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  font-style: italic;
  line-height: 1.4;
  color: var(--ink);
  padding-left: 20px;
  border-left: 4px solid var(--ink);
  margin: 2rem 0;
}

.kicker-label {
  display: inline-block;
  font-family: var(--font-text);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--stamp);
  margin-bottom: 0.5rem;
}

.byline {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}

.byline::before {
  content: "";
  display: block;
  width: 20px;
  height: 1px;
  background-color: var(--rule-dark);
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.italic { font-style: italic; }
.bold { font-weight: 700; }
.uppercase { text-transform: uppercase; letter-spacing: 0.05em; }

/* Rules and Dividers */
.section-rule {
  width: 100%;
  height: 4px;
  background-color: var(--rule-dark);
  border: none;
  margin: 0;
}

hr.section-rule--double, div.section-rule--double {
  width: 100%;
  height: 3px;
  border-top: 1px solid var(--rule-dark);
  border-bottom: 1px solid var(--rule-dark);
  background: transparent;
  margin: 0;
}
.section-rule--double {
  border-top: 3px double var(--rule-dark);
}

.section-rule--hairline {
  width: 100%;
  height: 1px;
  background-color: var(--rule);
  border: none;
  margin: 0;
}

/* ==========================================================================
   5. Layout & Grid System
   ========================================================================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  width: 100%;
}

.section {
  padding: var(--section-pad) 0;
  position: relative;
}

.section--condensed {
  padding: calc(var(--section-pad) / 2) 0;
}

.section--no-pad {
  padding: 0;
}

.newspaper-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
  align-items: start;
}

.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-cols-6 { grid-template-columns: repeat(6, 1fr); }

.col-span-1 { grid-column: span 1; }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.col-span-4 { grid-column: span 4; }
.col-span-5 { grid-column: span 5; }
.col-span-6 { grid-column: span 6; }
.col-span-7 { grid-column: span 7; }
.col-span-8 { grid-column: span 8; }
.col-span-9 { grid-column: span 9; }
.col-span-10 { grid-column: span 10; }
.col-span-11 { grid-column: span 11; }
.col-span-12 { grid-column: span 12; }

.column-bordered {
  border-right: 1px solid var(--rule);
  padding-right: var(--gutter);
}

.column-bordered:last-child {
  border-right: none;
  padding-right: 0;
}

/* ==========================================================================
   6. Header & Navigation (Masthead)
   ========================================================================== */
.site-header {
  border-bottom: 4px solid var(--rule-dark);
  background-color: var(--paper);
  position: relative;
  z-index: 100;
}

.masthead {
  padding-top: 15px;
}

.masthead__utility {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--rule);
}

.masthead__main {
  text-align: center;
  padding: 30px 0;
  position: relative;
}

.masthead__title {
  margin: 0;
  text-transform: none; /* Playfair Display handles this */
}

.masthead__subtitle {
  font-family: var(--font-text);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  margin-top: 10px;
  display: block;
}

.masthead__dateline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-top: 3px double var(--rule-dark);
  border-bottom: 1px solid var(--rule-dark);
}

.nav {
  position: sticky;
  top: 0;
  background-color: var(--paper);
  border-bottom: 1px solid var(--rule);
  z-index: 90;
  transition: transform 0.3s var(--ease-out);
}

.nav__list {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  padding: 15px 0;
}

.nav__item {
  position: relative;
}

.nav__link {
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
  padding: 5px 0;
  position: relative;
}

.nav__link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--ease-out);
}

.nav__link:hover::after,
.nav__link.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ==========================================================================
   7. Components: Buttons, Labels, Badges
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  border-radius: 0;
  transition: all 0.2s ease;
  text-align: center;
}

.btn--primary {
  background-color: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
}

.btn--primary:hover {
  background-color: var(--stamp);
  border-color: var(--stamp);
  color: #fff;
}

.btn--secondary {
  background-color: transparent;
  color: var(--ink);
  border: 1px solid var(--rule-dark);
}

.btn--secondary:hover {
  background-color: var(--ink);
  color: var(--paper);
}

.btn--block {
  width: 100%;
  display: flex;
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  border-radius: 0; /* Strictly sharp */
  background-color: var(--paper-bright);
}

/* ==========================================================================
   8. Components: Dispatch Cards (Projects)
   ========================================================================== */
.dispatch-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  background-color: var(--paper);
  border: 1px solid var(--rule);
  padding: 20px;
  transition: border-color 0.3s ease, transform 0.3s var(--ease-out);
}

.dispatch-card:hover {
  border-color: var(--rule-dark);
}

.dispatch-card__image-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--rule-dark);
  margin-bottom: 20px;
  background-color: var(--paper-warm);
}

.dispatch-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.1);
  mix-blend-mode: multiply;
  transition: transform 0.5s var(--ease-out), filter 0.5s ease;
}

[data-theme='dark'] .dispatch-card__image {
  mix-blend-mode: normal;
  opacity: 0.8;
}

.dispatch-card:hover .dispatch-card__image {
  transform: scale(1.05);
  filter: grayscale(0%) contrast(1);
}

.dispatch-card__stamp {
  position: absolute;
  top: 15px;
  right: 15px;
  border: 2px solid var(--stamp);
  color: var(--stamp);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 5px 10px;
  transform: rotate(15deg) scale(1.2);
  opacity: 0;
  transition: all 0.3s var(--ease-out);
  pointer-events: none;
  z-index: 10;
}

.dispatch-card:hover .dispatch-card__stamp {
  opacity: 1;
  transform: rotate(15deg) scale(1);
}

.dispatch-card__kicker {
  color: var(--stamp);
  margin-bottom: 10px;
}

.dispatch-card__title {
  margin-bottom: 15px;
}

.dispatch-card__excerpt {
  margin-bottom: 20px;
  flex-grow: 1;
}

.dispatch-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.dispatch-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid var(--rule);
  margin-top: auto;
}

.dispatch-card__link {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dispatch-card__link:hover {
  color: var(--stamp);
}

/* ==========================================================================
   9. Components: Stat Bar
   ========================================================================== */
.stat-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--rule-dark);
  background-color: var(--paper-bright);
}

.stat-bar__cell {
  padding: 30px 20px;
  text-align: center;
  border-right: 1px solid var(--rule-dark);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-bar__cell:last-child {
  border-right: none;
}

.stat-bar__value {
  display: block;
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 10px;
}

.stat-bar__label {
  display: block;
  font-family: var(--font-text);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

/* ==========================================================================
   10. Components: Patents, Papers, Certs
   ========================================================================== */
/* Patents */
.patent-card {
  border: 1px solid var(--rule-dark);
  background-color: var(--paper-warm);
  padding: 30px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 30px;
  margin-bottom: 30px;
}

.patent-card__header {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 15px;
  margin-bottom: 15px;
}

.patent-card__number {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  display: block;
  margin-bottom: 5px;
}

.patent-diagram {
  border: 1px dashed var(--rule-dark);
  background-color: var(--paper-bright);
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.patent-diagram img {
  filter: grayscale(100%);
  mix-blend-mode: multiply;
}

/* Research Papers */
.paper-card {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 30px;
  margin-bottom: 30px;
}

.paper-equation {
  background-color: var(--paper-bright);
  border: 1px solid var(--rule);
  padding: 20px;
  font-family: 'Times New Roman', Times, serif; /* Equation look */
  font-size: 18px;
  text-align: center;
  margin: 20px 0;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 30px 0;
  font-family: var(--font-text);
  font-size: 13px;
}

.data-table th,
.data-table td {
  border: 1px solid var(--rule-dark);
  padding: 12px 15px;
  text-align: left;
}

.data-table th {
  background-color: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table tbody tr:nth-child(even) {
  background-color: var(--paper-warm);
}

.comparison-table {
  display: flex;
  border: 1px solid var(--rule-dark);
  margin: 30px 0;
}

.comparison-table > div {
  flex: 1;
  padding: 20px;
}

.comparison-table > div:first-child {
  border-right: 1px solid var(--rule-dark);
}

/* Certificates */
.cert-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.cert-card {
  border: 1px solid var(--rule);
  padding: 15px;
  background: var(--paper-bright);
  text-align: center;
}

.cert-placeholder {
  width: 100%;
  aspect-ratio: 1.414 / 1; /* A4 Ratio */
  border: 1px dashed var(--rule-dark);
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 15px;
  background-color: var(--paper-warm);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
  text-transform: uppercase;
}

/* ==========================================================================
   11. Components: Detail Page Layouts
   ========================================================================== */
.dispatch-hero {
  border-bottom: 4px solid var(--rule-dark);
  padding: 60px 0;
  text-align: center;
  background-color: var(--paper-warm);
}

.dispatch-hero__title {
  max-width: 900px;
  margin: 0 auto 20px;
}

.dispatch-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  border-top: 1px solid var(--rule-dark);
  border-bottom: 1px solid var(--rule-dark);
  padding: 20px 0;
  margin: 40px 0;
}

.dispatch-meta__item {
  display: flex;
  flex-direction: column;
}

.dispatch-meta__label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 5px;
}

.dispatch-meta__value {
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.dispatch-body {
  max-width: 75ch; /* Optimal reading line length */
  margin: 0 auto;
}

.dispatch-body p {
  margin-bottom: 1.5em;
}

.dispatch-body h2 {
  font-family: var(--font-display);
  font-size: 32px;
  margin: 2em 0 1em;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 10px;
}

.simulation-container {
  width: 100%;
  aspect-ratio: 16/9;
  border: 2px solid var(--rule-dark);
  background-color: var(--ink);
  margin: 40px 0;
  position: relative;
  overflow: hidden;
}

/* ==========================================================================
   12. Footer (Classifieds)
   ========================================================================== */
.site-footer {
  border-top: 4px solid var(--rule-dark);
  background-color: var(--paper-warm);
  padding: 60px 0;
}

.classifieds {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  border: 1px solid var(--rule-dark);
  padding: 30px;
  background-color: var(--paper);
}

.classifieds__header {
  grid-column: 1 / -1;
  text-align: center;
  border-bottom: 3px double var(--rule-dark);
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.classified-box {
  border: 1px solid var(--rule);
  padding: 20px;
}

.classified-box h4 {
  font-family: var(--font-display);
  font-size: 18px;
  border-bottom: 1px solid var(--rule-dark);
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.classified-box ul li {
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.classified-box a:hover {
  color: var(--stamp);
  text-decoration: underline;
}

.footer-bottom {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  text-transform: uppercase;
}

/* ==========================================================================
   13. Utilities & Animations (GSAP ready)
   ========================================================================== */
/* Base reveal classes */
.rv {
  opacity: 1;
}

/* Applied by GSAP when in view */
.rv--visible {
  visibility: visible;
}

/* Simple fade in up (Fallback if GSAP isn't used) */
.rv-fade {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.rv-fade.rv--visible {
  opacity: 1;
  transform: translateY(0);
}

/* Rule animation */
.rv-rule {
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1s var(--ease-in-out);
}

.rv-rule.rv--visible {
  transform: scaleX(1);
}

/* Page Transition Overlay */
.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--paper);
  z-index: 99999;
  transform: translateY(100%);
  pointer-events: none;
}

.is-transitioning .page-transition {
  transform: translateY(0);
  transition: transform 0.6s var(--ease-in-out);
}

/* Spacing Utilities */
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mt-4 { margin-top: 40px; }
.mt-5 { margin-top: 50px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.mb-4 { margin-bottom: 40px; }
.mb-5 { margin-bottom: 50px; }

/* ==========================================================================
   14. Scrollbar & Print Aesthetic Extras
   ========================================================================== */
/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--paper);
  border-left: 1px solid var(--rule);
}

::-webkit-scrollbar-thumb {
  background: var(--ink-soft);
  border: 1px solid var(--paper);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ink);
}

/* ==========================================================================
   15. Responsive Media Queries
   ========================================================================== */
/* Large Desktop (Max 1200px) */
@media screen and (max-width: 1200px) {
  :root {
    --section-pad: 60px;
  }
}

/* Tablet Landscape / Small Desktop (Max 940px) */
@media screen and (max-width: 940px) {
  .newspaper-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  
  .col-span-1, .col-span-2, .col-span-3, .col-span-4, .col-span-5, .col-span-6, 
  .col-span-7, .col-span-8, .col-span-9, .col-span-10, .col-span-11, .col-span-12 {
    grid-column: span 6; /* Stack by default on smaller screens unless specified */
  }

  .stat-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-bar__cell:nth-child(2) {
    border-right: none;
  }
  
  .stat-bar__cell:nth-child(1),
  .stat-bar__cell:nth-child(2) {
    border-bottom: 1px solid var(--rule-dark);
  }

  .classifieds {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .patent-card {
    grid-template-columns: 1fr;
  }
}

/* Tablet Portrait (Max 768px) */
@media screen and (max-width: 768px) {
  :root {
    --gutter: 20px;
    --section-pad: 50px;
  }

  .nav__list {
    gap: 20px;
    flex-wrap: wrap;
  }

  .column-bordered {
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding-right: 0;
    padding-bottom: var(--gutter);
    margin-bottom: var(--gutter);
  }
  
  .column-bordered:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
  }

  .masthead__dateline {
    flex-direction: column;
    gap: 5px;
  }
  
  .comparison-table {
    flex-direction: column;
  }
  
  .comparison-table > div:first-child {
    border-right: none;
    border-bottom: 1px solid var(--rule-dark);
  }
}

/* Mobile (Max 600px) */
@media screen and (max-width: 600px) {
  :root {
    --section-pad: 40px;
  }

  .masthead__utility {
    flex-direction: column;
    gap: 10px;
  }

  .stat-bar {
    grid-template-columns: 1fr;
  }

  .stat-bar__cell {
    border-right: none !important;
    border-bottom: 1px solid var(--rule-dark);
  }
  
  .stat-bar__cell:last-child {
    border-bottom: none;
  }

  .classifieds {
    grid-template-columns: 1fr;
  }
  
  .data-table {
    display: block;
    overflow-x: auto;
  }
  
  .dispatch-meta {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   16. Print Media Query (Actual Printing)
   ========================================================================== */
@media print {
  body {
    background-color: white !important;
    color: black !important;
  }
  
  body::before {
    display: none; /* Remove noise */
  }
  
  .nav, 
  .site-footer,
  .btn,
  .page-transition {
    display: none !important;
  }
  
  .container {
    max-width: 100% !important;
    padding: 0 !important;
  }
  
  .dispatch-card {
    break-inside: avoid;
    border: 1px solid #000;
  }
  
  a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
  
  /* Reset link behavior for specific components */
  .nav__link::after,
  .masthead a::after {
    content: "";
  }
}


/* Responsive Overrides for Strict Grid */
@media screen and (max-width: 940px) {
  .newspaper-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .col-span-1, .col-span-2, .col-span-3, .col-span-4, .col-span-5, .col-span-6, 
  .col-span-7, .col-span-8, .col-span-9, .col-span-10, .col-span-11, .col-span-12 {
    width: 100%;
    margin-bottom: 0;
  }
  .column-bordered {
    border-right: none !important;
    border-bottom: 1px solid var(--rule);
    padding-right: 0 !important;
    padding-bottom: 20px;
    margin-bottom: 20px;
    padding-left: 0 !important;
  }
  .column-bordered:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
  }
  
  /* Reset padding-left on mobile for columns that were offset */
  .col-span-6 {
    padding-left: 0 !important;
  }
  .col-span-4 {
    padding-left: 0 !important;
  }
  
  .display-xl {
    font-size: clamp(40px, 12vw, 60px);
  }
  
  .display-lg {
    font-size: clamp(32px, 8vw, 46px);
  }
}

/* Simulation Support Classes */
.relative { position: relative; }
.absolute { position: absolute; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.w-full { width: 100%; }
.overflow-hidden { overflow: hidden; }
.bg-black { background-color: #000; }
.opacity-50 { opacity: 0.5; }
.text-accent { color: var(--stamp); }

/* ==========================================================================
   Project Case Study Supplements
   ========================================================================== */
.portfolio-case-study {
    padding: 40px 0;
    border-bottom: 2px solid var(--rule);
}
.project-header {
    margin-bottom: 30px;
    border-bottom: 4px solid var(--rule-dark);
    padding-bottom: 20px;
}
.project-badge {
    background: var(--ink);
    color: var(--paper);
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 15px;
}
.tagline {
    font-size: 20px;
    font-style: italic;
    color: #444;
    margin-top: 10px;
}
.featured-image {
    margin-bottom: 30px;
    border: 1px solid var(--rule);
    padding: 5px;
    background: var(--paper-bright);
}
.image-caption {
    display: block;
    font-size: 13px;
    color: #666;
    margin-top: 10px;
    text-align: center;
    font-style: italic;
}
.metrics-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding: 20px 0;
}
.metric-box {
    text-align: center;
    border-right: 1px solid var(--rule);
}
.metric-box:last-child {
    border-right: none;
}
.metric-val {
    display: block;
    font-size: 32px;
    font-weight: 900;
    font-family: var(--font-display);
    color: var(--stamp);
}
.metric-lbl {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: bold;
    margin-top: 5px;
}
.case-study-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}
.text-block ul {
    list-style: square;
    padding-left: 20px;
}
.text-block li {
    margin-bottom: 15px;
    font-size: 16px;
    line-height: 1.6;
}
.visual-card {
    border: 1px solid var(--rule);
    padding: 20px;
    background: var(--paper-warm);
}
.project-links {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}
.btn-github, .btn-research {
    padding: 10px 20px;
    border: 2px solid var(--ink);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
}
.btn-github {
    background: var(--ink);
    color: var(--paper);
}
.btn-research {
    background: transparent;
    color: var(--ink);
}

@media screen and (max-width: 768px) {
    .metrics-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .metric-box:nth-child(2) {
        border-right: none;
    }
    .metric-box:nth-child(1), .metric-box:nth-child(2) {
        border-bottom: 1px solid var(--rule);
        padding-bottom: 20px;
        margin-bottom: 20px;
    }
    .case-study-grid {
        grid-template-columns: 1fr;
    }
}
