/* ---- Theme tokens ---- */
:root {
  --bg: #f4f0e8;
  --bg-soft: #ece6da;
  --text: #1c1a16;
  --muted: #6d675c;
  --border: #ddd5c6;
  --shadow: rgba(40, 33, 20, 0.14);
  --maxw: 900px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191712;
    --bg-soft: #221f18;
    --text: #efe9db;
    --muted: #a49c8b;
    --border: #34302a;
    --shadow: rgba(0, 0, 0, 0.4);
  }
}

/* ---- Base ---- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--text); text-decoration: none; }

h1, h2, h3 { margin: 0; font-weight: 400; }

.display, .section-display, .featured-title {
  font-family: var(--serif);
  font-optical-sizing: auto;
  letter-spacing: -0.01em;
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 48px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 500;
}
.nav a {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.02em;
  margin-left: 26px;
  transition: color 0.15s ease;
}
.nav a:hover { color: var(--text); }

/* ---- Layout ---- */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 48px);
}
.section { padding: 84px 0; border-top: 1px solid var(--border); }
.section-display {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-style: italic;
  font-weight: 400;
  text-align: center;
  margin-bottom: 56px;
}

/* ---- Hero ---- */
.hero {
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 0;
}
.display {
  font-size: clamp(3.2rem, 12vw, 7rem);
  font-weight: 400;
  line-height: 0.98;
  margin-bottom: 34px;
}
.hero-tag {
  font-size: clamp(1.02rem, 2vw, 1.18rem);
  color: var(--muted);
  max-width: 52ch;
  margin: 0 auto 30px;
}
.hero-meta {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text);
  margin-bottom: 34px;
}
.hero-meta .dot { color: var(--muted); }
.hero-links { display: flex; gap: 30px; flex-wrap: wrap; justify-content: center; }
.hero-links a {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--text);
  transition: opacity 0.15s ease;
}
.hero-links a:hover { opacity: 0.55; }

/* ---- Featured (COMPUTA) ---- */
.featured { margin-bottom: 72px; text-align: center; }
.featured-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin: 0 0 8px;
}
.featured-title {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 34px;
}
.featured-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  text-align: left;
}
.featured-text p { margin: 0 0 18px; }
.note { color: var(--muted); font-size: 14px; margin-bottom: 0 !important; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 18px; }
.tags li {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 3px 11px;
  border-radius: 999px;
}

.project-shots {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  justify-content: center;
  flex-wrap: wrap;
}
.shot {
  display: block;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 14px 40px var(--shadow);
}
.shot-desktop { flex: 1 1 62%; min-width: 240px; max-width: 100%; }
.shot-mobile { flex: 0 1 26%; min-width: 110px; max-width: 150px; }

/* ---- Detailed project blocks ---- */
.icon { color: var(--text); }
.icon svg { display: block; }

.details { display: flex; flex-direction: column; gap: 72px; }
.detail-title {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 4.4vw, 2.6rem);
  font-weight: 400;
  text-align: center;
  margin-bottom: 34px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 44px;
  align-items: center;
}
.detail-text p { margin: 0 0 20px; }

.detail-repo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 30px 20px;
  border: 1px solid transparent;
  border-radius: 14px;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.detail-repo:hover {
  border-color: var(--border);
  background: var(--bg-soft);
  transform: translateY(-3px);
}
.detail-repo .icon svg { width: 60px; height: 60px; }
.detail-repo-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.detail-static {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 30px 20px;
}
.detail-static .icon svg { width: 60px; height: 60px; }

/* Alternate the icon side for editorial rhythm */
.detail:nth-child(even) .detail-grid { grid-template-columns: 1fr 1.7fr; }
.detail:nth-child(even) .detail-repo,
.detail:nth-child(even) .detail-static,
.detail:nth-child(even) .detail-media { order: -1; }

/* Project media (images / video thumbnails in the detail blocks) */
.detail-media { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.media-img { display: block; width: 100%; max-width: 320px; }
.media-img img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px var(--shadow);
  transition: transform 0.18s ease;
}
.media-img:hover img { transform: translateY(-3px); }
.media-caption {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-align: center;
}
.media-caption a { border-bottom: 1px solid var(--muted); }
.media-caption a:hover { color: var(--text); border-color: var(--text); }

/* Play button overlay on video thumbnail */
.video-thumb { position: relative; }
.video-thumb .play {
  position: absolute;
  top: 50%; left: 50%;
  width: 54px; height: 54px;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  transition: background 0.18s ease;
}
.video-thumb:hover .play { background: rgba(0, 0, 0, 0.75); }
.video-thumb .play::before {
  content: "";
  position: absolute;
  top: 50%; left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent #fff;
}

/* Aesthetic photo band */
.photo-band { max-width: 620px; margin: 12px auto 56px; padding: 0 clamp(20px, 5vw, 48px); }
.photo-band img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 16px 44px var(--shadow);
}

/* About with photo */
.about-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 44px;
  align-items: start;
  max-width: 820px;
  margin: 0 auto;
}
.about-photo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 14px 40px var(--shadow);
}
.about-grid .prose { max-width: none; margin: 0; }

/* Graduation photo beside the degree entry */
.entry-with-photo { display: flex; gap: 26px; align-items: center; justify-content: space-between; }
.entry-with-photo .entry-main { flex: 1; }
.entry-photo {
  width: 150px;
  height: auto;
  flex-shrink: 0;
  border-radius: 10px;
  box-shadow: 0 8px 24px var(--shadow);
}

/* ---- Experience / Education / Leadership timeline ---- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 40px;
  max-width: 640px;
  margin: 0 auto;
}
.entry-role {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.2;
}
.entry-meta {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 6px;
}
.entry p { margin: 12px 0 0; }

/* ---- Skills ---- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 34px 48px;
  max-width: 680px;
  margin: 0 auto;
}
.skill-group h3 {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 10px;
}
.skill-group p { color: var(--muted); margin: 0; }

/* ---- Leadership subsection ---- */
.leadership { margin-top: 64px; }
.leadership-heading {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 400;
  text-align: center;
  margin-bottom: 40px;
}

.other-work {
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  margin-top: 48px;
}
.other-work a { border-bottom: 1px solid var(--muted); }
.other-work a:hover { color: var(--text); border-color: var(--text); }

/* ---- About ---- */
.prose { max-width: 60ch; margin: 0 auto; }
.prose p { margin: 0 0 18px; }
.prose p:last-child { margin-bottom: 0; }

/* ---- Contact ---- */
.contact-list { list-style: none; padding: 0; margin: 0 auto; max-width: 460px; }
.contact-list li {
  display: flex;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.contact-list li:last-child { border-bottom: none; }
.contact-list span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  min-width: 92px;
}
.contact-list a { border-bottom: 1px solid var(--text); padding-bottom: 2px; }
.contact-list a:hover { opacity: 0.6; }

/* ---- Credentials ---- */
.cred-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 44px;
  align-items: center;
}
.cred-title {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 10px;
}
.cred-meta { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.cred-link { border-bottom: 1px solid var(--text); padding-bottom: 2px; }
.cred-link:hover { opacity: 0.6; }
.cred-cert { display: block; transition: transform 0.18s ease; }
.cred-cert:hover { transform: translateY(-3px); }
.cred-cert img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 14px 40px var(--shadow);
}

/* ---- Scroll reveal (progressive enhancement) ---- */
html.js .section-display,
html.js .featured,
html.js .detail,
html.js .entry,
html.js .skill-group,
html.js .cred-grid,
html.js .leadership,
html.js .prose,
html.js .other-work,
html.js .contact-list {
  opacity: 0;
  transform: translateY(28px) scale(0.985);
  transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1), transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
html.js .is-visible {
  opacity: 1;
  transform: none;
}
/* Staggered cascade for the skills grid */
html.js .skills-grid .skill-group:nth-child(2) { transition-delay: 0.08s; }
html.js .skills-grid .skill-group:nth-child(3) { transition-delay: 0.16s; }
html.js .skills-grid .skill-group:nth-child(4) { transition-delay: 0.24s; }
@media (prefers-reduced-motion: reduce) {
  html.js .section-display,
  html.js .featured,
  html.js .detail,
  html.js .entry,
  html.js .skill-group,
  html.js .cred-grid,
  html.js .leadership,
  html.js .prose,
  html.js .other-work,
  html.js .contact-list {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---- Footer ---- */
.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px clamp(20px, 5vw, 48px) 64px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  border-top: 1px solid var(--border);
}

/* ---- Responsive ---- */
@media (max-width: 720px) {
  .featured-grid { grid-template-columns: 1fr; gap: 30px; text-align: center; }
  .featured-text { text-align: left; }
  .tags { justify-content: flex-start; }
  .details { gap: 56px; }
  .detail-grid,
  .detail:nth-child(even) .detail-grid { grid-template-columns: 1fr; gap: 26px; }
  .detail:nth-child(even) .detail-repo { order: 0; }
  .detail-repo { padding: 24px 20px; }
  .cred-grid { grid-template-columns: 1fr; gap: 26px; }
  .skills-grid { grid-template-columns: 1fr; gap: 26px; }
  .about-grid { grid-template-columns: 1fr; gap: 26px; }
  .about-photo { max-width: 240px; margin: 0 auto; }
  .media-img { max-width: 340px; }
  .entry-with-photo { flex-direction: column-reverse; align-items: flex-start; gap: 18px; }
  .entry-photo { width: 190px; }
}
