@import url("https://fonts.googleapis.com/css2?family=Fragment+Mono&display=swap");

:root {
  --bg: #0e0e0e;
  --text: #e2dfd8;
  --muted: #52524e;
  --dim: #242420;
  --accent: #c4ad8a;
  --font: "Fragment Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100svh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  display: grid;
  place-items: center;
}

h1,
p {
  margin: 0;
}

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

.content {
  width: min(580px, calc(100% - 48px));
  padding: clamp(56px, 10svh, 100px) 0;
  opacity: 0;
  animation: appear 500ms ease 60ms forwards;
}

@keyframes appear {
  to {
    opacity: 1;
  }
}

/* ── Header ───────────────────────────────────── */

.header {
  margin-bottom: clamp(28px, 5vw, 40px);
}

h1 {
  font-size: clamp(1.25rem, 3.5vw, 1.75rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin-bottom: 10px;
}

.cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1.15s step-start infinite;
  margin-left: 1px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.tagline {
  color: var(--muted);
  font-size: clamp(0.78rem, 1.8vw, 0.88rem);
  letter-spacing: 0.01em;
}

/* ── Divider ──────────────────────────────────── */

.rule {
  width: 100%;
  height: 1px;
  background: var(--dim);
  margin: clamp(20px, 4vw, 30px) 0;
}

/* ── Experience ───────────────────────────────── */

.experience {
  display: grid;
  gap: 0;
}

.row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 20px;
  padding: 7px 0;
  cursor: default;
}

a.row {
  cursor: pointer;
}

.org {
  color: var(--muted);
  font-size: clamp(0.78rem, 1.8vw, 0.86rem);
  letter-spacing: 0.01em;
  transition: color 140ms ease;
  align-self: baseline;
}

.role {
  color: var(--text);
  font-size: clamp(0.78rem, 1.8vw, 0.86rem);
  align-self: baseline;
}

.tree-root {
  padding-top: 12px;
}

.tree-root:first-child {
  padding-top: 7px;
}

.tree-root .role {
  color: var(--muted);
}

.tree-row .org {
  position: relative;
  padding-left: 22px;
}

.tree-row .org::before,
.tree-row .org::after {
  content: "";
  position: absolute;
  left: 4px;
  background: currentColor;
  opacity: 0.68;
}

.tree-row .org::before {
  top: -7px;
  bottom: -7px;
  width: 1px;
}

.tree-row.tree-last .org::before {
  bottom: 50%;
}

.tree-row .org::after {
  top: 50%;
  width: 12px;
  height: 1px;
}

.tree-wide {
  grid-template-columns: max-content 1fr;
}

.tree-wide .org {
  white-space: nowrap;
}

.degree {
  display: inline-block;
  min-width: 25ch;
}

.degree::after {
  content: "B.S. Computer Engineering";
  animation: degree-shuffle 8s steps(1, end) infinite;
}

@keyframes degree-shuffle {
  0%, 34% { content: "B.S. Computer Engineering"; }
  35% { content: "B.S. C0mp#ter Eng!neering"; }
  36% { content: "B.S. 7xQp^ter E4g!n33r1ng"; }
  37% { content: "B.S. k2T$9r @nG!n##r1ng"; }
  38% { content: "B.S. Mx7#3m@t!c5"; }
  39% { content: "B.S. M4tH%q@t1c$"; }
  40% { content: "B.S. M@th3m@t!c5"; }
  41% { content: "B.S. Math3matics"; }
  42%, 76% { content: "B.S. Mathematics"; }
  77% { content: "B.S. M@th3m@t!c$"; }
  78% { content: "B.S. M4tH%q@t1c5"; }
  79% { content: "B.S. p9Z#v2r @nG!n33r"; }
  80% { content: "B.S. 9zQ%p8r Eng!n33r!ng"; }
  81% { content: "B.S. C0mp#ter E4g!n33r1ng"; }
  82% { content: "B.S. C0mputer Eng1neer!ng"; }
  83% { content: "B.S. Computer Engineer1ng"; }
  84%, 100% { content: "B.S. Computer Engineering"; }
}

@media (prefers-reduced-motion: reduce) {
  .degree::after {
    animation: none;
    content: "B.S. Computer Engineering";
  }
}

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

a.row:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

/* ── Pages ────────────────────────────────────── */

.pages {
  display: flex;
  gap: 0 22px;
}

.pages a {
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(0.78rem, 1.8vw, 0.86rem);
  letter-spacing: 0.01em;
  padding: 4px 0;
  text-decoration: none;
  transition: color 140ms ease;
}

.pages a::after {
  content: " →";
  color: var(--accent);
}

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

/* ── Links ────────────────────────────────────── */

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 22px;
}

.links a {
  color: var(--muted);
  font-size: clamp(0.78rem, 1.8vw, 0.86rem);
  letter-spacing: 0.01em;
  padding: 4px 0;
  position: relative;
  transition: color 140ms ease;
}

.links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 200ms ease;
}

.links a:hover {
  color: var(--text);
}

.links a:hover::after {
  width: 100%;
}

.links a:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

/* ── Responsive ───────────────────────────────── */

@media (max-width: 480px) {
  .row {
    grid-template-columns: 84px 1fr;
    gap: 14px;
  }
}

/* ── Photography page ─────────────────────────── */

body.photo-page {
  --muted: #908d88;
  --bio-text: #b8b4ae;
  display: block;
  min-height: 100svh;
  padding: 0;
  overflow-x: clip;
}

.photo-nav {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  width: 100%;
  padding: 18px 24px;
  background: rgba(14, 14, 14, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--dim);
  box-sizing: border-box;
}

.back-link {
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.82rem;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 140ms ease;
}

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

.gallery-hint {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-family: var(--font);
  font-size: 0.72rem;
  gap: 10px;
  justify-content: center;
  letter-spacing: 0.02em;
  margin: 18px 24px 18px;
  opacity: 1;
  text-align: center;
  transition: opacity 180ms ease;
}

.gallery-hint::before,
.gallery-hint::after {
  color: var(--accent);
}

.gallery-hint::before {
  content: "←";
}

.gallery-hint::after {
  content: "→";
}

.gallery-hint.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.gallery {
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
  padding: 20px 0;
  cursor: grab;
  user-select: none;
  contain: paint;
}

.gallery-marquee {
  display: flex;
  gap: 60px;
  will-change: transform;
}

.gallery-track {
  align-items: flex-start;
  display: flex;
  gap: 60px;
}

.gallery figure {
  flex-shrink: 0;
  width: 520px;
  margin: 0;
}

.gallery-media {
  align-items: center;
  display: flex;
  flex-direction: column;
  height: 520px;
  justify-content: center;
}

.gallery img {
  width: auto;
  height: auto;
  max-width: 520px;
  max-height: 520px;
  display: block;
  opacity: 0;
  transition: opacity 600ms ease;
}

.gallery img.visible {
  opacity: 1;
}

.gallery figcaption {
  color: var(--text);
  font-family: var(--font);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  margin-top: 12px;
  text-align: center;
  opacity: 0;
  transition: opacity 600ms ease, color 140ms ease;
}

.gallery-media:has(img.visible) figcaption {
  opacity: 1;
}


.gallery figure:hover figcaption {
  color: var(--accent);
}

.gallery figcaption em,
.lb-caption em {
  font-size: 0.8rem;
}

.caption-loc {
  font-size: 0.65rem;
}

/* ── Lightbox ─────────────────────────────────── */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 8, 0.96);
  opacity: 0;
  pointer-events: none;
  cursor: default;
  transition: opacity 220ms ease;
  user-select: none;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lb-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 90svh;
}

.lb-img {
  display: block;
  max-width: 90vw;
  max-height: 82svh;
  object-fit: contain;
  cursor: default;
}

.lb-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 6px 8px;
  transition: color 140ms ease;
  font-family: var(--font);
}

.lb-close:hover {
  color: var(--accent);
}

.lb-prev,
.lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 12px 20px;
  transition: color 140ms ease;
  font-family: var(--font);
}

.lb-prev { left: 16px; }
.lb-next { right: 16px; }

.lb-prev:hover,
.lb-next:hover {
  color: var(--accent);
}

.lb-caption {
  margin: 14px 0 0;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-align: center;
  cursor: default;
  user-select: none;
}

.lb-word {
  transition: color 140ms ease;
}

.lb-word:hover {
  color: var(--accent);
}

/* ── Photo bio ────────────────────────────────── */

.photo-bio {
  max-width: 560px;
  margin: 40px auto 80px;
  padding: 0 24px;
  border-top: 1px solid var(--dim);
  padding-top: 40px;
}

.photo-bio-text {
  color: var(--bio-text);
  font-family: var(--font);
  font-size: 0.8rem;
  line-height: 1.75;
  letter-spacing: 0.01em;
  margin: 0 0 18px;
}

.photo-bio-contact {
  color: var(--bio-text);
  font-family: var(--font);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  margin: 0;
}

.photo-bio-contact a {
  color: var(--accent);
  text-decoration: none;
  transition: color 140ms ease;
}

.photo-bio-contact a:hover {
  color: var(--text);
}
