/*
  Q&D visual system
  Palette source: Q&D Furniture / assets / COLOR PALETTE.png
  This file intentionally loads after the existing stylesheet so presentation can
  evolve without changing the portfolio's JavaScript, modals, or carousel behavior.
*/

@font-face {
  font-family: "Heavitas";
  src: url("images/fonts/Heavitas.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("images/fonts/Poppins-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("images/fonts/Poppins-Medium.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("images/fonts/Poppins-SemiBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("images/fonts/Poppins-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --qd-forest: #2c3930;
  --qd-forest-soft: #3f4f44;
  --qd-wood: #a27b5c;
  --qd-cream: #dcd7c9;

  --font-body: "Poppins", sans-serif;
  --font-display: "Heavitas", "Poppins", sans-serif;

  --page-bg: var(--qd-cream);
  --section-tint: var(--qd-cream);
  --surface: color-mix(in srgb, var(--qd-cream) 94%, white);
  --surface-raised: color-mix(in srgb, var(--qd-cream) 88%, white);
  --primary: var(--qd-forest);
  --primary-hover: var(--qd-forest-soft);
  --on-primary: var(--qd-cream);
  --text: var(--qd-forest);
  --muted-text: var(--qd-forest-soft);
  --border: rgba(44, 57, 48, 0.16);
  --accent: var(--qd-wood);
  --shadow: 0 18px 42px rgba(44, 57, 48, 0.1);
  --shadow-hover: 0 24px 52px rgba(44, 57, 48, 0.16);

  /* Keep the legacy variables semantic for every pre-existing component. */
  --red: var(--primary);
  --red-dark: var(--primary-hover);
  --black: var(--text);
  --ink: var(--text);
  --muted: var(--muted-text);
  --line: var(--border);
  --soft: var(--section-tint);
  --soft-red: #ece0d4;
  --white: var(--surface-raised);
  --bg-base: var(--page-bg);
  --bg-surface: var(--surface);
  --bg-glow: rgba(255, 253, 248, 0.72);
  --bg-shape: rgba(162, 123, 92, 0.12);
  --bg-grid: rgba(44, 57, 48, 0.055);
  --section-overlay: rgba(255, 253, 248, 0.2);
  --section-overlay-shape: rgba(162, 123, 92, 0.08);
  --radius: 14px;
}

html {
  background: var(--page-bg);
  scroll-padding-top: 1rem;
}

body {
  min-width: 320px;
  background: var(--page-bg) !important;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.68;
  letter-spacing: -0.005em;
  text-rendering: optimizeLegibility;
}

body,
button,
input,
textarea,
select {
  font-family: var(--font-body);
}

body::before {
  background-image:
    linear-gradient(90deg, rgba(44, 57, 48, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(44, 57, 48, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 12% 14%, rgba(162, 123, 92, 0.13) 0 1px, transparent 1.5px) !important;
  background-position: 0 0, 0 0, 16px 18px;
  background-size: 72px 72px, 72px 72px, 72px 72px;
  opacity: 0.45;
}

body::after {
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 253, 248, 0.62), transparent 24%),
    radial-gradient(circle at 88% 26%, rgba(162, 123, 92, 0.1), transparent 20%) !important;
  filter: blur(28px);
  opacity: 0.62;
}

main > section::before,
.section-pad::before,
main > section::after,
.section-pad::after {
  background: none !important;
  border: 0 !important;
  opacity: 0;
}

main > section {
  isolation: isolate;
}

.container {
  --bs-gutter-x: clamp(1.25rem, 3vw, 2rem);
}

.section-pad {
  padding-block: clamp(4.75rem, 8vw, 7.25rem);
}

.hero,
.skills-strip,
.projects-section,
.education-section,
.contact-section {
  background: var(--page-bg) !important;
}

.soft-section,
.experience-section,
.testimonials-section,
.premium-skills-section {
  background: var(--section-tint) !important;
}

.hero {
  min-height: min(100svh, 940px);
  padding-top: clamp(5.5rem, 10vw, 7.5rem);
  padding-bottom: clamp(4rem, 7vw, 6rem);
  background:
    linear-gradient(120deg, rgba(255, 253, 248, 0.84), rgba(235, 231, 218, 0.7)) !important;
}

.hero::before {
  background:
    radial-gradient(circle at 82% 28%, rgba(162, 123, 92, 0.14), transparent 28%),
    radial-gradient(circle at 12% 10%, rgba(255, 253, 248, 0.7), transparent 24%) !important;
  opacity: 1;
}

.hero::after {
  right: -8vw;
  left: auto;
  top: 14%;
  width: min(520px, 52vw);
  height: min(520px, 52vw);
  border: 1px solid rgba(162, 123, 92, 0.16) !important;
  border-radius: 50%;
  background: rgba(162, 123, 92, 0.08) !important;
  filter: blur(12px);
  opacity: 1;
}

/* Type hierarchy: expressive only where it carries the page, calm everywhere else. */
h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand,
.nav-link,
.btn,
.eyebrow,
.section-kicker,
.skills-kicker,
.project-type,
.timeline-year,
.timeline-content > span,
.timeline-tags span,
.card-badge,
.visitor-counter-label,
.contact-form label,
.testimonial-form label {
  font-family: var(--font-body) !important;
}

.hero h1,
.section-title,
.skills-title,
.commitment-title,
.footer-brand h2,
.modal-title {
  color: var(--text) !important;
  font-family: var(--font-display) !important;
  font-weight: 400 !important;
  letter-spacing: -0.035em !important;
  line-height: 1.02 !important;
  text-wrap: balance;
}

.hero h1 {
  max-width: 13ch;
  font-size: clamp(3rem, 6.1vw, 5.7rem);
  margin-bottom: 1.25rem;
}

.section-title,
.skills-title {
  font-size: clamp(2.25rem, 4.5vw, 4.1rem);
}

.section-heading {
  max-width: 740px;
  margin-bottom: clamp(2.35rem, 5vw, 3.6rem);
}

.lead-copy,
.hero-text,
.contact-copy p,
.feedback-note,
.commitment-desc {
  color: var(--muted-text) !important;
  font-size: clamp(0.98rem, 1.35vw, 1.08rem);
  line-height: 1.78;
}

.hero-role {
  color: var(--primary) !important;
  font-size: clamp(1rem, 1.55vw, 1.16rem);
  font-weight: 600;
  line-height: 1.55;
}

.eyebrow,
.section-kicker,
.skills-kicker,
.project-type,
.timeline-content > span,
.timeline-year,
.card-badge,
.visitor-counter-label {
  color: var(--primary-hover) !important;
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  line-height: 1.35;
  text-transform: uppercase;
}

/* Remove the remaining legacy cyan treatment from the hero label. */
.eyebrow {
  border-color: rgba(162, 123, 92, 0.34) !important;
  background: rgba(162, 123, 92, 0.1) !important;
  box-shadow: none !important;
}

.eyebrow::before,
.section-kicker::before,
.commitment-kicker::before {
  width: 28px;
  background: var(--accent) !important;
}

.commitment-section {
  background: var(--qd-forest) !important;
  color: var(--qd-cream);
}

.commitment-grid-bg {
  opacity: 0.18;
  background-image: radial-gradient(circle at center, rgba(220, 215, 201, 0.22) 1px, transparent 1px);
}

.commitment-glow {
  opacity: 0.12;
  background-color: var(--accent);
}

.commitment-kicker,
.commitment-title,
.commitment-desc {
  color: var(--qd-cream) !important;
}

.commitment-kicker {
  font-family: var(--font-body) !important;
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.commitment-title {
  color: var(--qd-cream) !important;
  font-size: clamp(2.35rem, 4.7vw, 4.25rem);
}

.commitment-desc,
.commitment-card p {
  color: rgba(220, 215, 201, 0.8) !important;
}

.commitment-card {
  border: 1px solid rgba(220, 215, 201, 0.17);
  border-radius: 16px;
  background: rgba(220, 215, 201, 0.055);
  box-shadow: none;
}

.commitment-card:hover {
  border-color: rgba(162, 123, 92, 0.74);
  background: rgba(220, 215, 201, 0.085);
  box-shadow: 0 20px 42px rgba(12, 18, 14, 0.24);
  transform: translateY(-5px);
}

.commitment-card h3 {
  color: var(--qd-cream) !important;
  font-family: var(--font-body) !important;
  font-size: 1.18rem;
  font-weight: 600;
}

.commitment-icon {
  border-color: rgba(162, 123, 92, 0.5);
  background: rgba(162, 123, 92, 0.16);
  color: var(--qd-cream);
}

/* Buttons and interactive controls favor strong, accessible forest/cream contrast. */
.btn {
  border-radius: 10px;
  font-family: var(--font-body) !important;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary-red {
  border-color: var(--primary) !important;
  background: var(--primary) !important;
  color: var(--on-primary) !important;
  box-shadow: 0 12px 24px rgba(44, 57, 48, 0.18);
}

.btn-primary-red:hover,
.btn-primary-red:focus-visible {
  border-color: var(--primary-hover) !important;
  background: var(--primary-hover) !important;
  color: var(--on-primary) !important;
  box-shadow: 0 16px 30px rgba(44, 57, 48, 0.24);
}

.btn-outline-dark,
.btn-soft,
.btn-light-outline {
  border-color: var(--border) !important;
  background: var(--surface-raised) !important;
  color: var(--text) !important;
  box-shadow: none;
}

.btn-outline-dark:hover,
.btn-soft:hover,
.btn-light-outline:hover {
  border-color: var(--accent) !important;
  background: var(--section-tint) !important;
  color: var(--text) !important;
  box-shadow: 0 10px 24px rgba(44, 57, 48, 0.1);
}

.theme-toggle,
.scroll-top-btn,
.chatbot-toggle {
  border-color: var(--border) !important;
  background: rgba(255, 253, 248, 0.9) !important;
  color: var(--text) !important;
  box-shadow: 0 12px 28px rgba(44, 57, 48, 0.14);
}

.theme-toggle:hover,
.scroll-top-btn:hover,
.chatbot-toggle:hover {
  border-color: var(--accent) !important;
  color: var(--primary) !important;
}

:where(a, button, input, textarea, select):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(162, 123, 92, 0.2);
}

/* Hero details retain the portfolio's personality, with quieter surfaces. */
.hero-layout {
  row-gap: clamp(2.5rem, 6vw, 4.5rem);
}

.hero-copy {
  max-width: 680px;
}

.hero-actions {
  gap: 0.7rem;
}

.hero-actions .btn,
.resume-actions .btn {
  min-width: 148px;
}

.hero-flip-face {
  border-color: var(--border) !important;
  border-radius: 18px;
  background: var(--surface-raised) !important;
  box-shadow: var(--shadow);
}

.hero-flip-front img,
#profilePhoto {
  border-radius: 12px;
  filter: saturate(0.94) contrast(1.02) !important;
}

.hero-flip-card:focus-visible {
  box-shadow: 0 0 0 4px rgba(162, 123, 92, 0.25);
}

.visitor-counter,
.hero-skill-float,
.profile-info-card,
.profile-value-card {
  border-color: var(--border) !important;
  background: var(--surface-raised) !important;
  color: var(--text) !important;
  box-shadow: 0 12px 26px rgba(44, 57, 48, 0.08);
}

.visitor-counter-icon,
.visitor-card i {
  background: rgba(162, 123, 92, 0.16) !important;
  color: var(--primary) !important;
}

.visitor-counter strong,
.profile-info-card strong,
.profile-value-card strong {
  color: var(--text) !important;
  font-family: var(--font-body) !important;
  font-weight: 600;
}

.visitor-counter small,
.profile-info-card span,
.profile-value-card span {
  color: var(--muted-text) !important;
}

/* Product-like surfaces: consistent borders, measured depth, and warmer details. */
.premium-skills-section {
  --skills-bg: var(--section-tint);
  --skills-card: var(--surface-raised);
  --skills-text: var(--text);
  --skills-muted: var(--muted-text);
  --skills-border: var(--border);
  --skills-chip-bg: var(--surface);
  padding-block: clamp(4.75rem, 8vw, 7.25rem) clamp(4.25rem, 7vw, 6rem);
}

.skills-bg-elements {
  opacity: 0.42;
}

.skills-bg-glow.glow-1,
.skills-bg-glow.glow-2,
.skills-bg-glow.glow-3 {
  background: rgba(162, 123, 92, 0.13);
}

.skills-title,
.card-name,
.card-percent {
  color: var(--text) !important;
}

.skills-header::after,
.card-category,
.card-exp,
.card-desc {
  color: var(--muted-text) !important;
}

.premium-skills-section .premium-card,
.premium-skills-section .premium-card.is-inactive {
  min-height: 344px;
  border-color: var(--border) !important;
  border-radius: 16px;
  background: var(--surface-raised) !important;
  box-shadow: 0 12px 30px rgba(44, 57, 48, 0.08);
}

.premium-skills-section .premium-card:hover {
  border-color: rgba(162, 123, 92, 0.65) !important;
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px) !important;
}

.card-icon,
.nav-arrow {
  border-color: var(--border) !important;
  background: var(--surface) !important;
  color: var(--primary) !important;
}

.card-badge {
  border-color: var(--primary) !important;
  background: var(--primary) !important;
  color: var(--on-primary) !important;
}

.skill-tags li,
.tags span,
.timeline-tags span {
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  font-family: var(--font-body) !important;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
}

.progress-fill {
  background: var(--accent) !important;
}

.premium-carousel-dots button {
  background: rgba(44, 57, 48, 0.22) !important;
}

.premium-carousel-dots button.is-active,
.nav-arrow:hover:not(:disabled) {
  border-color: var(--primary) !important;
  background: var(--primary) !important;
  color: var(--on-primary) !important;
}

.nav-arrow:disabled {
  background: var(--surface) !important;
  color: var(--muted-text) !important;
}

.project-card,
.timeline-list,
.testimonial-card,
.contact-info-panel,
.contact-form,
.chatbot-panel,
.resume-modal .modal-content,
.project-status-modal .modal-content,
.testimonial-modal .modal-content {
  border-color: var(--border) !important;
  background: var(--surface-raised) !important;
  color: var(--text) !important;
  box-shadow: var(--shadow);
}

.project-card,
.testimonial-card,
.contact-info-panel,
.contact-form,
.chatbot-panel,
.resume-modal .modal-content,
.project-status-modal .modal-content,
.testimonial-modal .modal-content {
  border-radius: 16px;
}

.project-card {
  display: flex;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
}

.project-card:hover {
  border-color: rgba(162, 123, 92, 0.68) !important;
  box-shadow: var(--shadow-hover);
  transform: translateY(-5px);
}

.featured-project {
  border-color: rgba(162, 123, 92, 0.46) !important;
}

.project-image-wrap {
  background: var(--section-tint);
}

.project-body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.project-card h4,
.timeline-content h3,
.testimonial-card strong,
.contact-list a,
.modal-title {
  color: var(--text) !important;
}

.project-card h4,
.timeline-content h3,
.testimonial-card strong {
  font-family: var(--font-body) !important;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.project-card p,
.timeline-content p,
.testimonial-card p,
.testimonial-card small,
.testimonial-card > span,
.feedback-note {
  color: var(--muted-text) !important;
}

.project-actions {
  margin-top: auto;
}

.project-type,
.contact-list i,
.timeline-summary i,
.testimonial-stars i,
.star-rating button.is-active {
  color: var(--accent) !important;
}

.timeline-summary {
  gap: 0.65rem;
  margin-bottom: 1.8rem;
}

.timeline-summary span {
  border-color: var(--border) !important;
  border-radius: 10px;
  background: var(--surface-raised) !important;
  color: var(--text) !important;
  box-shadow: 0 8px 18px rgba(44, 57, 48, 0.06);
  font-family: var(--font-body) !important;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
}

.experience-section .timeline-list,
.education-section .timeline-list,
body.dark-mode .experience-section .timeline-list,
body.dark-mode .education-section .timeline-list {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none;
}

.experience-section .timeline-list::before,
.education-section .timeline-list::before,
body.dark-mode .experience-section .timeline-list::after,
body.dark-mode .education-section .timeline-list::after {
  background: linear-gradient(180deg, rgba(162, 123, 92, 0.82), rgba(44, 57, 48, 0.18), transparent) !important;
}

.experience-section .timeline-item,
.education-section .timeline-item {
  border-color: var(--border) !important;
  border-radius: 14px;
  background: var(--surface-raised) !important;
  box-shadow: 0 12px 28px rgba(44, 57, 48, 0.07);
}

.experience-section .timeline-item:hover,
.education-section .timeline-item:hover {
  border-color: rgba(162, 123, 92, 0.64) !important;
  box-shadow: var(--shadow-hover);
}

.experience-section .timeline-dot,
.education-section .timeline-dot {
  border-color: var(--primary) !important;
  background: var(--primary) !important;
  color: var(--on-primary) !important;
  box-shadow: 0 10px 22px rgba(44, 57, 48, 0.16);
}

.experience-section .timeline-year,
.education-section .timeline-year {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface) !important;
  color: var(--text) !important;
  box-shadow: none;
}

.timeline-content > span {
  color: var(--primary-hover) !important;
  font-size: 0.7rem;
}

.timeline-tags span {
  min-height: 26px;
  padding: 0.28rem 0.55rem;
}

/* Forms, modals, and the small assistant use the same dependable material system. */
.contact-form input,
.contact-form textarea,
.contact-form select,
.testimonial-form input,
.testimonial-form textarea,
.chatbot-form input {
  border-color: var(--border) !important;
  border-radius: 9px;
  background: var(--surface) !important;
  color: var(--text) !important;
  font-family: var(--font-body) !important;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder,
.testimonial-form input::placeholder,
.testimonial-form textarea::placeholder,
.chatbot-form input::placeholder {
  color: rgba(86, 100, 90, 0.76) !important;
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus,
.testimonial-form input:focus,
.testimonial-form textarea:focus,
.chatbot-form input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 4px rgba(162, 123, 92, 0.18) !important;
}

.contact-form label,
.testimonial-form label,
.contact-assurance,
.contact-list a {
  color: var(--text) !important;
}

.contact-list a:hover {
  color: var(--primary-hover) !important;
}

.contact-assurance {
  border-color: var(--border) !important;
  background: var(--surface) !important;
}

.modal-header,
.modal-footer {
  border-color: var(--border) !important;
  background: var(--surface-raised) !important;
}

.resume-modal-body {
  background: var(--section-tint) !important;
}

.chatbot-header {
  border-color: var(--border) !important;
  background: var(--primary) !important;
  color: var(--on-primary) !important;
}

.chatbot-header strong {
  font-family: var(--font-body) !important;
  font-weight: 600;
}

.chatbot-header button {
  color: var(--on-primary) !important;
}

.bot-message {
  background: var(--surface) !important;
  color: var(--text) !important;
}

.user-message {
  background: var(--primary) !important;
  color: var(--on-primary) !important;
}

.chatbot-form button {
  background: var(--primary) !important;
  color: var(--on-primary) !important;
}

.site-footer {
  border-top: 1px solid rgba(220, 215, 201, 0.15);
  background: var(--qd-forest) !important;
  color: var(--qd-cream) !important;
}

.site-footer h2,
.site-footer h3,
.site-footer p,
.site-footer a,
.footer-bottom {
  color: var(--qd-cream) !important;
}

.footer-social a {
  border-color: rgba(220, 215, 201, 0.16) !important;
  background: rgba(220, 215, 201, 0.055) !important;
}

.footer-social a:hover {
  border-color: var(--accent) !important;
  background: rgba(162, 123, 92, 0.17) !important;
  color: var(--qd-cream) !important;
}

.footer-social i {
  background: rgba(220, 215, 201, 0.1) !important;
  color: var(--qd-cream) !important;
}

.footer-social small {
  color: rgba(220, 215, 201, 0.72) !important;
}

/* Dark mode preserves the same hierarchy instead of inverting every element. */
body.dark-mode {
  --page-bg: var(--qd-forest);
  --section-tint: #334238;
  --surface: var(--qd-forest-soft);
  --surface-raised: #4a5a4f;
  --primary: var(--qd-cream);
  --primary-hover: #f2efe5;
  --on-primary: var(--qd-forest);
  --text: var(--qd-cream);
  --muted-text: #ced0c2;
  --border: rgba(220, 215, 201, 0.2);
  --shadow: 0 18px 42px rgba(9, 14, 11, 0.28);
  --shadow-hover: 0 24px 52px rgba(9, 14, 11, 0.4);
  --red: var(--primary);
  --red-dark: var(--primary-hover);
  --black: var(--text);
  --ink: var(--text);
  --muted: var(--muted-text);
  --line: var(--border);
  --soft: var(--section-tint);
  --soft-red: rgba(162, 123, 92, 0.2);
  --white: var(--surface-raised);
  --bg-base: var(--page-bg);
  --bg-surface: var(--surface);
  --bg-glow: rgba(220, 215, 201, 0.07);
  --bg-shape: rgba(162, 123, 92, 0.13);
  --bg-grid: rgba(220, 215, 201, 0.06);
  --section-overlay: rgba(220, 215, 201, 0.04);
  --section-overlay-shape: rgba(162, 123, 92, 0.08);
  background: var(--page-bg) !important;
  color: var(--text);
}

body.dark-mode::before {
  background-image:
    linear-gradient(90deg, rgba(220, 215, 201, 0.055) 1px, transparent 1px),
    linear-gradient(0deg, rgba(220, 215, 201, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 12% 14%, rgba(162, 123, 92, 0.25) 0 1px, transparent 1.5px) !important;
  opacity: 0.42;
}

body.dark-mode::after {
  background:
    radial-gradient(circle at 86% 12%, rgba(162, 123, 92, 0.16), transparent 24%),
    radial-gradient(circle at 18% 82%, rgba(220, 215, 201, 0.045), transparent 22%) !important;
  opacity: 0.62;
}

body.dark-mode .hero,
body.dark-mode .skills-strip,
body.dark-mode .projects-section,
body.dark-mode .education-section,
body.dark-mode .contact-section {
  background: var(--page-bg) !important;
}

body.dark-mode .soft-section,
body.dark-mode .experience-section,
body.dark-mode .testimonials-section,
body.dark-mode .premium-skills-section {
  background: var(--section-tint) !important;
}

body.dark-mode .hero {
  background:
    linear-gradient(120deg, rgba(63, 79, 68, 0.62), rgba(44, 57, 48, 0.94)) !important;
}

body.dark-mode .hero::before {
  background:
    radial-gradient(circle at 82% 28%, rgba(162, 123, 92, 0.2), transparent 27%),
    radial-gradient(circle at 14% 12%, rgba(220, 215, 201, 0.05), transparent 22%) !important;
}

body.dark-mode .hero::after {
  border-color: rgba(162, 123, 92, 0.35) !important;
  background: rgba(162, 123, 92, 0.12) !important;
}

body.dark-mode .hero h1,
body.dark-mode .section-title,
body.dark-mode .skills-title,
body.dark-mode .card-name,
body.dark-mode .card-percent,
body.dark-mode .project-card h4,
body.dark-mode .timeline-content h3,
body.dark-mode .testimonial-card strong,
body.dark-mode .contact-form label,
body.dark-mode .testimonial-form label,
body.dark-mode .modal-title,
body.dark-mode .visitor-counter strong,
body.dark-mode .profile-info-card strong,
body.dark-mode .profile-value-card strong {
  color: var(--text) !important;
}

body.dark-mode .lead-copy,
body.dark-mode .hero-text,
body.dark-mode .contact-copy p,
body.dark-mode .project-card p,
body.dark-mode .timeline-content p,
body.dark-mode .testimonial-card p,
body.dark-mode .testimonial-card span,
body.dark-mode .testimonial-card small,
body.dark-mode .card-category,
body.dark-mode .card-exp,
body.dark-mode .card-desc,
body.dark-mode .visitor-counter small,
body.dark-mode .profile-info-card span,
body.dark-mode .profile-value-card span {
  color: var(--muted-text) !important;
}

body.dark-mode .contact-form input::placeholder,
body.dark-mode .contact-form textarea::placeholder,
body.dark-mode .testimonial-form input::placeholder,
body.dark-mode .testimonial-form textarea::placeholder,
body.dark-mode .chatbot-form input::placeholder {
  color: rgba(196, 200, 185, 0.72) !important;
}

body.dark-mode .hero-role,
body.dark-mode .eyebrow,
body.dark-mode .section-kicker,
body.dark-mode .skills-kicker,
body.dark-mode .project-type,
body.dark-mode .timeline-content > span,
body.dark-mode .timeline-year {
  color: var(--primary) !important;
}

body.dark-mode .eyebrow {
  border-color: rgba(162, 123, 92, 0.46) !important;
  background: rgba(162, 123, 92, 0.16) !important;
  box-shadow: none !important;
}

body.dark-mode .btn-primary-red {
  border-color: var(--primary) !important;
  background: var(--primary) !important;
  color: var(--on-primary) !important;
  box-shadow: 0 12px 24px rgba(9, 14, 11, 0.3);
}

body.dark-mode .btn-primary-red:hover,
body.dark-mode .btn-primary-red:focus-visible {
  border-color: var(--primary-hover) !important;
  background: var(--primary-hover) !important;
  color: var(--on-primary) !important;
}

body.dark-mode .btn-outline-dark,
body.dark-mode .btn-soft,
body.dark-mode .btn-light-outline,
body.dark-mode .theme-toggle,
body.dark-mode .scroll-top-btn,
body.dark-mode .chatbot-toggle {
  border-color: var(--border) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
}

body.dark-mode .btn-outline-dark:hover,
body.dark-mode .btn-soft:hover,
body.dark-mode .btn-light-outline:hover,
body.dark-mode .theme-toggle:hover,
body.dark-mode .scroll-top-btn:hover,
body.dark-mode .chatbot-toggle:hover {
  border-color: var(--accent) !important;
  background: var(--surface-raised) !important;
  color: var(--text) !important;
}

body.dark-mode .hero-flip-face,
body.dark-mode .visitor-counter,
body.dark-mode .hero-skill-float,
body.dark-mode .profile-info-card,
body.dark-mode .profile-value-card,
body.dark-mode .premium-card,
body.dark-mode .premium-card.is-inactive,
body.dark-mode .project-card,
body.dark-mode .testimonial-card,
body.dark-mode .contact-info-panel,
body.dark-mode .contact-form,
body.dark-mode .chatbot-panel,
body.dark-mode .resume-modal .modal-content,
body.dark-mode .project-status-modal .modal-content,
body.dark-mode .testimonial-modal .modal-content {
  border-color: var(--border) !important;
  background: var(--surface-raised) !important;
  color: var(--text) !important;
  box-shadow: var(--shadow);
}

body.dark-mode .premium-skills-section {
  --skills-bg: var(--section-tint);
  --skills-card: var(--surface-raised);
  --skills-text: var(--text);
  --skills-muted: var(--muted-text);
  --skills-border: var(--border);
  --skills-chip-bg: var(--surface);
}

body.dark-mode .skills-bg-glow.glow-1,
body.dark-mode .skills-bg-glow.glow-2,
body.dark-mode .skills-bg-glow.glow-3 {
  background: rgba(162, 123, 92, 0.16) !important;
}

body.dark-mode .card-icon,
body.dark-mode .nav-arrow,
body.dark-mode .skill-tags li,
body.dark-mode .tags span,
body.dark-mode .timeline-tags span,
body.dark-mode .timeline-summary span,
body.dark-mode .experience-section .timeline-year,
body.dark-mode .education-section .timeline-year,
body.dark-mode .contact-form input,
body.dark-mode .contact-form textarea,
body.dark-mode .contact-form select,
body.dark-mode .testimonial-form input,
body.dark-mode .testimonial-form textarea,
body.dark-mode .chatbot-form input,
body.dark-mode .bot-message {
  border-color: var(--border) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
}

body.dark-mode .experience-section .timeline-item,
body.dark-mode .education-section .timeline-item {
  border-color: var(--border) !important;
  background: var(--surface-raised) !important;
  box-shadow: var(--shadow);
}

body.dark-mode .experience-section .timeline-dot,
body.dark-mode .education-section .timeline-dot {
  border-color: var(--primary) !important;
  background: var(--primary) !important;
  color: var(--on-primary) !important;
  box-shadow: 0 10px 22px rgba(9, 14, 11, 0.25);
}

body.dark-mode .experience-section .timeline-list::before,
body.dark-mode .education-section .timeline-list::before,
body.dark-mode .experience-section .timeline-list::after,
body.dark-mode .education-section .timeline-list::after {
  background: linear-gradient(180deg, rgba(162, 123, 92, 0.88), rgba(220, 215, 201, 0.2), transparent) !important;
}

body.dark-mode .card-badge,
body.dark-mode .chatbot-header,
body.dark-mode .user-message,
body.dark-mode .chatbot-form button,
body.dark-mode .premium-carousel-dots button.is-active,
body.dark-mode .nav-arrow:hover:not(:disabled) {
  border-color: var(--primary) !important;
  background: var(--primary) !important;
  color: var(--on-primary) !important;
}

body.dark-mode .premium-carousel-dots button {
  background: rgba(220, 215, 201, 0.34) !important;
}

body.dark-mode .commitment-section,
body.dark-mode .site-footer {
  background: #26342b !important;
}

body.dark-mode .commitment-card {
  border-color: rgba(220, 215, 201, 0.19);
  background: rgba(220, 215, 201, 0.055);
}

body.dark-mode .modal .btn-close {
  filter: invert(1) grayscale(1) brightness(1.7);
}

@media (max-width: 991px) {
  .hero {
    min-height: auto;
  }

  .hero h1 {
    max-width: 15ch;
  }

  .hero-visual {
    max-width: 410px;
  }
}

@media (max-width: 759px) {
  .section-pad {
    padding-block: 4.25rem;
  }

  .hero {
    padding-top: 5.75rem;
  }

  .hero h1 {
    font-size: clamp(2.7rem, 13vw, 4rem);
  }

  .section-title,
  .skills-title,
  .commitment-title {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .hero-actions .btn,
  .resume-actions .btn {
    width: 100%;
    min-width: 0;
  }

  .premium-skills-section .premium-card,
  .premium-skills-section .premium-card.is-inactive {
    min-height: 0;
    border-radius: 14px;
  }

  .timeline-summary span {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/*
  Crisp light-mode correction
  The portfolio previously layered several translucent gradients and blurred
  ornaments. Light mode now stays flat, sharp, and anchored to Q&D cream.
*/
body:not(.dark-mode) {
  --page-bg: #dcd7c9;
  --section-tint: var(--qd-cream);
  --surface: color-mix(in srgb, var(--qd-cream) 94%, white);
  --surface-raised: color-mix(in srgb, var(--qd-cream) 88%, white);
  --muted-text: var(--qd-forest-soft);
  --border: rgba(44, 57, 48, 0.2);
  --shadow: 0 10px 24px rgba(44, 57, 48, 0.08);
  --shadow-hover: 0 16px 32px rgba(44, 57, 48, 0.13);
  background: var(--qd-cream) !important;
}

body:not(.dark-mode)::before,
body:not(.dark-mode)::after,
body:not(.dark-mode) .hero::before,
body:not(.dark-mode) .hero::after {
  content: none !important;
  border: 0 !important;
  background: none !important;
  filter: none !important;
  opacity: 0 !important;
}

body:not(.dark-mode) .hero,
body:not(.dark-mode) .projects-section,
body:not(.dark-mode) .education-section,
body:not(.dark-mode) .contact-section {
  background: var(--qd-cream) !important;
}

body:not(.dark-mode) .soft-section,
body:not(.dark-mode) .experience-section,
body:not(.dark-mode) .testimonials-section,
body:not(.dark-mode) .premium-skills-section {
  background: var(--section-tint) !important;
}

body:not(.dark-mode) .skills-bg-elements,
body:not(.dark-mode) .commitment-glow {
  display: none;
}

body:not(.dark-mode) .theme-toggle,
body:not(.dark-mode) .scroll-top-btn,
body:not(.dark-mode) .chatbot-toggle,
body:not(.dark-mode) .visitor-counter,
body:not(.dark-mode) .hero-flip-face,
body:not(.dark-mode) .premium-card,
body:not(.dark-mode) .project-card,
body:not(.dark-mode) .timeline-item,
body:not(.dark-mode) .testimonial-card,
body:not(.dark-mode) .contact-info-panel,
body:not(.dark-mode) .contact-form,
body:not(.dark-mode) .chatbot-panel {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Minimal icon-only skills marquee. */
.legacy-skills-carousel {
  display: none !important;
}

.premium-skills-section {
  padding-block: clamp(3.5rem, 6vw, 5rem) !important;
}

.premium-skills-section .skills-bg-elements {
  display: none !important;
}

.stack-heading {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  margin: 0 auto clamp(1.65rem, 3vw, 2.35rem);
  text-align: center;
}

.stack-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  color: var(--primary-hover);
  font-family: var(--font-body) !important;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1.3;
  text-transform: uppercase;
}

.stack-kicker::before {
  width: 22px;
  height: 2px;
  background: var(--accent);
  content: "";
}

.stack-heading h2 {
  margin: 0;
  color: var(--text) !important;
  font-family: var(--font-body) !important;
  font-size: clamp(1.25rem, 2.2vw, 1.7rem);
  font-weight: 600 !important;
  letter-spacing: -0.025em !important;
  line-height: 1.15 !important;
}

.stack-marquee {
  --stack-gap: clamp(1.15rem, 3vw, 2.5rem);
  width: min(100%, 1280px);
  margin: 0 auto;
  overflow: hidden;
  padding: 0.35rem max(1.25rem, 3vw);
}

.stack-marquee__track {
  display: flex;
  width: max-content;
  animation: stackMarquee 32s linear infinite;
  will-change: transform;
}

.stack-marquee:hover .stack-marquee__track {
  animation-play-state: paused;
}

.stack-marquee__group {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--stack-gap);
  margin: 0;
  padding: 0 var(--stack-gap) 0 0;
  list-style: none;
}

.stack-skill {
  display: grid;
  width: clamp(4.8rem, 8.5vw, 6.9rem);
  min-height: 5.7rem;
  align-content: center;
  justify-items: center;
  gap: 0.55rem;
  color: var(--text);
  text-align: center;
}

.stack-skill i {
  display: grid;
  min-height: 2.65rem;
  place-items: center;
  font-size: clamp(2.05rem, 3.4vw, 2.7rem);
  line-height: 1;
}

.stack-skill-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.stack-skill__icon {
  display: block;
  width: clamp(2.05rem, 3.4vw, 2.7rem);
  height: 2.65rem;
}

/* Keep the site in the Q&D palette, while each technology mark uses its
   recognizable brand color.  These are explicit because the CDN's `.colored`
   modifier is not consistently applied by every Devicon build. */
.stack-skill .devicon-html5-plain { color: #e34f26 !important; }
.stack-skill .devicon-css3-plain { color: #1572b6 !important; }
.stack-skill .devicon-javascript-plain { color: #f7df1e !important; }
.stack-skill .devicon-php-plain { color: #777bb4 !important; }
.stack-skill .devicon-java-plain { color: #ea2d2e !important; }
.stack-skill .devicon-csharp-plain { color: #512bd4 !important; }
.stack-skill .devicon-mysql-plain { color: #4479a1 !important; }
.stack-skill .devicon-git-plain { color: #f05032 !important; }
.stack-skill .devicon-bootstrap-plain { color: #7952b3 !important; }

.stack-skill span {
  color: var(--text);
  font-family: var(--font-body) !important;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
}

.stack-skill:hover i {
  transform: translateY(-2px);
}

.stack-skill:hover .stack-skill__icon {
  transform: translateY(-2px);
}

@keyframes stackMarquee {
  to {
    transform: translateX(-50%);
  }
}

@media (max-width: 640px) {
  .premium-skills-section {
    padding-block: 3.25rem !important;
  }

  .stack-marquee {
    --stack-gap: 1.1rem;
    padding-inline: 1rem;
  }

  .stack-marquee__track {
    animation-duration: 28s;
  }

  .stack-skill {
    width: 4.55rem;
    min-height: 5.05rem;
    gap: 0.42rem;
  }

  .stack-skill i {
    min-height: 2.2rem;
    font-size: 2.1rem;
  }

  .stack-skill__icon {
    width: 2.1rem;
    height: 2.2rem;
  }

  .stack-skill span {
    font-size: 0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stack-marquee {
    overflow-x: auto;
  }

  .stack-marquee__track {
    animation: none;
  }

  .stack-marquee__group[aria-hidden="true"] {
    display: none;
  }
}

/* Compact the handoff into the icon-only Tech Stack.  The prior hero bottom
   padding plus this section's top padding created a large blank cream area. */
@media (min-width: 992px) {
  .hero {
    padding-bottom: clamp(2rem, 3vw, 3rem);
  }
}

#skills.premium-skills-section {
  padding-top: clamp(2rem, 3vw, 3rem) !important;
  padding-bottom: clamp(2.75rem, 4vw, 3.75rem) !important;
}

@media (max-width: 640px) {
  #skills.premium-skills-section {
    padding: 2.75rem 0 3rem !important;
  }
}

/* Hero layout refinement - presentation only; all existing content stays put. */
@media (min-width: 992px) {
  .hero.section-pad {
    min-height: auto;
    padding-top: clamp(3.75rem, 5vw, 4.75rem);
    padding-bottom: clamp(2rem, 3vw, 3rem);
  }

  .hero-layout {
    --bs-gutter-x: clamp(2rem, 3.5vw, 3.5rem);
    --bs-gutter-y: 0;
  }

  .hero-visual {
    width: min(100%, 400px);
    max-width: 400px;
    margin-inline: auto;
  }

  .hero-flip-card,
  .hero-flip-inner,
  .hero-flip-face {
    min-height: clamp(480px, 38vw, 520px);
  }

  .hero-flip-front img,
  #profilePhoto {
    height: clamp(480px, 38vw, 520px);
    border-radius: 16px;
  }

  .hero-copy {
    max-width: 620px;
    padding-block: 0.25rem;
  }

  .eyebrow {
    margin-bottom: 0.7rem;
  }

  .hero h1 {
    max-width: 610px;
    margin-bottom: 0.95rem;
    font-size: clamp(3.05rem, 4.5vw, 4.5rem);
    line-height: 1.02 !important;
  }

  .hero-role {
    max-width: 35rem;
    margin-bottom: 0.8rem;
  }

  .hero-text {
    max-width: 37rem;
    margin-bottom: 1.4rem;
    line-height: 1.7;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 440px);
    gap: 0.7rem;
  }

  .hero-actions .btn {
    width: 100%;
    min-width: 0;
    min-height: 46px;
  }

  .visitor-counter {
    margin-top: 0.85rem;
  }
}

/* Resume modal: every action presents the same canonical PDF in a calm frame. */
.resume-modal .modal-content {
  overflow: hidden;
}

.resume-modal .modal-header {
  align-items: center;
  padding: 1rem 1.25rem;
}

.resume-modal .modal-header .section-kicker {
  margin-bottom: 0.22rem;
}

.resume-modal-body {
  padding: clamp(0.6rem, 1.1vw, 0.9rem);
  background: var(--section-tint) !important;
}

.resume-frame-wrap {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(44, 57, 48, 0.08);
}

.resume-modal-body iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.resume-modal .modal-footer {
  justify-content: flex-end;
  padding: 0.85rem 1.25rem;
}

@media (max-width: 768px) {
  .resume-modal-body {
    padding: 0 !important;
  }

  .resume-mobile-tools {
    border-bottom-color: var(--border) !important;
    background: var(--surface-raised) !important;
  }

  .resume-frame-wrap {
    margin: 0.65rem;
    padding: 0;
  }
}

/* Compact featured-project gallery - keeps every project detail intact. */
#projects.projects-section {
  padding-block: clamp(3.5rem, 5vw, 4.75rem);
}

#projects .project-section-heading {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  margin: 0 auto clamp(1.5rem, 2.5vw, 2rem);
  text-align: center;
}

#projects .project-section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  color: var(--primary-hover);
  font-family: var(--font-body) !important;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1.3;
  text-transform: uppercase;
}

#projects .project-section-kicker::before {
  width: 22px;
  height: 2px;
  background: var(--accent);
  content: "";
}

#projects .project-section-title {
  margin: 0;
  color: var(--text) !important;
  font-family: var(--font-body) !important;
  font-size: clamp(1.45rem, 2vw, 1.9rem) !important;
  font-weight: 600 !important;
  letter-spacing: -0.03em !important;
  line-height: 1.2 !important;
}

#projects .project-grid {
  --bs-gutter-x: clamp(0.9rem, 1.5vw, 1.25rem);
  --bs-gutter-y: clamp(0.9rem, 1.5vw, 1.25rem);
  align-items: stretch;
}

#projects .project-card {
  position: relative;
  min-height: 0;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(44, 57, 48, 0.07);
}

#projects .project-card:hover {
  transform: translateY(-3px);
}

#projects .project-image-wrap {
  height: auto !important;
  aspect-ratio: 16 / 9;
}

#projects .project-thumb {
  height: 100% !important;
  object-fit: cover;
  transition: transform 220ms ease;
}

#projects .project-card:hover .project-thumb {
  transform: scale(1.035);
}

#projects .project-body {
  min-height: 0 !important;
  padding: 0.9rem 0.95rem 1rem !important;
}

#projects .project-type {
  font-size: 0.62rem;
  line-height: 1.3;
}

#projects .project-card h4 {
  margin: 0.28rem 0 0.38rem;
  font-size: 1rem;
  line-height: 1.28;
}

#projects .project-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.48;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

#projects .tags {
  gap: 0.32rem;
  margin: 0.7rem 0 0.8rem;
}

#projects .tags span {
  padding: 0.25rem 0.45rem;
  font-size: 0.64rem;
}

#projects .project-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

#projects .project-actions .btn {
  min-width: 0;
  min-height: 36px;
  padding: 0.42rem 0.3rem;
  font-size: 0.7rem;
  line-height: 1.2;
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  #projects.projects-section {
    padding-block: 3.25rem;
  }

  #projects .project-image-wrap {
    height: clamp(150px, 48vw, 190px) !important;
    aspect-ratio: auto;
  }
}

/* Resume-led credentials, experience, and education sections. */
#certificates.certificates-section,
#experience.experience-section,
#education.education-section {
  padding-block: clamp(3.5rem, 5vw, 4.75rem);
}

#certificates.certificates-section,
#education.education-section {
  background: var(--section-tint) !important;
}

#experience.experience-section {
  background: var(--page-bg) !important;
}

.portfolio-section-heading {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  margin: 0 auto clamp(1.5rem, 2.5vw, 2rem);
  text-align: center;
}

.portfolio-section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  color: var(--primary-hover);
  font-family: var(--font-body) !important;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1.3;
  text-transform: uppercase;
}

.portfolio-section-kicker::before {
  width: 22px;
  height: 2px;
  background: var(--accent);
  content: "";
}

.portfolio-section-title {
  margin: 0;
  color: var(--text) !important;
  font-family: var(--font-body) !important;
  font-size: clamp(1.45rem, 2vw, 1.9rem) !important;
  font-weight: 600 !important;
  letter-spacing: -0.03em !important;
  line-height: 1.2 !important;
}

.certificate-placeholder {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: min(100%, 620px);
  margin: 0 auto;
  padding: 1rem 1.1rem;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: var(--surface-raised);
  box-shadow: 0 8px 20px rgba(44, 57, 48, 0.06);
}

.certificate-placeholder__icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(162, 123, 92, 0.44);
  border-radius: 11px;
  background: rgba(162, 123, 92, 0.13);
  color: var(--primary);
  font-size: 1rem;
}

.certificate-placeholder h3 {
  margin: 0 0 0.15rem;
  color: var(--text);
  font-family: var(--font-body) !important;
  font-size: 1rem;
  font-weight: 600;
}

.certificate-placeholder p {
  margin: 0;
  color: var(--muted-text);
  font-size: 0.88rem;
  line-height: 1.5;
}

.resume-entry-grid {
  --bs-gutter-x: clamp(0.9rem, 1.5vw, 1.25rem);
  --bs-gutter-y: clamp(0.9rem, 1.5vw, 1.25rem);
}

.resume-entry {
  height: 100%;
  padding: 1rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-raised);
  box-shadow: 0 7px 18px rgba(44, 57, 48, 0.06);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.resume-entry:hover {
  border-color: rgba(162, 123, 92, 0.68);
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.resume-entry.is-current {
  border-color: rgba(162, 123, 92, 0.54);
}

.resume-entry__date {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0.25rem 0.5rem;
  border: 1px solid rgba(162, 123, 92, 0.34);
  border-radius: 999px;
  background: rgba(162, 123, 92, 0.1);
  color: var(--primary-hover);
  font-family: var(--font-body) !important;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}

.resume-entry__meta {
  margin: 0.75rem 0 0.28rem;
  color: var(--primary-hover);
  font-family: var(--font-body) !important;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.42;
}

.resume-entry h3 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-body) !important;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.28;
}

.resume-entry__description {
  margin: 0.48rem 0 0;
  color: var(--muted-text);
  font-size: 0.84rem;
  line-height: 1.52;
}

@media (max-width: 767.98px) {
  #certificates.certificates-section,
  #experience.experience-section,
  #education.education-section {
    padding-block: 3.25rem;
  }

  .portfolio-section-heading {
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 480px) {
  .certificate-placeholder {
    align-items: flex-start;
  }
}

/* A restrained maze motif gives the certificates handoff a distinct, modern surface. */
#certificates.certificates-section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #101510 !important;
}

#certificates.certificates-section::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cpath d='M12 12H88V48H48V88H124V128H84V172H160V208M208 12H152V52H188V92H132V132H168V172H12M12 208H52V168H92V128H52V88H12' fill='none' stroke='%23dcd7c9' stroke-opacity='.22' stroke-width='2'/%3E%3C/svg%3E") !important;
  background-size: 220px 220px !important;
  background-repeat: repeat !important;
  content: "";
}

#certificates.certificates-section .container {
  position: relative;
  z-index: 1;
}

#certificates .portfolio-section-kicker {
  color: rgba(220, 215, 201, 0.82);
}

#certificates .portfolio-section-title,
#certificates .certificate-placeholder h3 {
  color: var(--qd-cream) !important;
}

#certificates .certificate-placeholder {
  border-color: rgba(220, 215, 201, 0.23);
  background: rgba(44, 57, 48, 0.76);
  box-shadow: none;
}

#certificates .certificate-placeholder__icon {
  border-color: rgba(162, 123, 92, 0.62);
  background: rgba(162, 123, 92, 0.16);
  color: var(--qd-cream);
}

#certificates .certificate-placeholder p {
  color: rgba(220, 215, 201, 0.76);
}

/* Contact uses the same compact heading system and a calmer, trusted form layout. */
#contact.contact-section {
  padding-block: clamp(3.5rem, 5vw, 4.75rem);
}

#contact .contact-layout {
  --bs-gutter-x: clamp(0.9rem, 1.5vw, 1.25rem);
  --bs-gutter-y: clamp(0.9rem, 1.5vw, 1.25rem);
}

#contact .contact-info-panel,
#contact .contact-form {
  padding: clamp(1.2rem, 2vw, 1.55rem);
  border-radius: 14px;
  box-shadow: 0 7px 18px rgba(44, 57, 48, 0.06);
}

#contact .contact-info-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#contact .contact-copy p {
  margin: 0 0 0.9rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

#contact .contact-list {
  gap: 0;
  border-top: 1px solid var(--border);
}

#contact .contact-list a {
  min-height: 46px;
  padding: 0.6rem 0.15rem;
  gap: 0.65rem;
  border-bottom: 1px solid var(--border);
  color: var(--text) !important;
  font-size: 0.82rem;
  line-height: 1.35;
  transform: none !important;
}

#contact .contact-list i {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(162, 123, 92, 0.32);
  border-radius: 8px;
  background: rgba(162, 123, 92, 0.1);
  color: var(--accent) !important;
}

#contact .contact-list a:hover {
  background: rgba(162, 123, 92, 0.06);
  color: var(--text) !important;
}

#contact .contact-form .row {
  --bs-gutter-x: 0.75rem;
  --bs-gutter-y: 0.75rem;
}

#contact .contact-form label {
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#contact .contact-form input,
#contact .contact-form textarea,
#contact .contact-form select {
  min-height: 44px;
  padding: 0.65rem 0.8rem;
  border-radius: 9px;
  font-size: 0.88rem;
}

#contact .contact-form textarea {
  min-height: 134px;
  resize: vertical;
}

#contact .contact-form__actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

#contact .contact-assurance {
  flex: 1;
  margin: 0;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  font-size: 0.75rem;
  line-height: 1.4;
}

#contact .contact-form__actions .btn {
  min-height: 42px;
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 991.98px) {
  #contact .contact-info-panel {
    justify-content: flex-start;
  }
}

@media (max-width: 575.98px) {
  #contact .contact-form__actions {
    align-items: stretch;
    flex-direction: column;
  }

  #contact .contact-form__actions .btn {
    width: 100%;
  }
}

/* Shared, low-contrast maze lines add a technical layer without darkening the palette. */
main > section {
  position: relative;
  isolation: isolate;
}

main > section::before,
main > section.section-pad::before,
body:not(.dark-mode) main > section.hero::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  border: 0 !important;
  opacity: 0.22 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cpath d='M12 12H88V48H48V88H124V128H84V172H160V208M208 12H152V52H188V92H132V132H168V172H12M12 208H52V168H92V128H52V88H12' fill='none' stroke='%232c3930' stroke-opacity='.32' stroke-width='1.5'/%3E%3C/svg%3E") !important;
  background-position: center !important;
  background-repeat: repeat !important;
  background-size: 220px 220px !important;
  filter: none !important;
  content: "" !important;
}

body.dark-mode main > section::before,
body.dark-mode main > section.section-pad::before {
  opacity: 0.24 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cpath d='M12 12H88V48H48V88H124V128H84V172H160V208M208 12H152V52H188V92H132V132H168V172H12M12 208H52V168H92V128H52V88H12' fill='none' stroke='%23dcd7c9' stroke-opacity='.26' stroke-width='1.5'/%3E%3C/svg%3E") !important;
}

main > section > .container,
#skills .stack-marquee {
  position: relative;
  z-index: 1;
}

/* Certificates now uses the same palette and pattern as the rest of the portfolio. */
#certificates.certificates-section {
  background: var(--section-tint) !important;
}

#certificates.certificates-section::before {
  opacity: 0.22 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cpath d='M12 12H88V48H48V88H124V128H84V172H160V208M208 12H152V52H188V92H132V132H168V172H12M12 208H52V168H92V128H52V88H12' fill='none' stroke='%232c3930' stroke-opacity='.32' stroke-width='1.5'/%3E%3C/svg%3E") !important;
}

body.dark-mode #certificates.certificates-section::before {
  opacity: 0.24 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cpath d='M12 12H88V48H48V88H124V128H84V172H160V208M208 12H152V52H188V92H132V132H168V172H12M12 208H52V168H92V128H52V88H12' fill='none' stroke='%23dcd7c9' stroke-opacity='.26' stroke-width='1.5'/%3E%3C/svg%3E") !important;
}

#certificates .portfolio-section-kicker {
  color: var(--primary-hover);
}

#certificates .portfolio-section-title,
#certificates .certificate-placeholder h3 {
  color: var(--text) !important;
}

#certificates .certificate-placeholder {
  border-color: var(--border);
  background: var(--surface-raised);
  box-shadow: 0 8px 20px rgba(44, 57, 48, 0.06);
}

#certificates .certificate-placeholder__icon {
  border-color: rgba(162, 123, 92, 0.44);
  background: rgba(162, 123, 92, 0.13);
  color: var(--primary);
}

#certificates .certificate-placeholder p {
  color: var(--muted-text);
}

/* Testimonials now follows the same compact heading rhythm as Skills and Projects. */
#testimonials.testimonials-section {
  padding-block: clamp(3.5rem, 5vw, 4.75rem);
}

#testimonials .portfolio-section-heading {
  margin-bottom: clamp(1.5rem, 2.5vw, 2rem);
}

#testimonials .testimonial-open-btn {
  margin-top: 0.35rem;
}

#testimonials .testimonial-carousel {
  padding: 0.25rem 0 0.45rem;
}

/* A centered final card keeps the resume grids balanced at tablet widths. */
.resume-entry-grid {
  justify-content: center;
}

@media (max-width: 767.98px) {
  #testimonials.testimonials-section {
    padding-block: 3.25rem;
  }
}

/* Deep, neutral dark mode: Q&D forest remains present, without a mint cast. */
body.dark-mode {
  --page-bg: #101512;
  --section-tint: #171d18;
  --surface: #1b231e;
  --surface-raised: #222b25;
  --primary: #e5e0d2;
  --primary-hover: #f3efe4;
  --on-primary: #101512;
  --text: #f0ecdf;
  --muted-text: #b9c0b5;
  --border: rgba(220, 215, 201, 0.16);
  --accent: #b68a68;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
  --shadow-hover: 0 24px 52px rgba(0, 0, 0, 0.52);
  --bg-base: var(--page-bg);
  --bg-surface: var(--surface);
  --bg-glow: rgba(220, 215, 201, 0.045);
  --bg-shape: rgba(182, 138, 104, 0.11);
  --bg-grid: rgba(220, 215, 201, 0.045);
  --section-overlay: rgba(220, 215, 201, 0.035);
  --section-overlay-shape: rgba(182, 138, 104, 0.065);
  background: var(--page-bg) !important;
}

body.dark-mode .hero {
  background: var(--page-bg) !important;
}

body.dark-mode .commitment-section,
body.dark-mode .site-footer {
  background: #141a16 !important;
}

body.dark-mode .skills-bg-glow.glow-1,
body.dark-mode .skills-bg-glow.glow-2,
body.dark-mode .skills-bg-glow.glow-3 {
  background: rgba(182, 138, 104, 0.1) !important;
}

/* The hero receives the same understated maze linework as every other section. */
body.dark-mode main > section.hero::before {
  opacity: 0.24 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cpath d='M12 12H88V48H48V88H124V128H84V172H160V208M208 12H152V52H188V92H132V132H168V172H12M12 208H52V168H92V128H52V88H12' fill='none' stroke='%23dcd7c9' stroke-opacity='.26' stroke-width='1.5'/%3E%3C/svg%3E") !important;
}

/* Certificate gallery: static framed images, without embedded viewer scrolling. */
#certificates .certificate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 560px));
  justify-content: center;
  gap: clamp(1rem, 2vw, 1.4rem);
}

#certificates .certificate-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-raised);
  box-shadow: 0 10px 24px rgba(44, 57, 48, 0.08);
}

#certificates .certificate-card__preview {
  position: relative;
  padding: clamp(0.65rem, 1.35vw, 0.95rem);
  background: linear-gradient(135deg, rgba(162, 123, 92, 0.18), rgba(220, 215, 201, 0.58));
}

#certificates .certificate-card__frame {
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
  aspect-ratio: 31 / 21;
  padding: clamp(0.55rem, 1.3vw, 0.85rem);
  border: 1px solid #73513c;
  border-radius: 1px;
  background: linear-gradient(135deg, #c39a78 0%, #a27b5c 44%, #73513c 100%);
  box-shadow:
    0 0 0 1px rgba(220, 215, 201, 0.84),
    0 0 0 5px rgba(162, 123, 92, 0.56),
    0 12px 24px rgba(44, 57, 48, 0.18);
}

#certificates .certificate-card__frame::before,
#certificates .certificate-card__frame::after {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  content: "";
}

#certificates .certificate-card__frame::before {
  inset: 5px;
  border: 1px solid rgba(220, 215, 201, 0.82);
  box-shadow: inset 0 0 0 1px rgba(87, 61, 45, 0.24);
}

#certificates .certificate-card__frame::after {
  inset: clamp(0.62rem, 1.7vw, 0.95rem);
  border: 1px solid rgba(94, 66, 48, 0.66);
}

#certificates .certificate-card__frame img {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(115, 81, 60, 0.36);
  object-fit: cover;
  object-position: center;
}

/* Keep scanned certificates fully visible within the same traditional frame. */
#certificates .certificate-card--scanned .certificate-card__frame img {
  background: #ffffff;
  object-fit: contain;
}

#certificates .certificate-frame__corner {
  position: absolute;
  z-index: 2;
  width: clamp(1.4rem, 4vw, 2.3rem);
  height: clamp(1.4rem, 4vw, 2.3rem);
  pointer-events: none;
}

#certificates .certificate-frame__corner::after {
  position: absolute;
  width: 0.38rem;
  height: 0.38rem;
  border: 1px solid #73513c;
  background: var(--qd-cream);
  content: "";
  transform: rotate(45deg);
}

#certificates .certificate-frame__corner--top-left {
  top: clamp(0.42rem, 1vw, 0.62rem);
  left: clamp(0.42rem, 1vw, 0.62rem);
  border-top: 2px solid var(--qd-cream);
  border-left: 2px solid var(--qd-cream);
}

#certificates .certificate-frame__corner--top-left::after {
  top: -0.26rem;
  left: -0.26rem;
}

#certificates .certificate-frame__corner--top-right {
  top: clamp(0.42rem, 1vw, 0.62rem);
  right: clamp(0.42rem, 1vw, 0.62rem);
  border-top: 2px solid var(--qd-cream);
  border-right: 2px solid var(--qd-cream);
}

#certificates .certificate-frame__corner--top-right::after {
  top: -0.26rem;
  right: -0.26rem;
}

#certificates .certificate-frame__corner--bottom-left {
  bottom: clamp(0.42rem, 1vw, 0.62rem);
  left: clamp(0.42rem, 1vw, 0.62rem);
  border-bottom: 2px solid var(--qd-cream);
  border-left: 2px solid var(--qd-cream);
}

#certificates .certificate-frame__corner--bottom-left::after {
  bottom: -0.26rem;
  left: -0.26rem;
}

#certificates .certificate-frame__corner--bottom-right {
  right: clamp(0.42rem, 1vw, 0.62rem);
  bottom: clamp(0.42rem, 1vw, 0.62rem);
  border-right: 2px solid var(--qd-cream);
  border-bottom: 2px solid var(--qd-cream);
}

#certificates .certificate-frame__corner--bottom-right::after {
  right: -0.26rem;
  bottom: -0.26rem;
}

body.dark-mode #certificates .certificate-card__preview {
  background: linear-gradient(135deg, rgba(182, 138, 104, 0.2), rgba(16, 21, 18, 0.42));
}

body.dark-mode #certificates .certificate-card__frame {
  border-color: #8f694f;
  box-shadow:
    0 0 0 1px rgba(220, 215, 201, 0.4),
    0 0 0 5px rgba(182, 138, 104, 0.36),
    0 12px 24px rgba(0, 0, 0, 0.36);
}

@media (max-width: 575.98px) {
  #certificates .certificate-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/*
  Mobile layout system
  The base site has accumulated a few desktop-first rules over time.  These
  final overrides keep the phone experience compact, comfortably tappable, and
  visually aligned with the desktop rhythm without changing any portfolio copy.
*/
html,
body {
  overflow-x: clip;
}

@media (max-width: 991.98px) {
  .hero-layout {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
    row-gap: 0;
  }

  .hero-copy {
    text-align: left;
  }
}

@media (max-width: 575.98px) {
  .container {
    --bs-gutter-x: 1.125rem;
  }

  .hero.section-pad {
    min-height: auto;
    padding-top: 5.25rem;
    padding-bottom: 3rem;
  }

  .hero-layout {
    --bs-gutter-x: 1.25rem;
    --bs-gutter-y: 1.35rem;
  }

  .hero-visual {
    width: min(100%, 360px);
    max-width: 360px;
    margin-inline: auto;
  }

  .hero h1 {
    max-width: 13ch;
    font-size: clamp(2.35rem, 11vw, 2.9rem);
    line-height: 1.04 !important;
  }

  .hero-role {
    margin-bottom: 0.7rem;
    font-size: 0.94rem;
    line-height: 1.58;
  }

  .hero-text {
    margin-bottom: 1.15rem;
    font-size: 0.88rem;
    line-height: 1.65;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 0.6rem;
  }

  .hero-actions .btn {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding-inline: 0.5rem;
    font-size: 0.73rem;
    line-height: 1.2;
    white-space: normal;
  }

  .visitor-counter {
    width: 100%;
    margin-inline: 0;
  }

  #skills.premium-skills-section {
    padding: 2.75rem 0 3.25rem !important;
  }

  .stack-marquee {
    padding-inline: 0.75rem;
  }

  #projects.projects-section,
  #experience.experience-section,
  #education.education-section,
  #certificates.certificates-section,
  #testimonials.testimonials-section,
  #contact.contact-section {
    padding-block: 3.25rem !important;
  }

  #projects .project-section-heading,
  .portfolio-section-heading,
  #testimonials .portfolio-section-heading {
    margin-bottom: 1.45rem;
  }

  #projects .project-body {
    padding: 0.9rem !important;
  }

  #projects .project-actions {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
  }

  #projects .project-actions .btn {
    min-height: 42px;
    padding: 0.55rem 0.7rem;
    font-size: 0.75rem;
    white-space: normal;
  }

  .resume-entry {
    padding: 0.95rem;
  }

  .resume-entry__meta {
    margin-top: 0.65rem;
  }

  .resume-entry__date {
    max-width: 100%;
    white-space: normal;
  }

  #testimonials .testimonial-carousel {
    padding-inline: 0;
  }

  #testimonials .testimonial-track .testimonial-card {
    width: min(360px, calc(100vw - 2.5rem));
    min-height: 0;
    padding: 1.15rem;
  }

  #contact .contact-info-panel,
  #contact .contact-form {
    padding: 1.1rem;
  }

  #contact .contact-list a {
    align-items: flex-start;
    overflow-wrap: anywhere;
  }

  #contact .contact-list i {
    flex: 0 0 30px;
  }

  #contact .contact-form input,
  #contact .contact-form textarea,
  #contact .contact-form select {
    min-height: 46px;
  }

  #contact .contact-form textarea {
    min-height: 128px;
  }

  .site-footer {
    padding: 2.25rem 0 calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }

  .footer-grid {
    gap: 1.35rem;
  }

  .footer-social {
    justify-content: flex-start;
  }

  .footer-social a {
    min-height: 44px;
  }

  .footer-bottom {
    line-height: 1.5;
  }

  .floating-theme-toggle {
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: calc(12px + env(safe-area-inset-right, 0px));
    width: 44px;
    height: 44px;
  }

  .scroll-top-btn {
    left: calc(12px + env(safe-area-inset-left, 0px));
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    width: 44px;
    height: 44px;
  }

  .chatbot-toggle {
    right: calc(12px + env(safe-area-inset-right, 0px));
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    width: 44px;
    height: 44px;
  }

  .chatbot-panel {
    right: calc(12px + env(safe-area-inset-right, 0px));
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    display: flex;
    width: min(340px, calc(100vw - 24px));
    max-height: calc(100dvh - 96px - env(safe-area-inset-top, 0px));
    flex-direction: column;
  }

  .chatbot-messages {
    min-height: 0;
    max-height: none;
    flex: 1 1 auto;
  }

  .project-status-modal .modal-dialog,
  .testimonial-modal .modal-dialog {
    width: calc(100% - 1rem);
    max-width: none;
    min-height: calc(100dvh - 1rem);
    max-height: calc(100dvh - 1rem);
    margin: 0.5rem auto;
  }

  .project-status-modal .modal-content,
  .testimonial-modal .modal-content {
    display: flex;
    max-height: calc(100dvh - 1rem);
    flex-direction: column;
  }

  .project-status-modal .modal-body,
  .testimonial-modal .modal-body {
    min-height: 0;
    overflow-y: auto;
  }

  .project-status-modal .modal-body {
    flex: 1 1 auto;
  }

  .testimonial-modal .testimonial-form {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
  }

  .testimonial-modal .modal-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 0.65rem;
  }

  .testimonial-modal .testimonial-form-status,
  .testimonial-modal .modal-footer .btn {
    width: 100%;
    margin: 0;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .resume-modal .modal-dialog,
  .resume-modal .modal-content {
    height: 100dvh;
    max-height: 100dvh;
  }

  .resume-modal .resume-frame-wrap {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Prevent fixed controls from appearing above Bootstrap's modal backdrop. */
body.modal-open .scroll-top-btn,
body.modal-open .chatbot-widget,
body.modal-open .floating-theme-toggle {
  visibility: hidden;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 375px) {
  #certificates .certificate-card__preview {
    padding: 0.55rem;
  }
}

@media (max-width: 319.98px) {
  body {
    min-width: 0;
  }

  .hero-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 575.98px) and (prefers-reduced-motion: reduce) {
  .stack-marquee {
    scroll-snap-type: x proximity;
  }

  .stack-skill {
    scroll-snap-align: center;
  }
}

/* A flexible vertical gallery gives every framed document enough presence. */
#certificates > .container {
  max-width: 620px;
}

#certificates .certificate-grid {
  display: flex !important;
  width: 100%;
  max-width: 460px;
  margin-inline: auto;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(1.1rem, 2.5vw, 1.35rem);
}

#certificates .certificate-card {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  flex: 0 0 auto;
  margin: 0;
}

@media (min-width: 768px) {
  #certificates > .container {
    max-width: 1120px;
  }

  #certificates .certificate-grid {
    max-width: none;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 1.25rem;
  }

  #certificates .certificate-card {
    width: auto;
    max-width: 520px;
    flex: 1 1 0;
  }
}

/* Lightweight first-load feedback that follows the Q&D palette. */
.site-loader {
  position: fixed;
  z-index: 3000;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--page-bg);
  color: var(--text);
  opacity: 1;
  transition: opacity 260ms ease, visibility 260ms ease;
}

.site-loader__content {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-raised);
  box-shadow: 0 10px 24px rgba(44, 57, 48, 0.1);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-loader__spinner {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  border: 2px solid rgba(162, 123, 92, 0.26);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: siteLoaderSpin 700ms linear infinite;
}

.site-loader.is-hidden {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

@keyframes siteLoaderSpin {
  to {
    transform: rotate(1turn);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-loader,
  .site-loader__spinner {
    animation: none;
    transition: none;
  }
}

/* Give the technical maze a clearer presence while retaining a quiet content layer. */
main > section::before,
main > section.section-pad::before,
body:not(.dark-mode) main > section.hero::before,
#certificates.certificates-section::before {
  opacity: 0.32 !important;
}

body.dark-mode main > section::before,
body.dark-mode main > section.section-pad::before,
body.dark-mode main > section.hero::before,
body.dark-mode #certificates.certificates-section::before {
  opacity: 0.4 !important;
}

@media (max-width: 575.98px) {
  main > section::before,
  main > section.section-pad::before,
  body:not(.dark-mode) main > section.hero::before,
  #certificates.certificates-section::before {
    opacity: 0.28 !important;
  }

  body.dark-mode main > section::before,
  body.dark-mode main > section.section-pad::before,
  body.dark-mode main > section.hero::before,
  body.dark-mode #certificates.certificates-section::before {
    opacity: 0.35 !important;
  }
}

/* Final dark-mode cleanup: neutral forest surfaces only, with no teal cast. */
body.dark-mode {
  --page-bg: #101512;
  --section-tint: #171d18;
  --surface: #1b231e;
  --surface-raised: #222b25;
  --text: #f0ecdf;
  --muted-text: #b9c0b5;
  --primary: #e5e0d2;
  --primary-hover: #f3efe4;
  --on-primary: #101512;
  --accent: #b68a68;
  --border: rgba(220, 215, 201, 0.16);
  --red: var(--primary);
  --red-dark: var(--primary-hover);
  --black: var(--text);
  --ink: var(--text);
  --muted: var(--muted-text);
  --line: var(--border);
  --soft: var(--section-tint);
  --soft-red: rgba(182, 138, 104, 0.12);
  --white: var(--surface-raised);
}

body.dark-mode .hero,
body.dark-mode .projects-section,
body.dark-mode .education-section,
body.dark-mode .contact-section {
  background: var(--page-bg) !important;
}

body.dark-mode .premium-skills-section,
body.dark-mode .experience-section,
body.dark-mode .testimonials-section,
body.dark-mode .soft-section,
body.dark-mode #certificates.certificates-section {
  background: var(--section-tint) !important;
}

body.dark-mode main > section::before,
body.dark-mode main > section.section-pad::before,
body.dark-mode main > section.hero::before,
body.dark-mode #certificates.certificates-section::before {
  opacity: 0.34 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cpath d='M12 12H88V48H48V88H124V128H84V172H160V208M208 12H152V52H188V92H132V132H168V172H12M12 208H52V168H92V128H52V88H12' fill='none' stroke='%23f0ecdf' stroke-opacity='.28' stroke-width='1.5'/%3E%3C/svg%3E") !important;
}

@media (max-width: 575.98px) {
  body.dark-mode main > section::before,
  body.dark-mode main > section.section-pad::before,
  body.dark-mode main > section.hero::before,
  body.dark-mode #certificates.certificates-section::before {
    opacity: 0.3 !important;
  }
}

/* Keep one background language only: the maze, without a second grid or glow layer. */
body::before,
body::after {
  display: none !important;
}

/* Square content blocks match the technical maze system without changing controls. */
.hero-flip-face,
.visitor-counter,
.hero-skill-float,
.profile-info-card,
.profile-value-card,
.premium-card,
.premium-card.is-inactive,
.project-card,
.resume-entry,
.timeline-item,
.commitment-card,
.testimonial-card,
.contact-info-panel,
.contact-form,
#certificates .certificate-card,
#certificates .certificate-card__preview,
#certificates .certificate-card__frame {
  border-radius: 0 !important;
}

/* Give square blocks a deliberate technical edge instead of a flat card treatment. */
.hero-flip-face,
.visitor-counter,
.hero-skill-float,
.profile-info-card,
.profile-value-card,
.premium-card,
.premium-card.is-inactive,
.project-card,
.resume-entry,
.timeline-item,
.commitment-card,
.testimonial-card,
.contact-info-panel,
.contact-form {
  border-top: 2px solid rgba(162, 123, 92, 0.72) !important;
  box-shadow:
    inset 0 0 0 1px rgba(44, 57, 48, 0.08),
    6px 6px 0 rgba(44, 57, 48, 0.13) !important;
}

body.dark-mode .hero-flip-face,
body.dark-mode .visitor-counter,
body.dark-mode .hero-skill-float,
body.dark-mode .profile-info-card,
body.dark-mode .profile-value-card,
body.dark-mode .premium-card,
body.dark-mode .premium-card.is-inactive,
body.dark-mode .project-card,
body.dark-mode .resume-entry,
body.dark-mode .timeline-item,
body.dark-mode .commitment-card,
body.dark-mode .testimonial-card,
body.dark-mode .contact-info-panel,
body.dark-mode .contact-form {
  border-top-color: rgba(182, 138, 104, 0.78) !important;
  box-shadow:
    inset 0 0 0 1px rgba(220, 215, 201, 0.07),
    6px 6px 0 rgba(0, 0, 0, 0.3) !important;
}

/* Explicit forest surfaces prevent legacy blue tones from leaking into key sections. */
body.dark-mode #skills,
body.dark-mode #experience,
body.dark-mode #education,
body.dark-mode #certificates,
body.dark-mode #testimonials {
  background: #151b16 !important;
}

/* Profile becomes a framed technical block instead of a plain portrait surface. */
.hero-visual {
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  padding: 0.65rem;
  border: 1px solid rgba(162, 123, 92, 0.58);
  background: linear-gradient(135deg, var(--surface-raised), var(--surface));
  box-shadow:
    inset 0 0 0 1px rgba(44, 57, 48, 0.08),
    8px 8px 0 rgba(44, 57, 48, 0.16);
}

.hero-visual::before {
  position: absolute;
  z-index: 0;
  inset: -0.38rem 0.38rem 0.38rem -0.38rem;
  border-bottom: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
  pointer-events: none;
  content: "";
}

.hero-visual .hero-flip-card {
  position: relative;
  z-index: 1;
}

body.dark-mode .hero-visual {
  border-color: rgba(182, 138, 104, 0.7);
  background: linear-gradient(135deg, #222b25, #171d18);
  box-shadow:
    inset 0 0 0 1px rgba(220, 215, 201, 0.08),
    8px 8px 0 rgba(0, 0, 0, 0.34);
}

/* Utility controls follow the same square technical language as the content blocks. */
.theme-toggle,
.scroll-top-btn,
.chatbot-toggle,
.chatbot-panel,
.chatbot-header button,
.chatbot-form button,
.star-rating button,
.visitor-counter-icon,
.status-icon {
  border-radius: 0 !important;
}

.theme-toggle,
.scroll-top-btn,
.chatbot-toggle {
  border-top: 2px solid var(--accent) !important;
  box-shadow:
    inset 0 0 0 1px rgba(44, 57, 48, 0.08),
    4px 4px 0 rgba(44, 57, 48, 0.15) !important;
}

.chatbot-panel {
  border-top: 2px solid var(--accent) !important;
  box-shadow:
    inset 0 0 0 1px rgba(44, 57, 48, 0.08),
    6px 6px 0 rgba(44, 57, 48, 0.16) !important;
}

body.dark-mode .theme-toggle,
body.dark-mode .scroll-top-btn,
body.dark-mode .chatbot-toggle,
body.dark-mode .chatbot-panel,
body.dark-mode .chatbot-header button,
body.dark-mode .chatbot-form button,
body.dark-mode .star-rating button,
body.dark-mode .visitor-counter-icon,
body.dark-mode .status-icon {
  border-color: var(--border) !important;
  background-color: var(--surface) !important;
  color: var(--text) !important;
}

body.dark-mode .theme-toggle,
body.dark-mode .scroll-top-btn,
body.dark-mode .chatbot-toggle,
body.dark-mode .chatbot-panel {
  border-top-color: var(--accent) !important;
  box-shadow:
    inset 0 0 0 1px rgba(220, 215, 201, 0.08),
    4px 4px 0 rgba(0, 0, 0, 0.34) !important;
}

.chatbot-form button,
body.dark-mode .chatbot-form button {
  border-color: var(--primary) !important;
  background: var(--primary) !important;
  color: var(--on-primary) !important;
}

/* One dark canvas: structure comes from the maze and technical edges, not green panels. */
body.dark-mode {
  --page-bg: #0d100e;
  --section-tint: #0d100e;
  --surface: #0d100e;
  --surface-raised: #0d100e;
  --soft: #0d100e;
  --white: #0d100e;
}

body.dark-mode,
body.dark-mode main,
body.dark-mode main > section,
body.dark-mode .hero,
body.dark-mode .premium-skills-section,
body.dark-mode .projects-section,
body.dark-mode .experience-section,
body.dark-mode .education-section,
body.dark-mode #certificates.certificates-section,
body.dark-mode .testimonials-section,
body.dark-mode .contact-section,
body.dark-mode .commitment-section,
body.dark-mode .site-footer {
  background: #0d100e !important;
}

body.dark-mode .hero-visual,
body.dark-mode .hero-flip-face,
body.dark-mode .visitor-counter,
body.dark-mode .hero-skill-float,
body.dark-mode .profile-info-card,
body.dark-mode .profile-value-card,
body.dark-mode .premium-card,
body.dark-mode .premium-card.is-inactive,
body.dark-mode .project-card,
body.dark-mode .resume-entry,
body.dark-mode .timeline-item,
body.dark-mode .commitment-card,
body.dark-mode .testimonial-card,
body.dark-mode .contact-info-panel,
body.dark-mode .contact-form,
body.dark-mode .chatbot-panel,
body.dark-mode .chatbot-form input,
body.dark-mode .bot-message,
body.dark-mode .contact-form input,
body.dark-mode .contact-form textarea,
body.dark-mode .resume-modal .modal-content,
body.dark-mode .project-status-modal .modal-content,
body.dark-mode .testimonial-modal .modal-content,
body.dark-mode #certificates .certificate-card {
  background: #0d100e !important;
}

/* Final blanket rule for every portfolio area and its non-image content blocks. */
body.dark-mode main > section,
body.dark-mode main > section > .container,
body.dark-mode .timeline-list,
body.dark-mode .skills-list span,
body.dark-mode .card-icon,
body.dark-mode .nav-arrow,
body.dark-mode .skill-tags li,
body.dark-mode .testimonial-track,
body.dark-mode .certificate-grid {
  background-color: #0d100e !important;
}

body.dark-mode .premium-skills-section {
  --skills-bg: #0d100e;
  --skills-card: #0d100e;
  --skills-chip-bg: #0d100e;
}

/* Keep section content on the same canvas: headings must not sit in dark rectangles. */
body.dark-mode main > section > .container {
  background: transparent !important;
}

body.dark-mode main > section,
body.dark-mode .premium-skills-section,
body.dark-mode .projects-section,
body.dark-mode .experience-section,
body.dark-mode .education-section,
body.dark-mode #certificates.certificates-section,
body.dark-mode .testimonials-section,
body.dark-mode .contact-section {
  background-color: #0d100e !important;
}

/* Pure black dark mode: remove every remaining blue, mint, or forest base tone. */
html:has(body.dark-mode),
body.dark-mode,
body.dark-mode main,
body.dark-mode main > section,
body.dark-mode .hero,
body.dark-mode .premium-skills-section,
body.dark-mode .projects-section,
body.dark-mode .experience-section,
body.dark-mode .education-section,
body.dark-mode #certificates.certificates-section,
body.dark-mode .testimonials-section,
body.dark-mode .contact-section,
body.dark-mode .commitment-section,
body.dark-mode .site-footer {
  background: #000 !important;
}

body.dark-mode {
  --page-bg: #000;
  --section-tint: #000;
  --surface: #000;
  --surface-raised: #000;
  --soft: #000;
  --white: #000;
}

/* Site-wide technical block language: no remaining pill, circle, or rounded-card treatment. */
body *,
body *::before,
body *::after {
  border-radius: 0 !important;
}

/* Project screenshots are restored as concise framed previews. */
#projects .project-image-wrap {
  display: block !important;
  height: auto !important;
  aspect-ratio: 16 / 8.5;
  padding: 0.32rem;
  border-top: 1px solid rgba(162, 123, 92, 0.72);
  border-bottom: 1px solid var(--border);
  background: var(--section-tint);
  overflow: hidden;
}

#projects .project-thumb {
  display: block;
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  object-position: top;
  filter: saturate(0.9) contrast(1.02);
}

#projects .project-card:hover .project-thumb {
  filter: saturate(1) contrast(1.04);
}

body.dark-mode #projects .project-image-wrap {
  background: #0d100e !important;
  border-top-color: rgba(182, 138, 104, 0.82);
}

/* Light footer uses the Q&D palette directly, with no legacy blue/teal gradient. */
body:not(.dark-mode) .site-footer {
  background: var(--qd-forest) !important;
  border-top: 2px solid var(--qd-wood) !important;
  color: var(--qd-cream) !important;
}

body:not(.dark-mode) .site-footer h2,
body:not(.dark-mode) .site-footer h3,
body:not(.dark-mode) .site-footer p,
body:not(.dark-mode) .site-footer a,
body:not(.dark-mode) .site-footer .footer-bottom {
  color: var(--qd-cream) !important;
}

body:not(.dark-mode) .site-footer .footer-social a,
body:not(.dark-mode) .site-footer .footer-social i {
  border-color: rgba(220, 215, 201, 0.24) !important;
  background: rgba(220, 215, 201, 0.06) !important;
  color: var(--qd-cream) !important;
}

body:not(.dark-mode) .site-footer .footer-social a:hover {
  border-color: var(--qd-wood) !important;
  background: rgba(162, 123, 92, 0.22) !important;
}

/* Match every dark section to the Projects canvas exactly. */
body.dark-mode {
  --projects-canvas: #000;
}

body.dark-mode #projects.projects-section,
body.dark-mode #skills.premium-skills-section,
body.dark-mode #experience.experience-section,
body.dark-mode #education.education-section,
body.dark-mode #certificates.certificates-section,
body.dark-mode #testimonials.testimonials-section,
body.dark-mode #contact.contact-section,
body.dark-mode .hero {
  background-color: var(--projects-canvas) !important;
  background-image: none !important;
}

body.dark-mode #projects.projects-section::before,
body.dark-mode #skills.premium-skills-section::before,
body.dark-mode #experience.experience-section::before,
body.dark-mode #education.education-section::before,
body.dark-mode #certificates.certificates-section::before,
body.dark-mode #testimonials.testimonials-section::before,
body.dark-mode #contact.contact-section::before,
body.dark-mode .hero::before {
  background-color: transparent !important;
}

/* Minimal semantic icons give every section heading a shared visual anchor. */
.stack-heading h2,
.project-section-title,
.portfolio-section-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.58rem;
}

.section-title-icon {
  display: inline-flex;
  width: 1.85rem;
  height: 1.85rem;
  flex: 0 0 1.85rem;
  align-items: center;
  justify-content: center;
  color: var(--qd-wood);
  font-size: 0.82em;
  line-height: 1;
}

body.dark-mode .section-title-icon {
  color: #e2b68f;
}

@media (max-width: 575.98px) {
  .section-title-icon {
    width: 1.65rem;
    height: 1.65rem;
    flex-basis: 1.65rem;
  }
}

/* Experience and education receive a quiet technical rail so their records feel intentional. */
#experience .resume-entry-grid,
#education .resume-entry-grid {
  position: relative;
  padding-top: 1.15rem;
}

#experience .resume-entry-grid::before,
#education .resume-entry-grid::before {
  position: absolute;
  top: 0.15rem;
  right: calc(var(--bs-gutter-x) * 0.5);
  left: calc(var(--bs-gutter-x) * 0.5);
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    var(--qd-wood) 0 2.2rem,
    transparent 2.2rem 3rem
  );
  opacity: 0.7;
  content: "";
}

#experience .resume-entry,
#education .resume-entry {
  position: relative;
  padding-left: 1.3rem;
}

#experience .resume-entry::before,
#education .resume-entry::before {
  position: absolute;
  top: 1rem;
  bottom: 1rem;
  left: 0;
  width: 3px;
  background: linear-gradient(var(--qd-wood) 0 42%, transparent 42% 55%, var(--qd-wood) 55% 100%);
  content: "";
}

#experience .resume-entry::after,
#education .resume-entry::after {
  position: absolute;
  top: 1rem;
  left: -0.22rem;
  width: 0.46rem;
  height: 0.46rem;
  border: 1px solid var(--qd-wood);
  background: var(--qd-cream);
  content: "";
}

body.dark-mode #experience .resume-entry-grid::before,
body.dark-mode #education .resume-entry-grid::before {
  opacity: 0.85;
}

body.dark-mode #experience .resume-entry::after,
body.dark-mode #education .resume-entry::after {
  background: #000;
}

/* Refined record detail: quiet blueprint corners replace the heavier timeline rail. */
#experience .resume-entry-grid,
#education .resume-entry-grid {
  padding-top: 0;
}

#experience .resume-entry-grid::before,
#education .resume-entry-grid::before {
  display: none;
}

#experience .resume-entry,
#education .resume-entry {
  padding-left: 1.05rem;
}

#experience .resume-entry::before,
#education .resume-entry::before {
  top: 0.65rem;
  right: auto;
  bottom: auto;
  left: 0.65rem;
  width: 0.92rem;
  height: 0.92rem;
  border-top: 1px solid var(--qd-wood);
  border-left: 1px solid var(--qd-wood);
  background: transparent;
}

/* Testimonial cards share one measured frame and a compact feedback header. */
#testimonials .testimonial-track .testimonial-card {
  display: flex;
  width: min(360px, calc(100vw - 48px));
  height: auto;
  min-height: 342px;
  flex: 0 0 auto;
  flex-direction: column;
  box-sizing: border-box;
  padding: 1.35rem;
}

#testimonials .testimonial-stars {
  align-items: center;
  min-height: 2.15rem;
  margin-bottom: 1rem;
  padding: 0.42rem 0.56rem;
  border-left: 3px solid var(--qd-wood);
  border-bottom: 1px solid rgba(162, 123, 92, 0.3);
  background: rgba(162, 123, 92, 0.08);
}

#testimonials .testimonial-stars i {
  color: var(--qd-wood) !important;
  font-size: 0.9rem;
}

#testimonials .testimonial-card > p {
  flex: 1 1 auto;
  margin-bottom: 1rem;
}

#testimonials .testimonial-card strong {
  padding-top: 0.7rem;
  border-top: 1px solid var(--border);
}

body.dark-mode #testimonials .testimonial-stars {
  border-bottom-color: rgba(226, 182, 143, 0.32);
  background: rgba(182, 138, 104, 0.1);
}

body.dark-mode #testimonials .testimonial-stars i {
  color: #e2b68f !important;
}

@media (max-width: 575.98px) {
  #testimonials .testimonial-track .testimonial-card {
    height: auto;
    min-height: 350px;
    padding: 1.15rem;
  }
}

/* Core Skills remains an icon carousel, now framed like a compact technical signal strip. */
#skills .stack-heading::after {
  width: 3.8rem;
  height: 2px;
  margin-top: 0.12rem;
  background: repeating-linear-gradient(
    90deg,
    var(--qd-wood) 0 0.72rem,
    transparent 0.72rem 1rem
  );
  opacity: 0.78;
  content: "";
}

#skills .stack-marquee {
  position: relative;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
  border-top: 1px solid rgba(162, 123, 92, 0.34);
  border-bottom: 1px solid rgba(162, 123, 92, 0.34);
}

#skills .stack-marquee::before,
#skills .stack-marquee::after {
  position: absolute;
  z-index: 1;
  top: -1px;
  width: 1.9rem;
  height: 3px;
  background: var(--qd-wood);
  content: "";
}

#skills .stack-marquee::before {
  left: clamp(1.25rem, 3vw, 2.5rem);
}

#skills .stack-marquee::after {
  right: clamp(1.25rem, 3vw, 2.5rem);
}

#skills .stack-skill {
  position: relative;
}

#skills .stack-skill::before {
  position: absolute;
  inset: 0.15rem 0.2rem 0.1rem;
  border-right: 1px solid rgba(162, 123, 92, 0.22);
  border-left: 1px solid rgba(162, 123, 92, 0.22);
  pointer-events: none;
  content: "";
}

#skills .stack-skill::after {
  position: absolute;
  bottom: 0;
  left: calc(50% - 2px);
  width: 4px;
  height: 4px;
  background: var(--qd-wood);
  opacity: 0.75;
  content: "";
}

body.dark-mode #skills .stack-marquee {
  border-color: rgba(226, 182, 143, 0.28);
}

body.dark-mode #skills .stack-skill::before {
  border-color: rgba(226, 182, 143, 0.2);
}

/* Ratings stay unmistakable on the black testimonial canvas. */
body.dark-mode #testimonials .testimonial-stars i,
body.dark-mode #testimonials .testimonial-card .testimonial-stars i {
  color: #d99d62 !important;
  text-shadow: 0 0 8px rgba(217, 157, 98, 0.2);
}

/* The feedback form uses a clear gold selected state, separate from card ratings. */
body.dark-mode #testimonialModal .star-rating button {
  border-color: rgba(226, 182, 143, 0.32) !important;
  background: #000 !important;
}

body.dark-mode #testimonialModal .star-rating button i {
  color: #765b46 !important;
}

body.dark-mode #testimonialModal .star-rating button.is-active {
  border-color: #d99d62 !important;
  background: rgba(217, 157, 98, 0.16) !important;
}

body.dark-mode #testimonialModal .star-rating button.is-active i {
  color: #f0b66f !important;
  text-shadow: 0 0 7px rgba(240, 182, 111, 0.28);
}

body:not(.dark-mode) #testimonialModal .star-rating button.is-active {
  border-color: var(--qd-wood) !important;
  background: rgba(162, 123, 92, 0.14) !important;
}

body:not(.dark-mode) #testimonialModal .star-rating button.is-active i {
  color: var(--qd-wood) !important;
}

/* Inputs need a gentle surface contrast while the page canvas stays pure black. */
body.dark-mode .contact-form input,
body.dark-mode .contact-form textarea,
body.dark-mode #testimonialModal input,
body.dark-mode #testimonialModal textarea,
body.dark-mode .chatbot-form input {
  border-color: rgba(226, 182, 143, 0.3) !important;
  background: #171a17 !important;
  color: #f0ecdf !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

body.dark-mode .contact-form input::placeholder,
body.dark-mode .contact-form textarea::placeholder,
body.dark-mode #testimonialModal input::placeholder,
body.dark-mode #testimonialModal textarea::placeholder,
body.dark-mode .chatbot-form input::placeholder {
  color: #9f968a !important;
  opacity: 1;
}

body.dark-mode .contact-form input:focus,
body.dark-mode .contact-form textarea:focus,
body.dark-mode #testimonialModal input:focus,
body.dark-mode #testimonialModal textarea:focus,
body.dark-mode .chatbot-form input:focus {
  border-color: #d99d62 !important;
  background: #1b1f1b !important;
  box-shadow: 0 0 0 3px rgba(217, 157, 98, 0.14) !important;
  outline: none;
}

/* Guided static prompts make Bal useful without an external AI service. */
.chatbot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  padding: 0.1rem 0.75rem 0.7rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-raised);
}

.chatbot-suggestions button {
  min-height: 1.75rem;
  padding: 0.25rem 0.45rem;
  border: 1px solid rgba(162, 123, 92, 0.45);
  background: transparent;
  color: var(--text);
  font-family: var(--font-body) !important;
  font-size: 0.61rem;
  font-weight: 600;
  line-height: 1.1;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.chatbot-suggestions button:hover,
.chatbot-suggestions button:focus-visible {
  border-color: var(--qd-wood);
  background: rgba(162, 123, 92, 0.16);
  color: var(--text);
  outline: none;
}

body.dark-mode .chatbot-suggestions {
  border-color: rgba(226, 182, 143, 0.22);
  background: #0d100e;
}

body.dark-mode .chatbot-suggestions button {
  border-color: rgba(226, 182, 143, 0.42);
  color: #f0ecdf;
}

body.dark-mode .chatbot-suggestions button:hover,
body.dark-mode .chatbot-suggestions button:focus-visible {
  border-color: #e2b68f;
  background: rgba(217, 157, 98, 0.16);
}


/* Make the technical maze visible enough to support, never compete with, the content. */
body:not(.dark-mode) main > section::before,
body:not(.dark-mode) main > section.section-pad::before,
body:not(.dark-mode) main > section.hero::before {
  opacity: 0.38 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cpath d='M12 12H88V48H48V88H124V128H84V172H160V208M208 12H152V52H188V92H132V132H168V172H12M12 208H52V168H92V128H52V88H12' fill='none' stroke='%232c3930' stroke-opacity='.38' stroke-width='1.5'/%3E%3C/svg%3E") !important;
}

body.dark-mode main > section::before,
body.dark-mode main > section.section-pad::before,
body.dark-mode main > section.hero::before {
  opacity: 0.38 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cpath d='M12 12H88V48H48V88H124V128H84V172H160V208M208 12H152V52H188V92H132V132H168V172H12M12 208H52V168H92V128H52V88H12' fill='none' stroke='%23f0ecdf' stroke-opacity='.38' stroke-width='1.5'/%3E%3C/svg%3E") !important;
}

/* Spacious mobile rhythm: readable cards, comfortable controls, and no cramped headings. */
@media (max-width: 767.98px) {
  main > section.section-pad,
  #skills.premium-skills-section {
    padding-block: clamp(3.25rem, 10vw, 4.5rem) !important;
  }

  .container {
    --bs-gutter-x: 1.2rem;
  }

  .portfolio-section-heading,
  #projects .project-section-heading,
  .stack-heading {
    margin-bottom: 1.6rem;
  }

  .portfolio-section-title,
  #projects .project-section-title,
  .stack-heading h2 {
    gap: 0.45rem;
    font-size: clamp(1.42rem, 7vw, 1.78rem) !important;
  }

  #projects .project-grid,
  .resume-entry-grid,
  .contact-layout {
    --bs-gutter-y: 1rem;
  }

  #projects .project-body,
  .resume-entry,
  .contact-info-panel,
  .contact-form {
    padding: 1.05rem !important;
  }

  #skills .stack-marquee {
    padding-right: 1rem;
    padding-left: 1rem;
  }

}

/* Final phone layout pass: preserve breathing room instead of compressing desktop blocks. */
@media (max-width: 575.98px) {
  body {
    overflow-x: hidden;
  }

  .container {
    --bs-gutter-x: 1.35rem;
  }

  main > section.section-pad,
  #skills.premium-skills-section {
    padding-block: 3.75rem !important;
  }

  .hero.section-pad {
    padding-top: 4.5rem !important;
    padding-bottom: 3.75rem !important;
  }

  .hero-layout {
    row-gap: 2rem;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .hero-actions .btn,
  .project-actions .btn,
  .contact-form__actions .btn {
    min-height: 2.9rem;
  }

  .portfolio-section-heading,
  #projects .project-section-heading,
  .stack-heading {
    margin-bottom: 1.9rem;
  }

  #projects .project-grid,
  .resume-entry-grid,
  .contact-layout {
    --bs-gutter-y: 1.25rem;
  }

  #projects .project-body,
  .resume-entry,
  .contact-info-panel,
  .contact-form {
    padding: 1.2rem !important;
  }

  #certificates .certificate-grid {
    gap: 1.5rem;
  }

  #testimonials .testimonial-track .testimonial-card {
    width: calc(100vw - 2.7rem);
    height: auto;
    min-height: 360px;
  }

  .modal-dialog {
    margin: 0.85rem;
  }
}

#experience .resume-entry::after,
#education .resume-entry::after {
  top: auto;
  right: 0.65rem;
  bottom: 0.65rem;
  left: auto;
  width: 0.92rem;
  height: 0.92rem;
  border-right: 1px solid var(--qd-wood);
  border-bottom: 1px solid var(--qd-wood);
  background: transparent;
}
