/* ====== Site Styles (stable, unified) ====== */

/* Base text */
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

/* ---------- Header ---------- */
header {
  background: #222222;
  color: #ffffff;
  padding: 20px 30px;

  /* polish */
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0, 0, 0, .15);
}

/* Brand */
header .site-title {
  color: white;
  text-decoration: none;
  width: 49%;
  display: inline-block;
}

header img {
  width: 50px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

header h2 {
  font-size: 16px;
}

/* Nav (right-aligned) */
header #main-navigation {
  width: 49%;
  display: inline-block;
  text-align: right;
}

header #main-navigation ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

header #main-navigation ul li {
  display: inline-block;
}

header #main-navigation ul li a {
  color: white;
  text-decoration: none;
  padding: 10px 15px;
  border-radius: 3px;
}

header #main-navigation ul li a:hover,
header #main-navigation ul li a:focus {
  background: #444;
  transition: 0.3s ease all;
  outline: none;
}

/* Optional: subtle accent underline on nav hover */
#main-navigation a:hover,
#main-navigation a:focus {
  background: transparent;
  box-shadow: inset 0 -2px 0 #4CAF50;
  transition: box-shadow .15s ease, color .15s ease;
}

/* Newly added */
#main-navigation a {
  color: var(--ink);
  text-decoration: none;
  position: relative;
  transition: color 0.2s ease;
}

#main-navigation a:hover {
  color: var(--accent);
}

#main-navigation a[aria-current="page"] {
  color: var(--accent);
  font-weight: 700;
}

/* optional underline for the active page */
#main-navigation a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* End newly added */

/* ---------- Footer ---------- */
footer {
  background: #222;
  color: #777;
  padding: 40px;
  text-align: center;
}

footer img {
  display: block;
  border-radius: 5px;
  width: 80px;
  margin: 0 auto 10px;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 800px;
  text-align: center;
  background: #555;
  background-image: url('../image/background.jpg');
  /* ensure file exists & case matches */
  background-size: cover;
  background-position: center;
}

.hero-content {
  color: white;
  padding-top: 130px;
  line-height: 1;
}

.hero-title {
  margin: 0;
  font-size: 100px;
}

.hero-content p {
  font-size: 50px;
  margin-bottom: 60px;
}

/* Legacy hero button (used only if you still use .hero-cta somewhere) */
.hero-cta {
  display: inline-block;
  color: white;
  border: 3px solid white;
  border-radius: 3px;
  padding: 15px 30px;
  margin-right: 20px;
  text-decoration: none;
  font-size: 20px;
}

.hero-cta:hover,
.hero-cta:focus {
  background: white;
  color: #333;
}

/* ---------- Sections ---------- */
.site-section {
  padding: 50px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 30px;
}

.site-section-inside {
  width: 80%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.section-header h2 {
  font-size: 30px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 300;
  color: #777;
}

.site-section-secondary {
  background: #EFEFEF;
}

/* About */
.about {
  background: #ECF0F1;
  width: 100%;
  padding: 50px 0;
}

/* ---------- Feature Boxes (Services) ---------- */
.service-box {
  display: inline-block;
  width: 24%;
  padding: 20px 30px;
  line-height: 1;
  vertical-align: top;
}

.service-box img {
  width: 80px;
  margin-bottom: 15px;
}

.service-box h4,
.service-box h5 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 20px;
  color: #999;
  text-transform: uppercase;
  font-weight: 300;
  letter-spacing: 2px;
}

/* ---------- Testimonials ---------- */
.testimonial-box {
  display: inline-block;
  width: 27%;
  padding: 20px 30px;
  vertical-align: top;
}

.testimonial-content {
  background: #ECF0F1;
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 15px;
}

.testimonial-author img {
  float: left;
  width: 80px;
  border-radius: 50%;
  margin-right: 15px;
}

.testimonial-author h5 {
  font-size: 18px;
  margin: 0;
  padding-top: 15px;
}

.testimonial-author span {
  color: #999;
  font-size: 14px;
}

/* ---------- Projects Grid & Cards ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.proj-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
  transition: transform .12s ease, box-shadow .2s ease, border-color .15s ease;
}

.proj-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, .14);
  border-color: #4CAF50;
  /* accent on hover */

  z-index: 10; /* ADD THIS */
}

.proj-card h3 {
  margin-top: 0;
}

/* ---------- Accent Pill Buttons (anchors & buttons) ---------- */
:root {
  --accent: #4CAF50;
  --accent-contrast: #ffffff;
}

.pill,
a.pill:link,
a.pill:visited,
button.pill,
input[type="submit"].pill {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 9999px;
  border: 2px solid var(--accent);
  color: var(--accent);
  background: transparent;
  text-decoration: none;
  line-height: 1;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .15s ease, color .15s ease, border-color .15s ease;
  will-change: transform;
}

.pill:hover,
.pill:focus {
  background: var(--accent);
  color: var(--accent-contrast);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, .12);
  outline: none;
}

.pill:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .12);
}

.pill:focus-visible {
  box-shadow: 0 0 0 3px rgba(76, 175, 80, .25), 0 10px 20px rgba(0, 0, 0, .12);
}

/* ---------- Quick Links layout ---------- */
.site-section-inside .quick-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
}

.quick-links-tag {
  margin: 4px 0 0;
  font-size: .95rem;
  color: #666;
}

/* ---------- Certifications badges ---------- */
.cert-subtitle {
  margin: 4px 0 0;
  color: #666;
}

.cert-updated {
  text-align: center;
  margin-top: 8px;
  font-size: 0.9rem;
  color: #777;
  font-style: italic;
}

.cert-badges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.cert-badge {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  color: #111827;
  transition: transform .12s ease, box-shadow .2s ease, border-color .15s ease, background .15s ease;
}

.cert-badge img {
  height: 28px;
  width: auto;
}

.cert-badge span {
  font-weight: 600;
  line-height: 1.2;
}

.cert-badge.earned {
  border-color: rgba(76, 175, 80, .35);
}

.cert-badge.wip {
  border-color: rgba(255, 193, 7, .45);
}

.cert-badge:hover,
.cert-badge:focus {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, .08);
  outline: none;
  border-color: var(--accent);
}

@media (max-width: 768px) {
  .cert-badges {
    grid-template-columns: 1fr;
  }
}

/* --- Certification badge wrapping fix --- */
.cert-badge {
  overflow: hidden;
  /* prevent text bleeding out of the border */
  align-items: flex-start;
  /* allow multi-line text without vertical squish */
}

.cert-badge img {
  flex: 0 0 auto;
  /* keep icon size stable */
}

.cert-badge span {
  display: block;
  /* allow proper wrapping */
  white-space: normal;
  /* wrap instead of trying to stay on one line */
  word-break: break-word;
  /* guard against long tokens */
  line-height: 1.25;
  /* a bit more breathing room for 2 lines */
}

/* ---------- Contact Form (stacked, aligned, textarea top-left) ---------- */
.form-wrap {
  max-width: 840px;
  margin: 0 auto;
}

.form-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .08);
}

.form-row {
  display: block;
}

/* stack fields vertically on all screens */
.field {
  width: 100%;
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
  text-align: left;
}

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #F9FAFB;
  color: #111827;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  text-align: left;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #9CA3AF;
}

.field textarea {
  vertical-align: top;
  /* placeholder starts top-left */
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: #222;
  box-shadow: 0 0 0 3px rgba(34, 34, 34, .15);
  background: #fff;
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.status {
  color: #555;
  font-size: .95rem;
}

.hp {
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
}

/* ---------- Resume page polish ---------- */
.resume-subtitle {
  margin: 4px 0 18px;
  font-size: 1rem;
  color: #666;
}

.resume-preview {
  text-align: center;
  margin-top: 20px;
}

.resume-preview p {
  margin-top: 12px;
  font-size: 0.95rem;
}

/* Center pill buttons when there are multiple (About section CTAs) */
.resume-download {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  /* wrap nicely on small screens */
  margin-top: 1em;
}

.resume-download .pill {
  margin: 6px;
}

/* ---------- Accessibility polish ---------- */
html {
  scroll-behavior: smooth;
}

a:focus,
button:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- Responsive ---------- */
@media screen and (max-width: 768px) {

  /* Header layout */
  header .site-title {
    width: 100%;
    display: block;
    text-align: center;
    margin-bottom: 20px;
  }

  header #main-navigation {
    width: 100%;
    display: block;
    text-align: center;
  }

  /* Hero */
  .hero {
    min-height: 300px;
  }

  .hero-content {
    padding-top: 80px;
  }

  .hero-title {
    font-size: 30px;
  }

  .hero-content p {
    font-size: 16px;
    margin-bottom: 30px;
  }

  /* Services & Testimonials stacked */
  .service-box,
  .testimonial-box {
    width: 100%;
    display: block;
  }
}

/* Hover tech summary bubble for project cards */
.proj-card {
  position: relative;
}

.proj-card .tech-tip {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #222;
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.2;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  /* purely informational */
  transition: opacity .18s ease, transform .18s ease;
  max-width: 240px;
}

.proj-card:hover .tech-tip,
.proj-card:focus-within .tech-tip {
  opacity: 1;
  transform: translateY(0);
}

/* On touch devices, hide the bubble (you already list stack in text anyway) */
@media (hover: none) {
  .proj-card .tech-tip {
    display: none;
  }
}

/* Visible stack line under project descriptions */
.stack-line {
  font-size: 0.9em;
  color: #666;
  margin: -4px 0 8px;
}

/* Project screenshots - consistent sizing */
.proj-card .proj-shot {
  width: 100%;
  height: 180px;
  /* keeps all cards uniform */
  object-fit: cover;
  /* crops instead of stretching */
  border-radius: 6px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
  transition: transform .18s ease;
}

.proj-card:hover .proj-shot {
  transform: scale(1.02);
}

/* Projects grid: responsive, even gaps, nice wrapping */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  /* space between cards */
  align-items: stretch;
  /* make cards equal height in each row */
}

/* Cards: consistent padding, equal height behavior */
.proj-card {
  position: relative;      /* ADD */
  z-index: 0;              /* ADD */

  display: flex;
  flex-direction: column;
  /* allows footer to stick to bottom */
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .06);
}

/* Title spacing */
.proj-card h3 {
  margin: 8px 0 6px;
}

/* Description + stack spacing */
.proj-card p {
  margin: 6px 0;
}

/* Push the link row to the bottom so buttons align across cards */
.proj-card .proj-links {
  margin-top: auto;
  /* key for equal-height alignment */
}

/* Screenshot sizing (from earlier, kept here for completeness) */
.proj-card .proj-shot {
  width: 100%;
  height: 180px;
  object-fit: contain;        /* show entire screenshot */
  background: #ffffff;        /* subtle frame behind image */
  border-radius: 6px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
  transition: transform .18s ease;
}

.proj-card:hover .proj-shot {
  transform: scale(1.02);
}

/* Small screen breathing room */
@media (max-width: 480px) {
  .projects-grid {
    gap: 16px;
  }

  .proj-card {
    padding: 12px;
  }
}

/* --- Disable legacy hover stack popups --- */
.tech-tip,
.stack-tip,
.stack-pop,
.proj-card .stack-pop,
.proj-card .tech-tip,
.proj-card .stack-tip {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Keep the always-visible stack line looking nice */
.stack-line {
  margin-top: 6px;
  font-size: .9rem;
  color: #666;
}

/* --- ServiceNow page helpers --- */
.pill-row.center {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.muted {
  color: #777;
}

.small {
  font-size: 0.9rem;
}

.card-block {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .06);
  margin: 16px 0;
}

.walkthrough {
  margin: 0 0 8px 18px;
}

.walkthrough li {
  margin: 6px 0;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.screenshot-grid .shot {
  display: block;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .12s ease, box-shadow .2s ease;
}

.screenshot-grid .shot:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, .12);
}

.screenshot-grid img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.screenshot-grid .cap {
  display: block;
  padding: 8px 10px;
  font-size: .9rem;
  color: #555;
  background: #fafafa;
  border-top: 1px solid #eee;
}

/* --- ServiceNow page: demo block --- */
.sn-demo h2 {
  margin: 0 0 10px;
}

.sn-figure {
  margin: 0;
}

.sn-figure img {
  width: 100%;
  max-width: 900px;
  height: auto;
  border-radius: 10px;
  display: block;
  margin: 8px auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
}

.sn-figcaption {
  text-align: center;
  color: var(--muted, #666);
  font-size: 0.95rem;
}

/* --- ServiceNow page: mini tables --- */
.sn-model h2 {
  margin-top: 0;
}

.sn-model h3 {
  margin: 18px 0 8px;
  font-size: 1.05rem;
}

.sn-mini {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0 12px;
  font-size: 0.95rem;
}

.sn-mini th,
.sn-mini td {
  padding: 8px 10px;
  border: 1px solid #eee;
  vertical-align: top;
}

.sn-mini thead th {
  background: #fafafa;
  text-align: left;
}

.sn-model .small {
  color: var(--muted, #666);
}

/* --- ServiceNow page: next steps --- */
/* Add spacing between screenshots and next section */
.sn-screens {
  text-align: center;
  margin-top: 40px;
  margin-bottom: 50px;     /* <-- adds nice space below screenshots */
}

.sn-next h2 {
  text-align: center;
  margin-top: 40px;
  margin-bottom: 16px;
  font-size: 1.8rem;       /* same size as your other section titles */
  color: #333;
}

.sn-next-list {
    margin: 8px auto 40px;
    max-width: 900px;
    text-align: left;
}

.sn-next-list li {
  margin: 6px 0;
}

.sn-video {
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 8px;
}

/* Thumbnail link with play overlay */
.sn-thumb {
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .15);
  transition: transform .15s ease, box-shadow .2s ease;
  outline: none;
}

.sn-thumb img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
  /* keeps a nice wide thumbnail */
  object-fit: cover;
}

.sn-thumb .sn-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 48px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .0), rgba(0, 0, 0, .35));
  color: white;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .4);
  pointer-events: none;
  /* click passes through to link */
}

.sn-thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
}

.sn-thumb:focus-visible {
  box-shadow: 0 0 0 3px rgba(76, 175, 80, .3), 0 6px 20px rgba(0, 0, 0, .15);
}

/* Duration badge (bottom-right corner of thumbnail) */
.sn-duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: background 0.15s ease, transform 0.15s ease;
}

.sn-thumb:hover .sn-duration {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.05);
}

/* === ServiceNow page: thumbnail + modal === */
.sn-figure {
  max-width: 720px;
  margin: 0 auto 16px;
}

.sn-thumb {
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
  transition: transform .18s ease, box-shadow .2s ease;
}

.sn-thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .18);
}

.sn-thumb img {
  display: block;
  width: 100%;
  height: auto;
}

.sn-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  transition: background .15s ease, transform .15s ease;
}

.sn-thumb:hover .sn-play {
  background: rgba(0, 0, 0, .7);
  transform: translate(-50%, -50%) scale(1.05);
}

/* Modal shell */
.sn-modal[hidden] {
  display: none;
}

.sn-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.sn-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .6);
}

.sn-modal-frame {
  position: relative;
  width: min(90vw, 960px);
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
}

.sn-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #000;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}

.sn-modal-close:hover {
  background: #fff;
}

/* Caption */
.sn-figcaption {
  text-align: center;
  color: #666;
  font-size: 14px;
  margin-top: 8px;
}

/* ===== Modal hotfixes ===== */
.sn-modal[hidden] {
  display: none !important;
}

.sn-modal {
  z-index: 1000;
}

.sn-modal-frame {
  position: relative;
  /* stacking context for children */
  overflow: hidden;
}

#sn-modal-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  /* below the close button */
  display: block;
  background: #000;
}

.sn-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #000;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  /* above the video */
}

/* Image modal sizing */
.sn-modal-image-frame {
  width: min(90vw, 1000px);
  height: auto;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sn-modal-image-frame img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
}

/* Fix the thumbnail play overlay odd half-circle */
.sn-thumb {
  position: relative;
  display: block;
  overflow: hidden;
}

.sn-thumb .sn-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
}

/* Newly added below */
/* ===== Modal hotfixes ===== */
.sn-modal[hidden] {
  display: none !important;
}

.sn-modal {
  z-index: 1000;
}

.sn-modal-frame {
  position: relative;
  overflow: hidden;
}

#sn-modal-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
  background: #000;
}

.sn-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #000;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  z-index: 2;
}

/* Ensure play overlay is centered and not clickable */
.sn-thumb {
  position: relative;
  display: block;
  overflow: hidden;
}

.sn-thumb .sn-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
}

/* Center the demo heading */
.sn-demo h2 {
  text-align: center;
}

.card.sn-demo>h2 {
  text-align: center !important;
}

.sn-figure {
  margin-bottom: 24px;
}

.proj-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tip-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: inherit;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}

.tip-btn:hover {
  background: rgba(255,255,255,.10);
}

.tip {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  width: min(380px, 72vw);
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(10,16,28,.98);
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
  color: rgba(231,238,252,.95);
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  z-index: 20;

  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}

.tip::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 10px;
  width: 12px;
  height: 12px;
  background: rgba(10,16,28,.98);
  border-left: 1px solid rgba(255,255,255,.16);
  border-top: 1px solid rgba(255,255,255,.16);
  transform: rotate(45deg);
}

.tip-btn:hover .tip,
.tip-btn:focus .tip,
.tip-btn:focus-visible .tip {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.proj-card:focus-within {
  z-index: 10;
}

/* =========================
   Projects tooltip hotfix
   Put this at the VERY END
   ========================= */

   .proj-card {
    position: relative;
    z-index: 0;
  }
  
  .proj-card:hover,
  .proj-card:focus-within {
    z-index: 50; /* ensures tooltip stays above neighboring cards */
  }
  
  /* Keep tooltip above its own card too */
  .tip {
    z-index: 200;
  }

  /* === Tooltip edge-aware flip === */
.proj-card:nth-child(3n) .tip {
  left: auto;
  right: 0;
}

.proj-card:nth-child(3n) .tip::before {
  left: auto;
  right: 14px;
}