/*
  MR Techworks main stylesheet
  These notes are safe to leave in the file. The browser ignores anything inside CSS comments.
  Use Ctrl + F to search for a section name when you want to change part of the site.
*/

/* ===== Global design settings =====
   This section controls the main colors, spacing, rounded corners, shadows, fonts, and page width.
   Change these variables when you want the whole site theme to change at once. */
:root {
  --bg: #07111f; /* Main dark background color. */
  --bg-deep: #0d1d33;
  --surface: rgba(12, 27, 48, 0.84); /* Card/panel background color. */
  --surface-soft: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.08);
  --text: #ecf2ff; /* Main text color. */
  --text-muted: #b7c6e0; /* Softer text color for descriptions. */
  --text-dark: #05111d;
  --line: rgba(233, 242, 255, 0.14);
  --line-strong: rgba(233, 242, 255, 0.26);
  --blue: #7dc5ff; /* Main link/accent blue. */
  --teal: #36d7c8; /* Main teal accent color. */
  --sand: #f3ddba;
  --amber: #ff9d4f; /* Orange accent color. */
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 14px 36px rgba(0, 0, 0, 0.28);
  --radius: 24px; /* Main rounded corner size. */
  --radius-md: 18px;
  --radius-sm: 14px;
  --radius-pill: 999px;
  --max-width: 1160px; /* Maximum width for centered page content. */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4.5rem;
  --header-height: 84px; /* Default height for the sticky header. */
  --heading-font: "Aptos Display", "Segoe UI Variable Display", "Trebuchet MS", sans-serif;
  --body-font: "Aptos", "Segoe UI", Tahoma, sans-serif;
  --focus: rgba(255, 157, 79, 0.72);
}

/* ===== Basic reset =====
   This keeps sizing predictable so padding and borders do not accidentally make boxes too wide. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Smooth scrolling when clicking page links like #projects or #contact. */
html {
  scroll-behavior: smooth;
}

/* ===== Main page look =====
   Controls the default text color, font, line spacing, and dark gradient background. */
body {
  margin: 0;
  color: var(--text);
  font-family: var(--body-font);
  line-height: 1.65;
  background:
    radial-gradient(900px 600px at 15% 0%, rgba(125, 197, 255, 0.18), transparent 60%),
    radial-gradient(700px 500px at 90% 10%, rgba(54, 215, 200, 0.15), transparent 60%),
    radial-gradient(700px 500px at 50% 100%, rgba(255, 157, 79, 0.14), transparent 60%),
    linear-gradient(180deg, #09101c 0%, #081323 48%, #07111f 100%);
}

/* Makes images responsive so they shrink inside their containers instead of overflowing. */
img {
  display: block;
  max-width: 100%;
}

/* Makes form controls use the same font as the rest of the site. */
button,
input,
textarea,
select {
  font: inherit;
}

/* Default link color and link hover behavior. */
a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  color: var(--teal);
}

/* Keyboard focus outline. Important for accessibility when someone tabs through the page. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* ===== Headings and paragraph defaults =====
   Controls the general look of page titles and section titles. */
h1,
h2,
h3,
h4 {
  margin-top: 0;
  margin-bottom: 0.65rem;
  font-family: var(--heading-font);
  letter-spacing: -0.025em;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.6rem, 5vw, 4.7rem);
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  margin-top: 0;
}

/* ===== Accessibility skip link =====
   Hidden until focused. Lets keyboard users jump straight to the main content. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 1rem;
  z-index: 1001;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(54, 215, 200, 0.45);
  background: rgba(7, 17, 31, 0.96);
  color: var(--text);
}

.skip-link:focus {
  left: 1rem;
}

/* ===== Layout helpers =====
   .container keeps content centered and prevents it from stretching too wide. */
.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

.narrow {
  max-width: 860px;
}

/* Section spacing. Most major page blocks use this padding. */
.section {
  padding: var(--space-3xl) 0;
}

.section-tight {
  padding: var(--space-xl) 0;
}

.section-alt {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

/* Section intro area, usually holds the eyebrow text, heading, and short intro paragraph. */
.section-header {
  display: grid;
  gap: 0.45rem;
  margin-bottom: var(--space-xl);
  max-width: 72ch;
}

/* Was Small uppercase labels above headings, like "Projects" or "Services". Changed my mind on the tiny title text */
.eyebrow,
.preview-kicker,
.panel-label {
  margin: 0;
  font-size: 1.00rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--teal);
}

/* Larger intro paragraph text, usually under a main heading. */
.lead {
  max-width: 68ch;
  color: var(--text-muted);
  font-size: 1.08rem;
}

.text-muted {
  color: var(--text-muted);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
}

.text-link::after {
  content: ">";
  transition: transform 160ms ease;
}

.text-link:hover::after,
.text-link:focus-visible::after {
  transform: translateX(3px);
}

.section-title {
  display: inline-block;
  margin-bottom: 0.2rem;
  padding-bottom: 0.45rem;
  border-bottom: 3px solid rgba(54, 215, 200, 0.4);
}

/* Groups buttons, badges, tags, and footer links into wrapping rows. */
.button-group,
.badge-list,
.tag-list,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ===== Buttons =====
   Base button style. The primary, secondary, and ghost buttons build from this. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.8rem 1.15rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  font-weight: 700;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.btn-primary {
  border: none;
  color: var(--text-dark);
  background: linear-gradient(135deg, rgba(54, 215, 200, 1), rgba(125, 197, 255, 1));
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
}

.btn-ghost {
  background: transparent;
}

/* ===== Badges and tags =====
   Small pill-shaped labels used for skills, highlights, or categories. */
.badge,
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 700;
}

.badge {
  border: 1px solid rgba(233, 242, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.badge-highlight {
  border-color: rgba(54, 215, 200, 0.3);
  background: rgba(54, 215, 200, 0.12);
}

.tag {
  color: var(--text);
  border: 1px solid rgba(243, 221, 186, 0.25);
  background: rgba(243, 221, 186, 0.1);
}

/* ===== Header and navigation =====
   Sticky top bar with blur effect. This affects the nav area at the top of the site. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  background: rgba(7, 17, 31, 0.88);
}

.header-inner {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--text);
}

/* Site logo image. This currently points to assets/images/favicon.ico. */
.site-logo {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 0%;
  background: center / contain no-repeat url("/assets/images/favicon.ico");
  color: transparent;
  font-size: 0;
  text-indent: -9999px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

.site-brand-text {
  display: grid;
  gap: 0.1rem;
}

.site-brand-name {
  font-family: var(--heading-font);
  font-size: 1.15rem;
  font-weight: 800;
}

.site-brand-tag {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Navigation list layout. Removes bullet points and lines nav links up horizontally. */
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  color: var(--text);
  font-weight: 600;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  background: rgba(125, 197, 255, 0.1);
  border-color: rgba(125, 197, 255, 0.18);
}

/* ===== Hero sections =====
   Big intro areas at the top of home pages or inside pages. */
.hero-home,
.page-hero {
  padding: clamp(3.5rem, 8vw, 6rem) 0 var(--space-2xl);
}

/* Main grid helper classes. These control multi-column layouts across the site. */
.hero-grid,
.split-hero,
.content-split,
.preview-grid,
.footer-grid,
.contact-grid,
.card-grid,
.process-grid,
.stats-grid {
  display: grid;
  gap: 1.25rem;
}

.hero-grid,
.split-hero {
  grid-template-columns: 1.2fr 0.9fr;
  align-items: center;
}

.hero-copy {
  max-width: 68ch;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

/* ===== Cards and panels =====
   Shared card styling for most boxed content, including project cards, contact cards, FAQs, and callouts. */
.hero-panel,
.card,
.preview-card,
.process-card,
.stat-card,
.contact-card,
.image-frame,
.callout-banner,
.credential-strip,
.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(18, 36, 61, 0.92), rgba(8, 19, 35, 0.88));
  box-shadow: var(--shadow-soft);
}

.hero-panel,
.preview-card,
.contact-card,
.stat-card,
.process-card,
.credential-strip,
.callout-banner,
.card {
  overflow: hidden;
}

.hero-panel-image,
.preview-image,
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-panel {
  display: grid;
  min-height: 100%;
}

.hero-panel-image {
  aspect-ratio: 1 / 1;
}

.hero-panel-body,
.card,
.process-card,
.stat-card,
/* Keeps contact cards equal height inside their grid. */
.contact-card {
  padding: 1.35rem;
}

.card {
  display: grid;
  align-content: start;
}
/* Homepage hero background image */
.hero-background {
  min-height: 75vh;
  background-image: url("/assets/images/homeimage.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
}

/* This dark layer makes the text easier to read */
.hero-overlay {
  width: 100%;
  min-height: 75vh;
  display: flex;
  align-items: center;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.82) 0%,
    rgba(0, 0, 0, 0.62) 45%,
    rgba(0, 0, 0, 0.2) 100%
  );
}

.hero-content {
  width: 100%;
  padding: 5rem 1.5rem;
}

.hero-copy {
  max-width: 650px;
}

.hero-copy .section-title {
  margin-bottom: 1rem;
}

.hero-copy .lead {
  max-width: 620px;
}
/* Featured card style. Adds extra emphasis and works with the "Featured" label below. */
.card-featured {
  position: relative;
  border-color: rgba(125, 197, 255, 0.28);
  background: linear-gradient(180deg, rgba(26, 54, 90, 0.96), rgba(10, 20, 36, 0.92));
}

.card-featured::before {
  content: "Featured";
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 157, 79, 0.35);
  background: rgba(255, 157, 79, 0.16);
  color: var(--sand);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Column count helpers. These decide whether sections use 2, 3, or 4 columns on wider screens. */
.card-grid-2,
.preview-grid,
.content-split,
.contact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card-grid-3,
.stats-grid,
/* Process section layout, such as steps in a service process. */
.process-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.contact-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.preview-grid {
  align-items: stretch;
}

.preview-card {
  display: grid;
  min-height: 100%;
}

.preview-image {
  aspect-ratio: 16 / 10;
}

.preview-body {
  padding: 1.35rem;
}

/* Stats cards, usually used for quick numbers or highlights. */
.stat-card {
  position: relative;
  min-height: 100%;
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(54, 215, 200, 0.08), transparent 45%);
  pointer-events: none;
}

.stat-number {
  position: relative;
  margin-bottom: 0.45rem;
  font-family: var(--heading-font);
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--sand);
}

.stat-label {
  position: relative;
  margin-bottom: 0;
  color: var(--text-muted);
}

.process-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.process-card {
  position: relative;
  padding: 1.5rem;
}

.process-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  border-radius: 50%;
  border: 1px solid rgba(54, 215, 200, 0.28);
  background: rgba(54, 215, 200, 0.12);
  color: var(--teal);
  font-family: var(--heading-font);
  font-weight: 800;
}

/* Image frame styling. Adds padding, border, rounded corners, and image sizing. */
.image-frame {
  padding: 0.75rem;
}

.image-frame img {
  aspect-ratio: 4 / 3;
  border-radius: calc(var(--radius) - 8px);
}

/* Highlight strips and callout banners. Good for certifications, CTAs, or important notes. */
.credential-strip,
.callout-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.5rem;
}

.callout-banner {
  background:
    radial-gradient(circle at top left, rgba(54, 215, 200, 0.12), transparent 35%),
    linear-gradient(180deg, rgba(18, 36, 61, 0.95), rgba(8, 19, 35, 0.9));
}

/* Cleaner list styling for bullet lists inside cards or sections. */
.clean-list {
  margin: 0.85rem 0 0;
  padding-left: 1.2rem;
}

.clean-list li {
  margin: 0.45rem 0;
}

.clean-list li::marker {
  color: var(--teal);
}

.compact-list {
  margin-top: 0.65rem;
}

.project-link {
  margin-top: 1rem;
  margin-bottom: 0;
}
/* ===== Footer =====
   Controls the bottom area of the site, including footer columns and links. */
.footer-grid {
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  padding: var(--space-2xl) 0 1.5rem;
}

.footer-brand {
  margin-bottom: 1rem;
}

.footer-heading {
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.footer-copy {
  max-width: 34ch;
  color: var(--text-muted);
}

.site-footer {
  margin-top: var(--space-2xl);
  border-top: 1px solid var(--line);
  background: rgba(6, 13, 24, 0.96);
}

.footer-links a {
  color: var(--text-muted);
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--teal);
}

.footer-bottom {
  padding: 0 0 var(--space-xl);
  color: var(--text-muted);
}

/* ===== FAQ accordion =====
   Styles the question/answer drop-down boxes made with <details> and <summary>. */
.faq-list {
  display: grid;
  gap: 0.9rem;
}

.faq-item {
  padding: 0;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 1.15rem 1.25rem;
  font-weight: 700;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

/* Adds the plus sign on closed FAQ questions. */
.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--teal);
  font-size: 1.3rem;
  line-height: 1;
}

/* Changes the plus sign to a minus sign when an FAQ is opened. */
.faq-item[open] summary::after {
  content: "-";
}

.faq-item p {
  margin: 0;
  padding: 0 1.25rem 1.25rem;
  color: var(--text-muted);
}

.contact-card {
  min-height: 100%;
}

/* ===== Contact details ===== */
.contact-card address {
  margin: 0;
  font-style: normal;
  line-height: 1.65;
}

.contact-card a[href^="tel:"],
.contact-card a[href^="sms:"],
.contact-card a[href^="mailto:"] {
  overflow-wrap: anywhere;
}

/* Makes button-based text links match regular text links. */
button.text-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
}

button.text-link:hover,
button.text-link:focus-visible {
  color: var(--teal);
}

/* ===== Service pricing ===== */
.price-value {
  margin-bottom: 0.75rem;
  font-family: var(--heading-font);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 800;
  color: var(--sand);
}

.service-note {
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(54, 215, 200, 0.06);
  color: var(--text-muted);
}

/* ===== Certifications section =====
   Styles certificate cards, certificate images, and spotlight layouts. */
.cert-grid {
  align-items: start;
}

.cert-card {
  gap: 0.8rem;
}

.cert-thumb {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.cert-card-horizontal {
  grid-template-columns: minmax(180px, 240px) 1fr;
  align-items: center;
  gap: 1rem;
}

.cert-card-horizontal .cert-thumb {
  height: 100%;
  min-height: 200px;
}

.cert-content {
  display: grid;
  align-content: start;
}

.cert-grid-wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cert-spotlight {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem;
}

.cert-spotlight-media {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.cert-spotlight-copy {
  display: grid;
  align-content: start;
}

.cert-thumb-wide {
  aspect-ratio: auto;
  max-height: 460px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.96);
  padding: 0.5rem;
}

.cert-spotlight-badge {
  width: min(220px, 100%);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
}

/* ===== Animation helpers =====
   Add these classes to HTML elements when you want them to fade/rise into place. */
.reveal {
  animation: riseIn 620ms ease both;
}

.reveal-delay {
  animation-delay: 90ms;
}

.reveal-delay-2 {
  animation-delay: 180ms;
}

.reveal-delay-3 {
  animation-delay: 270ms;
}

/* The actual rise-in animation used by .reveal. */
@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Respects users who prefer reduced motion by turning off animations and smooth scrolling. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ===== Responsive layout: tablets and smaller laptops =====
   Reduces big multi-column sections so they fit better on medium screens. */
@media (max-width: 1040px) {
  .hero-grid,
  .split-hero,
  .content-split,
  .footer-grid,
  .contact-grid,
  .preview-grid,
  .card-grid-2,
  .card-grid-3,
  .stats-grid,
  .process-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== Responsive layout: phones and small tablets =====
   Stacks most grids into one column and centers the header/nav. */
@media (max-width: 820px) {
  :root {
    --header-height: auto;
  }

  .header-inner {
    padding: 1rem 0;
    flex-wrap: wrap;
    justify-content: center;
  }

  .site-brand {
    width: 100%;
    justify-content: center;
  }

  .site-nav ul {
    justify-content: center;
  }

  .hero-home,
  .page-hero,
  .section {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  .hero-grid,
  .split-hero,
  .content-split,
  .preview-grid,
  .footer-grid,
  .card-grid-2,
  .card-grid-3,
  .stats-grid,
  .process-grid,
  .contact-grid,
  .cert-spotlight,
  .cert-card-horizontal,
  .cert-grid-wide {
    grid-template-columns: 1fr;
  }

  .cert-card-horizontal .cert-thumb {
    min-height: 0;
  }

  .callout-banner,
  .credential-strip {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ===== Responsive layout: small phones =====
   Tightens spacing and reduces large text/cards so the page does not feel cramped. */
@media (max-width: 560px) {
  .container {
    width: min(100% - 1.25rem, var(--max-width));
  }

  .site-brand {
    align-items: flex-start;
  }

  .site-brand-tag {
    font-size: 0.78rem;
  }

  .site-nav a {
    padding: 0.5rem 0.72rem;
  }

  .hero-panel-body,
  .card,
  .preview-body,
  .process-card,
  .stat-card,
  .contact-card,
  .callout-banner,
  .credential-strip {
    padding: 1.1rem;
  }

  h1 {
    font-size: clamp(1.95rem, 10vw, 2.85rem);
  }
}

/* This section is for the articles page*/

/* ===== Article library =====
   Controls the search box and article card layout on the Articles page. */
.article-library-controls {
  display: grid;
  gap: 0.75rem;
  max-width: 760px;
}

.search-label {
  font-weight: 800;
  color: var(--text);
}

.article-search {
  width: 100%;
  min-height: 52px;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.article-search::placeholder {
  color: var(--text-muted);
}

.article-search:focus {
  border-color: rgba(54, 215, 200, 0.55);
}

.article-count {
  margin: 0;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.article-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(18, 36, 61, 0.92), rgba(8, 19, 35, 0.88));
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.article-card:hover,
.article-card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(125, 197, 255, 0.35);
  box-shadow: var(--shadow);
}

.article-card-link {
  display: grid;
  height: 100%;
  color: inherit;
}

.article-card-link:hover {
  color: inherit;
}

.article-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-card-body {
  display: grid;
  align-content: start;
  gap: 0.55rem;
  padding: 1.35rem;
}

.article-card-body h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
}

.article-card-body p {
  margin-bottom: 0;
}

@media (max-width: 1040px) {
  .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .article-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Full article reader page =====
   Controls the layout for the full article reader page. */
.article-page h1 {
  margin-bottom: 1rem;
}

.article-page h2 {
  margin-top: 2rem;
}

.article-page p {
  color: var(--text-muted);
}

.article-hero-image {
  width: 100%;
  max-height: 420px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  margin: 2rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.article-body {
  display: grid;
  gap: 0.35rem;
}

.article-references {
  margin-top: 2.5rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.article-references ul {
  margin-bottom: 0;
}

.article-back-link {
  margin-top: 2rem;
}

/* Project Demos */

.demo-window {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #111;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.demo-window-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.8rem;
  background: #1f2937;
}

.demo-window-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f97316;
}

.demo-window-bar span:nth-child(2) {
  background: #facc15;
}

.demo-window-bar span:nth-child(3) {
  background: #22c55e;
}

.demo-window-bar p {
  margin: 0 0 0 0.5rem;
  color: #e5e7eb;
  font-size: 0.85rem;
}

.demo-window iframe {
  width: 100%;
  height: 600px;
  border: none;
  background: white;
}

.project-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.notes-modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.65);
  z-index: 9999;
}

.notes-modal.open {
  display: grid;
}

.notes-modal-content {
  position: relative;
  width: min(520px, 92vw);
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.5rem;
  background: white;
  color: #111827;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.notes-modal-content h3 {
  margin-top: 0;
}

.notes-modal-content p,
.notes-modal-content li {
  line-height: 1.5;
}

.notes-modal-content ul {
  padding-left: 1.2rem;
}

.notes-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: #f1f5f9;
  color: #111827;
  font-size: 1.4rem;
  cursor: pointer;
}

.notes-close:hover {
  background: #e2e8f0;
}

.notes-small {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #64748b;
}

.project-links button {
  font: inherit;
  cursor: pointer;
}

.article-card-image-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.05);
}

.article-card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
