/* =========================
   Root Variables
========================= */

:root {
  --background-color: #ffffff;
  --primary: #b3cba8;
  --secondary: #3a3b35;
  --tertiary: #688778;
  --quaternary: #927e77;
  --light-grey: #e5e5e5;
  --light-green: #eef3ef;
  --dark-green: #4d6c5c;
  --matcha-grey: #bac2b8;
  --hover-color: #b3cba8;
  --navy-shadow: rgba(2, 12, 27, 0.25);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --fz-xs: 13px;
  --fz-sm: 14px;
  --fz-md: 16px;
  --fz-lg: 18px;
  --fz-xl: 22px;

  --navbar-height: 75px;

  --navy-box-shadow: 0 8px 25px -8px var(--navy-shadow);
}


/* =========================
   Global Reset
========================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--background-color);
  font-family: var(--font-sans);
  font-size: var(--fz-md);
  letter-spacing: 0.5px;
  line-height: 1.5;
  margin: 0;
  overflow-x: hidden;

  /* Push all page content below the fixed navbar — always exactly one navbar height */
  padding-top: var(--navbar-height);
}


/* =========================
   Typography
========================= */

p {
  color: var(--quaternary);
  font-size: var(--fz-lg);
  max-width: 650px;
}

h1 {
  color: var(--primary);
  font-size: clamp(32px, 6vw, 50px);
  margin: 0;
}

h2, h3, h4, h5 {
  color: var(--secondary);
  margin: 0;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color .2s ease;
}

a:hover {
  color: var(--hover-color);
}


/* =========================
   Navbar — Desktop
========================= */

#navbar {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--navbar-height);
  padding: 0 28px;

  display: flex;
  justify-content: space-between;
  align-items: center;

  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(179, 203, 168, 0.2);

  z-index: 1000;
}

.nav-logo {
  font-weight: 700;
  font-size: var(--fz-md);
  color: var(--secondary);
  letter-spacing: 0.3px;
}

.nav-logo span {
  color: var(--primary);
}

nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

nav a {
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: var(--fz-sm);
  color: var(--secondary);
}

nav a:hover {
  color: var(--hover-color);
}


/* =========================
   Hamburger Button
   Hidden on desktop, shown on mobile
========================= */

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 4px;
  z-index: 1100;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--secondary);
  border-radius: 2px;
  transition: transform 0.28s ease, opacity 0.28s ease;
  transform-origin: center;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* =========================
   Mobile Dropdown Menu
========================= */

@media (max-width: 768px) {

  .nav-toggle {
    display: flex;
  }

  nav {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: 100%;

    flex-direction: column;
    align-items: center;
    gap: 0;

    background-color: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--light-grey);
    box-shadow: 0 8px 24px -4px var(--navy-shadow);

    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }

  nav.nav-open {
    max-height: 300px;
  }

  nav a {
    width: 100%;
    text-align: center;
    padding: 16px 0;
    font-size: var(--fz-md);
    border-bottom: 1px solid var(--light-grey);
  }

  nav a:last-child {
    border-bottom: none;
  }

  nav a:active {
    background: var(--light-green);
  }

}


/* =========================
   Sections (index / about)
========================= */

.section {
  padding: clamp(60px, 8vw, 100px) 20px;
  min-height: calc(100vh - var(--navbar-height));

  display: flex;
  justify-content: center;
  align-items: center;
}

.section-content {
  width: 100%;
  max-width: 1100px;

  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
}


/* =========================
   Intro
========================= */

#intro {
  width: 100%;
  max-width: 900px;
}

#intro-line {
  font-family: var(--font-mono);
  font-size: clamp(var(--fz-md), 4vw, var(--fz-xl));
}

#name {
  color: var(--secondary);
  font-size: clamp(32px, 8vw, 70px);

  border-right: 3px solid var(--primary);
  white-space: nowrap;
  overflow: hidden;
  display: inline-block;

  animation:
    typing 3s steps(30, end),
    blink-caret 1s step-end infinite;
}

#description {
  margin-top: 20px;
  font-size: var(--fz-lg);
}


/* =========================
   Typing Animation
========================= */

@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

@keyframes blink-caret {
  50% { border-color: transparent }
}


/* =========================
   About Section Layout
========================= */

#about {
  width: 100%;
}

#about .section-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 40px;
  flex-wrap: nowrap;
}

#about .section-content img {
  width: 250px;
  max-width: 30vw;
  height: auto;

  border-radius: 10px;
  box-shadow: var(--navy-box-shadow);

  flex-shrink: 0;
}

#about .code-block {
  flex: 1;
  min-width: 250px;
  max-width: 600px;
}


/* =========================
   Code Block
========================= */

.code-block {
  background-color: var(--matcha-grey);
  border-radius: 10px;
  border-top: 25px solid var(--light-grey);
  box-shadow: var(--navy-box-shadow);

  font-family: Consolas, Monaco, monospace;
  font-size: 14px;

  padding: 20px;
  overflow-x: auto;
}


/* =========================
   Weekly & Final Sections
========================= */

#weekTabs,
#projectDetails {
  width: 100%;
  border-radius: 10px;
  box-shadow: var(--navy-box-shadow);
  padding: 20px;
}

.range { color: var(--quaternary); }
.school-name { color: var(--tertiary); }
.caption { font-size: var(--fz-xs); color: var(--dark-green); }


/* =========================
   Images
========================= */

img {
  max-width: 100%;
  height: auto;
}


/* =========================
   Tablet
========================= */

@media (max-width: 768px) {

  .section {
    padding: 60px 20px;
  }

  #about .section-content {
    flex-direction: column;
    text-align: center;
  }

  #about .section-content img {
    width: 70%;
    max-width: 300px;
  }

  #name {
    white-space: normal;
    border-right: none;
    animation: none;
  }

}


/* =========================
   Mobile
========================= */

@media (max-width: 480px) {

  p {
    font-size: var(--fz-md);
  }

}