/* ---------- Tokens ---------- */

:root {
  --bg: #ffffff;
  --bg-alt: #f6f6f6;
  --ink: #111111;
  --ink-soft: #5c5c5c;
  --line: #e8e8e8;
  --accent: #e00c20;
  --accent-hover: #c00a1b;
  --max: 1120px;
  --header-h: 72px;
  --radius: 4px;
  --font: "Manrope", system-ui, sans-serif;
  --font-display: "Source Serif 4", Georgia, serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

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

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

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

.container {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}


/* ---------- Header ---------- */

.header-section {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-wrap {
  position: relative;
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.header-logo {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  flex-shrink: 0;
  color: var(--ink);
}

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

.header-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.header-toggle {
  display: none;
  width: 40px;
  height: 40px;
  margin-left: auto;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  border-radius: var(--radius);
}

.header-toggle .bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.header-checkbox:checked + .header-toggle .bar:first-child {
  transform: translateY(4px) rotate(45deg);
}

.header-checkbox:checked + .header-toggle .bar:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

.header-nav {
  margin-left: auto;
}

.header-nav ul {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.header-nav a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

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

.header-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  background: var(--accent);
  color: #fff !important;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius);
  flex-shrink: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}

.header-button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}


/* ---------- Hero ---------- */

.home-hero {
  position: relative;
  min-height: min(92vh, 820px);
  overflow: hidden;
  background: #0d0d0d;
  color: #fff;
}

.home-slider {
  position: absolute;
  inset: 0;
}

.home-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.home-slide.is-active {
  opacity: 1;
}

.home-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.45) saturate(0.85);
}

.home-hero-overlay {
  position: relative;
  z-index: 2;
  min-height: min(92vh, 820px);
  display: flex;
  align-items: flex-end;
  padding: 4rem 0 5rem;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.72) 100%);
}

.hero-copy {
  max-width: 640px;
  animation: heroRise 0.9s ease both;
}

.hero-kicker {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 0.75rem;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  color: #fff;
}

.hero-lead {
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 1.75rem;
  max-width: 36rem;
}

.global-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.4rem;
  background: var(--accent);
  color: #fff !important;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius);
  transition: background 0.2s ease, transform 0.2s ease;
}

.global-button:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.home-slider-dots {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  display: flex;
  gap: 0.45rem;
}

.home-slider-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
}

.home-slider-dots button.is-active {
  background: #fff;
  width: 22px;
  border-radius: 999px;
}

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


/* ---------- Sections ---------- */

.loop-section {
  padding: 4.5rem 0;
}

.section-alt {
  background: var(--bg-alt);
}

.global-label {
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--ink);
}

.section-intro {
  text-align: center;
  max-width: 36rem;
  margin: 0 auto 2.5rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.global-label + .editorial-block,
.global-label + .timeline,
.global-label + .skill-groups,
.global-label + .simple-list,
.global-label + .loop-wrap {
  margin-top: 2.5rem;
}


/* ---------- Editorial / timeline ---------- */

.editorial-block {
  max-width: 720px;
  margin-inline: auto;
  padding: 1.75rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.editorial-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.editorial-block .date,
.titem .date {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
}

.status-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
}

.editorial-block h3,
.titem h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.edu-gpa {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0.65rem 0;
}

.edu-loc {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.org-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.badge-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.badge-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.org {
  font-size: 0.95rem;
  color: var(--ink-soft);
  font-weight: 500;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.titem {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.5rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--line);
}

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

.titem ul {
  margin-top: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.titem li {
  position: relative;
  padding-left: 1rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.titem li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}


/* ---------- Item cards (editorial grid) ---------- */

.loop-wrap {
  display: grid;
  gap: 1.5rem;
}

.loop-wrap.items-2 {
  grid-template-columns: repeat(2, 1fr);
}

.loop-wrap.items-3 {
  grid-template-columns: repeat(3, 1fr);
}

.item {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.section-alt .item {
  background: #fff;
}

.item:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}

.project-card {
  cursor: pointer;
}

.item-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.item-image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #1a1a1a;
}

.item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.item:hover .item-image img {
  transform: scale(1.04);
}

.item-image--placeholder {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, #1a1a1a 0%, #3a1015 55%, #e00c20 160%);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.item-content {
  padding: 1.25rem 1.35rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}

.item-tag {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.item-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.item-title a:hover {
  color: var(--accent);
}

.item-excerpt {
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

.authors,
.when,
.ref-note {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.card-hint {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
}

.text-link {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-link:hover {
  color: var(--accent);
}


/* ---------- Skills ---------- */

.skill-groups {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  max-width: 800px;
  margin-inline: auto;
}

.group .label {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  display: inline-flex;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
}


/* ---------- Lists ---------- */

.simple-list {
  max-width: 800px;
  margin-inline: auto;
  border-top: 1px solid var(--line);
}

.simple-list li {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.simple-list .src {
  color: var(--ink-soft);
  font-weight: 500;
}

.simple-list .when {
  flex-shrink: 0;
  font-weight: 700;
  color: var(--ink-soft);
}


/* ---------- Footer ---------- */

.site-footer {
  background: #111;
  color: #f2f2f2;
  padding: 3.5rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.footer-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.footer-desc {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  max-width: 28rem;
}

.footer-nav-title {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}

.footer-nav-column {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.footer-nav-column a {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 500;
  font-size: 0.95rem;
}

.footer-nav-column a:hover {
  color: #fff;
}

.fine {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}


/* ---------- Reveal ---------- */

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

.reveal.in {
  opacity: 1;
  transform: none;
}


/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  display: grid;
  place-items: center;
  padding: 2rem;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox-figure {
  margin: 0;
  max-width: min(960px, 100%);
  text-align: center;
}

.lightbox-figure img {
  max-height: 75vh;
  width: auto;
  margin-inline: auto;
  border-radius: var(--radius);
}

.lightbox-figure figcaption {
  margin-top: 0.85rem;
  color: #fff;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  border-radius: var(--radius);
}

.lightbox-close {
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  font-size: 1.75rem;
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

.lightbox-nav[hidden] {
  display: none;
}


/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .loop-wrap.items-2,
  .loop-wrap.items-3 {
    grid-template-columns: 1fr;
  }

  .titem {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .header-toggle {
    display: flex;
  }

  .header-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .header-checkbox:checked ~ .header-nav {
    max-height: 320px;
  }

  .header-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1.25rem 1rem;
  }

  .header-nav a {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
  }

  .header-button {
    padding: 0.45rem 0.8rem;
    font-size: 0.8rem;
  }

  .home-hero,
  .home-hero-overlay {
    min-height: min(88vh, 700px);
  }
}

@media (max-width: 560px) {
  .container,
  .header-wrap {
    width: min(100% - 1.5rem, var(--max));
  }

  .simple-list li {
    flex-direction: column;
    gap: 0.35rem;
  }

  .home-hero-overlay {
    padding: 3rem 0 4rem;
  }
}

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

  .reveal,
  .hero-copy,
  .home-slide,
  .item,
  .item-image img {
    transition: none !important;
    animation: none !important;
  }

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