:root{
  --bg:#f0f2f5;
  --text:#0b0b0b;
  --muted:#6b6b6b;
  --card:#ffffff;
  --stroke:#bdbdbd;
  --shadow: 0 4px 20px rgba(0,0,0,.10);
  --radius: 18px;
  --border:#d8dce3;
  --mint:#34d399;
  --mint-muted:rgba(110,231,183,.15);
}

[data-theme="dark"]{
  --bg:#0d1117;
  --text:#e6edf3;
  --muted:#adbac7;
  --card:#1c2333;
  --stroke:#30363d;
  --shadow: 0 4px 20px rgba(0,0,0,.4);
  --border:#2d3748;
}

[data-theme="dark"] .outline{
  -webkit-text-stroke: 2px #c9d1d9;
}

[data-theme="dark"] nav{
  background: rgba(13,17,23,0.40);
  border-color: rgba(255,255,255,0.10);
  box-shadow:
    0 4px 24px rgba(0,0,0,.3),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

[data-theme="dark"] .btn,
[data-theme="dark"] .chip,
[data-theme="dark"] .input{
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}

[data-theme="dark"] .grid-overlay{
  opacity: .7;
  background:
    linear-gradient(to right, rgba(255,255,255,.18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.18) 1px, transparent 1px);
  background-size: 28px 28px;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
}

a{ color:inherit; text-decoration:none; }
img{ max-width:100%; display:block; }

nav{
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 36px), 1200px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255,255,255,0.35);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 999px;
  padding: 8px 8px 8px 20px;
  box-shadow:
    0 4px 24px rgba(0,0,0,.08),
    inset 0 1px 0 rgba(255,255,255,0.7);
}

.logo{
  font-weight:900;
  letter-spacing:-.02em;
  font-size:22px;
  white-space: nowrap;
}

.navlinks{
  display: flex;
  flex: 1;
  gap: 2px;
  align-items: center;
  font-weight: 600;
}

.navlinks-left{ justify-content: flex-start; }
.navlinks-right{ justify-content: flex-end; }

.navlinks a{
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px;
  position: relative;
  transition: color .25s;
}

.navlinks a i{ font-size: 16px; line-height: 1; }

/* animated underline slide-in */
.navlinks a::after{
  content: '';
  position: absolute;
  bottom: 2px;
  left: 14px;
  right: 14px;
  width: auto;
  height: 2px;
  background: var(--mint);
  border-radius: 999px;
  transform: scaleX(0);
  transition: transform .25s ease;
}

.navlinks a:hover{ color: var(--text); }
.navlinks a:hover::after{ transform: scaleX(1); }

.navlinks a.active{ color: var(--text); }
.navlinks a.active::after{ transform: scaleX(1); }

.navCta{
  background: var(--text);
  color: #fff;
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  transition: background .25s, color .25s, transform .15s;
}

.navCta:hover{
  background: var(--mint);
  color: var(--text);
  transform: translateY(-1px);
}
.navCta.active{ background: var(--mint); color: var(--text); }

/* hamburger button — hidden on desktop */
.navTheme{
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--text);
  padding: 4px 8px;
  line-height: 1;
  transition: color .2s;
}
.navTheme:hover{ color: var(--mint); }

.navBurger{
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 24px;
  color: var(--text);
  padding: 4px 8px;
  line-height: 1;
}

@media (max-width: 600px){
  nav{
    border-radius: 18px;
    flex-wrap: wrap;
    padding: 10px 14px;
  }

  .navBurger{ display: block; }

  /* hide logo and theme toggle when dropdown is open */
  nav.open .logo{ display: none; }
  nav.open .navTheme{ display: none; }

  .navlinks{
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 4px;
    padding: 4px 0;
  }

  .navlinks-left,
  .navlinks-right{ padding: 0; }

  nav.open .navlinks{ display: flex; }

  .navlinks a{ text-align: center; }

  .navlinks a{
    text-align: center;
    padding: 10px 14px;
  }
}

main{
  margin-top:80px;
  flex: 1;
  text-align: center;
}

.pageTitle{
  margin:0 0 14px;
  letter-spacing:-.03em;
  font-size:42px;
}

.lead{
  margin: 8px auto 28px;
  color:var(--muted);
  font-weight:650;
  max-width:60ch;
  line-height: 1.65;
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:28px;
  text-align: center;
}

.grid{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:14px;
}

@media (max-width: 900px){
  .grid{ grid-template-columns:1fr; }
  .pageTitle{ font-size:34px; }
}

/* HERO */
.hero{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:28px;
  align-items:end;
}
@media (max-width: 920px){
  .hero{ grid-template-columns:1fr; align-items:start; }
}

.hello{
  color:var(--text);
  font-weight:700;
  margin-bottom:14px;
  background:var(--mint-muted);
  display:inline-block;
  padding:4px 12px;
  border-radius:999px;
  border:1px solid var(--mint);
}

.big{
  font-size:78px;
  line-height:.92;
  cursor: default;
  margin:0;
  letter-spacing:-.05em;
  font-weight:900;
}
@media (max-width: 920px){
  .big{ font-size:54px; }
}

.outline{
  font-size:78px;
  line-height:.92;
  cursor: default;
  margin:10px 0 0;
  letter-spacing:-.05em;
  font-weight:900;
  color:transparent;
  -webkit-text-stroke: 2px var(--stroke);
}
@media (max-width: 920px){
  .outline{ font-size:54px; }
}

.sub{
  margin-top: 14px;
  margin-bottom: 0;
  max-width:55ch;
  color:var(--muted);
  font-weight:650;
  line-height: 1.65;
}

.cta{
  display:flex;
  gap:12px;
  margin-top:22px;
  flex-wrap:wrap;
}

.btn{
  padding:12px 16px;
  border-radius: 999px;
  font-weight:850;
  cursor: pointer;
  border:1px solid var(--border);
  background:var(--card);
  color:var(--text);
  transition: background .2s, border-color .2s, box-shadow .2s, transform .2s;
}

.btn:hover{
  background: var(--border);
  transform: translateY(-1px);
}

.btn.primary{
  background:var(--mint);
  color:var(--text);
  border-color:var(--mint);
}

.btn.primary:hover{
  transform: translateY(-2px);
  box-shadow: 0 0 14px rgba(110,231,183,.6), 0 0 32px rgba(110,231,183,.3);
  color: #ffffff;
}

.photoCard{
  border-radius:var(--radius);
  background:linear-gradient(180deg,#fafafa,#f2f2f2);
  box-shadow:var(--shadow);
  overflow:hidden;
  min-height:360px;
  position:relative;
}
@media (max-width: 920px){
  .photoCard{ min-height:280px; }
}

.photoCard img{
  width:100%;
  height:100%;
  object-fit:cover;
  filter:grayscale(1);
  opacity:.95;
}

.badge{
  position:absolute;
  left:16px;
  top:16px;
  background:#fff;
  border:1px solid var(--border);
  padding:8px 12px;
  border-radius:999px;
  font-weight:850;
}

/* PROJECTS */
.projTitle{ margin:0 0 8px; letter-spacing:-.02em; }

.projGrid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 8px;
}

/* lone card on last row → full width */
.projCard:last-child:nth-child(3n+1){ grid-column: 1 / -1; }

/* 2 cards on last row → span evenly */
.projCard:last-child:nth-child(3n+2){ grid-column: span 2; }

@media (max-width: 900px){
  .projGrid{ grid-template-columns: 1fr; }
  .projCard:last-child:nth-child(3n+1),
  .projCard:last-child:nth-child(3n+2){ grid-column: 1; }
}
@media (min-width: 600px) and (max-width: 900px){
  .projGrid{ grid-template-columns: repeat(2, 1fr); }
  .projCard:last-child:nth-child(3n+1){ grid-column: 1 / -1; }
  .projCard:last-child:nth-child(3n+2){ grid-column: span 1; }
}

.projCard{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .25s, box-shadow .25s, border-color .25s;
  cursor: default;
}

.projCard:hover{
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(110,231,183,.15), 0 4px 12px rgba(0,0,0,.08);
  border-color: var(--mint);
}

.projCard-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.projCard-icon{
  font-size: 28px;
  color: var(--mint);
}

.projCard-tags{
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tag{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--mint-muted);
  color: var(--mint);
  border: 1px solid rgba(110,231,183,.3);
}

.tag i{ font-size: 13px; }

.projCard-title{
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.projCard-year{
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--border);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  margin-left: auto;
  align-self: center;
}

.projCard-desc{
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.projCard-techicons{
  display: flex;
  gap: 10px;
  font-size: 22px;
  justify-content: center;
  flex: 1;
  align-items: flex-start;
}
.projCard-links{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 4px;
}
.meta{ color:var(--muted); font-weight:500; font-size:14px; }
.links{ margin-top:12px; display:flex; gap:10px; flex-wrap:wrap; justify-content:center; }
.chip{
  display:inline-block;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:var(--card);
  color:var(--text);
  font-weight:850;
  font-size:13px;
}

/* SOCIAL ICON BUTTONS */
.socialBtn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--text);
  transition: background .2s, border-color .2s, color .2s, box-shadow .2s, transform .2s;
}

.socialBtn i{
  font-size: 20px;
  line-height: 1;
}

.socialBtn:hover{
  background: var(--mint);
  border-color: var(--mint);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(110,231,183,.6), 0 0 28px rgba(110,231,183,.3);
  transform: translateY(-2px);
}

[data-theme="dark"] .socialBtn{
  border-color: var(--mint);
  color: var(--mint);
}

[data-theme="dark"] .socialBtn:hover{
  color: #0b0b0b;
}

/* CONTACT */
.contactGrid{
  display: grid;
  grid-template-columns: 3fr 4fr;
  gap: 14px;
  max-width: 1100px;
  margin: 0 auto;
}

@media (max-width: 700px){
  .contactGrid{ grid-template-columns: 1fr; }
}


.form{
  display:grid;
  gap:14px;
}
.input{
  width:100%;
  padding:14px 16px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
  font-family: inherit;
  font-weight:650;
}
textarea.input{ min-height:140px; resize:vertical; }

/* ===== Animated background + parallax layers ===== */

.bg{
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* make the main content sit above background */
.wrap{
  max-width:1100px;
  margin:0 auto;
  padding:26px 18px 24px;   /* was 70px bottom */
  position: relative;
  z-index: 1;

  min-height: 100vh;        /* makes footer reach bottom */
  display: flex;            /* enables sticky footer layout */
  flex-direction: column;
}

/* subtle moving grid */
.grid-overlay{
  position:absolute;
  inset:-40px;
  opacity:.55;
  background:
    linear-gradient(to right, rgba(0,0,0,.10) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,.10) 1px, transparent 1px);
  background-size: 28px 28px;
  transform: translateZ(0);
  animation: gridDrift 16s linear infinite;
}

@keyframes gridDrift{
  from{ transform: translate3d(0,0,0); }
  to  { transform: translate3d(-28px,-28px,0); }
}

@media (prefers-reduced-motion: reduce){
  .grid-overlay{ animation: none !important; }
}

/* ===== 3D Bubbles ===== */
.bubble{
  position: absolute;
  border-radius: 50%;
  will-change: transform;
  animation: bubbleFloat ease-in-out infinite;

  /* glassmorphism */
  background: radial-gradient(
    circle at 35% 30%,
    rgba(255,255,255,.55) 0%,
    rgba(167,243,208,.45) 40%,
    rgba(110,231,183,.25) 100%
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(110,231,183,.55);
  box-shadow:
    inset 0 -6px 20px rgba(110,231,183,.30),
    inset 4px  4px 14px rgba(255,255,255,.50),
    0 8px 32px rgba(110,231,183,.25),
    0 2px 8px  rgba(0,0,0,.06);
}

/* top-left highlight shine */
.bubble::before{
  content:'';
  position:absolute;
  width:30%; height:20%;
  top:13%; left:20%;
  border-radius:50%;
  background: radial-gradient(ellipse, rgba(255,255,255,.90), transparent 70%);
  transform: rotate(-30deg);
}

/* small secondary reflection */
.bubble::after{
  content:'';
  position:absolute;
  width:12%; height:8%;
  bottom:20%; right:20%;
  border-radius:50%;
  background: radial-gradient(ellipse, rgba(255,255,255,.55), transparent 70%);
}

.b1{ width:320px; height:320px; left:-80px;  top:5%;      opacity:.85; animation-duration:14s; }
.b2{ width:180px; height:180px; right:8%;    top:18%;     opacity:.75; animation-duration:10s; animation-delay:-3s; }
.b3{ width:70px;  height:70px;  left:32%;    top:58%;     opacity:.70; animation-duration:8s;  animation-delay:-5s; }
.b4{ width:130px; height:130px; right:22%;   bottom:18%;  opacity:.60; animation-duration:12s; animation-delay:-2s; }
.b5{ width:60px;  height:60px;  left:14%;    top:42%;     opacity:.55; animation-duration:9s;  animation-delay:-6s; }
.b6{ width:210px; height:210px; right:-40px; bottom:28%;  opacity:.50; animation-duration:16s; animation-delay:-1s; }
.b7{ width:45px;  height:45px;  left:58%;    top:12%;     opacity:.65; animation-duration:7s;  animation-delay:-4s; }
.b8{ width:95px;  height:95px;  left:10%;    bottom:18%;  opacity:.60; animation-duration:11s; animation-delay:-7s; }

@keyframes bubbleFloat{
  0%  { transform: translate3d(0,    0px, 0) scale(1);    }
  33% { transform: translate3d(6px, -22px, 0) scale(1.02); }
  66% { transform: translate3d(-5px,-10px, 0) scale(0.98); }
  100%{ transform: translate3d(0,    0px, 0) scale(1);    }
}

@media (prefers-reduced-motion: reduce){
  .bubble{ animation: none !important; }
}

/* ===== About portrait (center + moving) ===== */
.aboutCenter{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  margin-top:36px;
}

/* Language skill circles */
.aboutCardsRow{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  align-items: stretch;
}

@media (max-width: 600px){
  .aboutCardsRow{ grid-template-columns: 1fr; }
}

.langCardWrap{
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.skillIconsCard{
  display: flex;
  flex-direction: column;
  justify-content: center;
}

[data-card3d]{
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.skillIconsGrid{
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.skillIcon{
  flex: 0 0 calc(33.333% - 14px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.skillIcon i{
  font-size: 34px;
}

.langGrid{
  display: flex;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
}

.langCard{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.langRing{
  width: 75px;
  height: 75px;
  transform: rotate(-90deg);
}

.langRing-bg{
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.langRing-fill{
  fill: none;
  stroke: var(--mint);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.langInfo{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.langPct{
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.langName{
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.portraitFloat{
  animation: portraitFloat 6.5s ease-in-out infinite;
  will-change: transform;
}

@keyframes portraitFloat{
  0%{ transform: translate3d(0,0,0); }
  50%{ transform: translate3d(0,-14px,0); }
  100%{ transform: translate3d(0,0,0); }
}

/* Circle profile photo */
.portraitCard{
  width: clamp(130px, 20vw, 200px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--mint);
  box-shadow: 0 0 0 4px var(--mint-muted);
  transform: translate3d(0,0,0);
  will-change: transform;
}

[data-theme="dark"] .portraitCard{
  box-shadow: 0 0 0 4px var(--mint-muted), 0 0 20px rgba(52,211,153,0.4), 0 0 40px rgba(52,211,153,0.15);
}

.portraitImg{
  width: 100%;
  height: auto;
  display: block;
  position: relative;
  z-index: 1;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  .portraitFloat{ animation:none !important; }
}

/* ===== Home page centered hero ===== */
.heroGroup{
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.heroSolo{
  grid-template-columns: 1fr;
  justify-items: center;
  margin-top: 0;
  flex: unset;
}

.heroSolo > div{
  text-align: center;
  max-width: 760px;
}

.heroSolo .sub{
  margin-left: auto;
  margin-right: auto;
  margin-top: 16px;
}

.iconBtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
}

.iconBtn i{
  font-size: 18px;
  line-height: 1;
}

#site-footer{
  margin-top: auto;         /* footer stays at bottom on short pages */
}

body.home .siteFooter{
  margin-top: 0;
}

.siteFooter{
  margin-top: 40px;
  padding: 18px 0 8px;
  color: var(--muted);
  font-weight: 650;
  text-align: center;
}

.footerInner{
  display:flex;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
}

/* ===== Digital Clock ===== */
.digitalClock{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-bottom: 14px;
  text-align: center;
  transform: translateY(-40px);
}

.clock-time{
  font-family: 'Courier New', Courier, monospace;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
  display: flex;
  align-items: baseline;
  color: var(--text);
}

.clock-sep{
  color: var(--mint);
  margin: 0 2px;
  animation: clockBlink 1s step-end infinite;
}

#clock-s{
  color: var(--mint);
}

.clock-ampm{
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-left: 6px;
  padding-bottom: 4px;
  align-self: flex-end;
  letter-spacing: 0.05em;
}

.clock-date{
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

@keyframes clockBlink{
  0%, 100%{ opacity: 1; }
  50%{ opacity: 0.25; }
}

@media (prefers-reduced-motion: reduce){
  .clock-sep{ animation: none !important; }
}

@media (max-width: 920px){
  .clock-time{ font-size: 22px; }
}