@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&family=Roboto:wght@400;500&display=swap');

/* -------------------------
   Base + Theme Tokens
-------------------------- */
:root {
  /* light theme */
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-border: #e5e7eb;

  --panel: #FFEAD3;
  --panel-border: #9E3B3B;

  --accent: #B4535A;
  --text: #1f2937;
  --muted: #6b7280;

  --link: #2563eb;
  --link-hover: #1d4ed8;

  --ring: rgba(180, 83, 90, 0.35);
  --shadow: rgba(0, 0, 0, 0.12);

  --media-bg: #ffffff;
  --dot: #d1d5db;

  /* NEW: hero bg token so it can switch in dark mode */
  --hero-bg: #fff7ed;
}

/* Dark theme overrides (works with your JS: data-theme="dark") */
:root[data-theme="dark"] {
  --bg: #0b0f14;
  --surface: #0f172a;
  --surface-border: rgba(255, 255, 255, 0.10);

  --panel: #111827;
  --panel-border: rgba(180, 83, 90, 0.55);

  --text: #e5e7eb;
  --muted: #9ca3af;

  --link: #93c5fd;
  --link-hover: #bfdbfe;

  --ring: rgba(147, 197, 253, 0.35);
  --shadow: rgba(0, 0, 0, 0.45);

  --media-bg: #0b1220;
  --dot: rgba(255, 255, 255, 0.22);

  /* NEW: hero bg token in dark mode */
  --hero-bg: color-mix(in srgb, var(--accent) 14%, var(--surface));
}

/* -------------------------
   Resets + Accessibility
-------------------------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Roboto", sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 10px;
  z-index: 999;
}

.skip-link:focus {
  left: 12px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* -------------------------
   Nav
-------------------------- */
.site-nav {
  background: var(--surface);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--surface-border);
}

.brand {
  margin: 0;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.2px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-link {
  color: var(--text);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background-color 160ms ease, transform 160ms ease;
}

.nav-link:hover {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  transform: translateY(-1px);
}

.nav-link:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

/* -------------------------
   Dark Mode Toggle Button
-------------------------- */
.theme-toggle {
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px var(--shadow);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

:root[data-theme="dark"] .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

.theme-toggle:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
}

/* -------------------------
   Shared Link “pill” style
-------------------------- */
.icon-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.icon-link:hover {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  box-shadow: 0 6px 18px var(--shadow);
  transform: translateY(-1px);
  text-decoration: none;
}

.icon-link:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
}

/* -------------------------
   Hero (About) + Contact Hero
-------------------------- */
.hero,
.contact-hero {
  background: var(--hero-bg);
  border-bottom: 1px solid var(--surface-border);
  padding: 26px 16px;
}

.hero-inner {
  max-width: 1020px;
  margin: 0 auto;
}

.hero-top {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.hero img {
  border-radius: 999px;
  border: 4px solid var(--accent);
}

.hero-text h1,
.contact-hero h1 {
  font-family: "Poppins", sans-serif;
  margin: 0 0 8px 0;
  font-weight: 700;
  color: var(--accent);
}

.address {
  margin: 6px 0 4px 0;
  color: var(--muted);
}

.tagline {
  margin: 8px 0 0 0;
  color: var(--text);
  /* FIX: no more hard-coded light text */
}

.quick-links {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px var(--shadow);
  background: #9F3F45;
}

.btn:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
}

.btn-outline:hover {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--text);
}

/* -------------------------
   Panels / Sections
-------------------------- */
main {
  padding: 12px 0 26px 0;
}

.panel {
  max-width: 980px;
  margin: 18px auto;
  padding: 18px;
  background: var(--panel);
  border-radius: 14px;
  border: 2px solid var(--panel-border);
}

.panel h2 {
  font-family: "Poppins", sans-serif;
  margin: 0 0 10px 0;
  color: var(--panel-border);
  display: inline-block;
  padding-bottom: 4px;
  border-bottom: 2px solid color-mix(in srgb, var(--panel-border) 35%, transparent);
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.subtext {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* DL styling */
.two-col-dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
  margin: 0;
}

.two-col-dl dt {
  font-weight: 700;
}

.two-col-dl dd {
  margin: 0;
  color: var(--text);
  /* FIX: was hard-coded */
}

.stacked-dl {
  margin: 0;
  display: grid;
  gap: 12px;
}

.dl-row dt {
  font-weight: 700;
}

.dl-row dd {
  margin: 0;
  color: var(--text);
  /* FIX: was hard-coded */
}

.ext-link {
  color: var(--link);
  text-decoration: none;
}

.ext-link:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.ext-link:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

/* readability polish */
.bullets li,
.panel ul li {
  margin-bottom: 6px;
}

.panel a {
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* -------------------------
   Skill bubbles
-------------------------- */
.skill-bubbles {
  list-style: none;
  margin: 12px 0 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-bubbles li {
  padding: 8px 12px;
  border: 2px solid var(--panel-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 70%, var(--accent) 18%);
  color: var(--panel-border);
  font-weight: 600;
  font-size: 0.95rem;
}

/* -------------------------
   Projects grid + cards (BIGGER!)
-------------------------- */
#projects.panel {
  max-width: 1140px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

@media (min-width: 1200px) {
  .projects-grid {
    gap: 22px;
  }
}

.card.is-hidden {
  display: none !important;
}


.card {
  background: var(--panel);
  border-radius: 16px;
  padding: 16px;
  border: 2px solid var(--panel-border);
  transition: transform 180ms ease, box-shadow 180ms ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px var(--shadow);
}

.card h3 {
  margin: 0 0 8px 0;
  font-family: "Poppins", sans-serif;
  color: color-mix(in srgb, var(--panel-border) 85%, black);
}

.bullets {
  margin: 12px 0 0 18px;
  padding: 0;
}

/* Tech badges */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 10px 0;
}

.badge {
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--text);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
}

/* Project toolbar (search + chips) */
.projects-toolbar {
  display: grid;
  gap: 12px;
  margin: 12px 0 8px 0;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  padding: 10px 12px;
}

.search-wrap i {
  color: var(--muted);
}

#projectSearch {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
}

#projectSearch::placeholder {
  color: var(--muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px var(--shadow);
}

.chip.active {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 45%, var(--surface-border));
}

.results-note {
  margin: 0 0 10px 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* -------------------------
   Media (image + slider) — FIXED FOR DARK MODE
-------------------------- */
.project-img {
  width: 100%;
  height: 420px;
  object-fit: contain;
  background: var(--media-bg);
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  margin: 10px 0;
}

.slider {
  position: relative;
  margin: 10px 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--surface-border);
  background: var(--media-bg);
}

.slides {
  position: relative;
}

.slide {
  width: 100%;
  height: 420px;
  object-fit: contain;
  background: var(--media-bg);
  display: none;
}

.slide.active {
  display: block;
}

/* arrows */
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  cursor: pointer;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text);
  font-size: 28px;
  line-height: 48px;
  box-shadow: 0 12px 26px var(--shadow);
}

.slider-btn.prev {
  left: 12px;
}

.slider-btn.next {
  right: 12px;
}

.slider-btn:hover {
  transform: translateY(-50%) scale(1.06);
}

.dots {
  display: flex;
  gap: 7px;
  justify-content: center;
  padding: 10px 0 12px;
  background: var(--media-bg);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: var(--dot);
}

.dot.active {
  background: var(--accent);
}

@media (hover: hover) and (pointer: fine) {
  .slider-btn {
    opacity: 0;
    transition: opacity 160ms ease;
  }

  .slider:hover .slider-btn {
    opacity: 1;
  }
}

/* -------------------------
   Contact page (match aesthetic + nicer form)
-------------------------- */
.one-col {
  max-width: 760px;
  margin: 18px auto;
}

.contact-form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.contact-form label {
  font-weight: 600;
  color: var(--text);
  /* FIX */
}

.contact-form input,
.contact-form textarea {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
}

.contact-form textarea {
  resize: vertical;
}

.contact-form input:hover,
.contact-form textarea:hover {
  border-color: color-mix(in srgb, var(--accent) 65%, var(--surface-border));
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
}

.contact-form button {
  padding: 10px 12px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 700;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.contact-form button:hover {
  background: #9F3F45;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px var(--shadow);
}

/* -------------------------
   Footer
-------------------------- */
.site-footer {
  background: var(--surface);
  color: var(--muted);
  padding: 16px;
  display: flex;
  justify-content: center;
  gap: 18px;
  align-items: center;
  border-top: 1px solid var(--surface-border);
}

.site-footer p {
  margin: 0;
}

.footer-link {
  color: var(--link);
  text-decoration: none;
}

.footer-link:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* -------------------------
   Back to top button
-------------------------- */
.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  display: grid;
  place-items: center;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 12px 26px var(--shadow);
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.to-top:hover {
  transform: translateY(-2px);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  box-shadow: 0 14px 30px var(--shadow);
}

.to-top:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
}

/* -------------------------
   Responsive
-------------------------- */
@media (max-width: 980px) {
  #projects.panel {
    max-width: 980px;
  }

  .slide,
  .project-img {
    height: 360px;
  }
}

@media (max-width: 760px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .slide,
  .project-img {
    height: 300px;
  }
}

@media (max-width: 680px) {
  .site-nav {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .two-col-dl {
    grid-template-columns: 1fr;
  }

  .slider-btn {
    width: 40px;
    height: 40px;
    font-size: 22px;
    line-height: 40px;
  }
}