/* ---------- tokens ---------- */
:root {
  --bg: #f7f6f3;
  --bg-alt: #ffffff;
  --ink: #14151a;
  --ink-soft: #52545e;
  --ink-faint: #8a8c96;
  --line: rgba(20, 21, 26, 0.1);
  --accent: #5b5bf0;
  --accent-2: #ff6b57;
  --accent-soft: rgba(91, 91, 240, 0.1);
  --card: #ffffff;
  --shadow: 0 12px 30px -14px rgba(20, 21, 26, 0.16);
  --radius: 18px;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
}

:root[data-theme="dark"] {
  --bg: #101014;
  --bg-alt: #0b0b0e;
  --ink: #f3f3f5;
  --ink-soft: #b5b6c0;
  --ink-faint: #74757f;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #8f8fff;
  --accent-2: #ff8a76;
  --accent-soft: rgba(143, 143, 255, 0.14);
  --card: #16161c;
  --shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101014;
    --bg-alt: #0b0b0e;
    --ink: #f3f3f5;
    --ink-soft: #b5b6c0;
    --ink-faint: #74757f;
    --line: rgba(255, 255, 255, 0.1);
    --accent: #8f8fff;
    --accent-2: #ff8a76;
    --accent-soft: rgba(143, 143, 255, 0.14);
    --card: #16161c;
    --shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--ink);
}

p { margin: 0; color: var(--ink-soft); }
a { color: inherit; text-decoration: none; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
}

.bg-photo {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url('assets/caron-profile.jpg');
  background-size: cover;
  background-position: center 15%;
  opacity: 0.055;
  filter: grayscale(70%) blur(2px);
  transition: opacity 0.3s ease;
}
:root[data-theme="dark"] .bg-photo {
  opacity: 0.07;
  filter: grayscale(85%) blur(2px);
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
  background-image: radial-gradient(circle at 15% 20%, var(--accent-soft), transparent 40%),
                     radial-gradient(circle at 85% 0%, rgba(255,107,87,0.08), transparent 45%);
}

/* ---------- scroll progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 100;
  transition: width 0.1s linear;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
}
.logo .dot { color: var(--accent); }

.nav {
  display: flex;
  gap: 28px;
}
.nav a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}
.nav a:hover { color: var(--ink); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-switch {
  position: relative;
  width: 60px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.ts-icon {
  width: 16px;
  height: 16px;
  color: var(--ink-faint);
  position: relative;
  z-index: 1;
  pointer-events: none;
}
.ts-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 2px 8px rgba(20, 21, 26, 0.28);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}
:root[data-theme="dark"] .theme-switch .ts-thumb {
  transform: translateX(26px);
}

.nav-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.nav-toggle span {
  width: 16px;
  height: 1.5px;
  background: var(--ink);
  display: block;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.94rem;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
:root[data-theme="dark"] .btn-primary,
@media (prefers-color-scheme: dark) { }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--accent); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: 100px 0 80px;
  display: flex;
  align-items: center;
  gap: 40px;
  z-index: 1;
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(480px circle at var(--gx, 50%) var(--gy, 30%), var(--accent-soft), transparent 65%);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.hero:hover .hero-glow { opacity: 1; }
.hero-inner { flex: 1; }

.eyebrow {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.08;
  max-width: 850px;
  font-weight: 700;
}
.grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin-top: 24px;
  font-size: 1.08rem;
  max-width: 620px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 34px;
  flex-wrap: wrap;
}

.hero-links {
  display: flex;
  gap: 22px;
  margin-top: 30px;
}
.hero-links a {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-faint);
  border-bottom: 1px solid transparent;
}
.hero-links a:hover { color: var(--ink); border-color: var(--ink); }

.hero-avatar { flex-shrink: 0; }
.avatar-ring {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  padding: 5px;
}
.avatar-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  border: 3px solid var(--bg);
}
.avatar-ring span {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  color: #fff;
}

/* ---------- sections ---------- */
.section {
  padding: 90px 0;
  position: relative;
  z-index: 1;
}
.section-alt {
  background: color-mix(in srgb, var(--accent) 6%, var(--bg));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section-tag {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.section-title {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  margin-bottom: 14px;
}
.section-sub {
  max-width: 560px;
  margin-bottom: 40px;
}
.section-sub a { color: var(--accent); font-weight: 600; }

/* about */
.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr;
  gap: 50px;
}
.about-lead {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.35;
}
.about-body p { margin-bottom: 18px; }
.about-body strong { color: var(--ink); }

/* work list */
.work-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.work-item {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 28px;
  padding: 40px 0;
  border-top: 1px solid var(--line);
  position: relative;
  transition: transform 0.35s ease, opacity 0.35s ease, filter 0.35s ease;
}
.work-item:last-child { border-bottom: 1px solid var(--line); }

@media (hover: hover) and (pointer: fine) {
  .work-list:hover .work-item {
    opacity: 0.5;
    filter: blur(1.5px);
  }
  .work-list:hover .work-item:hover {
    opacity: 1;
    filter: blur(0);
    transform: scale(1.02);
    z-index: 2;
    background: var(--card);
    border-radius: var(--radius);
    border-top-color: transparent;
    box-shadow: var(--shadow);
  }
}
.work-num {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--ink-faint);
  font-weight: 600;
  padding-top: 4px;
}
.work-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.work-head h3 {
  font-size: 1.4rem;
}
.work-meta {
  font-size: 0.85rem;
  color: var(--ink-faint);
  font-weight: 500;
  white-space: nowrap;
}
.work-body {
  display: flex;
  align-items: center;
  gap: 40px;
}
.work-item.flip .work-body {
  flex-direction: row-reverse;
}
.work-content { flex: 1 1 auto; min-width: 0; }
.work-content p { max-width: 700px; }
.work-visual {
  flex: 0 0 220px;
  width: 220px;
}
.work-visual svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 16px 26px rgba(20, 21, 26, 0.18));
}
.work-stats {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
}
.work-stats li {
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.work-stats strong {
  color: var(--ink);
  font-family: var(--font-display);
}
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.tag {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* repo grid */
.repo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.repo-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: block;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.repo-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}
.repo-thumb {
  position: relative;
  aspect-ratio: 1200 / 630;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.repo-thumb svg {
  width: 100%;
  height: 100%;
  display: block;
}
.repo-card:hover .repo-thumb svg {
  transform: scale(1.03);
  transition: transform 0.4s ease;
}
.repo-card-body { padding: 20px 22px 24px; }
.repo-card-body h4 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.repo-card-body p {
  font-size: 0.9rem;
}
.see-all { margin-top: 34px; }

/* skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px 40px;
  margin-bottom: 50px;
}
.skill-group h4 {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--ink-faint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--font-body);
}

.cert-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}
.cert-pill {
  flex: 1 1 220px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.cert-logo {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cert-logo svg { width: 22px; height: 22px; }
.cert-logo-aws,
.cert-logo-edu {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.cert-logo-ms {
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 7px;
}
.cert-logo-ms svg { width: 100%; height: 100%; }
.cert-text { min-width: 0; }
.cert-pill strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.98rem;
  margin-bottom: 4px;
}
.cert-pill span {
  font-size: 0.85rem;
  color: var(--ink-faint);
}

/* resume */
.resume-panel {
  display: flex;
  align-items: center;
  gap: 46px;
}
.resume-icon {
  flex: 0 0 120px;
  width: 120px;
}
.resume-icon svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 14px 24px rgba(20, 21, 26, 0.18));
}
.resume-content { flex: 1 1 auto; }
.resume-content .section-title { margin-bottom: 14px; }
.resume-content .section-sub { margin-bottom: 30px; }
.resume-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* contact */
.contact { text-align: center; }
.contact-inner { display: flex; flex-direction: column; align-items: center; }
.contact .section-sub { margin-left: auto; margin-right: auto; }
.contact-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

/* footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px 0 50px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.85rem;
  color: var(--ink-faint);
}
.footer-links { display: flex; gap: 20px; }
.footer-links a:hover { color: var(--ink); }

/* ---------- scroll to top ---------- */
.scroll-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}
.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.scroll-top:hover { transform: translateY(-3px); }

/* ---------- reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.hero-inner .reveal:nth-child(1) { transition-delay: 0s; }
.hero-inner .reveal:nth-child(2) { transition-delay: 0.08s; }
.hero-inner .reveal:nth-child(3) { transition-delay: 0.16s; }
.hero-inner .reveal:nth-child(4) { transition-delay: 0.24s; }
.hero-inner .reveal:nth-child(5) { transition-delay: 0.32s; }
.hero-avatar.reveal { transition-delay: 0.2s; }

/* ---------- marquee ---------- */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  background: var(--bg-alt);
  position: relative;
  z-index: 1;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 34s linear infinite;
}
.marquee-track span {
  display: inline-flex;
  align-items: center;
  padding: 16px 28px;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-faint);
  white-space: nowrap;
  position: relative;
}
.marquee-track span::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 28px;
  opacity: 0.6;
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}

/* ---------- worked-with ---------- */
.worked-with {
  position: relative;
  z-index: 1;
  padding: 56px 0 60px;
  text-align: center;
}
.worked-with-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 30px;
}
.logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 56px;
  row-gap: 28px;
}
.wm {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink-faint);
  letter-spacing: -0.01em;
  filter: grayscale(100%);
  opacity: 0.75;
  transition: opacity 0.25s ease, filter 0.25s ease, color 0.25s ease;
  cursor: default;
}
.wm:hover {
  opacity: 1;
  filter: grayscale(0%);
}
.wm-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wm-logo {
  height: 30px;
  width: auto;
  object-fit: contain;
  display: block;
}
.wm-logo[alt="CSG International"] {
  height: 42px;
}
.wm-logo-savvysaver {
  height: 46px;
}
.wm-logo-mono {
  opacity: 0.6;
  filter: grayscale(100%);
  transition: opacity 0.25s ease, filter 0.25s ease;
}
.wm-item:hover .wm-logo-mono {
  opacity: 1;
  filter: grayscale(0%);
}
:root[data-theme="dark"] .wm-logo-invert {
  filter: grayscale(100%) invert(1) brightness(1.6);
}
:root[data-theme="dark"] .wm-item:hover .wm-logo-invert {
  filter: grayscale(0%) invert(1) brightness(1.6);
}
.wm-sub {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  font-style: italic;
  color: var(--ink-faint);
  opacity: 0.75;
}

@media (max-width: 720px) {
  .logo-row { gap: 32px; row-gap: 20px; }
  .wm { font-size: 1.2rem; }
  .wm-logo { height: 24px; }
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 24px; }
  .repo-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .hero { flex-direction: column-reverse; text-align: left; padding-top: 60px; }
  .hero-avatar { align-self: flex-start; }
  .resume-panel { flex-direction: column; text-align: center; gap: 26px; }
  .resume-actions { justify-content: center; }
}

@media (max-width: 720px) {
  .nav {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 20px 28px 26px;
    gap: 18px;
    transform: translateY(-130%);
    transition: transform 0.3s ease;
  }
  .nav.open { transform: translateY(0); }
  .nav-toggle { display: flex; }
  .work-item { grid-template-columns: 1fr; }
  .work-num { display: none; }
  .work-body,
  .work-item.flip .work-body {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 20px;
  }
  .work-visual { width: 100%; flex-basis: auto; max-width: 220px; margin: 0 auto; }
}
