/* =========================================================
   Dark chalkboard theme
   Palette: slate-green board, chalk-white text, one chalk-yellow accent.
   Type: Fraunces (headings) + Inter (body).
========================================================= */

:root {
  --bg: #14201c;
  --bg-alt: #192723;
  --card: #1d2c27;
  --card-hover: #243630;
  --border: rgba(236, 233, 223, 0.12);
  --accent: #ecd36f;
  --accent-soft: rgba(236, 211, 111, 0.1);
  --accent-line: rgba(236, 211, 111, 0.35);
  --on-accent: #14201c;
  --text: #ece9df;
  --text-muted: #a9b5ac;
  --radius: 8px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --transition: 0.25s ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px; /* fixed header height */
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }

.container {
  width: min(1120px, 92%);
  margin-inline: auto;
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(20, 32, 28, 0.9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}

.header.scrolled { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--text);
}

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

.nav-menu { display: flex; gap: 1.5rem; }

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
  position: relative;
}

.nav-link:hover,
.nav-link.active { color: var(--accent); }

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.4rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover { background: #f3df94; }

.btn-full { width: 100%; }

/* =========================================
   HERO
========================================= */

.hero {
  position: relative;
  min-height: calc(100vh - 64px);
  padding: 90px 0 80px;
  display: flex;
  align-items: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 70px;
  align-items: center;
}

.hero-content { min-width: 0; }

.hero-role {
  margin-bottom: 18px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent);
}


.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(52px, 6.5vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  font-weight: 600;
}
.hero-intro {
  max-width: 600px;
  margin: 28px 0 28px;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.75;
}

/* The one place the award is shown */
.hero-award {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 28px;
  padding: 14px 18px;
  border: 1px solid var(--accent-line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
  transition: transform var(--transition), background var(--transition);
}

.hero-award:hover {
  transform: translateY(-2px);
  background: rgba(236, 211, 111, 0.16);
}

.hero-award-text { display: block; }

.hero-award strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
}

.hero-award small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  padding: 13px 22px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background var(--transition), border-color var(--transition);
}

.hero-btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.hero-btn-primary:hover { background: #f3df94; }

.hero-btn-secondary {
  border: 1px solid var(--border);
  color: var(--text);
}

.hero-btn-secondary:hover { border-color: var(--accent-line); }

.hero-micro-proof {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.hero-micro-proof b {
  color: var(--text);
  font-size: 0.9rem;
}

.hero-micro-proof i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-photo-frame {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 0.82;
}


.hero-photo-frame img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}

@media (max-width: 900px) {
  .hero { padding-top: 60px; }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero-visual { order: -1; }

  .hero-photo-frame { width: min(76vw, 360px); }

  .hero h1 { font-size: clamp(48px, 13vw, 80px); }

  .hero-intro { font-size: 1rem; }
}

@media (max-width: 600px) {
  .hero { padding: 45px 0 70px; }
  .hero-photo-frame { width: 78vw; }
  .hero-micro-proof { gap: 10px; }
  .hero-micro-proof i { display: none; }
}

/* ===== Sections ===== */
.section { padding: 80px 0; }

.section-title {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.section-sub {
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  font-size: 1rem;
}

.subhead {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  margin: 3.5rem 0 1.25rem;
}

/* ===== Projects ===== */
.project { background: var(--bg); }

.project-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.25rem;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  padding: 2.25rem;
}

.project-kicker {
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.project-text h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 0.7rem;
}

.project-text p:not(.project-kicker) {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.project-text .tags { margin-bottom: 1.5rem; }

.code-box {
  margin: 0;
  min-height: calc(4 * 1.6em + 4rem);
  background: #0d1512;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2rem 1.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  color: #e6edf3;
  white-space: pre;
  overflow-x: auto;
}

.code-box code { font: inherit; }

/* Blinking cursor shown while the code types itself (see script.js) */
.type-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.pj-badge {
  display: inline-block;
  margin-top: 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  background: rgba(46, 164, 79, 0.2);
  border: 1px solid #2ea44f;
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
}

/* Badge appears once the typing has finished */
.js .pj-badge {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.js .pj-badge.show { opacity: 1; }

/* ===== About ===== */
.about { background: var(--bg-alt); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  margin-bottom: 2.5rem;
}

.about-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-line);
  margin-bottom: 1.25rem;
  display: block;
}

.about-bio p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.75;
}

.about-bio strong { color: var(--text); }

.about-bio .btn { margin-top: 0.5rem; }

.about-exp h3,
.skills-tags h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.exp-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.25rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--border);
}

.exp-row:last-child { border-bottom: 1px solid var(--border); }

.exp-when {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.exp-row h4 {
  font-size: 1rem;
  margin-bottom: 0.15rem;
}

.exp-row p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.tl-logo {
  display: block;
  height: 40px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  margin-top: 0.6rem;
  padding: 6px 12px;
  border-radius: 6px;
}

/* Three skill columns so the row fills the width */
.skills-tags {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 2.5rem;
  margin-bottom: 1rem;
}

.skills-tags h3 { grid-column: 1 / -1; }

.skill-group {
  padding-top: 0.9rem;
  margin-bottom: 1.1rem;
  border-top: 1px solid var(--border);
}

.skill-group h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
}

/* What I do: plain two-column list, no cards */
.roles-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 3.5rem;
}

.role-item {
  padding: 1.1rem 0;
  border-top: 1px solid var(--border);
}

.role-item:last-child:nth-child(odd) { grid-column: 1 / -1; }

.role-item h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.role-item p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ===== Teaching Hub ===== */
.teaching-hub { background: var(--bg); }

.qa-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}

.qa-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: background var(--transition), border-color var(--transition);
}

.qa-card:hover {
  background: var(--card-hover);
  border-color: var(--accent-line);
}

.qa-icon {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.qa-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.qa-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Notices */
.notice-board {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 800px;
}

.notice-item {
  display: flex;
  gap: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  align-items: flex-start;
}

.notice-date {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  white-space: nowrap;
}

.notice-body h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.notice-body p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Highlights */
.lb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}

.lb-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
}

.lb-card.featured { grid-column: span 2; }

.lb-header {
  margin-bottom: 0.9rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
}

.lb-header h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.lb-list li {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.4rem 0;
  font-size: 0.95rem;
}

.lb-list li b {
  flex: 0 0 4.6rem;
  color: var(--accent);
  font-weight: 700;
}

.rank {
  flex: 0 0 26px;
  align-self: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.rank.first {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
}

/* ===== Learn ===== */
.learn { background: var(--bg-alt); }

.learn-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  align-items: start;
}

.learn-group h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--accent-line);
}

.learn-group li { border-bottom: 1px solid var(--border); }

.learn-group a {
  display: block;
  padding: 0.85rem 0;
  transition: color var(--transition);
}

.learn-group a span {
  display: block;
  font-weight: 600;
}

.learn-group a small {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.learn-group a:hover span { color: var(--accent); }

/* ===== Student work ===== */
.portfolios { background: var(--bg); }

.port-list { border-top: 1px solid var(--border); }

.port-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  padding: 1.2rem 0.25rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), padding var(--transition);
}

.port-row:hover {
  background: var(--card);
  padding-inline: 1rem;
}

.port-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
}

.port-row:hover .port-name { color: var(--accent); }

.port-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ===== Contact ===== */
.contact { background: var(--bg-alt); }

.contact-form {
  max-width: 580px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group { margin-bottom: 1.1rem; }

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(236, 211, 111, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: #8a9890; }

.contact-alt {
  margin-top: 1.25rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.contact-alt a {
  color: var(--accent);
  font-weight: 600;
}

.contact-alt a:hover { text-decoration: underline; }

/* ===== Footer ===== */
.footer {
  background: #0d1512;
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
}

.footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.footer-nav a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

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

.footer-social {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.footer-social a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  padding: 0.3rem 0.9rem;
  border-radius: 4px;
  transition: background var(--transition);
}

.footer-social a:hover { background: var(--accent-soft); }

.copyright {
  font-size: 0.85rem;
  color: #8a9890;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .about-grid,
  .project-card,
  .qa-grid,
  .roles-list,
  .skills-tags,
  .learn-groups {
    grid-template-columns: 1fr;
  }

  .learn-groups { gap: 2rem; }

  .lb-grid {
    grid-template-columns: 1fr;
    max-width: 440px;
  }

  /* The featured card must not span 2 columns in a 1-column grid */
  .lb-card.featured { grid-column: auto; }

  /* Mobile / tablet menu */
  .nav-toggle { display: flex; }

  .nav-menu {
    position: fixed;
    top: 64px;
    left: 0;
    width: 100%;
    max-height: calc(100vh - 64px);
    max-height: calc(100dvh - 64px);
    overflow-y: auto;
    background: rgba(20, 32, 28, 0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    transform: translateY(-130%);
    opacity: 0;
    visibility: hidden;          /* keeps closed links out of the tab order */
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0s linear 0.3s;
  }

  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }

  .nav-link { font-size: 1rem; }
  .nav-link.active::after { bottom: -4px; width: 2.2rem; }
}



@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .section { padding: 60px 0; }
  .section-title { font-size: 1.8rem; }
  .project-card { padding: 1.5rem; }
  .code-box { font-size: 0.75rem; }
  .exp-row { grid-template-columns: 1fr; gap: 0.3rem; }
  .notice-item { flex-direction: column; gap: 0.6rem; }
  .about-photo { margin-inline: auto; }
}

/* ===== Scroll reveal =====
   Content is only hidden when JS has added .js to <html>,
   so it never stays invisible without JS.
   .reveal fades whole blocks; .stagger animates children one after another. */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.js .reveal.visible {
  opacity: 1;
  transform: none;
}

.js .reveal-delay-1 { transition-delay: 0.08s; }
.js .reveal-delay-2 { transition-delay: 0.16s; }

.js .stagger > * { opacity: 0; }

.js .stagger.visible > * {
  opacity: 1;
  /* "backwards" so the final state does not override hover styles */
  animation: rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ===== Accessibility ===== */
.nav-toggle:focus-visible,
.nav-link:focus-visible,
.btn:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.contact-form button:disabled {
  cursor: default;
  opacity: 0.85;
}

/* Honeypot (visually hidden, still in the DOM for bots) */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  min-height: 1.4em;
  margin-top: 0.9rem;
  font-size: 0.9rem;
  text-align: center;
  color: var(--text-muted);
}

.form-status.success { color: #4ade80; }
.form-status.error { color: #f87171; }

.form-group input.invalid,
.form-group textarea.invalid { border-color: #f87171; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .js .reveal,
  .js .stagger > * {
    opacity: 1;
    transform: none;
  }
}
