.intro-block {
  max-width: 68ch;
  margin: 0 auto;
  text-align: left;
}
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Lora:wght@400;500;600;700&display=swap");

:root {
  --primary-color: #4e3565;
  --primary-color-dark: #4e3565;
  --accent-color: #d494b1;
  --secondary-color: #b4aabc;
  --text-dark: #1f2937;
  --text-light: #4a4452;
  --extra-light: #fdfcff;
  --max-width: 1200px;
  --surface: #f7f3fc;
  --shadow: 0 1px 3px rgba(0,0,0,0.05);
  --page-background: #fcfafe;

  /* fonts */
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-heading: "Lora", Georgia, serif;

  /* layout */
  --nav-height: 64px;
  --footer-height: 52px;
  /* uniform section height */
  --section-min-height: 420px;
}

/* Reset/basics */
* { margin: 0; padding: 0; box-sizing: border-box; }
a { text-decoration: none; }
html {
  background: var(--page-background);
  background-color: #fcfafe !important;
  min-height: 100%;
  height: -webkit-fill-available;
}
body {
  font-family: var(--font-body);
  background: var(--page-background);
  background-color: #fcfafe !important;
  min-height: 100%;
  min-height: -webkit-fill-available;
  padding-bottom: var(--footer-height);
}

/* Headings in Ivy Presto */
h1, h2, h3, h4, h5, h6, .title, .subtitle, nav .logo a { font-family: var(--font-heading); }

/* Nav */
nav {
  width: 100%;
  position: fixed; top: 0; left: 0;
  background: rgba(247, 243, 252, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.nav__content {
  max-width: var(--max-width);
  margin: auto;
  padding: 0.9rem 1rem;
  display: flex; align-items: center; justify-content: space-between;
}
nav .logo a { font-size: 1.5rem; font-weight: 600; color: #2d1f3d; transition: .3s; display: inline-flex; align-items: center; gap: 0.5rem; }
nav .logo a .name { font-family: var(--font-body); font-size: 1rem; font-weight: 500; color: #1a1a1a; }
nav .checkbox { display: none; }
nav input { display: none; }
nav .checkbox i { font-size: 2rem; color: #2d1f3d; cursor: pointer; }

/* Hamburger (mobile) */
.checkbox .hamburger { display: inline-flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 8px; }
.checkbox .hamburger span { display: block; width: 22px; height: 2px; background: #2d1f3d; border-radius: 2px; }

nav hr { display: none; }
nav ul { display: flex; align-items: center; gap: 1rem; list-style: none; transition: left .3s; }
nav ul li a { padding: .5rem 1rem; font-weight: 500; color: #1a1a1a; transition: color .3s, border-color .3s; border-bottom: 2px solid transparent; }
nav ul li a:hover { color: #2d1f3d; }
nav ul li a.active { color: #2d1f3d; border-bottom-color: #2d1f3d; }

/* Footer */
footer {
  background: rgba(247, 243, 252, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-top: 3rem;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  z-index: 97;
  height: var(--footer-height);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}
.footer__content {
  max-width: var(--max-width); margin: 0 auto; padding: 1rem 1rem;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem 1rem;
}
.footer__links { display: flex; gap: 1rem; }
.footer__links a { color: var(--text-dark); font-weight: 600; }
.footer__links a:hover { color: var(--secondary-color); }

/* Sections & layout */
.section__container {
  min-height: var(--section-min-height); /* consistent minimal height */
  max-width: var(--max-width);
  margin: auto;
  padding: 1rem;
  display: grid; gap: 4rem;
  grid-template-columns: repeat(2, 1fr);
  grid-template-areas: "content image";
}
.section__container1 {
  min-height: var(--section-min-height); /* consistent minimal height */
  max-width: 1300px;
  margin: auto;
  padding: 0 1rem; /* prevent cards from touching screen edges */
  display: grid; gap: 4rem;
  grid-template-columns: repeat(2, 1fr);
  grid-template-areas: "content image";
}

/* Hero spacing under fixed nav */
.section__container.hero { 
  padding-top: calc(var(--nav-height) + 3rem); 
  padding-bottom: 0; 
  min-height: auto;
  gap: 1rem;
  align-items: start;
}
.hero { padding-top: calc(var(--nav-height) + 3rem); padding-bottom: 0; }
/* Hero content spacing */
.hero .content { padding-top: 0; padding-bottom: 0; justify-content: flex-start; }
.hero .title { margin-top: 0.75rem; margin-bottom: 1.5rem; }
.hero .description.lead { margin-bottom: 0; }
.hero .image { align-items: flex-start; padding-top: 0.5rem; }

.content { display: flex; flex-direction: column; justify-content: center; grid-area: content; }
.image   { display: grid; place-items: center; grid-area: image; }
.image img { width: clamp(20rem, 80%, 24rem); height: auto; border-radius: 8px; object-fit: cover; transition: transform .3s ease; }

/* Typography */
.subtitle { letter-spacing: 2px; color: var(--text-light); font-weight: 360; margin-bottom: .5rem; }
.title { font-size: 2.5rem; font-weight: 400; line-height: 3rem; color: var(--text-dark); margin-bottom: 1rem; text-align: left; }
.title1 { font-size: 2.5rem; font-weight: 400; line-height: 3rem; color: var(--text-dark); margin-bottom: 1rem; text-align: right; }
.title span { font-weight: 600; }

/* Make card titles responsive (shrink on smaller screens) */
.section-box .title {
  font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.2rem);
  line-height: 1.15em;
}

.description  { line-height: 1.5rem; color: var(--text-light); margin-bottom: 2rem; }
.description1 { line-height: 1.5rem; color: #7a7489; margin-bottom: 2rem; text-align: left; }
.description2 { line-height: 1.5rem; color: #7a7489; margin-bottom: 2rem; text-align: right; }
/* Default italicized text color */
.section-box i { color: var(--text-light); }
/* Dark grey for technology keywords (first italic in description) - matches description hover color */
.section-box .description1 i:first-of-type,
.section-box .description2 i:first-of-type { color: #5a5562; }
/* Keep the trailing status note (e.g., "Project in progress.") same color as description */
.section-box .description1 i:last-of-type:not(:first-of-type),
.section-box .description2 i:last-of-type:not(:first-of-type) { color: #b4aabc; }
/* Muted pink for "read more" - always visible, bolder on hover */
.section-box strong {
  color: var(--accent-color);
  transition: font-weight 0.2s ease;
  font-weight: 600;
}
.section-box:hover strong,
.section-box a:hover strong {
  font-weight: 800; /* bolder on hover */
  font-size: 1.05em;
}

/* Nicer lead paragraph */
.description.lead {
  font-size: clamp(1rem, 0.8rem + 0.8vw, 1.35rem);
  line-height: 1.6;
  letter-spacing: 0.005em;
  color: #5a5562;
  font-weight: 400;
  max-width: 68ch;
  margin-top: .35rem;
}

/* Highlight effect */
.highlight {
  color: var(--accent-color);
  font-weight: 600;
}

/* Typed layout: prevent push-down */
.typing-box { position: relative; }
.typing-box .sizer {
  visibility: hidden; display: block;
  white-space: pre-wrap; line-height: 1.6; font-size: inherit;
}
#typed-desc {
  position: absolute; left: 0; top: 0;
  white-space: pre-wrap; line-height: 1.6; font-size: inherit;
}

/* Cards / boxes */
.section-box { background: var(--surface); border-radius: 8px; box-shadow: var(--shadow); border: none; padding: 2rem; max-width: var(--max-width); margin: 0 auto 0 auto; overflow: hidden; }
.section__container1.section-box { padding: 2rem 1rem; } /* ensure horizontal padding for case studies outside research-grid */
.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.card { background: var(--secondary-color); border: none; border-radius: 8px; box-shadow: var(--shadow); padding: 1.25rem 1.5rem; }
.card .title { margin-bottom: .5rem; color: #1f1a23; }
.card .description { margin-bottom: 0; color: #1f1a23; }

/* Case/Research detail pages - unify spacing and typography */
.section__work {
  min-height: 100vh;
  max-width: 1400px; /* shared content width */
  width: 92vw;       /* slightly larger gutters */
  margin: auto;      /* center horizontally */
  padding: calc(var(--nav-height) + 1rem) 1rem 2rem 1rem; /* increase side padding a bit */
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  overflow-wrap: break-word; /* Allow long words/URLs to wrap */
  word-break: break-word; /* Break long words if needed */
}
.section__work h1,
.section__work h2,
.section__work h3,
.section__work p,
.section__work ul,
.section__work li {
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--text-light);
  overflow-wrap: break-word;
  word-break: break-word;
}
/* Ensure links and code wrap properly */
.section__work a,
.section__work code {
  overflow-wrap: break-word;
  word-break: break-all; /* More aggressive breaking for URLs and code */
}
.section__work .title { color: var(--text-dark); }

/* Ensure content blocks inside case pages start at top-left, not centered */
.section__work .content {
  align-items: flex-start;
  justify-content: flex-start;
}

/* Normalize first-child spacing inside case pages */
.section__work > *:first-child,
.section__work .content > *:first-child {
  margin-top: 0;
}

/* Remove manual <br> spacing after fixed nav on detail pages */
nav + br + br,
nav + br + br + br,
nav + br + br + br + br { display: none; }

/* Index case cards: neutralize ad-hoc left margins so side padding matches */
.rectangle_button { margin-left: 0 !important; }
.section__container1 .image img { margin-left: 0 !important; }

/* Anchor scroll offset so first card isn't hidden under fixed nav */
#research, #work { scroll-margin-top: calc(var(--nav-height) + 16px); }

/* Section backgrounds for visual separation */
.intro-section {
  background-color: var(--page-background);
  padding: 0.25rem 1rem 1.5rem 1rem;
  margin: 0;
  margin-top: calc(var(--nav-height) - 2rem);
  width: 100%;
}

@media (min-width: 768px) {
  .intro-section {
    margin-top: calc(var(--nav-height) + 2rem);
    padding: 1.25rem 1rem 1.5rem 1rem;
  }
}

/* Larger desktop spacing for intro (keep mobile as-is) */
@media (min-width: 1200px) {
  .intro-section {
    margin-top: calc(var(--nav-height) + 3rem);
    padding: 2.5rem 1rem 3.5rem 1rem;
  }
}

.intro-section .section__container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: block;
}

.intro-section .content {
  display: block;
}

.intro-paragraph {
  font-size: clamp(0.875rem, 0.75rem + 0.5vw, 1rem);
  line-height: 1.7;
  letter-spacing: 0.005em;
  color: var(--text-dark);
  font-weight: 400;
  margin: 0;
  text-align: left;
}

/* Hero name + tagline (visual hierarchy above intro) */
.hero-name {
  margin: 0 0 0.35rem 0;
  font-family: var(--font-heading);
  color: var(--primary-color-dark);
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.1;
  font-weight: 600;
}
.hero-tagline {
  margin: 0 0 1.5rem 0;
  font-family: var(--font-body);
  color: var(--text-light);
  font-weight: 400;
  letter-spacing: 0.02em;
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
}

.intro-paragraph strong {
  color: var(--accent-color);
  font-weight: 600;
}

/* Intro actions - button row under intro paragraph */
.intro-actions { 
  margin-top: 1.25rem; 
  display: flex; 
  gap: 0.75rem; 
  justify-content: flex-start; 
}

@media (min-width: 768px) {
  .intro-actions {
    margin-top: 2rem;
  }
}

@media (min-width: 1200px) {
  .intro-actions {
    margin-top: 2.5rem;
  }
}
.btn { 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  padding: 0.55rem 0.9rem; 
  border-radius: 999px; 
  font-weight: 600; 
  font-size: 0.95rem; 
  line-height: 1; 
  border: 1px solid transparent; 
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease; 
}
.btn--primary { 
  background: var(--primary-color-dark); 
  color: #fff; 
}
.btn--primary:hover { 
  background: #fff; 
  color: var(--primary-color-dark); 
  border-color: var(--primary-color-dark); 
  box-shadow: 0 2px 10px rgba(78,53,101,0.12); 
}
.btn--accent { 
  background: var(--accent-color); 
  color: #fff; 
}
.btn--accent:hover { 
  background: #fff; 
  color: var(--accent-color); 
  border-color: var(--accent-color); 
  box-shadow: 0 2px 10px rgba(212,148,177,0.18); 
}

@media (max-width: 750px) {
  .intro-actions { 
    gap: 0.6rem; 
  }
  .btn { 
    padding: 0.5rem 0.8rem; 
    font-size: 0.9rem; 
  }
}

.timeline-section {
  background-color: var(--page-background);
  padding: 2rem 1rem 3rem 1rem;
  margin: 0;
  width: 100%;
}

.timeline-section .section-heading {
  max-width: 1300px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
}

.timeline-section hr {
  max-width: 1300px;
  margin-left: auto;
  margin-right: auto;
}

.cs-projects-section {
  background-color: var(--page-background);
  padding: 2rem 1rem 3rem 1rem;
  margin: 0;
  width: 100%;
}

.cs-projects-section .section-heading {
  max-width: 1300px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
}

.cs-projects-section hr {
  max-width: 1300px;
  margin-left: auto;
  margin-right: auto;
}

.case-studies-section {
  background-color: var(--page-background);
  padding: 2rem 1rem 3rem 1rem;
  margin: 0;
  width: 100%;
}

.case-studies-section .section-heading {
  max-width: 1300px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
}

.case-studies-section hr {
  max-width: 1300px;
  margin-left: auto;
  margin-right: auto;
}

/* Research grid: two compact cards per row, no image */
.research-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 1.5rem;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 1rem; /* preserve left/right gutters like other sections */
}
.research-grid .section__container1 {
  grid-template-columns: 1fr; /* single column inside card */
  padding: 1.5rem; /* comfortable interior padding */
}
.research-grid .section__container1 .image { display: none; }
@media (max-width: 800px) { .research-grid { grid-template-columns: 1fr; } }

/* Case studies grid: single column layout with images */
.case-studies-grid {
  display: grid;
  grid-template-columns: 1fr; /* single column for case studies */
  gap: 1.5rem;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 1rem; /* preserve left/right gutters like research-grid */
}
.case-studies-grid .section__container1 {
  padding: 0; /* Remove padding since case-studies-grid provides outer padding */
  max-width: none; /* Remove max-width since case-studies-grid provides it */
}
.case-studies-grid .section__container1.section-box {
  padding: 2rem; /* Restore padding from section-box */
}

/* Make case-study images larger on wide screens (desktop) */
@media (min-width: 1200px) {
  .case-studies-grid .image img {
    width: clamp(24rem, 38vw, 34rem);
  }
}

/* ===== Case Page (Shared Additions) ===== */
/* Methods list */
ul.methods {
  display: block;
  list-style: disc outside;
  padding-left: 1.25rem;
  margin: 0.5rem 0 0 0;
}
ul.methods > li { display: list-item; margin-bottom: .5rem; }

/* Media helpers */
.img-fluid { width: 100%; height: auto; display: block; border: 0; }

.media-row {
  display: grid;
  grid-template-columns: min(25%, 260px) 1fr;
  gap: 1rem;
  align-items: start;
}
.media-row .media { width: 100%; }
.media-row .text { width: 100%; }

/* ===== Case Page: top note ===== */
.note {
  background: var(--surface);
  color: var(--text-light);
  border: none;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  width: 100%; /* ensure full-width inside flex parents like .content */
}
.note .label {
  font-weight: 600;
  color: var(--text-dark);
}

/* ===== Case Page: unified vertical rhythm ===== */
/* Hide stray line breaks inserted between blocks on some pages */
.section__work > br { display: none; }

/* Headings and paragraphs spacing */
.section__work h1.title { margin-bottom: 1rem; }
.section__work .subtitle { margin-top: 1.5rem; margin-bottom: 0.5rem; }
.section__work .description { margin-bottom: 1rem; }

/* Images spacing */
.section__work img,
.section__work .img-fluid { margin: 0.75rem 0; display: block; }

/* ===== Design banner (flowy signature text) ===== */
.design-banner { position: relative; width: 100%; overflow: hidden; padding: 1.5rem 0; margin: 1rem 0 2rem 0; }
.design-banner .design-text {
  position: absolute;
  left: -40%;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-family: var(--font-heading);
  font-size: clamp(3.5rem, 10vw, 9rem);
  line-height: 1;
  color: rgba(78,53,101,0.18);
  letter-spacing: 0.03em;
  animation: design-float 12s linear infinite;
}
.design-banner .design-text.alt {
  left: -60%;
  color: rgba(184,146,255,0.20);
  filter: blur(.3px);
  animation-duration: 16s;
  animation-delay: 4s;
}
@keyframes design-float {
  0%   { transform: translate(-10%, -50%); opacity: .28; }
  80%  { opacity: .14; }
  100% { transform: translate(110%, -50%); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .design-banner .design-text, .design-banner .design-text.alt { animation: none; opacity: .22; left: 50%; transform: translate(-50%, -50%); }
}

/* ===== Animated section tags (above research/work) ===== */
.section-tag { width: 100%; overflow: hidden; margin: .25rem 0 .75rem 0; }
.section-tag .marquee { display: inline-block; white-space: nowrap; animation: none; font-size: 0; }
.section-tag .tagline {
  display: inline-block;
  margin-right: 0; /* no gap to ensure seamless loop */
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 2.6vw, 2.2rem); /* reset after container font-size:0 */
  letter-spacing: .08em;
  text-transform: lowercase;
  color: var(--primary-color-dark);
  opacity: .7;
}
.section-tag .tagline.alt { color: var(--primary-color-dark); opacity: .7; }

/* Static section headings */
.section-heading {
  font-family: var(--font-heading);
  font-size: clamp(1.9rem, 2.6vw, 2.6rem);
  color: var(--primary-color-dark);
  letter-spacing: 0;
  font-weight: 400;
  line-height: 3rem;
  margin: 1rem 0 .75rem 0;
  text-align: center;
}
#timeline {
  scroll-margin-top: calc(var(--nav-height) + 0.5rem);
}
/* Limit hr width below section headings */
.section-heading + hr {
  max-width: 1300px;
  margin: 0 auto;
  border: none;
  border-top: 1px solid #e7e1ee;
}
/* Reduce space specifically above the first heading after the hero */
.section__container.hero + .section-heading { margin-top: 0.35rem; }
/* Timeline styles */
.timeline-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0.75rem 0.5rem;
  position: relative;
}
.timeline-container::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.5rem;
  bottom: 1.5rem;
  width: 2px;
  background: var(--accent-color);
}
.timeline-item {
  position: relative;
  padding-left: 0;
  margin-bottom: 0.9rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.timeline-item.visible {
  opacity: 1;
  transform: translateY(0);
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.1rem;
  width: 1.5rem;
  height: 2px;
  background: var(--accent-color);
}
.timeline-content {
  background: transparent;
  border-radius: 8px;
  padding: 0.3rem 0;
  padding-left: 2rem;
  line-height: 1.6;
}
.timeline-content > div {
  display: block;
}
.timeline-date {
  font-size: 0.85rem;
  color: var(--accent-color);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 0.05rem;
}
.timeline-title {
  font-size: 1rem;
  color: var(--text-dark);
  font-weight: 600;
}
.timeline-org {
  font-size: 0.95rem;
  color: var(--text-light);
  font-weight: 400;
}
/* Hover letter effect (used by section tags and headings) */
.char { display: inline-block; transition: transform .18s ease, opacity .18s ease; cursor: default; font: inherit; line-height: inherit; letter-spacing: inherit; color: inherit; font-weight: 400 !important; font-size: 1em !important; }
/* Ensure injected star/bunny spans match text size/weight */
.char span { font-size: 1em !important; font-weight: 400 !important; line-height: inherit; }
#top .title .char { font-weight: 400; font-family: var(--font-heading); }

/* Hero title color */
#top .title { color: var(--primary-color-dark); }
.char:hover { transform: translateY(-2px) scale(1.06); }
@keyframes tag-scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .section-tag .marquee { animation: none; }
}

/* Case page utilities for structured content (e.g., Goals & Constraints) */
.section__work h2 { font-size: 1.6rem; color: var(--text-dark); margin-top: 1.25rem; margin-bottom: 0.5rem; }
.section__work h3 { font-size: 1.1rem; color: var(--text-dark); margin: 0.5rem 0; }
.section__work h1.title {
  font-family: var(--font-heading);
  color: var(--primary-color-dark);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.15;
}
.section__work .grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); /* two equal columns */
  column-gap: 2rem;
  row-gap: 0.75rem;
  align-items: start;
}
.section__work .list {
  list-style-type: disc;
  padding-left: 1.25rem;
  margin: 0.25rem 0 0.5rem 0;
  column-count: 1; /* keep items vertical under each heading */
  display: block; /* override global nav ul flex */
  align-items: initial;
  gap: 0;
}
/* Spacing for each bullet */
.section__work .list li { margin-bottom: .35rem; display: list-item; width: 100%; }
@media (max-width: 750px) {
  .section__work .grid-2 { grid-template-columns: 1fr; gap: 0.5rem 0; }
  .section__work .list { column-count: 1; }
}

/* ===== Fun hover tilt for cards/images on detail pages ===== */
@media (prefers-reduced-motion: no-preference) {
  /* Index cards */
  .section-box {
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
    will-change: transform;
  }
  .section-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(78,53,101,0.12);
    opacity: 0.98;
  }
  .section-box:hover .title { color: var(--primary-color-dark); font-weight: 450; }
  .section-box:hover .description1 { color: #3a3442; }
  .section-box:hover .image img { transform: scale(1.05); }
  /* Remove tilt on detail page inner elements */
  .section__work .note,
  .section__work .img-fluid { transition: none; }
}

/* Mobile */
@media (max-width: 750px) {
  nav .checkbox { display: block; }
  nav ul {
    position: absolute; width: 100%; height: calc(100vh - var(--nav-height));
    left: 0; top: var(--nav-height); background: rgba(247, 243, 252, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex-direction: column; justify-content: center; gap: 3rem;
    transform: translateX(100%);
    transition: transform .32s ease;
    z-index: 98;
  }
  nav #check:checked ~ ul { transform: translateX(0); }
  nav ul li a { font-size: 1.25rem; }
  
  /* Ensure consistent margins for all project pages on mobile */
  .section__work {
    width: 90vw !important;
    max-width: 1200px !important;
    padding: calc(var(--nav-height) + 1rem) 1rem 2rem 1rem !important;
    margin: 0 auto !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    box-sizing: border-box !important;
  }

  .section__container {
    padding: calc(var(--nav-height) + 1rem) 1.5rem 5rem 1.5rem;
    grid-template-columns: 1fr;
    grid-template-areas:
      "image"
      "content";
    text-align: left; gap: 2rem;
  }
  /* Hero = text first, then image */
  .section__container.hero {
    grid-template-areas:
      "content"
      "image";
  }
  /* keep your choice: hide hero image on very small screens */
  #top .image { display: none; }

  .section__container1 {
    grid-template-columns: 1fr;
    grid-template-areas: "image" "content";
    padding: 2rem 1rem; text-align: left; gap: 2rem;
  }

  .content { align-items: flex-start; }
  .section-box, .section-box .content, .section-box .title, .section-box .description { text-align: left; }
  .section-box a { display: block; text-align: left; }

  .rectangle_button { display: block; width: 100% !important; height: auto; min-height: 140px; margin: 0 !important; padding: 1rem !important; }
  .button_content { align-items: flex-start; }

  .card-grid { grid-template-columns: 1fr; }
  .image { grid-area: image; }
  .image img { width: 100% !important; height: auto !important; margin: 0 !important; max-width: 100%; }
  
  /* Reduce card padding and spacing on mobile */
  .section-box {
    padding: 1.5rem 1.25rem 1.25rem 1.25rem !important;
  }
  .section-box .description1 {
    margin-bottom: 0.75rem !important;
  }
  .section-box strong {
    margin-bottom: 0;
  }

  .timeline-container {
    padding: 0.75rem 1rem !important;
  }
  .timeline-container::before {
    left: 1rem !important;
  }
  .timeline-item::before {
    left: 1rem !important;
  }
  .timeline-content {
    padding-left: calc(2rem + 1.5rem) !important;
  }

  /* Blinking caret */
  .typed-cursor {
    display: inline-block;
    margin-left: 2px;
    animation: caret-blink 0.9s steps(1) infinite;
  }
  @keyframes caret-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
  }

}

/* ===== Cursor sparkle trail ===== */
.sparkle {
  position: fixed;
  pointer-events: none;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.95), rgba(184,146,255,0.95) 60%, rgba(78,53,101,0) 70%);
  filter: drop-shadow(0 0 6px rgba(184,146,255,0.9));
  transform: translate(-50%, -50%) scale(1);
  animation: sparkle-fade 2.2s ease-out forwards;
  z-index: 2147483646; /* above content but below modals if any */
}
@keyframes sparkle-fade {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(0.6); }
}
