/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #faf9ff;
  --bg-alt:       #f2f0fb;
  --surface:      #ffffff;
  --border:       #e2dff5;
  --border-hover: #c4bfec;
  --text:         #1e1b3a;
  --text-muted:   #6b6880;
  --accent:       #6b74c8;
  --accent-deep:  #5660b0;
  --accent-light: #eeeffe;
  --accent-mid:   #c5c9f0;
  --shadow-sm:    0 1px 4px rgba(100,90,180,.07), 0 2px 12px rgba(100,90,180,.05);
  --shadow-md:    0 2px 8px rgba(100,90,180,.08), 0 6px 24px rgba(100,90,180,.07);
  --shadow-lg:    0 4px 16px rgba(100,90,180,.10), 0 12px 40px rgba(100,90,180,.09);
  --radius:       14px;
  --radius-sm:    8px;
  --max-w:        860px;
  --font:         'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ── Nav ── */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 24px;
  transition: background .3s, box-shadow .3s;
}
#nav.scrolled {
  background: rgba(250,249,255,.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--border);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.01em;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 6px;
}
.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 20px;
  transition: color .2s, background .2s;
}
.nav-links a:hover {
  color: var(--accent);
  background: var(--accent-light);
}

/* ── Hero ── */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: relative;
  overflow: hidden;
}
#hero::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(140,130,220,.12) 0%, transparent 65%);
  pointer-events: none;
}
#hero::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(160,140,230,.08) 0%, transparent 65%);
  pointer-events: none;
}
.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  padding-top: 80px;
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 48px;
  align-items: center;
}
.hero-text { grid-column: 1; }
.hero-bison {
  grid-column: 2;
  width: 100%;
  max-width: 220px;
  height: auto;
  user-select: none;
  animation: bison-float 4s ease-in-out infinite;
  filter: drop-shadow(0 8px 24px rgba(100,90,180,.18));
}
@keyframes bison-float {
  0%, 100% { transform: translateY(0px) rotate(-1.5deg); }
  50%       { transform: translateY(-12px) rotate(1.5deg); }
}
.hero-pfp {
  grid-column: 2;
  width: 240px;
  height: 240px;
  object-fit: cover;
  border-radius: 50%;
  user-select: none;
  box-shadow: 0 8px 32px rgba(100,90,180,.22), 0 0 0 4px var(--accent-mid);
  animation: pfp-float 4s ease-in-out infinite;
}
@keyframes pfp-float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid var(--accent-mid);
  border-radius: 20px;
  padding: 5px 12px;
  margin-bottom: 24px;
}
.hero-name {
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 18px;
}
.hero-sub {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.65;
  margin-bottom: 32px;
}
.hero-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Buttons ── */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: color .2s, border-color .2s, background .2s, box-shadow .2s;
}
.btn-ghost:hover {
  color: var(--accent);
  border-color: var(--accent-mid);
  background: var(--accent-light);
  box-shadow: var(--shadow-md);
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border-radius: 20px;
  box-shadow: 0 2px 12px rgba(107,116,200,.35);
  transition: background .2s, box-shadow .2s;
}
.btn-primary:hover {
  background: var(--accent-deep);
  box-shadow: 0 4px 20px rgba(107,116,200,.45);
}

/* ── Sections ── */
.section { padding: 96px 24px; }
.section-alt { background: var(--bg-alt); }
.container {
  max-width: var(--max-w);
  margin: 0 auto;
}
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 40px;
}
.section-label::before {
  content: '';
  display: block;
  width: 18px; height: 2px;
  background: var(--accent-mid);
  border-radius: 2px;
}

/* ── About ── */
.about-text {
  max-width: 640px;
}
.about-text p {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.75;
}
.about-text p:last-child { margin-bottom: 0; }
.about-text a {
  color: var(--accent);
  font-weight: 500;
  transition: opacity .2s;
}
.about-text a:hover { opacity: .75; }

/* ── Interests ── */
.interests-list {
  display: flex;
  flex-direction: column;
}
.interest-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.interest-row:first-child { border-top: 1px solid var(--border); }
.interest-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.interest-body {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── Currently ── */
.currently-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.currently-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.currently-row:first-child { border-top: 1px solid var(--border); }
.currently-icon { font-size: 20px; flex-shrink: 0; }
.currently-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 2px;
}
.currently-val {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

/* ── Timeline ── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.timeline-item {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  transition: border-color .3s, box-shadow .3s, transform .2s ease, background .3s;
}
.timeline-item:hover {
  border-color: var(--accent-mid);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}
.timeline-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.timeline-date {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: .02em;
  white-space: nowrap;
  font-weight: 500;
  text-align: center;
}
.timeline-logo {
  max-width: 56px;
  max-height: 56px;
  width: auto;
  height: auto;
  display: block;
  opacity: 1;
  flex-shrink: 0;
}
.timeline-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.timeline-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.timeline-role {
  font-size: 12px;
  color: var(--text-muted);
}
.timeline-body > p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 12px;
}
.timeline-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: 10px;
  padding: 2px 8px;
  margin-bottom: 10px;
  transition: background .2s;
}
.timeline-link:hover { background: var(--accent-mid); }

/* ── Tags ── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tags span {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  background: var(--bg-alt);
  color: var(--text-muted);
  border-radius: 10px;
  border: 1px solid var(--border);
}

/* ── Projects ── */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.project-card {
  display: block;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: border-color .25s, box-shadow .25s, transform .2s ease, background .3s;
  cursor: pointer;
}
.project-card:hover {
  border-color: var(--accent-mid);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.project-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.project-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.project-card .project-type {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  padding: 2px 8px;
  border-radius: 8px;
  margin-bottom: 10px;
  display: inline-block;
}
.project-arrow {
  font-size: 16px;
  color: var(--accent-mid);
  transition: transform .2s, color .2s;
}
.project-card:hover .project-arrow {
  transform: translate(3px, -3px);
  color: var(--accent);
}
.project-card > p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 18px;
}

/* ── Contact ── */
.contact-container { text-align: center; }
.contact-sub {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 32px;
  margin-top: -28px;
}
.contact-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Footer ── */
footer {
  padding: 28px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}
.footer-bison {
  width: 28px;
  height: 28px;
  object-fit: contain;
  opacity: 0.75;
}

/* ── Scroll animations ── */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .55s ease, transform .55s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }
.hero-text .fade-up:nth-child(1) { transition-delay: .05s; }
.hero-text .fade-up:nth-child(2) { transition-delay: .15s; }
.hero-text .fade-up:nth-child(3) { transition-delay: .25s; }
.hero-text .fade-up:nth-child(4) { transition-delay: .35s; }
.hero-bison { opacity: 0; transition: opacity .7s ease .45s, transform 4s ease-in-out infinite; }
.hero-bison.visible { opacity: 1; }
.hero-pfp { opacity: 0; transition: opacity .7s ease .45s, transform 4s ease-in-out infinite; }
.hero-pfp.visible { opacity: 1; }

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .45s ease, transform .45s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── Responsive ── */

/* Tablet: 721px – 1024px */
@media (max-width: 1024px) {
  :root { --max-w: 100%; }
  .hero-inner { padding-left: 0; padding-right: 0; }
  .hero-bison { max-width: 180px; }
  .hero-pfp { width: 200px; height: 200px; }
}

/* Mobile landscape + small tablet: ≤ 720px */
@media (max-width: 720px) {
  .section { padding: 72px 20px; }

  /* Hero: stack vertically, bison above text */
  .hero-inner {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    justify-items: center;
    text-align: center;
    gap: 28px;
    padding-top: 100px;
  }
  .hero-text { grid-column: 1; grid-row: 2; }
  .hero-bison {
    grid-column: 1; grid-row: 1;
    max-width: 140px;
  }
  .hero-pfp {
    grid-column: 1; grid-row: 1;
    width: 140px; height: 140px;
  }
  .hero-tag { margin: 0 auto 20px; }
  .hero-sub { max-width: 100%; margin-left: auto; margin-right: auto; }
  .hero-links { justify-content: center; }

  /* Nav */
  .nav-links { gap: 2px; }
  .nav-links a { padding: 6px 8px; font-size: 12px; }

  /* Layout */
  .projects-grid { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px; }
  .timeline-meta {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }
  .timeline-logo {
    max-width: 32px;
    max-height: 32px;
    width: auto;
    height: auto;
  }
  .interest-row { grid-template-columns: 1fr; gap: 6px; }
  .about-text { max-width: 100%; }
}

/* Small phones: ≤ 420px */
@media (max-width: 420px) {
  .nav-logo { font-size: 13px; }
  .nav-links { display: none; }
  .hero-name { font-size: 36px; }
  .hero-sub { font-size: 15px; }
  .hero-bison { max-width: 110px; }
  .hero-pfp { width: 110px; height: 110px; }
  .btn-primary, .btn-ghost { font-size: 12px; padding: 8px 14px; }
}

/* ── Pop-out hover (must come after .reveal.visible to override cascade) ── */
.timeline-item:hover {
  background: var(--accent-light);
  border-color: var(--accent-mid);
  box-shadow: var(--shadow-lg), inset 4px 0 0 var(--accent);
  transform: translateY(-4px);
}
.timeline-item:hover .timeline-header h3 {
  color: var(--accent);
}
.project-card:hover {
  background: var(--accent-light);
  border-color: var(--accent-mid);
  box-shadow: var(--shadow-lg), inset 4px 0 0 var(--accent);
  transform: translateY(-4px);
}
.project-card:hover h3 {
  color: var(--accent);
}

/* ── Active nav link ── */
.nav-links a.active {
  color: var(--accent);
  background: var(--accent-light);
}

/* ── Typewriter cursor ── */
.tw-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  border-radius: 1px;
  animation: blink .75s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Copied button state ── */
.btn-primary.copied {
  background: #4caf7d;
  box-shadow: 0 2px 12px rgba(76,175,125,.4);
  transition: background .2s, box-shadow .2s;
}

/* Landscape on short devices */
@media (max-height: 500px) and (orientation: landscape) {
  #hero { min-height: auto; padding: 80px 24px 40px; }
  .hero-inner { padding-top: 20px; }
  .section { padding: 56px 24px; }
  .timeline-item { grid-template-columns: 120px 1fr; }
  .timeline-meta {
    flex-direction: column;
    align-items: center;
  }
  .timeline-logo {
    max-width: 40px;
    max-height: 40px;
    width: auto;
    height: auto;
  }
}

/* Wide screens: ≥ 1280px */
@media (min-width: 1280px) {
  :root { --max-w: 900px; }
  .hero-bison { max-width: 240px; }
  .hero-pfp { width: 260px; height: 260px; }
}
