/* =========================================================
   enhance.css — modern UI layer on top of main.css
   Loaded after main.css so these rules win the cascade.
   Theming driven by `body.night` (toggled in js/main.js).
   ========================================================= */

:root {
  --accent: #2f7bff;
  --accent-2: #00c2a8;
  --accent-glow: rgba(47, 123, 255, 0.18);
  --bg: #fbfcff;
  --text: #444452;
  --heading: #1d1d27;
  --muted: #6a6a7a;
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-border: rgba(20, 30, 60, 0.1);
  --card-shadow: 0 10px 30px -16px rgba(24, 40, 90, 0.28);
  --pill-bg: rgba(47, 123, 255, 0.08);
}

body.night,
html.night {
  --accent: #6aa8ff;
  --accent-2: #3fe0c5;
  --accent-glow: rgba(106, 168, 255, 0.16);
  --bg: #0f1320;
  --text: #b6b6c6;
  --heading: #f2f3f7;
  --muted: #8c8ca0;
  --card-bg: rgba(255, 255, 255, 0.035);
  --card-border: rgba(255, 255, 255, 0.09);
  --card-shadow: 0 16px 40px -20px rgba(0, 0, 0, 0.7);
  --pill-bg: rgba(106, 168, 255, 0.12);
}

html {
  scroll-behavior: smooth;
}

body,
html {
  background-color: var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", Apercu, "Source Sans Pro", system-ui,
    -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  transition: background-color 0.4s ease, color 0.4s ease;
}

body.night {
  background-color: var(--bg);
  color: var(--text);
}

::selection {
  background: var(--accent);
  color: #fff;
}
body.night ::selection {
  background: var(--accent-2);
  color: #0f1320;
}

strong {
  color: var(--heading);
}

/* ---------- Ambient aurora background ---------- */
.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(40% 50% at 12% 8%, var(--accent-glow), transparent 60%),
    radial-gradient(38% 44% at 92% 22%, rgba(0, 194, 168, 0.12), transparent 60%),
    radial-gradient(45% 50% at 78% 96%, var(--accent-glow), transparent 62%);
  opacity: 0.9;
  transition: opacity 0.4s ease;
}

#site {
  position: relative;
  z-index: 1;
}

/* ---------- Intro / hero ---------- */
.intro__hello {
  font-weight: 500;
  letter-spacing: -0.5px;
  color: var(--heading);
}

.intro__tagline {
  font-weight: 400;
  letter-spacing: -0.5px;
  color: var(--heading);
  line-height: 1.25;
}

.intro__tagline .name {
  font-weight: 700;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.intro__role {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--muted);
  margin: 4px 0 26px;
  letter-spacing: 0.2px;
}
.intro__role .intro__role-at {
  color: var(--accent);
  margin: 0 2px;
  font-weight: 700;
}
.intro__role .underline-link {
  color: var(--heading);
  font-weight: 700;
}
body.night .intro__role .underline-link {
  color: var(--heading);
}

@media screen and (max-width: 550px) {
  .intro__role {
    font-size: 1rem;
  }
}

/* ---------- Section titles ---------- */
.section__title {
  color: var(--accent);
  position: relative;
  font-weight: 700;
}
.section__title::before {
  content: "";
  position: absolute;
  top: 0.65em;
  right: -36px;
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
@media screen and (max-width: 768px) {
  .section__title::before {
    right: auto;
    left: 0;
    top: 1.8em;
  }
  .section__content {
    padding-top: 42px;
  }
}

/* ---------- Skills as cards + pills ---------- */
.skills .section__content {
  max-width: 760px;
}
.skills .skillz {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
}
.skills .skillz__category {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 18px 20px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: transform 0.25s ease, border-color 0.25s ease,
    box-shadow 0.25s ease;
}
.skills .skillz__category:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--card-shadow);
}
.skills .skillz__category__label {
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 1.2px;
  margin-bottom: 12px;
}
body.night .skills .skillz__category__label {
  color: var(--accent);
}
.skills .skillz__category ul {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.skills .skillz__category__item {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 8px;
  background: var(--pill-bg);
  color: var(--text);
  border: 1px solid var(--card-border);
  line-height: 1.35;
}

/* The legacy mobile rule pins categories to 47% width; let the grid size them. */
@media screen and (max-width: 630px) {
  .skills .skillz__category {
    width: auto;
    margin-right: 0;
    margin-bottom: 0;
  }
}

/* ---------- Experience cards ---------- */
.experience .section__content {
  max-width: 720px;
}
.experience .jobs {
  margin-bottom: 48px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.experience .job {
  margin-bottom: 0;
  padding: 22px 24px;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background: var(--card-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease,
    box-shadow 0.25s ease;
}
.experience .job::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity 0.25s ease;
}
.experience .job:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--card-shadow);
}
.experience .job:hover::before {
  opacity: 1;
}
.experience .job__company {
  font-weight: 700;
  font-size: 1.05rem;
}
.experience .job__company a {
  color: var(--heading);
}
.experience .job__company a:hover {
  color: var(--accent);
}
.experience .job__position {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
  margin-top: 2px;
}
.experience .job__time {
  color: var(--muted);
}
body.night .experience .job__time {
  color: var(--muted);
}
.job__summary {
  margin: 12px 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
}

/* ---------- Projects grid + cards ---------- */
.projects .section__content {
  max-width: 760px;
}
.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.projects .project {
  max-width: none;
  margin-bottom: 0;
  padding: 24px;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  background: var(--card-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease,
    box-shadow 0.25s ease;
}
.projects .project:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: var(--card-shadow);
}
.projects .project__name {
  margin-bottom: 12px;
}
.projects .project__name a {
  font-size: 1.05rem;
  color: var(--heading);
  white-space: normal; /* allow long titles to wrap inside the card */
}
.projects .project__name a:after {
  white-space: nowrap;
}
.projects .project__name a:hover {
  color: var(--accent);
}
.projects .project p {
  color: var(--text);
  flex: 1;
}
.projects .project__used {
  margin-top: 14px;
}
.projects .project__used__item {
  color: var(--accent);
  border-color: var(--card-border);
  background: var(--pill-bg);
}

/* ---------- Awards ---------- */
.achievements .section__content {
  max-width: 700px;
}
.awards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.award {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  background: var(--card-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 0.95rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.award:hover {
  transform: translateX(4px);
  border-color: var(--accent);
}
.award__marker {
  color: var(--accent);
  font-size: 1.05rem;
  line-height: 1.5;
}
.award__text {
  color: var(--text);
}

/* ---------- Links / underline accent ---------- */
.section__content .underline-link:after {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  height: 2px;
}
body.night .section__content .underline-link:after {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.arrow-link {
  color: var(--accent);
}
/* The original img/arrow.png asset is missing — draw the arrow in CSS. */
.arrow-link:after,
.experience .arrow-link:after {
  background: none;
  content: "\2192"; /* → */
  width: auto;
  height: auto;
  font-weight: 700;
  bottom: 0;
  margin-left: 8px;
}

/* highlight links keep the slide-fill but use the accent var */
.intro__contact .highlight-link {
  -webkit-box-shadow: inset 0 -3px 0 var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent);
}
.intro__contact .highlight-link:hover {
  -webkit-box-shadow: inset 0 -33px 0 0 var(--accent);
  box-shadow: inset 0 -33px 0 0 var(--accent);
}

/* ---------- Footer ---------- */
.footer__links a {
  color: var(--accent) !important;
}
.footer__links a:after {
  background: var(--accent);
}

/* ---------- Reveal animation: gentle blur-in ---------- */
.waypoint {
  filter: blur(2px);
}
.in-view {
  filter: blur(0);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
