/*
  landing.css
  This stylesheet defines the portfolio page design,
  including dark/light themes, glassmorphism, and responsive layout.
*/

@import url("https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:wght@300;400;500&display=swap");

/* ============================================================
   Global reset + base behaviors
   - Base box-sizing, reset margins/padding, and a small default
     transition for subtle UI motion. Keep this minimal as it
     affects every element on the page.
============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
  transition: all 0.2s linear;
}

/*
    Theme variables — centralized colors, spacing, and component tokens
    - Update these to change the site's color palette or adjust
      spacing/rounded corners consistently.
  */
:root {
  --bg: #0d0d0d;
  --surface: #161616;
  --surface2: #1e1e1e;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  --text: #f0ede8;
  --muted: #888;
  --accent: #e8ff52;
  --accent2: #ff6b35;
  --teal: #2dd4bf;
  --purple: #a78bfa;
  --pill-bg: rgba(255, 255, 255, 0.06);
  --panel: rgba(255, 255, 255, 0.06);
  --panel-border: rgba(255, 255, 255, 0.1);
  --header-glow: linear-gradient(
    110deg,
    rgba(232, 255, 82, 0.2),
    rgba(45, 212, 191, 0.12),
    rgba(255, 255, 255, 0.06)
  );
  --radius: 14px;
  /* Fixed header height used to offset page content */
  --header-height: 76px;
}

/* Light mode variable overrides
  - Swapped values used when `html[data-theme="light"]` is set.
  - Keep naming consistent with the dark theme variables above.
*/
html[data-theme="light"] {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface2: #f2f4f8;
  --border: rgba(15, 23, 42, 0.08);
  --border-hover: rgba(15, 23, 42, 0.16);
  --text: #0f172a;
  --muted: #556070;
  --accent: #d8b30a;
  --accent2: #ff6b35;
  --teal: #0f766e;
  --purple: #7c3aed;
  --pill-bg: rgba(15, 23, 42, 0.05);
  --panel: rgba(255, 255, 255, 0.78);
  --panel-border: rgba(15, 23, 42, 0.08);
  --header-glow: linear-gradient(
    110deg,
    rgba(216, 179, 10, 0.16),
    rgba(45, 212, 191, 0.12),
    rgba(15, 23, 42, 0.04)
  );
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  /* Offset content below the fixed header */
  padding-top: var(--header-height);
}

/* Prevent accidental horizontal overflow on small viewports */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

/* ============================================================
  Layout sections
  - Each major visual block (header, hero, cards, footer) is
    separated and described. Change these in isolation.
============================================================ */

/* ─── HEADER / NAV ───
  Sticky header with glassmorphism effect. Contains:
  - `.site-brand` (logo + brand text)
  - `.site-links` (primary navigation links)
  - `.hamburger` and `.theme-toggle` controls for mobile
*/

/* Sticky header with gradient glass overlay */
.site-header {
  /* Fixed header: always visible at the top of the viewport while scrolling */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  backdrop-filter: blur(22px);
  background: var(--panel);
  background-image: var(--header-glow);
  background-blend-mode: screen;
  border-bottom: 1px solid var(--panel-border);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.18);
}
.site-nav {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 16px clamp(16px, 4vw, 48px);
  /* Use a 3-column grid: brand | nav (fluid) | controls
     This avoids flex wrapping issues on wide screens and keeps the
     navigation centered while ensuring controls stay visible. */
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
  grid-column: 1;
}
.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(232, 255, 82, 0.18);
  color: var(--accent);
  font-weight: 700;
}

.brand-copy strong {
  display: block;
  font-size: 14px;
}
.brand-copy small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-links {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: center;
  /* keep links on one line in desktop/web views; allow horizontal scroll if needed */
  flex-wrap: nowrap;
  gap: 12px;
  align-items: center;
  overflow-x: auto;
  grid-column: 2;
}
.site-links::-webkit-scrollbar {
  display: none;
}
.site-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 10px 14px;
  border-radius: 999px;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
  white-space: nowrap;
}
.site-links a:hover,
.site-links a:focus-visible {
  background: rgba(232, 255, 82, 0.12);
  transform: translateY(-1px);
}
.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}
.hamburger,
.theme-toggle {
  grid-column: 3;
  justify-self: end;
}
.theme-toggle:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
}
.hamburger {
  display: none;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  position: relative;
}
.hamburger:hover {
  background: rgba(255, 255, 255, 0.08);
}
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 1px;
  background: var(--text);
  transition:
    transform 0.26s cubic-bezier(0.2, 0.9, 0.2, 1),
    opacity 0.18s ease;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  transform-origin: center;
}
.hamburger span:first-child {
  top: calc(50% - 6px);
}
.hamburger span:nth-child(2) {
  top: 50%;
  transform: translateX(-50%) translateY(-50%);
}
.hamburger span:last-child {
  top: calc(50% + 6px);
}

.hamburger.open span:first-child {
  transform: translateX(-50%) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: translateX(-70%);
}
.hamburger.open span:last-child {
  transform: translateX(-50%) rotate(-45deg);
}
.hamburger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── HERO ─── */
.hero {
  padding: 80px 48px 56px;
  max-width: 960px;
  margin: 0 auto;
}
.hero-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: "DM Sans", sans-serif;
  font-weight: 500;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-label::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}
.hero h1 {
  font-family: "Syne", sans-serif;
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--text);
}
.hero h1 .typewriter {
  display: inline-flex;
  position: relative;
  color: var(--accent);
}
.hero h1 .typewriter::after {
  content: "|";
  display: inline-block;
  margin-left: 6px;
  animation: blink 1.2s steps(2, start) infinite;
}
@keyframes blink {
  0%,
  40% {
    opacity: 1;
  }
  41%,
  100% {
    opacity: 0;
  }
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero-sub {
  margin-top: 24px;
  font-size: 16px;
  color: var(--muted);
  max-width: 520px;
  font-weight: 300;
  line-height: 1.7;
}

.hero-avatar {
  display: flex;
  justify-content: left;
  margin-bottom: 18px;
}
.profile-pic {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transition:
    transform 0.18s ease,
    filter 0.18s ease;
}
.profile-pic:hover {
  transform: translateY(-4px);
}
.hero-meta {
  margin-top: 36px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
/* Flexible stats row for numbers and logos */
.hero-stat {
  text-align: center;
}
.hero-stat-num {
  font-family: "Syne", sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}
.hero-stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.hero-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.hero-logos .logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  filter: brightness(0.9) saturate(0.8);
  transition: filter 0.2s;
}
.hero-logos .logo:hover {
  filter: brightness(1) saturate(1);
}
.hero-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}
.cta-row {
  margin-top: 40px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
/* Button styles used for primary and secondary CTAs */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s;
  border: 1px solid transparent;
  font-family: "DM Sans", sans-serif;
}
.btn-accent {
  background: var(--accent);
  color: #0d0d0d;
}
.btn-accent:hover {
  background: #f5ff85;
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-hover);
}
.btn-ghost:hover {
  border-color: var(--text);
}

/* ─── SECTIONS ─── */
.section {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 48px 80px;
  /* offset anchors so they land below the fixed header */
  scroll-margin-top: var(--header-height);
}
.section-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
}
/* Glass panel style used by cards and section containers.
   The panel uses blur and translucent backgrounds.
*/
/* Glass panels give cards and sections a translucent, blurred edge */
.glass-panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(22px);
  padding: 36px;
  border-radius: var(--radius);
}
.about-grid,
.skills-grid,
.services-grid,
.contact-grid,
.cert-grid {
  display: grid;
  gap: 20px;
}
.about-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.9fr);
  align-items: start;
}
.about-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.about-chip {
  display: inline-flex;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(232, 255, 82, 0.12);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.about-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.about-highlights span {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
}
.about-stats {
  display: grid;
  gap: 14px;
}
.about-stats div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.about-stats strong {
  font-size: 24px;
  color: var(--text);
}
.about-stats span {
  color: var(--muted);
  font-size: 12px;
}
.skills-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  /* Add breathing room between the previous section (about) and skills */
  margin-top: 36px;
}
.skill-card h3,
.service-card h3 {
  margin-bottom: 16px;
  font-family: "Syne", sans-serif;
  font-size: 20px;
}
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.skill-tags span {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
}
.skill-tags.soft span {
  background: rgba(45, 212, 191, 0.08);
  border-color: rgba(45, 212, 191, 0.15);
  color: var(--teal);
}
.cert-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.cert-card {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}
.cert-card strong {
  font-size: 15px;
}
.cert-card span {
  color: var(--muted);
  font-size: 12px;
}
.services-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}
.service-card {
  min-height: 180px;
  padding: 28px;
}
.service-card p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.7;
}
.contact-grid {
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
  align-items: center;
}
.contact-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.contact-card p {
  color: var(--muted);
  line-height: 1.75;
}
.contact-info {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}
.contact-email i {
  font-size: 14px;
}
.contact-panel {
  padding: 40px;
}

/*
    STACK PILLS
    - Small UI pills used to display technology stack items.
    - Designed to wrap and remain readable on narrow viewports.
  */

/* ─── STACK PILLS ─── */
.stack-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 56px;
}
.pill {
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--pill-bg);
  font-family: "DM Sans", sans-serif;
}
.pill.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(232, 255, 82, 0.06);
}

/* ─── PROJECT GRID ─── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ─── CARDS ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  position: relative;
  transition:
    border-color 0.2s,
    transform 0.2s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}
.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.card-status {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
  font-weight: 500;
}
.status-live {
  background: rgba(45, 212, 191, 0.12);
  color: var(--teal);
  border: 1px solid rgba(45, 212, 191, 0.25);
}
.status-shipped {
  background: rgba(232, 255, 82, 0.1);
  color: var(--accent);
  border: 1px solid rgba(232, 255, 82, 0.2);
}
.status-concept {
  background: rgba(167, 139, 250, 0.1);
  color: var(--purple);
  border: 1px solid rgba(167, 139, 250, 0.2);
}
.card h3 {
  font-family: "Syne", sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 8px;
}
.card-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  flex: 1;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 20px;
}
.tag {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--surface2);
  color: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--border);
}
.card-foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-stack {
  font-size: 11px;
  color: var(--muted);
}

/* ─── MARQUEE ─── */
.marquee-wrap {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  padding: 14px 0;
  margin: 42px 0 64px;
  white-space: nowrap;
}
.marquee-inner {
  display: inline-flex;
  gap: 48px;
  animation: scroll 28s linear infinite;
}
.marquee-item {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 12px;
}
.marquee-item::after {
  content: "·";
  color: var(--border-hover);
}
@keyframes scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* ─── FEATURED CARD ─── */
.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.featured:hover {
  border-color: var(--border-hover);
}
.featured-left {
  padding: 36px 32px;
  border-right: 1px solid var(--border);
}
.featured-right {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.featured-badge {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent2);
  background: rgba(255, 107, 53, 0.1);
  border: 1px solid rgba(255, 107, 53, 0.2);
  padding: 3px 10px;
  border-radius: 100px;
  display: inline-block;
  margin-bottom: 16px;
}
.featured h3 {
  font-family: "Syne", sans-serif;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
}
.featured-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}
.flow-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.flow-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.flow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.flow-step-label {
  color: var(--muted);
}
.flow-step-tool {
  margin-left: auto;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
}

/* ─── FOOTER ─── */
.footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 48px 64px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-left {
  font-size: 13px;
  color: var(--muted);
}
.footer-left strong {
  color: var(--text);
  font-weight: 500;
}
.popup-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(8, 12, 18, 0.76);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.24s ease,
    visibility 0.24s ease;
  z-index: 100;
}
.popup-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.popup-cta {
  position: relative;
  width: min(100%, 420px);
  padding: 28px 28px 24px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.28);
}
.popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
}
.popup-close:hover {
  background: rgba(255, 255, 255, 0.14);
}
.popup-cta strong {
  font-size: 18px;
  color: var(--text);
}
.popup-cta p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
.popup-contact {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}
.popup-contact i {
  font-size: 14px;
}
.popup-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.contact-row {
  display: flex;
  gap: 16px;
}
.contact-item {
  font-size: 13px;
  color: var(--muted);
}

/* ─── RESPONSIVE BREAKPOINTS ─── */
/* Tablet and small desktop behaviors for screens 768px wide and below. */
@media (max-width: 768px) {
  /* Header keeps its glass effect on mobile; only adjust nav layout */
  .site-nav {
    padding: 14px 16px;
    gap: 10px;
    position: relative;
  }
  .site-links {
    display: none;
    position: absolute;
    top: 100%;
    right: 12px;
    left: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    z-index: 55;
    margin-top: 8px;
    box-sizing: border-box;
    /* use left/right positioning to control width, avoid 100vw to prevent horizontal overflow */
    box-sizing: border-box;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
  }
  .site-links.open {
    display: flex;
  }
  .site-links a {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    transition:
      background 0.2s ease,
      color 0.2s ease;
  }
  .site-links a:hover,
  .site-links a:focus-visible {
    background: rgba(232, 255, 82, 0.12);
    color: var(--text);
  }
  .theme-toggle {
    order: 3;
  }
  .hamburger {
    display: inline-flex;
    order: 2;
    margin-left: auto; /* push hamburger and theme-toggle to the right */
  }
  .section,
  .hero {
    padding-left: 16px;
    padding-right: 16px;
  }
  .about-grid,
  .skills-grid,
  .services-grid,
  .contact-grid,
  .cert-grid {
    grid-template-columns: 1fr;
  }
  .popup-overlay {
    padding: 18px;
  }
}

/* Narrow phone optimizations for screens 640px wide and below. */
@media (max-width: 640px) {
  .hero {
    padding-top: 56px;
  }
  .site-nav {
    justify-content: space-between;
  }
  .site-header {
    padding-bottom: 10px;
  }
  .hero,
  .section {
    padding-left: 20px;
    padding-right: 20px;
  }
  /* Tighter navbar items on very narrow screens */
  .site-links {
    gap: 8px;
    justify-content: center;
  }
  .site-links a {
    padding: 8px 10px;
    font-size: 11px;
    letter-spacing: 0.04em;
  }
  /* Slightly reduce the skills top margin on very narrow screens */
  .skills-grid {
    margin-top: 20px;
  }
  .featured {
    grid-template-columns: 1fr;
  }
  .featured-left {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .hero h1 {
    font-size: 36px;
  }
}
