:root{
  --bg: #f4faf8;
  --bg-soft: #dff3ee;
  --surface: #ffffff;
  --ink: #0d3b3d;
  --ink-soft: #4a7373;
  --accent: #178a8a;
  --accent-2: #3fb6a8;
  --accent-3: #7fd4c1;
  --coral: #ff8b6b;
  --coral-soft: #ffe3d8;
  --yellow: #f4c95d;
  --pastel-mint: #c9f0e3;
  --pastel-sky: #cfe9f3;
  --pastel-pink: #ffdcdf;
  --line: #cfe7e3;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Baloo 2", var(--sans);
}

html[data-theme="dark"]{
  --bg: #0b2120;
  --bg-soft: #12302e;
  --surface: #123130;
  --ink: #eaf6f2;
  --ink-soft: #9bcac1;
  --coral-soft: #3a2622;
  --pastel-mint: #1c3f3a;
  --pastel-sky: #1a3540;
  --pastel-pink: #40192d;
  --line: #21453f;
}

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

body{
  background:
    radial-gradient(900px 500px at 90% -10%, var(--bg-soft), transparent 60%),
    radial-gradient(700px 400px at -10% 30%, var(--coral-soft), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.65;
  padding: 0 1.25rem 5rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a{ color: inherit; }
:focus-visible{ outline: 2px solid var(--accent); outline-offset: 3px; }

.glitter{ position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.sparkle{
  position: absolute; font-size: 0.9rem; color: var(--accent-2);
  opacity: 0.5; animation: twinkle 2.6s ease-in-out infinite;
}
.sparkle:nth-child(2n){ color: var(--coral); font-size: 0.65rem; }
.sparkle:nth-child(3n){ color: var(--pastel-sky); font-size: 1rem; }
@keyframes twinkle{
  0%, 100%{ opacity: 0.12; transform: scale(0.7); }
  50%{ opacity: 0.7; transform: scale(1.1); }
}
@media (prefers-reduced-motion: reduce){ .sparkle{ animation: none; opacity: 0.3; } }

.container{ max-width: 860px; margin: 0 auto; }

/* ---------- Sticky header (banner + nav stack together, always aligned) ---------- */
.site-header{
  position: sticky;
  top: 0;
  z-index: 30;
  width: calc(100% + 2.5rem);
  margin: 0 -1.25rem;
}

/* ---------- Scrolling top banner ---------- */
.ticker-bar{
  width: 100%;
  overflow: hidden;
  background: linear-gradient(90deg,
    var(--pastel-mint) 0%,
    var(--accent-3) 35%,
    var(--pastel-sky) 70%,
    var(--pastel-mint) 100%);
  color: var(--ink);
  border-bottom: 1.5px solid var(--surface);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

html[data-theme="dark"] .ticker-bar{
  background: linear-gradient(90deg,
    var(--bg-soft) 0%,
    #1f5b52 35%,
    var(--pastel-sky) 70%,
    var(--bg-soft) 100%);
  border-bottom-color: var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.ticker-track{
  display: inline-block;
  width: max-content;
  animation: ticker-scroll 6.5s linear infinite;
}
.ticker-track span{
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  padding: 0.5rem 0;
  white-space: nowrap;
  display: inline-block;
  font-weight: 500;
}
.ticker-track span::after{ content: "  ✦  welcome to my portfolio!  ✦  glad you're here ^_^  ✦  take a look around!  ✦ "; }
@keyframes ticker-scroll{
  0%{ transform: translateX(100vw); }
  60%{ transform: translateX(-100%); }
  100%{ transform: translateX(-100%); }
}
@media (prefers-reduced-motion: reduce){ .ticker-track{ animation: none; transform: translateX(0); } }

/* ---------- Windows-style window chrome ---------- */
.win{
  background: var(--surface);
  border: 1.5px solid var(--accent-3);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 16px 34px -22px rgba(23,138,138,0.45);
}
.win-bar{
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.5rem 0.5rem 0.85rem;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}
.win-title-group{
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.win-icon{
  width: 14px; height: 14px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  flex-shrink: 0;
}
.win-title{
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.win-controls{
  margin-left: auto;
  display: flex;
  gap: 0.3rem;
}
.win-btn{
  width: 22px; height: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: var(--ink-soft);
  line-height: 1;
}
.win-btn.close:hover{ background: #e5484d; border-color: #e5484d; color: #fff; }
.win-btn.min:hover, .win-btn.max:hover{ background: var(--pastel-mint); }

.nav-wrap{
  position: relative;
  width: 100%;
  padding: 1rem 1.25rem 2.25rem;
  display: flex;
  justify-content: flex-end;
}
.nav-bar{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.55rem;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  border: none;
  border-radius: 10px;
}
html[data-theme="dark"] .nav-bar{ background: rgba(18,49,48,0.9); }

.menu-toggle{
  background: transparent;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  width: 36px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.menu-toggle:hover{ background: var(--pastel-mint); }

.menu-icon,
.menu-icon::before,
.menu-icon::after{
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.menu-icon{ position: relative; }
.menu-icon::before{ position: absolute; top: -6px; left: 0; }
.menu-icon::after{ position: absolute; top: 6px; left: 0; }
.menu-toggle[aria-expanded="true"] .menu-icon{ background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-icon::before{ transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon::after{ transform: translateY(-6px) rotate(-45deg); }

.menu-panel{
  position: absolute;
  top: 100%;
  right: 1.25rem;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  width: max-content;
  min-width: 140px;
  max-height: 0;
  overflow: hidden;
  margin-top: 0.5rem;
  background: rgba(255,255,255,0.95);
  border: 1px solid transparent;
  border-radius: 10px;
  box-shadow: none;
  transition: max-height 0.25s ease, padding 0.25s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
html[data-theme="dark"] .menu-panel{ background: rgba(18,49,48,0.95); }
.menu-panel.open{
  max-height: 340px;
  padding: 0.4rem;
  border-color: var(--line);
  box-shadow: 0 14px 30px -20px rgba(23,138,138,0.4);
}
.menu-panel a, .theme-toggle{
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 0.55rem 0.7rem;
  border-radius: 7px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.theme-toggle{
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
}
.menu-panel a:hover, .theme-toggle:hover{ background: var(--pastel-mint); color: var(--ink); }

/* ---------- Hero ---------- */
.hero{ margin-bottom: 3.25rem; }
.hero-body{ padding: 2.25rem 2.25rem 2.5rem; text-align: left; }
.hero-greeting{
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.hero-name{
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 2.75rem);
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.hero-role{ color: var(--ink-soft); font-size: 1rem; margin-bottom: 0.9rem; }
.hero-desc{ color: var(--ink-soft); max-width: 46ch; margin: 0; font-size: 0.96rem; }

/* ---------- Sections ---------- */
section{ margin-bottom: 3.5rem; scroll-margin-top: 6.5rem; }
h2{
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 1.1rem;
}

.panel{
  background: var(--surface);
  border: 1.5px solid var(--accent-3);
  border-radius: 18px;
  padding: 1.6rem 1.85rem;
  box-shadow: 0 14px 30px -22px rgba(23,138,138,0.4);
}

/* ---------- About ---------- */
.about-row{ display: grid; grid-template-columns: auto 1fr; gap: 1.75rem; align-items: center; }
.about-face{
  font-family: var(--mono);
  font-size: 1.5rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.15rem;
  color: var(--accent);
  white-space: nowrap;
}
@media (max-width: 560px){
  .about-row{ grid-template-columns: 1fr; }
  .about-face{ justify-self: start; }
}

/* ---------- Skills ---------- */
.skill-group{ margin-bottom: 1rem; }
.skill-group:last-child{ margin-bottom: 0; }
.skill-group-label{
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}
.skill-row{ display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skill-chip{
  font-family: var(--mono);
  font-size: 0.83rem;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
}
.skill-chip.c-lang{ background: var(--pastel-mint); border-color: var(--accent-3); }
.skill-chip.c-tool{ background: var(--pastel-sky); border-color: #a9d3e6; }
.skill-chip.c-programming{ background: var(--pastel-pink); border-color: #eca8ae; }
.skill-chip.c-additional{ background: var(--coral-soft); border-color: #ffc7ae; }

/* ---------- Education ---------- */
.edu-header{
  margin-bottom: 1.25rem;
}
.edu-info{
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.edu-line{
  font-family: var(--display);
  font-weight: 400;
  font-size: 1rem;
  color: var(--ink-soft);
}
.edu-line-degree{
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}
.coursework{
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
}
.coursework-list{
  list-style: disc;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: var(--ink-soft);
  font-size: 0.94rem;
}
.coursework-list li::marker{ color: var(--accent); }

/* ---------- Projects grid ---------- */
.projects-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
@media (max-width: 640px){ .projects-grid{ grid-template-columns: 1fr; } }

.card{
  background: var(--surface);
  border: 1.5px solid var(--accent-3);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 14px 30px -20px rgba(23,138,138,0.4);
  display: flex;
  flex-direction: column;
}
.card.featured{ grid-column: 1 / -1; }
.card-tab{
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  background: var(--bg-soft);
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--line);
}
.card-body{ padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.card h3{
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  margin-bottom: 0.45rem;
}
.card p{ color: var(--ink-soft); font-size: 0.94rem; margin-bottom: 1rem; max-width: 60ch; }

.tag-row{ display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.tag{
  font-family: var(--mono);
  font-size: 0.72rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.btn{
  display: inline-block;
  align-self: flex-start;
  margin-top: auto;
  background: var(--accent);
  color: #ffffff;
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.88rem;
  transition: background-color 0.15s ease;
}
.btn:hover{ background: var(--ink); }

.wip-badge{
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--pastel-mint);
  border: 1px solid var(--accent-3);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
  margin-left: 0.4rem;
  vertical-align: middle;
}

/* Media carousel inside featured project */
.carousel-container{
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 9;
  overflow: hidden;
  background: var(--bg-soft);
}
.carousel-container .carousel-track{
  display: flex; width: 100%; height: 100%;
  transition: transform 0.4s ease-in-out;
}
.carousel-container .carousel-slide{
  flex: 0 0 100%; min-width: 100%; height: 100%;
  display: flex; justify-content: center; align-items: center;
}
.project-img-slide, .project-video-slide{
  max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
}
.carousel-btn{
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.85);
  color: var(--ink);
  border: 1px solid var(--line);
  width: 32px; height: 32px; padding: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
}
.carousel-btn:hover{ background: var(--accent); color: #fff; }
.prev-btn{ left: 10px; }
.next-btn{ right: 10px; }

/* ---------- Contact ---------- */
.connect-panel{ padding: 0 !important; }
.connect-body{ padding: 1.5rem 1.85rem; }
.connect-lead{
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.contact-links{ display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }
.contact-btn{
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-soft);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.contact-icon{
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.brand-mark{
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-block;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.brand-mark-linkedin{
  -webkit-mask-image: url('https://cdn.jsdelivr.net/npm/simple-icons@v13/icons/linkedin.svg');
  mask-image: url('https://cdn.jsdelivr.net/npm/simple-icons@v13/icons/linkedin.svg');
}
.brand-mark-github{
  -webkit-mask-image: url('https://cdn.jsdelivr.net/npm/simple-icons@v13/icons/github.svg');
  mask-image: url('https://cdn.jsdelivr.net/npm/simple-icons@v13/icons/github.svg');
}
.brand-mark-devpost{
  -webkit-mask-image: url('https://cdn.jsdelivr.net/npm/simple-icons@v13/icons/devpost.svg');
  mask-image: url('https://cdn.jsdelivr.net/npm/simple-icons@v13/icons/devpost.svg');
}
.contact-btn:hover{ border-color: var(--accent); color: var(--accent); background: var(--pastel-mint); }

/* ---------- Mouse trail ---------- */
.trail-dot{
  position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999;
  font-size: 13px; line-height: 1;
  animation: trail-fade 0.7s ease-out forwards;
}
@keyframes trail-fade{
  0%{ opacity: 0.8; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
  100%{ opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(25deg); }
}

footer{
  text-align: center;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}

/* ---------- Fixed side mascot ---------- */
.mascot-wrap{
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.mascot-bubble{
  display: none;
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--accent-3);
  border-radius: 14px;
  padding: 0.55rem 0.9rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--ink);
  margin-bottom: 0.6rem;
  max-width: 170px;
  box-shadow: 0 10px 20px -14px rgba(23,138,138,0.5);
}
.mascot-bubble.show{ display: block; }
.mascot-bubble::after{
  content: "";
  position: absolute;
  bottom: -7px;
  left: 22px;
  width: 0; height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid var(--accent-3);
}
.mascot-img{
  width: 76px;
  height: auto;
  cursor: pointer;
  filter: drop-shadow(0 8px 14px rgba(23,138,138,0.35));
  transition: transform 0.15s ease;
}
.mascot-img:hover{ transform: translateY(-3px) scale(1.05); }
@media (max-width: 560px){
  .mascot-img{ width: 56px; }
}

/* ---------- Scroll reveal + hover lift ---------- */
.reveal{
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible{
  opacity: 1;
  transform: none;
}
.reveal.visible:hover{
  transform: scale(1.015);
}

@media (prefers-reduced-motion: reduce){
  .reveal, .reveal.visible, .reveal.visible:hover{
    opacity: 1;
    transform: none;
    transition: none;
  }
}
