@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

/* Instrument Serif utility classes */
.instrument-serif-regular {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-style: normal;
  font-stretch: condensed;
  letter-spacing: -0.02em;
}
.instrument-serif-regular-italic {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-style: italic;
  font-stretch: condensed;
  letter-spacing: -0.02em;
}

:root {
  --color-bg: #000;
  --color-bg-alt: #000;
  --color-card: #000;
  --color-primary: #fff;
  --color-secondary: #fff;
  --color-accent: #fff;
  --color-text: #fff;
  --color-muted: #d1d5db;
  --color-border: #fff;
  --radius: 0;
  --shadow: none;
  --transition: 0.2s cubic-bezier(.4,0,.2,1);
  --font-serif: "Instrument Serif", serif;
  --font-sans: "Helvetica Neue UltraLight","Helvetica Neue",Helvetica,Arial,sans-serif;
}

/* Theme palettes: default to 'auto' (follow system) */
:root, :root[data-theme="auto"] {
  --color-bg: #f5f5f7;        /* was #ffffff */
  --color-bg-alt: #f5f5f7;
  --color-card: #ffffff;
  --color-primary: #111111;
  --color-secondary: #111111;
  --color-accent: #111111;
  --color-text: #111111;
  --color-muted: #4b5563;
  --color-border: #111111;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root, :root[data-theme="auto"] {
    --color-bg: #000;
    --color-bg-alt: #000;
    --color-card: #191919;
    --color-primary: #ffffff;
    --color-secondary: #ffffff;
    --color-accent: #ffffff;
    --color-text: #ffffff;
    --color-muted: #d1d5db;
    --color-border: #ffffff;
    color-scheme: dark;
  }
}

/* Explicit overrides */
:root[data-theme="light"] {
  --color-bg: #f5f5f7;        /* was #ffffff */
  --color-bg-alt: #f5f5f7;
  --color-card: #ffffff;
  --color-primary: #111111;
  --color-secondary: #111111;
  --color-accent: #111111;
  --color-text: #111111;
  --color-muted: #4b5563;
  --color-border: #111111;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --color-bg: #000;
  --color-bg-alt: #000;
  --color-card: #191919;
  --color-primary: #ffffff;
  --color-secondary: #ffffff;
  --color-accent: #ffffff;
  --color-text: #ffffff;
  --color-muted: #d1d5db;
  --color-border: #ffffff;
  color-scheme: dark;
}

/* Apply theme variables */
html { color-scheme: light dark; }
body {
  background: var(--color-bg);
  color: var(--color-text);
  transition: background-color var(--transition), color var(--transition);
}
a { color: var(--color-primary); }
hr, .bordered { border-color: var(--color-border); }

/* Utility for hidden label used by the toggle */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* Base typography: Helvetica Neue UltraLight (ultra light) */
html, body {
  font-family: "Helvetica Neue UltraLight","Helvetica Neue",Helvetica,Arial,sans-serif;
  font-weight: 400; /* UltraLight */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ensure regular text inherits the light weight */
:where(p, a, li, span, small, label, input, textarea, button) {
  font-family: inherit;
  font-weight: inherit;
}

/* Titles stay on Instrument Serif (unchanged) */
h1, h2, h3, h4, h5, h6,
.hero h1,
.section > h2,
.card h3,
.title {
  font-family: "Instrument Serif", serif;
  /* no forced weight change to keep existing Instrument Serif styling */
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 10, 10, 0.5);
  -webkit-backdrop-filter: blur(15px);
  backdrop-filter: blur(15px);
  padding: 0 2rem;
  height: 68px;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Remove Quantaflux Labs text from navbar logo, keep only the logo image */
.navbar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.navbar-logo img {
  height: 40px;
  width: 40px;
  background: var(--color-card);
  padding: 4px;
  /*border: 1px solid var(--color-border);*/
  border-radius: 0;
}

/* Nav bar links use condensed Instrument Serif font */
.navbar-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.navbar-links a,
.navbar-links button {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 400;
  font-size: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border-radius: 0;
  transition: background var(--transition), color var(--transition);
  font-family: "Instrument Serif", serif;
  font-stretch: condensed;
  letter-spacing: -0.02em;
}
.navbar-links a.active,
.navbar-links a:hover {
  background: rgba(255,255,255,0.07);
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}
.navbar-links button {
  display: flex;
  align-items: center;
}

/* Remove borders from large containers */
.section,
.cards,
nav,
header,
main,
footer {
  border: none !important;
}

/* Projects page: only the cards have borders */
.cards .card {
  border: 1px solid #ccc;
  /* optional: border-radius: 8px; */
}

/* Keep borders on links */
a {
  border: 1px solid currentColor;
}

/* Keep border on selected nav item, but not on the navbar itself */
nav {
  border: none !important;
}

nav a.active,
.nav a.active,
.navbar a.active {
  border: 1px solid currentColor;
}

/* Projects page: on hover, text turns white in light mode (buttons turn black) */
:root[data-theme="light"] #projects .cta-btn:hover,
:root[data-theme="light"] #projects .cta-btn:focus-visible {
  color: #ffffff !important;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] #projects .cta-btn:hover,
  :root[data-theme="auto"] #projects .cta-btn:focus-visible {
    color: #ffffff !important;
  }
}

/* Rest of the styles unchanged, but included for completeness */
.hero h1,
.section h2,
.card h3 {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-style: normal;
  font-stretch: condensed;
  letter-spacing: -0.02em;
}
.navbar-logo {
  font-size: 2.2rem;
}
.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}
.section h2 {
  font-size: 2.3rem;
  margin-bottom: 1.2rem;
  text-align: center;
}
.card h3 {
  font-size: 1.7rem;
  margin-bottom: 0.7rem;
}
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  margin: 0;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}

.dev-banner {
  position: sticky;
  top: 68px; /* Height of navbar, so banner sits below navbar */
  z-index: 9;
  width: 100vw;
  padding: 1rem 0;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: #eaf6ff;
  background: rgba(60, 120, 255, 0.18);
  backdrop-filter: blur(4px) saturate(220%) contrast(120%);
  -webkit-backdrop-filter: blur(4px) saturate(220%) contrast(120%);
  border: 0.5px solid rgba(255,255,255,0.04);
  box-shadow:
    0 4px 24px 0 rgba(60, 120, 255, 0.10),
    0 0 0 2px rgba(255,255,255,0.08) inset,
    0 0 12px 2px rgba(60,120,255,0.06) inset;
  margin-bottom: 2rem;
  letter-spacing: 0.02em;
  background-clip: padding-box;
  overflow: hidden;
}

.hero {
  min-height: 56vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;

  /* Full-bleed */
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 4rem 2rem 3rem;

  background: var(--color-bg-alt);
  box-shadow: none;
  border-radius: 0;
  position: relative;
  top: 0;
}
.hero p {
  font-size: 1.35rem;
  color: var(--color-muted);
  margin-bottom: 2rem;
  font-family: var(--font-sans);
}
.cta-btn {
  background: var(--color-bg);
  color: var(--color-primary);
  font-weight: 600;
  font-size: 1.1rem;
  padding: 0.9rem 2.2rem;
  border: 1px solid var(--color-border);
  border-radius: 0;
  box-shadow: none;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  font-family: var(--font-sans);
}
.cta-btn:hover {
  background: var(--color-primary);
  color: var(--color-bg);
  box-shadow: none;
}
.section {
  max-width: 900px;
  margin: 0 auto 2.5rem;
  padding: 2rem 2rem 0.5rem;
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  border-radius: 0;
}
.cards {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}
.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 0;
  box-shadow: none;
  padding: 2rem 1.2rem 1.2rem;
  min-width: 220px;
  flex: 1 1 220px;
  max-width: 320px;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: none;
  border: 2px solid var(--color-border);
}
.card p {
  font-size: 1rem;
  color: var(--color-muted);
  margin-bottom: 1.2rem;
  font-family: var(--font-sans);
}
.card-link {
  background: var(--color-bg);
  color: var(--color-primary);
  padding: 0.7rem 1.4rem;
  border: 1px solid var(--color-border);
  border-radius: 0;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  font-family: var(--font-sans);
}
.card-link:hover {
  background: var(--color-primary);
  color: var(--color-bg);
}
.cta-btn,
.card-link,
.button,
.btn,
form button[type="submit"] {
  background: var(--color-card);
}

.cta-btn:hover,
.card-link:hover,
.button:hover,
.btn:hover,
form button[type="submit"]:hover {
  background: var(--color-primary);
  color: var(--color-bg);
}
form#contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 480px;
  margin: 1.2rem auto 0;
  background: var(--color-card);
  padding: 2rem 1.5rem;
  border-radius: 0;
  box-shadow: none;
  border: 1px solid var(--color-border);
}
form input, form textarea {
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 0.8rem;
  border-radius: 0;
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  color: var(--color-text);
  transition: border var(--transition), background var(--transition);
}
form input:focus, form textarea:focus {
  border-color: var(--color-primary);
  background: var(--color-bg);
  outline: none;
}
form button[type="submit"] {
  background: var(--color-bg);
  color: var (--color-primary);
  font-weight: 600;
  border: 1px solid var(--color-border);
  padding: 0.9rem 1.8rem;
  border-radius: 0;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  box-shadow: none;
  font-family: var(--font-sans);
}
form button[type="submit"]:hover {
  background: var(--color-primary);
  color: var(--color-bg);
}
#form-status {
  display: block;
  font-size: 0.97rem;
  color: var(--color-accent);
  margin-top: 0.5rem;
  min-height: 1.2em;
}
footer {
  background: var(--color-bg-alt);
  color: var(--color-muted);
  text-align: center;
  padding: 2rem 0 1.4rem;
  font-size: 1rem;
  border-top: 1px solid var(--color-border);
  margin-top: 2.5rem;
  font-family: var(--font-sans);
}
.footer-link {
  color: var(--color-primary);
  text-decoration: none;
  margin-left: 1.5rem;
  font-weight: 500;
  transition: color var(--transition);
  font-family: var(--font-sans);
}
.footer-link:hover {
  color: var(--color-accent);
}

/* Force hero (first section) text to white regardless of theme */
main > section:first-of-type,
main > section.hero,
main > section.hero * {
  /* Override palette locally for hero */
  --color-text: #ffffff;
  --color-primary: #ffffff;
  --color-secondary: #ffffff;
  --color-accent: #ffffff;
  --color-muted: #f3f4f6;
  --color-border: #ffffff;
  color: var(--color-text);
}

/* Improve readability over images */
main > section:first-of-type :where(h1, h2, h3, h4, p, a, span, small, li, blockquote, strong, em) {
  color: #ffffff !important;
  text-shadow: none !important;
}

/* Hero: force Projects button to black bg, white text, white border; invert on hover */
main > section:first-of-type a.cta-btn[href="#projects"],
main > section:first-of-type a.cta-btn[href*="projects"] {
  background: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}
main > section:first-of-type a.cta-btn[href="#projects"]:hover,
main > section:first-of-type a.cta-btn[href*="projects"]:hover {
  background: #fff !important;
  color: #000 !important;
  border-color: #000 !important;
}
main > section:first-of-type a.cta-btn[href="#projects"]:focus-visible,
main > section:first-of-type a.cta-btn[href*="projects"]:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}

/* Social icons: correct colors in light mode (idle black, hover white) */
:root[data-theme="light"] .cta-btn img {
  filter: invert(0);
  transition: filter var(--transition);
}
:root[data-theme="light"] .cta-btn:hover img {
  filter: invert(1);
}
/* Auto + system light */
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] .cta-btn img { filter: invert(0); }
  :root[data-theme="auto"] .cta-btn:hover img { filter: invert(1); }
}

/* Navbar: white in light mode, black tint in dark remains as-is */
:root[data-theme="light"] .navbar {
  background: #ffffff;
  color: #111111;
}
:root[data-theme="light"] .navbar a,
:root[data-theme="light"] .navbar .navbar-logo {
  color: #111111;
}
/* Auto + system light */
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] .navbar {
    background: #ffffff;
    color: #111111;
  }
  :root[data-theme="auto"] .navbar a,
  :root[data-theme="auto"] .navbar .navbar-logo {
    color: #111111;
  }
}

/* Navbar: more translucent in light mode */
:root[data-theme="light"] .navbar {
  background-color: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  color: #111111;
}
:root[data-theme="light"] .navbar a,
:root[data-theme="light"] .navbar .navbar-logo {
  color: #111111;
}

/* Auto + system light */
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] .navbar {
    background-color: rgba(255, 255, 255, 0.6);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    color: #111111;
  }
  :root[data-theme="auto"] .navbar a,
  :root[data-theme="auto"] .navbar .navbar-logo {
    color: #111111;
  }
}

/* Responsive Design */
@media (max-width: 1200px) {
  .cards {
    gap: 1.2rem;
  }
}
@media (max-width: 900px) {
  .section, .hero {
    padding: 2rem 1rem;
    max-width: 99vw;
  }
  .cards {
    flex-direction: column;
    gap: 1rem;
  }
}
@media (max-width: 600px) {
  .navbar-logo {
    font-size: 1.4rem;
  }
  .hero h1 {
    font-size: 2.3rem;
  }
  .section h2 {
    font-size: 1.4rem;
  }
  .card h3 {
    font-size: 1.2rem;
  }
}

/* Contact Flex Styles */
.contact-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2em;
}

.contact-flex p {
  margin: 0;
}

.contact-flex .cta-btn {
  white-space: nowrap;
}

/* Shared button styling (used on index and projects) */
.button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border: 1.5px solid var(--accent, currentColor);
  border-radius: 0px;
  text-decoration: none;
  font-weight: 600;
  line-height: 1;
  background: transparent;
  color: inherit;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.button:hover,
.btn:hover {
  background: var(--accent, currentColor);
  color: #000 !important;
}

/* Optional: spacing for action rows under cards */
.cards .actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.75rem;
  text-align: center;
}

footer {
  background: var(--color-bg-alt);
  color: var(--color-muted);
  text-align: center;
  padding: 2rem 0 1.4rem;
  font-size: 1rem;
  border-top: 1px solid var(--color-border);
  margin-top: 2.5rem;
  font-family: var(--font-sans);
}
footer span {
  display: inline-block;
  margin-right: 0.75rem;
}
footer label {
  display: none;
}
footer select {
  margin-left: 0.75rem;
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
}

/* Hero section centering */
.hero,
.hero-section {
  display: flex;
  flex-direction: column;
  justify-content: center;      /* vertical center */
  align-items: center;          /* horizontal center */
  text-align: center;
  min-height: clamp(500px, 90vh, 900px);
  padding: 4rem 1.5rem;
  margin: 0 auto;
  max-width: 1100px;
  gap: 1.5rem;
}

.hero img,
.hero-section img {
  max-width: 260px;
  width: 100%;
  height: auto;
  display: block;
}

.hero .buttons,
.hero-section .buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.hero .buttons a,
.hero .buttons button,
.hero-section .buttons a,
.hero-section .buttons button {
  text-align: center;
}

/* If the hero container was inside something restricting centering */
.hero > *:not(img),
.hero-section > *:not(img) {
  max-width: 800px;
}

/* --- Full-bleed hero override (place AFTER previous .hero rules) --- */
.hero,
.hero-section {
  position: relative;
  width: 100%;
  max-width: none;          /* override earlier max-width */
  margin: 0;
  padding: 0;               /* inner wrapper will handle padding */
  overflow: hidden;
}

.hero::before,
.hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url(/path/to/your/hero.jpg) center/cover no-repeat;
  /* optional dark overlay */
  background-blend-mode: multiply;
  z-index: 0;
  /* If you want a tint: */
  /* background-color: rgba(0,0,0,0.25); */
}

.hero img.hero-bg,
.hero-section img.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

/* Inner constrained content */
.hero-inner,
.hero-section .hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: clamp(500px, 90vh, 900px);
  text-align: center;
  gap: 1.5rem;
}

/* Buttons row still centered */
.hero-inner .buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Remove earlier width cap on direct children if present */
.hero > *:not(.hero-inner),
.hero-section > *:not(.hero-inner) {
  /* no constraints */
}

/* --- Hero adjustments (override previous rules) --- */
.hero,
.hero-section {
  position: relative;
  /* Remove prior gradient+image stacked backgrounds; force only image */
  background: url('hero.webp') center / cover no-repeat !important;
  min-height: clamp(340px, 50vh, 560px) !important;
  padding: 2.75rem 1.25rem 2.25rem !important;
  gap: 1.1rem !important;
  max-width: 1100px;
  margin: 0 auto;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.2);              /* uniform dark filter */
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero img.profile-pic {
  margin: 0.5rem auto 0;
}

@media (max-width: 200px) {
  .hero {
    min-height: 200px;
    padding: 2.2rem 1rem 2rem;
  }
}

/* --- Hero cleanup & full overlay (index + shared) --- */
.hero,
.hero-section {
  position: relative;
  /* Remove prior gradient+image stacked backgrounds; force only image */
  background: url('hero.webp') center / cover no-repeat !important;
  min-height: clamp(340px, 50vh, 560px) !important;
  padding: 2.75rem 1.25rem 2.25rem !important;
  gap: 1.1rem !important;
  max-width: 1100px;
  margin: 0 auto;
}

/* Full dark overlay (single source of truth) */
.hero::before,
.hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.1);
  pointer-events: none;
  z-index: 0;
}

/* Neutralize any previous partial overlays */
.hero::after,
.hero-section::after,
.hero-overlay,
.hero .hero-overlay,
.hero-section .hero-overlay {
  display: none !important;
}

/* Ensure stacking of content above overlay */
.hero > * ,
.hero-section > * {
  position: relative;
  z-index: 1;
}

/* If an existing .hero-overlay div remains in HTML, repurpose it safely */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55) !important;
  pointer-events: none;
}

/* Mobile tweak */
@media (max-width: 600px) {
  .hero,
  .hero-section {
    min-height: 400px !important;
    padding: 2.3rem 1rem 2rem !important;
  }
}

/* --- Hero full-bleed width override --- */
.hero,
.hero-section {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

/* Optional: limit text line length while keeping full-bleed background.
   Uncomment if you want narrower centered content.
.hero > *:not(:where(.hero::before)),
.hero-section > * {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}
*/

/* Center hero inner content */
.hero,
.hero-section {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero img.profile-pic {
  display: block;
  margin: 0.5rem auto 0;
}

/* Hero centering override (add near end of file) --- */
.hero,
.hero-section {
  display: flex;
  flex-direction: column;
  justify-content: center;   /* vertical centering */
  align-items: center;       /* horizontal centering */
  text-align: center;        /* center text */
}

.hero img,
.hero-section img {
  display: block;
  margin: 0 auto;
}

.hero .btn,
.hero-section .btn {
  margin-left: 0;
  margin-right: 0;
}

/* Center hero content */
main > section:first-of-type {
  display: flex;
  flex-direction: column;
  align-items: center;          /* horizontal centering */
  justify-content: center;
  text-align: center;
  padding-left: 0;              /* in case a global section pad is asymmetric */
  padding-right: 0;
}

/* Optional: wrap hero content in a container if you have many wide elements */
main > section:first-of-type > .hero-inner {
  max-width: 960px;
  width: 100%;
  margin-inline: auto;
  padding: 0 1.25rem;
}

/* Make inline avatar + heading groups center nicely */
main > section:first-of-type h1,
main > section:first-of-type h2,
main > section:first-of-type p {
  margin-left: auto;
  margin-right: auto;
}

/* If an image (profile picture) is floating or inline with unexpected baseline */
main > section:first-of-type img.profile,
main > section:first-of-type img[alt*="profile" i] {
  display: block;
  margin: 1rem auto;
}

/* Buttons row centering */
main > section:first-of-type .cta-group,
main > section:first-of-type .buttons,
main > section:first-of-type nav {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Safety: remove stray left/right margins on direct children */
main > section:first-of-type > * {
  margin-left: 0;
}

/* TEMP (uncomment to debug bounding box)
// main > section:first-of-type { outline: 1px dashed magenta; }
// main > section:first-of-type > * { outline: 1px dashed cyan; }
*/

/* --- HERO RESET (remove earlier conflicting hero rules) --- */
/* Neutralize previous hero flex attempts */
main > section:first-of-type,
.hero,
.hero-section {
  all: unset;
  display: flex;
  box-sizing: border-box;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 100dvh;                 /* full viewport height */
  padding: clamp(2.5rem, 6vh, 5rem) 1.25rem;
  position: relative;
  overflow: hidden;
  text-align: center;
  /* Preserve prior forced light text */
  --color-text: #fff;
  --color-primary: #fff;
  --color-secondary: #fff;
  --color-accent: #fff;
  --color-muted: #f3f4f6;
  --color-border: #ffffff;
  color: var(--color-text);
}

/* Inner width constraint */
main > section:first-of-type > .hero-inner,
.hero > .hero-inner,
.hero-section > .hero-inner {
  width: 100%;
  max-width: 960px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.75rem, 1.2vh, 1.25rem);
}

/* Headings & text spacing */
.hero-inner h1,
.hero-inner h2,
.hero-inner p,
.hero-inner .tagline {
  margin: 0;
  max-width: 48ch;
}

.hero-inner h1 {
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.hero-inner h2 {
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  font-weight: 500;
  opacity: 0.9;
}

.hero-inner p {
  font-size: clamp(0.95rem, 1.3vw, 1.05rem);
  opacity: 0.85;
}

/* Profile image */
.hero-inner .profile-pic,
.hero-inner img.profile,
.hero-inner img[alt*="profile" i] {
  /* width: 120px;
  height: 120px; */
  border-radius: 50%;
  object-fit: cover;
  margin: 0 0 0.75rem;
  border: 2px solid rgba(255,255,255,0.6);
  box-shadow: 0 4px 18px -6px rgba(0,0,0,0.55);
}

/* Buttons / CTA group */
.hero-inner .cta-group,
.hero-inner .buttons,
.hero-inner nav.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
  margin-top: 0.75rem;
}

.hero-inner .cta-group a,
.hero-inner a.cta-btn,
.hero-inner button.cta-btn {
  text-decoration: none;
  padding: 0.7rem 1.15rem;
  font-size: 0.95rem;
  line-height: 1.1;
  border-radius: 999px;
  border: 1px solid #fff;
  background: rgba(0,0,0,0.35);
  color: #fff;
  backdrop-filter: blur(6px) brightness(1.15);
  -webkit-backdrop-filter: blur(6px) brightness(1.15);
  transition: background .25s, color .25s, border-color .25s;
}

.hero-inner .cta-group a:hover,
.hero-inner a.cta-btn:hover,
.hero-inner button.cta-btn:hover {
  background: #fff;
  color: #000;
  border-color: #000;
}

/* Specific Projects button rule (retain intent) */
.hero-inner a.cta-btn[href*="projects"] {
  background: #000;
  color: #fff;
  border-color: #fff;
}
.hero-inner a.cta-btn[href*="projects"]:hover {
  background: #fff;
  color: #000;
  border-color: #000;
}

/* Social icons row */
.hero-inner .social,
.hero-inner ul.social {
  list-style: none;
  display: flex;
  gap: 0.9rem;
  padding: 0;
  margin: 1rem 0 0;
}

.hero-inner .social a {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.1);
  transition: background .25s, border-color .25s;
}

.hero-inner .social a:hover {
  background: #fff;
  border-color: #fff;
}

.hero-inner .social a img,
.hero-inner .social a svg {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
  transition: filter .25s;
}

.hero-inner .social a:hover img,
.hero-inner .social a:hover svg {
  filter: none;
}

/* Prevent stray horizontal shift if global sections use side padding */
body,
main,
main > section:first-of-type {
  margin: 0;
}

/* Small screens adjustments */
@media (max-width: 600px) {
  .hero-inner h1 { font-size: clamp(2.1rem, 9vw, 2.75rem); }
  .hero-inner h2 { font-size: 1.05rem; }
  .hero-inner .cta-group a,
  .hero-inner a.cta-btn { width: auto; }
}

/* Optional subtle overlay if there's a background image */
main > section:first-of-type::after,
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.35));
  pointer-events: none;
  z-index: 0;
}

main > section:first-of-type > .hero-inner,
.hero > .hero-inner {
  position: relative;
  z-index: 1;
}

/* Profile picture */
.profile-pic {
  /* width: 160px;
  max-width: 40vw;  /* stays responsive on very small screens
  height: auto; */
  border-radius: 50%;
  display: block;
  margin: 1rem auto;
}

/* Final unified profile pic sizing */
.hero .profile-pic,
.profile-pic {
  width: 140px !important;
  max-width: 40vw;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  margin: 1rem auto;
  border: none;
  box-shadow: none;
}

/* Ensure no border from any later rules */
.hero .profile-pic,
.profile-pic {
  border: none !important;
  box-shadow: none !important;
}

/* === Compact Hero + Profile Pic Overrides (add near end) === */
.hero {
  min-height: auto !important;
  padding: 2.2rem 1.25rem 2.4rem !important;
  display: block !important;
}

.hero h1 {
  margin: 0 0 0.55rem;
  line-height: 1.05;
}

.hero p {
  margin: 0 0 0.75rem;
}

.hero .cta-btn {
  margin-top: 0.4rem;
}

/* Unified profile picture styling */
.hero .profile-pic,
.profile-pic {
  width: 120px !important;      /* adjust smaller/larger as desired */
  max-width: 40vw;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  border-radius: 50%;
  margin: 0.65rem auto 0.8rem;
  box-shadow: none;
  border: 1px solid var(--color-border);
}

/* Even tighter option for very small screens */
@media (max-width: 480px) {
  .hero {
    padding: 1.75rem 1rem 2rem !important;
  }
  .hero .profile-pic,
  .profile-pic {
    width: 105px !important;
    margin: 0.5rem auto 0.7rem;
  }
  .hero h1 {
    font-size: 1.9rem;
  }
}

