:root {
  --bg: #ffffff;
  --fg: #111111;
  --link: #0055ff;
  --border: #d9d9d9;
  --about-border: #ffa417;
  --writing-border: #ff5a3c;
  --projects-border: #3ce1ff;
  --talks-border: #48ff40;
  --screen-bg: #ffffff;
}
* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  line-height: 1.6;
}
a { color: var(--link); }
noscript { display: none; }
.screen {
  position: absolute;
  top: 80px;
  left: 80px;
  right: 80px;
  bottom: 80px;
  padding: 50px;
  border: 2px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.05);
  background: var(--screen-bg);
  overflow: auto;

  display: flex;
  flex-direction: column;
}
/* Close button (X) */
.win-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  line-height: 24px;
  text-align: center;
  font-weight: 700;
  font-size: 22px;
  border: none;
  background: transparent;
  color: var(--border);
  cursor: pointer;
  padding: 0;
  z-index: 10;
}
.win-close:hover { color: #bfbfbf; }
.win-close:active { transform: translate(1px,1px); }

/* Shrink animation when minimizing */
.screen.is-minimizing {
  animation: shrink-to-dot 450ms ease-in forwards;
}
@keyframes shrink-to-dot {
  0% { transform: scale(1); opacity: 1; }
  80% { transform: scale(0.02); opacity: 1; }
  100% { transform: scale(0.02); opacity: 0; }
}

@media (max-width: 600px) {
  .screen {
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    padding: 12.5px;
  }
}
.header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 28px;
}
.title {
  font-weight: 700;
  letter-spacing: 0.4px;
  font-size: 1.6em;
  text-transform: uppercase;
}
.status {
  font-size: 13px;
  opacity: 0.7;
  text-align: right;
}

.status:hover {
  cursor: pointer;
}
nav {
  grid-column: 1 / -1;
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  position: relative;
}
nav a {
  padding: 6px 10px;
  border-radius: 4px;
  text-decoration: none;
  color: var(--link);
  text-transform: uppercase;
  border: 2px solid transparent;
  position: relative;
  z-index: 1;
}
nav a:hover {
  text-decoration: underline;
}
/* Override per-link active borders to use a single moving indicator instead */
nav a.active { border-color: transparent !important; }
.nav-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  pointer-events: none;
  z-index: 0;
  transition: transform 250ms cubic-bezier(0.22, 1, 0.36, 1), width 250ms cubic-bezier(0.22, 1, 0.36, 1), height 250ms cubic-bezier(0.22, 1, 0.36, 1), border-color 200ms ease;
  opacity: 0;
}
main p { margin-bottom: 20px; }
main {flex: 1}
main ul { margin-bottom: 20px; list-style: none; padding-left: 0; }
#writing li, #projects p, #talks li { margin-bottom: 28px; }
/* Footer */
.footer {
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  opacity: 0.75;
}
/* Keep selection allowed, but remove highlight color in footer */
.footer::selection, .footer *::selection {
  background: transparent;
  color: inherit;
}
/* Footer links should not appear blue or underlined */
.footer a,
.footer a:visited,
.footer a:hover,
.footer a:active {
  color: inherit;
  text-decoration: none;
}
.clicker {
  display: inline-block;
  width: 6px;
  height: 1em;
  background: var(--fg);
  margin-left: 4px;
  animation: blink 1s steps(1, end) infinite;
  vertical-align: text-bottom;
}
@keyframes blink { 0%,49%{opacity:1} 50%,100%{opacity:0} }
.page { display: none; position: relative; }
.page.active { display: block; }
.page .content { position: relative; }
#about p { margin-bottom: 28px; }
/* Ensure section titles align with left edge of body text */
.content h3, .content h4 {
  margin: 0 0 16px 0;
  padding-left: 0;
  text-align: left;
}
.content p {
  margin: 0 0 20px 0;
}

/* Responsive 6x6 photo grid for project images */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
@media (max-width: 800px) {
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}
/* Individual photo container */
.photo-wrap {
  overflow: hidden;
  position: relative;
  aspect-ratio: 1 / 1;
}
/* Allow hovered photos to expand beyond the grid */
.photo-wrap:hover {
  overflow: visible;
  z-index: 10;
}
.photo-grid img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease, object-fit 0.3s ease;
  transform: translate(-50%, -50%);
  transform-origin: center center;
}
/* Enlarge and reveal full photo on hover */
.photo-wrap:hover img {
  transform: translate(-50%, -50%) scale(2);
  object-fit: contain;
}
/* Project grid */


.projects-grid {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 0;
  margin: 0;
}

.project-card {
  display: inline-block;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 4px;
  background: #fff;
  color: #000;
  text-align: left;
  border: 1px solid var(--border);
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-amb:hover {
  background: #ffa417;
  color: #fff;
  border-color: #ffa417;
}

.card-rhythm:hover {
  background: #ff5a3c;
  color: #fff;
  border-color: #ff5a3c;
}

.card-ealc:hover {
  background: #3ce1ff;
  color: #000;
  border-color: #3ce1ff;
}

.card-couple:hover {
  background: #c073ff;
  color: #fff;
  border-color: #c073ff;
}

/* Project switching */
.project-pane {
  display: none;
  padding: 0;
}
.project-pane.active { display: block; }
.project-pane h3 {
  margin: 0 0 16px 0;
}
.project-switch {
  color: inherit;
  cursor: pointer;
  margin-left: 8px;
}

/* Heart animations */
.heart {
  transition: left 1200ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
              top 1200ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 1200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  width: 22px;
  height: 22px;
  background: #ff0000;
  transform: rotate(-45deg);
}
.heart::before,
.heart::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  background: #ff0000;
  border-radius: 50%;
}
.heart::before { top: -11px; left: 0; }
.heart::after  { top: 0; left: 11px; }
.heart.shake { animation: heart-shake 2s ease; }
@keyframes heart-shake {
  0%, 100% { transform: rotate(-45deg) scale(2) translate(0, 0); }
  20% { transform: rotate(-45deg) scale(2) translate(1px, -1px); }
  40% { transform: rotate(-45deg) scale(2) translate(-1px, 1px); }
  60% { transform: rotate(-45deg) scale(2) translate(1px, 1px); }
  80% { transform: rotate(-45deg) scale(2) translate(-1px, -1px); }
}

/* Floating dots that drift upward and fade */
.float-dot {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff2b2b;
  opacity: 1;
  z-index: 9999;
  transform: translate(0,0) scale(1);
  will-change: transform, opacity;
  transition: transform 2500ms cubic-bezier(0.22, 1, 0.36, 1), opacity 2500ms ease;
}
.float-dot.light { background: #ff6b6b; width: 4px; height: 4px; }

/* Centered heart wrapper for beating and growth */
.heart-wrap {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(1);
  z-index: 9999;
}
