*, *::before, *::after {margin: 0; padding: 0; box-sizing: border-box;
    touch-action: manipulation;

}
:root{
  --bg:      #070c18;
  --bg2:     #0d1526;
  --line:    rgba(255,255,255,0.07);
  --cyan:    #00e5ff;
  --gold:    #ffc947;
  --text:    #cdd9f0;
  --muted:   #5a7099;
  --mono:    'Space Mono', monospace;
  --sans:    'Inter', sans-serif;
}

html {scroll-behavior: smooth;}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.75;
    overflow-x: hidden;

}
::selection {background: var(--cyan); color: var(--bg);}
::-webkit-scrollbar {width: 4px;}
::-webkit-scrollbar-thumb {background: var(--muted); border-radius: 3px;}

/* ── CANVAS ── */

#bg-canvas {
    position: fixed;
    inset: 0;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.45;
    pointer-events: none !important;
}

/* ── NAV ── */

nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 200;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 6vw;
    border-bottom: 1px solid var(--line);
    background: rgba(7, 17, 31, 0.85);
    backdrop-filter: blur(12px);
}

.logo {
    font-family: var(--mono);
    font-size: 1rem;
    color: var(--cyan);
    text-decoration: none;
    letter-spacing: 0.06em;

}
.logo span{color: var(--gold);}

.nav-links {
    display: flex;
    gap: 2.2rem;
    list-style: none;
}
.nav-links a {
    font-family: var(--mono);
    font-size: 0.9rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    position: relative;
    border-bottom: 1px solid transparent;
    padding-bottom: 1px;
    transition: color 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
    color: var(--cyan);
    border-bottom-color: var(--cyan);
}


section{
    display: none;
}
section.active {
    display: block;
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.section-inner {
    max-width: 820px;
    margin: 0 auto;
    padding: 5rem 6vw;
    border-bottom: 1px solid var(--line);
}
.section-label {
    display: block;
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 2rem;

}

/* ── INTRO ── */

#intro {
    min-height: 100vh;
    align-items: center;
    padding: 0.6vw;
    border-bottom: 1px solid var(--line);
}
#intro.active {
    display: flex;
}

.intro-inner {
    position: relative;
    z-index: 1;
    max-width: 850px;
    margin: 0 auto;
    width: 100%;
}
.intro-label {
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1rem;
}
h1 {
    font-family: var(--sans);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    line-height: 1.2;
    font-weight: 600;
    color: #ddeeff;
    margin-bottom: 1.4rem;
}    
.intro-sub{
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
    max-width: 480px;
    margin-bottom: 2rem;
}
.intro-btns{
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.btn-solid{
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--bg);
    background: var(--cyan);
    padding: 0.7rem 1.5rem;
    border-radius: 2px;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.2s;
}
.btn-solid:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}
.btn-line{
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text);
    text-decoration: none;
    border: 1px solid var(--muted);
    border-radius: 2px;
    padding: 0.7rem 1.5rem;
    transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.btn-line:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    transform: translateY(-2px);
}

/* ── ABOUT ── */

.about-body {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3rem;
    align-items: start;

}
.about-text p {
    color: var(--muted);
    margin-bottom: 1rem;
    font-size: 1rem;
}
.about-text p:first-child {
    color: var(--text);
}
.chip-row {
    display: flex;
    flex-wrap:wrap;
    gap: 0.5rem;
    margin-top: 1.4rem;
}
.chip-row span {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cyan);
    border: 1px solid rgba(0,212,245,0.2);
    background: rgba(0,212,245,0.04);
    padding: 0.3rem 0.5rem;
    border-radius: 2px;
}
.about-cards {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    min-width: 130px;
}
.mini-card {
    background: var(--bg2);
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
}
.mini-card strong {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--cyan);
  line-height: 1;
  text-transform: uppercase;
}
.mini-card span {
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

/* ── EDUCATION ── */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-left: 1px solid var(--line);
    margin-left: 0.5rem;
    padding-left: 0;
}
.tl-item {
    display: flex;
    gap: 1.5rem;
    position: relative;
    padding-bottom: 2.5rem;
}
.tl-item:last-child {
    padding-bottom: 0;
}
.tl-dot {
    width: 9px;
    height: 9px;
    min-width: 9px;
    background: var(--cyan);
    border-radius: 50%;
    margin-left: -5px;
    margin-top: 0.5rem;
    box-shadow: 0 0 8px var(--cyan);
}
.tl-body {
    flex: 1;
}
.tl-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.3rem;
}
.tl-body h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #ddeeff;
  line-height: 1.4;
}
.tl-year {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--gold);
  white-space: nowrap;
  padding-top: 0.15rem;
}

.tl-place {
  font-size: 0.8rem;
  color: var(--cyan);
  margin-bottom: 0.2rem;
  font-family: var(--mono);
}

/* ── PROJECTS ── */

.projects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    margin-top: 0.5rem;
}

.pcard {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1.5rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: border-color 0.25s;
}
.pcard:hover { border-color: rgba(0,212,245,0.3); }

.pcard-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ptype {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 2px;
  border: 1px solid;
}
.ptype.py1  { color: var(--gold); border-color: rgba(240,165,0,0.3); background: rgba(240,165,0,0.06); }
.ptype.py2   { color: #4ec9b0;    border-color: rgba(78,201,176,0.3); background: rgba(78,201,176,0.06); }

.plink {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}
.plink:hover {
    color: var(--cyan);
}
.pcard h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #ddeeff;
}
.pcard p {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.5;
    flex: 1;
}
.ptags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.3rem;
}
.ptags span{
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--muted);
    border: 1px solid var(--line);
    padding: 0.2rem 0.5rem;
    border-radius: 2px;
}

/* ── CONTACT ── */

.contact-inner {
    border-bottom: none;
}
h2 {
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: 600;
    color: #ddeeff;
    margin-bottom: 0.8rem;
    letter-spacing: -0.01em;
}
.contact-sub {
    font-size: 1rem;
    color: var(--muted);
    margin-bottom: 2rem;
    max-width: 450px;
}
.contact-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.contact-row a {
    font-family: var(--mono);
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--cyan);
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
    transition: border-color 0.2s;
}
.contact-row a:hover {
    border-bottom-color: var(--cyan);
}

footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--muted);
    letter-spacing: 0.1rem;
}

/* ── NAV TOGGLE (MOBILE) ── */

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 101;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--cyan);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── RESPONSIVE ── */

@media (min-width: 769px) and (max-width: 900px) {
  .projects-grid { grid-template-columns: 1fr; }
  .about-body { grid-template-columns: 1fr; }
  .about-cards { flex-direction: row; flex-wrap: wrap; min-width: unset; }
}
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
   nav { padding: 1rem 4vw; }
  .nav-links {
    display: none;
    flex-direction: column;
    gap: 0;
    position: fixed;
    top: 57px; /* height of nav */
    left: 0; right: 0;
    background: rgba(7, 17, 31, 0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    padding: 1rem 0; 
}
  .nav-links.open { display: flex; z-index: 199; }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: 0.9rem 6vw;
    font-size: 0.8rem;
    border-bottom: none;
  }
   .nav-links a:hover,
   .nav-links a.active {
        background: rgba(0, 229, 255, 0.05);
        color: var(--cyan);
        border-bottom: none;
    }
  .section-inner { padding: 4rem 4vw; }

  #intro { padding: 0 4vw; }
  .intro-btns { flex-direction: column; }
  .btn-solid, .btn-line { text-align: center; }

  .about-body { grid-template-columns: 1fr; gap: 2rem; }
  .about-cards { flex-direction: row; flex-wrap: wrap; min-width: unset; }
  .mini-card { flex: 1; min-width: 80px; }
  .projects-grid { grid-template-columns: 1fr; }
  .pcard { padding: 1.2rem; }
  .tl-top { flex-direction: column; gap: 0.2rem; }
  .contact-row { flex-direction: column; gap: 1rem; }
}
@media (max-width: 480px) {
  .logo { font-size: 0.85rem; }
  .nav-links { gap: 0.8rem; }
  .nav-links a { font-size: 0.6rem; letter-spacing: 0.06em; }
  .chip-row span { font-size: 0.6rem; }
}
