/* =============================
   Design tokens
   Dark is the default. Light mode re-declares the same tokens, so every
   rule below stays theme-agnostic. The *-rgb tokens exist because the
   translucent overlays need to flip from white-on-dark to slate-on-light.
   ============================= */
:root {
  --color-body: #a9b4c4;
  --color-heading: #f1f5f9;
  --color-base: #131c2e;
  --color-background: #0b1220;
  --color-brand: #34d399;
  --color-brand2: #38bdf8;

  --overlay-rgb: 255, 255, 255;
  --bg-rgb: 11, 18, 32;
  --base-rgb: 19, 28, 46;

  --primary: var(--color-brand2);
  --card: var(--color-base);
  --light: var(--color-heading);
  --topnav-height: 72px;

  color-scheme: dark;
}

/* Light theme — every colour here was contrast-checked against the
   surfaces it sits on (all pairs pass WCAG AA). */
:root[data-theme="light"] {
  --color-body: #475569;
  --color-heading: #0f172a;
  --color-base: #ffffff;
  --color-background: #f8fafc;
  --color-brand: #067a53;
  --color-brand2: #0369a1;

  --overlay-rgb: 15, 23, 42;
  --bg-rgb: 248, 250, 252;
  --base-rgb: 255, 255, 255;

  color-scheme: light;
}

html,
body {
  overflow-x: hidden;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -60px;
  left: 12px;
  z-index: 100001;
  background: var(--color-brand);
  color: var(--color-background);
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 999px;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 12px;
  color: var(--color-background);
}

/* Global visible focus state for keyboard users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}
body {
  margin: 0;
  background-color: var(--color-background);
  color: var(--color-body);
  font-family: "Inter", sans-serif;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--color-heading);
  font-weight: 700;
}
a {
  text-decoration: none;
  color: var(--color-body);
  cursor: pointer;
}
a:hover {
  color: var(--color-brand);
}
img {
  width: 100%;
}

/* ---------- Top navbar ---------- */
.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--topnav-height);
  display: flex;
  align-items: center;
  background: rgba(var(--base-rgb), 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(var(--overlay-rgb), 0.08);
}
.topnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
}
.topnav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--color-heading);
  flex-shrink: 0;
}
.topnav-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-brand);
}
.topnav-name {
  font-weight: 700;
  white-space: nowrap;
}
.topnav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(var(--overlay-rgb), 0.12);
  background: transparent;
  cursor: pointer;
}
.topnav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: var(--color-heading);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.topnav-menu {
  display: flex;
  align-items: center;
  gap: 24px;
}
.topnav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.topnav-link {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--color-body);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  position: relative;
  padding: 6px 0;
}
.topnav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: var(--color-brand);
  transition: width 0.25s ease;
}
.topnav-link:hover,
.topnav-link:focus-visible,
.topnav-link.active {
  color: var(--color-heading);
}
.topnav-link:hover::after,
.topnav-link:focus-visible::after,
.topnav-link.active::after {
  width: 100%;
}
.topnav-resume {
  flex-shrink: 0;
  padding: 8px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  background-color: var(--color-brand);
  color: var(--color-background);
}
.topnav-resume:hover,
.topnav-resume:focus-visible {
  background-color: var(--color-brand2);
  color: var(--color-background);
}

@media (max-width: 991.98px) {
  .topnav-toggle {
    display: flex;
  }
  .topnav-menu {
    position: fixed;
    top: var(--topnav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--color-base);
    border-bottom: 1px solid rgba(var(--overlay-rgb), 0.08);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .topnav-menu.open {
    max-height: 80vh;
    overflow-y: auto;
  }
  .topnav-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 12px 24px;
  }
  .topnav-links li {
    width: 100%;
  }
  .topnav-link {
    display: block;
    width: 100%;
    padding: 12px 0;
  }
  .topnav-resume {
    margin: 4px 24px 20px;
    text-align: center;
  }
  .topnav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .topnav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }
  .topnav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

.content-wrapper {
  padding-top: var(--topnav-height);
}
.full-height {
  min-height: calc(100vh - var(--topnav-height));
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 60px;
  padding-bottom: 60px;
  border-bottom: 1px solid rgba(var(--overlay-rgb), 0.08);
}
.hero-title {
  color: var(--color-brand);
  font-weight: 700;
  font-size: 1.15rem;
  margin: 4px 0 14px;
}
.skill-pill {
  display: inline-block;
  background: rgba(var(--overlay-rgb), 0.04);
  border: 1px solid rgba(var(--overlay-rgb), 0.1);
  border-radius: 999px;
  padding: 6px 14px;
  margin: 0 6px 8px 0;
  font-size: 0.86rem;
  color: var(--color-body);
}
.btn {
  padding: 12px 28px;
  font-weight: 700;
  border-radius: 999px;
}
.btn-brand {
  background-color: var(--color-brand);
  border-color: var(--color-brand);
  color: var(--color-background);
}
.btn-brand:hover,
.btn-brand:focus {
  background-color: var(--color-brand2);
  color: var(--color-background);
  border-color: var(--color-brand2);
}
.btn-outline-brand {
  background-color: transparent;
  border: 1px solid var(--color-brand);
  color: var(--color-heading);
}
.btn-outline-brand:hover,
.btn-outline-brand:focus {
  background-color: var(--color-brand);
  color: var(--color-background);
  border-color: var(--color-brand);
}
.link-custom {
  font-weight: 700;
  position: relative;
}
.link-custom::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  height: 2px;
  width: 0;
  background: var(--color-brand);
  transition: width 0.4s ease;
}
.link-custom:hover::after {
  width: 100%;
}

.text-brand {
  color: var(--color-brand);
}
.bg-base {
  background-color: var(--color-base);
  border: 1px solid rgba(var(--overlay-rgb), 0.06);
  border-radius: 16px;
}
.shadow-effect {
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.shadow-effect:hover {
  transform: translateY(-4px);
  border-color: rgba(52, 211, 153, 0.4);
}
.iconbox {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  border-radius: 14px;
  background-color: rgba(52, 211, 153, 0.12);
  color: var(--color-brand);
}

.card-custom .card-custom-img {
  overflow: hidden;
  border-radius: 16px 16px 0 0;
}
/* Uniform media box so every card in a row lines up, whatever the
   source image's aspect ratio is — also reserves space to prevent CLS. */
.card-custom .card-custom-img img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center top;
}
/* Equal-height cards across a row */
.card-custom {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card-custom .card-custom-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.form-control {
  background-color: rgba(var(--overlay-rgb), 0.03);
  border: 1px solid rgba(var(--overlay-rgb), 0.1);
  color: var(--color-heading);
  border-radius: 12px;
}
.form-control:focus {
  background-color: rgba(var(--overlay-rgb), 0.05);
  border-color: var(--color-brand);
  color: var(--color-heading);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25);
}
.form-control::placeholder {
  color: var(--color-body);
}
.form-label {
  color: var(--color-body);
  font-weight: 600;
  font-size: 0.86rem;
  margin-bottom: 6px;
}
.light {
  border-radius: 100%;
  background-color: var(--color-base);
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
}
.light:hover {
  background-color: var(--color-brand);
  color: var(--color-background);
  border-color: var(--color-brand);
}
li {
  text-align: justify;
}

h6 {
  font-weight: 700;
  position: relative;
}
h6::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  height: 2px;
  width: 0;
  background: var(--color-brand);
  transition: width 0.4s ease;
}
h6:hover::after {
  width: 35%;
}
h6:hover {
  color: var(--color-brand);
}
h4:hover {
  color: var(--color-brand);
}
.work {
  color: var(--color-brand);
}

/* ---------- Ambient background ---------- */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.28;
  pointer-events: none;
  z-index: -1;
}
.ambient-glow--one {
  width: 480px;
  height: 480px;
  top: -10%;
  left: 20%;
  background: var(--color-brand);
}
.ambient-glow--two {
  width: 520px;
  height: 520px;
  bottom: -10%;
  right: -5%;
  background: var(--color-brand2);
}
@media (prefers-reduced-motion: no-preference) {
  .ambient-glow--one {
    animation: drift-one 24s ease-in-out infinite;
  }
  .ambient-glow--two {
    animation: drift-two 28s ease-in-out infinite;
  }
}
@keyframes drift-one {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(40px, 30px);
  }
}
@keyframes drift-two {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-30px, -40px);
  }
}

/* ---------- Preloader ---------- */
.loader-wrapper {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-background);
  transition: opacity 1s ease-out;
}
.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.loader-mark {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--color-heading);
}
.loader-bar {
  width: 160px;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(var(--overlay-rgb), 0.1);
}
.loader-bar span {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-brand), var(--color-brand2));
  animation: loader-fill 1s ease-in-out infinite;
}
@keyframes loader-fill {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(350%);
  }
}

/* ---------- Chatbot wrapper & floating button ---------- */
#chatbot-root {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
.chat-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--color-brand), var(--color-brand2));
  color: var(--color-background);
  font-size: 28px;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 30px rgba(52, 211, 153, 0.25);
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.2s;
  outline: none;
}
.chat-btn:active {
  transform: scale(0.95);
}
.chat-btn:focus {
  box-shadow: 0 18px 36px rgba(52, 211, 153, 0.35);
}

.bounce {
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* ---------- Chat window ---------- */
.chat-window {
  width: 380px;
  max-width: 92vw;
  height: 520px;
  background: var(--color-base);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  transform-origin: 100% 100%;
  will-change: transform, opacity;
}
.chat-open {
  animation: chatOpen 0.36s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}
@keyframes chatOpen {
  from {
    transform: translateY(20px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: linear-gradient(90deg, var(--color-brand), var(--color-brand2));
  color: var(--color-background);
}
.chat-header .title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}
.bot-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(var(--bg-rgb), 0.15);
  display: grid;
  place-items: center;
  color: var(--card);
  font-weight: 800;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.avatar-face {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 18px;
  transition: transform 0.28s;
}
.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.icon-btn {
  background: transparent;
  border: none;
  color: var(--color-background);
  cursor: pointer;
  font-size: 18px;
  padding: 6px;
  border-radius: 8px;
}
.icon-btn:focus {
  outline: 2px solid rgba(var(--bg-rgb), 0.3);
}
.small-txt {
  font-size: 12px;
  opacity: 0.85;
}

/* main messages area */
.chat-body {
  flex: 1;
  padding: 16px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(var(--overlay-rgb), 0.02);
}
.msg {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 14px;
  animation: msgPop 0.42s ease;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.25);
}
@keyframes msgPop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.msg.bot {
  background: rgba(var(--overlay-rgb), 0.06);
  color: var(--color-heading);
  align-self: flex-start;
  border-bottom-left-radius: 6px;
}
.msg.user {
  background: linear-gradient(135deg, var(--color-brand), var(--color-brand2));
  color: var(--color-background);
  align-self: flex-end;
  border-bottom-right-radius: 6px;
}

/* typing indicator variations */
.typing-dots {
  display: flex;
  gap: 6px;
  margin: 6px 0;
}
.typing-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-brand2);
  animation: typing 0.9s infinite ease-in-out;
}
.typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}
.typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes typing {
  0% {
    transform: scale(0.6);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(0.6);
    opacity: 0.6;
  }
}

/* typewriter */
.typewriter {
  white-space: pre-wrap;
  overflow: hidden;
  border-right: 0.12em solid rgba(var(--overlay-rgb), 0.3);
  animation: typewriter 1.6s steps(20) 1;
}
@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* quick replies area */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border-top: 1px dashed rgba(var(--overlay-rgb), 0.08);
}
.quick-btn {
  background: rgba(var(--overlay-rgb), 0.06);
  color: var(--color-heading);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  cursor: pointer;
}
.quick-btn:hover {
  transform: translateY(-3px);
  border-color: var(--color-brand);
}

/* footer input */
.chat-footer {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: rgba(var(--overlay-rgb), 0.02);
  align-items: center;
  border-top: 1px solid rgba(var(--overlay-rgb), 0.08);
}
.chat-input {
  flex: 1;
  background: rgba(var(--overlay-rgb), 0.04);
  border-radius: 999px;
  padding: 10px 12px;
  border: 1px solid rgba(var(--overlay-rgb), 0.1);
  color: var(--light);
  outline: none;
}
.btn-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--color-brand), var(--color-brand2));
  border: none;
  color: var(--color-background);
  cursor: pointer;
}

/* small helpers */
.mini-card {
  background: rgba(var(--overlay-rgb), 0.04);
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  color: var(--color-heading);
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.25);
}
.mini-card + .mini-card {
  margin-top: 8px;
}
.project-carousel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
}
.project-slide {
  min-width: 220px;
  background: rgba(var(--overlay-rgb), 0.03);
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  color: var(--color-heading);
  border-radius: 12px;
  padding: 12px;
}
.small-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.12);
  color: var(--color-brand);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}
.small-btn:hover,
.small-btn:focus-visible {
  background: var(--color-brand);
  color: var(--color-background);
}

/* Chatbot: online indicator */
.bot-avatar {
  position: relative;
}
.chat-online-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-brand);
  border: 2px solid var(--color-base);
}

/* Chatbot: skill chip groups (used by the Skills quick reply) */
.skill-group + .skill-group {
  margin-top: 10px;
}
.skill-group h6 {
  color: var(--color-brand2);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}
.skill-chip {
  display: inline-block;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--color-brand2);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.76rem;
  margin: 0 4px 4px 0;
}

/* Chatbot: roadmap visual */
.roadmap-list {
  position: relative;
  padding-left: 20px;
  margin-top: 8px;
}
.roadmap-list::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: linear-gradient(var(--color-brand), var(--color-brand2));
  opacity: 0.5;
}
.roadmap-step {
  position: relative;
  padding: 4px 0 4px 14px;
  font-size: 0.86rem;
  color: var(--color-body);
}
.roadmap-step::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-brand2);
}
.roadmap-step strong {
  color: var(--color-heading);
}

/* Chatbot: speak-aloud control on bot messages */
.msg-speak-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-left: 6px;
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  vertical-align: middle;
  font-size: 13px;
}
.msg-speak-btn:hover,
.msg-speak-btn:focus-visible {
  opacity: 1;
}

/* Chatbot: mic button states */
.icon-btn[data-mic-state="listening"] {
  color: var(--color-brand);
  animation: mic-pulse 1s ease-in-out infinite;
}
.icon-btn[data-mic-state="error"] {
  color: #ff6b6b;
}
@keyframes mic-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.15);
  }
}

/* Chatbot: optional light theme, scoped to the chat window only */
#chatWindow[data-chat-theme="light"] {
  background: #f8fafc;
  color: #0f1724;
}
#chatWindow[data-chat-theme="light"] .chat-body {
  background: #f1f5f9;
}
#chatWindow[data-chat-theme="light"] .msg.bot {
  background: #ffffff;
  color: #0f1724;
  border: 1px solid #e2e8f0;
}
#chatWindow[data-chat-theme="light"] .mini-card,
#chatWindow[data-chat-theme="light"] .project-slide {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #0f1724;
}
#chatWindow[data-chat-theme="light"] .chat-input {
  background: #ffffff;
  color: #0f1724;
  border-color: #cbd5e1;
}
#chatWindow[data-chat-theme="light"] .quick-btn {
  background: #eef2f7;
  color: #0f1724;
  border-color: #cbd5e1;
}
#chatWindow[data-chat-theme="light"] .chat-footer {
  background: #f8fafc;
  border-top-color: #e2e8f0;
}

/* emoji float */
.emoji-float {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  animation: floatUp 1.6s ease forwards;
}
@keyframes floatUp {
  from {
    transform: translateY(0) scale(0.9);
    opacity: 1;
  }
  to {
    transform: translateY(-140px) scale(1.25);
    opacity: 0;
  }
}

/* confetti canvas */
#confettiCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99998;
  mix-blend-mode: screen;
}

/* small responsive tweaks */
@media (max-width: 520px) {
  .chat-window {
    width: 92vw;
    border-radius: 14px;
    height: 70vh;
  }
}

/* ============================================================
   Phase 2 — premium UI components
   ============================================================ */

/* ---------- Hero 3D background ---------- */
.hero-section {
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

/* Soft depth orbs — transform-only animation, GPU composited */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}
.hero-orb--1 {
  width: 620px;
  height: 620px;
  top: -22%;
  left: -8%;
  background: radial-gradient(
    circle at center,
    rgba(52, 211, 153, 0.18) 0%,
    rgba(52, 211, 153, 0.07) 38%,
    transparent 68%
  );
  animation: hero-orb-a 28s ease-in-out infinite;
}
.hero-orb--2 {
  width: 560px;
  height: 560px;
  top: 24%;
  right: -10%;
  background: radial-gradient(
    circle at center,
    rgba(56, 189, 248, 0.16) 0%,
    rgba(56, 189, 248, 0.06) 38%,
    transparent 68%
  );
  animation: hero-orb-b 34s ease-in-out infinite;
}
.hero-orb--3 {
  width: 420px;
  height: 420px;
  bottom: -14%;
  left: 34%;
  background: radial-gradient(
    circle at center,
    rgba(52, 211, 153, 0.12) 0%,
    rgba(56, 189, 248, 0.06) 42%,
    transparent 70%
  );
  animation: hero-orb-c 24s ease-in-out infinite;
}
@keyframes hero-orb-a {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(70px, 50px, 0) scale(1.12);
  }
}
@keyframes hero-orb-b {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1.08);
  }
  50% {
    transform: translate3d(-60px, 40px, 0) scale(1);
  }
}
@keyframes hero-orb-c {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(40px, -30px, 0) scale(1.15);
  }
}

/* 3D perspective floor at the horizon — sits below the copy, never across it */
.hero-floor {
  position: absolute;
  left: -25%;
  right: -25%;
  bottom: 0;
  height: 42%;
  perspective: 320px;
  perspective-origin: 50% 0%;
  mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.55) 55%, #000 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.55) 55%, #000 100%);
}
.hero-floor-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(56, 189, 248, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(52, 211, 153, 0.38) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: rotateX(78deg) translateY(0);
  transform-origin: 50% 100%;
  will-change: transform;
  animation: hero-floor-scroll 7s linear infinite;
}
@keyframes hero-floor-scroll {
  to {
    transform: rotateX(78deg) translateY(64px);
  }
}

/* Hero profile photo — 3D tilt stage */
.hero-photo-stage {
  position: relative;
  max-width: 420px;
  margin: 0 auto 24px;
  perspective: 1200px;
}
.hero-photo-wrap {
  position: relative;
  max-width: 380px;
  margin: 0 auto;
  transform-style: preserve-3d;
  transition: transform 0.25s ease-out;
  will-change: transform;
}
.hero-photo-glow {
  position: absolute;
  inset: -10%;
  z-index: -1;
  border-radius: 32px;
  background: linear-gradient(135deg, var(--color-brand), var(--color-brand2));
  filter: blur(48px);
  opacity: 0.35;
  animation: hero-glow-pulse 6s ease-in-out infinite;
}
.hero-photo-frame {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(var(--overlay-rgb), 0.1);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
  aspect-ratio: 4 / 5;
  animation: hero-photo-float 5s ease-in-out infinite;
  transform: translateZ(30px);
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.hero-photo-badge {
  position: absolute;
  left: 50%;
  bottom: -18px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-base);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: var(--color-heading);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}
.hero-photo-badge i {
  color: var(--color-brand);
}
@keyframes hero-photo-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}
@keyframes hero-glow-pulse {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(1.04);
  }
}

/* Impact / highlights */
.impact-section {
  padding: 28px 0;
  border-bottom: 1px solid rgba(var(--overlay-rgb), 0.08);
}
.impact-card {
  text-align: center;
  padding: 18px 10px;
  border-radius: 16px;
  background: rgba(var(--overlay-rgb), 0.03);
  border: 1px solid rgba(var(--overlay-rgb), 0.06);
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.impact-card:hover {
  transform: translateY(-3px);
  border-color: rgba(52, 211, 153, 0.35);
}
.impact-card strong {
  display: block;
  font-size: 1.7rem;
  color: var(--color-brand);
  margin-bottom: 4px;
}
.impact-card span {
  font-size: 0.78rem;
  color: var(--color-body);
  line-height: 1.35;
}

/* About capability cards */
.capability-card {
  background: var(--color-base);
  border: 1px solid rgba(var(--overlay-rgb), 0.06);
  border-radius: 16px;
  padding: 20px;
  height: 100%;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.capability-card:hover {
  transform: translateY(-4px);
  border-color: rgba(52, 211, 153, 0.4);
}
.capability-card .iconbox {
  width: 46px;
  height: 46px;
  font-size: 20px;
}
.capability-card p {
  color: var(--color-body);
}

/* Experience timeline */
.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--color-brand), rgba(var(--overlay-rgb), 0.08));
}
.timeline-item {
  position: relative;
  margin-bottom: 24px;
}
.timeline-item:last-child {
  margin-bottom: 0;
}
.timeline-dot {
  position: absolute;
  left: -28px;
  top: 22px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-base);
  border: 2px solid var(--color-brand2);
}
.timeline-item--current .timeline-dot {
  background: var(--color-brand);
  border-color: var(--color-brand);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.2);
}
.timeline-badge {
  display: inline-block;
  background: rgba(52, 211, 153, 0.14);
  color: var(--color-brand);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

/* Tech tags (reused across Experience/Projects) */
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tech-tag {
  display: inline-block;
  background: rgba(56, 189, 248, 0.1);
  color: var(--color-brand2);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.74rem;
  font-weight: 600;
}

/* Process / "From Data to Decision" flow */
.process-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.process-step {
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--color-base);
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  font-weight: 600;
  color: var(--color-heading);
  white-space: nowrap;
}
.process-step--final {
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.4);
  color: var(--color-brand);
}
.process-arrow {
  color: var(--color-brand2);
  font-weight: 700;
  font-size: 1.1rem;
}
@media (max-width: 767.98px) {
  .process-flow {
    flex-direction: column;
    align-items: stretch;
  }
  .process-arrow {
    text-align: center;
    transform: rotate(90deg);
  }
}

/* Additional Work section label */
.professional-work h3 {
  color: var(--color-heading);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
  }
  .bounce {
    animation: none !important;
  }
}

/* ============================================================
   Phase 4 — project filters, case-study cards, details modal
   ============================================================ */

.project-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.filter-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(var(--overlay-rgb), 0.12);
  background: transparent;
  color: var(--color-body);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.filter-btn:hover,
.filter-btn:focus-visible {
  border-color: var(--color-brand);
  color: var(--color-heading);
}
.filter-btn.active {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: var(--color-background);
}

.project-item {
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.project-item.is-hidden {
  display: none;
}

.case-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
}
.case-card-img {
  height: 160px;
  overflow: hidden;
}
.case-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.case-card:hover .case-card-img img {
  transform: scale(1.05);
}
.case-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.case-problem {
  font-size: 0.86rem;
  color: var(--color-body);
  margin-bottom: 10px;
}
.btn-sm {
  padding: 8px 16px;
  font-size: 0.82rem;
  margin-top: auto;
  align-self: flex-start;
}

.project-empty-state {
  color: var(--color-body);
  font-size: 0.9rem;
  padding: 20px 0;
}

.pro-work-card {
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Details modal */
.project-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(2, 6, 15, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.project-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.project-modal {
  position: relative;
  width: min(640px, 100%);
  max-height: 85vh;
  overflow-y: auto;
  background: var(--color-base);
  border: 1px solid rgba(var(--overlay-rgb), 0.1);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  transform: translateY(16px);
  transition: transform 0.25s ease;
}
.project-modal-overlay.open .project-modal {
  transform: translateY(0);
}
.project-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(var(--overlay-rgb), 0.12);
  background: transparent;
  color: var(--color-heading);
  cursor: pointer;
  font-size: 16px;
}
.project-modal-close:hover,
.project-modal-close:focus-visible {
  border-color: var(--color-brand);
  color: var(--color-brand);
}
.project-modal h3 {
  margin-bottom: 4px;
  padding-right: 32px;
}
.project-modal-section {
  margin-top: 16px;
}
.project-modal-section h6 {
  color: var(--color-brand2);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.project-modal-section p {
  margin-bottom: 0;
  font-size: 0.92rem;
}
body.modal-open {
  overflow: hidden;
}
@media (max-width: 575.98px) {
  .project-modal {
    padding: 24px;
    max-height: 90vh;
  }
}

/* ============================================================
   Resume viewer modal — preview first, then download / back
   ============================================================ */
.resume-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100001;
  background: rgba(2, 6, 15, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.resume-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.resume-modal {
  width: min(900px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--color-base);
  border: 1px solid rgba(var(--overlay-rgb), 0.1);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  transform: translateY(16px);
  transition: transform 0.25s ease;
}
.resume-modal-overlay.open .resume-modal {
  transform: translateY(0);
}
.resume-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(var(--overlay-rgb), 0.08);
}
.resume-modal-head h3 {
  margin-bottom: 2px;
  font-size: 1.15rem;
}
.resume-modal-head p {
  color: var(--color-brand);
  font-weight: 600;
}
.resume-modal-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(var(--overlay-rgb), 0.12);
  background: transparent;
  color: var(--color-heading);
  cursor: pointer;
  font-size: 15px;
}
.resume-modal-close:hover,
.resume-modal-close:focus-visible {
  border-color: var(--color-brand);
  color: var(--color-brand);
}
.resume-modal-body {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #0f1724;
}
.resume-frame {
  display: block;
  width: 100%;
  height: 68vh;
  border: 0;
  position: relative;
  z-index: 1;
}
.resume-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  margin: 0;
  color: var(--color-body);
  font-size: 0.9rem;
}
.resume-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid rgba(var(--overlay-rgb), 0.08);
}
.resume-modal-actions .btn {
  margin-top: 0;
}

/* On small screens most browsers can't render a PDF inline — show the
   fallback message and the action buttons instead of an empty frame. */
@media (max-width: 767.98px) {
  .resume-frame {
    display: none;
  }
  .resume-modal-body {
    min-height: 190px;
  }
  .resume-modal-actions {
    flex-direction: column;
  }
  .resume-modal-actions .btn {
    width: 100%;
    text-align: center;
  }
}

/* =============================
   Contact form: honeypot, loading state, status messages
   ============================= */
.form-hp {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

#contactSubmit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
#contactSubmit .btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(var(--bg-rgb), 0.35);
  border-top-color: var(--color-background);
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}
#contactSubmit.is-loading .btn-spinner { display: inline-block; }
#contactSubmit.is-loading .btn-label { opacity: 0.75; }
#contactSubmit:disabled { cursor: progress; opacity: 0.85; }
@keyframes btn-spin { to { transform: rotate(360deg); } }

.form-status {
  margin: 14px 0 0;
  min-height: 1.4em;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
}
.form-status:empty { margin-top: 0; }
.form-status.is-info { color: var(--color-body); }
.form-status.is-success { color: var(--color-brand); }
.form-status.is-error { color: #fca5a5; }

/* =============================
   Reading progress bar + back-to-top
   ============================= */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 1001;
  background: transparent;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-brand), var(--color-brand2));
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.5);
  transition: width 0.1s linear;
}

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 100px;
  z-index: 9990;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(52, 211, 153, 0.45);
  background: rgba(var(--base-rgb), 0.92);
  backdrop-filter: blur(8px);
  color: var(--color-heading);
  font-size: 16px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s,
    background 0.2s ease, border-color 0.2s ease;
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: var(--color-background);
}
.back-to-top:focus-visible {
  outline: 2px solid var(--color-brand2);
  outline-offset: 3px;
}
/* Step aside while the chat window is open */
body:has(#chatWindow[aria-hidden="false"]) .back-to-top {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 575.98px) {
  .back-to-top {
    right: 18px;
    bottom: 92px;
    width: 42px;
    height: 42px;
  }
}

/* =============================
   Copy-to-clipboard buttons (email / phone)
   ============================= */
.contact-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.copy-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid rgba(var(--overlay-rgb), 0.12);
  background: rgba(var(--overlay-rgb), 0.04);
  color: var(--color-body);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.copy-btn:hover {
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.45);
  color: var(--color-brand);
}
.copy-btn:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}
.copy-btn.is-copied {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: var(--color-background);
}
.copy-status {
  margin: 0;
  min-height: 1.3em;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-brand);
}

/* =============================
   Image lightbox
   ============================= */
.case-card-img,
.card-custom-img {
  position: relative;
}
.zoomable {
  cursor: zoom-in;
}
/* Hover affordance so people know the shot can be enlarged */
.case-card-img::after {
  content: "\f00e"; /* magnifying glass with plus */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(var(--bg-rgb), 0.82);
  color: var(--color-brand);
  font-size: 14px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}
.case-card:hover .case-card-img::after,
.case-card:focus-within .case-card-img::after {
  opacity: 1;
  transform: translateY(0);
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 100002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: rgba(5, 9, 18, 0.92);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}
.lightbox-overlay.open {
  opacity: 1;
  visibility: visible;
}
.lightbox-figure {
  margin: 0;
  max-width: min(1200px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.lightbox-figure img {
  width: auto;
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid rgba(var(--overlay-rgb), 0.12);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
  transform: scale(0.96);
  transition: transform 0.25s ease;
}
.lightbox-overlay.open .lightbox-figure img {
  transform: scale(1);
}
.lightbox-figure figcaption {
  color: var(--color-body);
  font-size: 0.95rem;
  text-align: center;
  max-width: 70ch;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(var(--overlay-rgb), 0.18);
  background: rgba(var(--base-rgb), 0.9);
  color: var(--color-heading);
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.lightbox-close:hover {
  background: var(--color-brand);
  color: var(--color-background);
}
.lightbox-close:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 3px;
}

@media (max-width: 575.98px) {
  .lightbox-overlay { padding: 20px 12px; }
  .lightbox-figure img { max-height: 70vh; }
  .lightbox-close { top: 12px; right: 12px; }
}

/* =============================
   Print stylesheet
   Ctrl+P gives a clean, readable document instead of a screenshot of a
   dark website: no chrome, no animation, ink-friendly colours, and link
   destinations spelled out since a printed link can't be clicked.
   ============================= */
@media print {
  @page {
    margin: 14mm;
  }

  html,
  body {
    background: #fff !important;
    color: #111 !important;
    font-size: 11pt;
  }

  /* Interactive / decorative chrome has no place on paper */
  .topnav,
  .scroll-progress,
  .back-to-top,
  #chatbot-root,
  .loader-wrapper,
  .ambient-glow,
  .hero-bg,
  .hero-photo-glow,
  .hero-photo-badge,
  .lightbox-overlay,
  .resume-modal-overlay,
  #projectModalOverlay,
  .skip-link,
  .copy-btn,
  .copy-status,
  .form-status,
  .filter-btn,
  .view-details-btn,
  #contactForm,
  footer .list-inline {
    display: none !important;
  }

  .content-wrapper {
    padding-top: 0 !important;
  }

  /* Sections shouldn't be forced to a full screen height on paper */
  .full-height {
    min-height: 0 !important;
    height: auto !important;
    display: block !important;
    padding: 12pt 0 !important;
    border-bottom: 1px solid #ddd !important;
  }

  section {
    break-inside: auto;
  }

  h1, h2, h3, h4, h5, h6 {
    color: #000 !important;
    break-after: avoid;
  }
  p, li {
    color: #222 !important;
    orphans: 3;
    widows: 3;
  }

  a {
    color: #0b4f8a !important;
    text-decoration: underline;
  }
  /* Spell out destinations for external links only */
  main a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #555;
    word-break: break-all;
  }

  .bg-base,
  .case-card,
  .card-custom,
  .impact-card,
  .iconbox {
    background: #fff !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    break-inside: avoid;
  }

  .text-brand,
  .hero-title,
  .impact-card strong {
    color: #0b6b4f !important;
  }

  .skill-pill,
  .tech-tag {
    background: #f2f4f7 !important;
    border: 1px solid #ccc !important;
    color: #222 !important;
  }

  img {
    max-width: 100% !important;
    break-inside: avoid;
  }

  /* Nothing should animate or be transform-hidden on paper */
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    text-shadow: none !important;
  }
  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* =============================
   Theme toggle button
   ============================= */
.theme-toggle {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(var(--overlay-rgb), 0.14);
  background: rgba(var(--overlay-rgb), 0.05);
  color: var(--color-heading);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.theme-toggle:hover {
  background: rgba(var(--overlay-rgb), 0.12);
  border-color: var(--color-brand);
  color: var(--color-brand);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

@media (max-width: 991.98px) {
  .theme-toggle {
    margin: 12px 24px 0;
    width: auto;
    height: 44px;
    border-radius: 12px;
    gap: 8px;
    grid-auto-flow: column;
  }
  .theme-toggle::after {
    content: "Switch theme";
    font-size: 0.9rem;
    font-weight: 600;
  }
}

/* Light theme needs a touch more definition than translucency alone gives */
:root[data-theme="light"] .topnav {
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
:root[data-theme="light"] .bg-base,
:root[data-theme="light"] .case-card,
:root[data-theme="light"] .card-custom,
:root[data-theme="light"] .impact-card {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 24px rgba(15, 23, 42, 0.05);
}
:root[data-theme="light"] .loader-wrapper {
  background: var(--color-background);
}

/* =============================
   Light theme: neutralise Bootstrap's hardcoded white utilities
   (.text-white / .light) which are invisible on a light surface.
   ============================= */
:root[data-theme="light"] .text-white,
:root[data-theme="light"] .btn-floating.text-white,
:root[data-theme="light"] footer .list-inline-item a,
:root[data-theme="light"] i.light {
  color: var(--color-body) !important;
}
:root[data-theme="light"] footer .list-inline-item a:hover,
:root[data-theme="light"] footer .list-inline-item a:focus-visible {
  color: var(--color-brand) !important;
}
:root[data-theme="light"] .btn-floating {
  border-color: rgba(var(--overlay-rgb), 0.14);
}

/* Chat messages may contain deliberate line breaks (e.g. resume search
   results); preserve them without turning on full pre formatting. */
.msg.bot span,
.msg.user span {
  white-space: pre-line;
}

/* =============================
   Deep links: keep the target clear of the fixed navbar so a shared
   link like .../#work lands on the heading, not underneath the header.
   ============================= */
section[id],
[id="main-content"] {
  scroll-margin-top: calc(var(--topnav-height) + 8px);
}

/* Secondary tag for a status note (e.g. "Launching soon") — reads as a
   state, not as a technology, so it shouldn't look like the tech tags. */
.tech-tag--muted {
  background: transparent !important;
  border-style: dashed !important;
  color: var(--color-body) !important;
  opacity: 0.85;
}
