/* ---------------------------------------------------------------
   milo feng — personal site
   design tokens
--------------------------------------------------------------- */
:root {
  --bg:          #1f1f23;
  --bg-card:     #2b2b30;
  --bg-hover:    #3a3a40;
  --border:      rgba(255, 255, 255, 0.08);
  --border-soft: rgba(255, 255, 255, 0.04);
  --text:        #f3f4f6;
  --text-muted:  #a1a3ac;
  --text-dim:    #6e7079;

  --container: 768px;
  --radius:    8px;
  --radius-sm: 6px;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

::selection { background: rgba(243, 244, 246, 0.16); }

:focus-visible {
  outline: 1px solid var(--text-muted);
  outline-offset: 3px;
  border-radius: 3px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------------------------------------------------------
   nav
--------------------------------------------------------------- */
.nav {
  padding: 20px 0;
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav__brand {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s var(--ease);
}

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

.nav__link.is-active { color: var(--text); }

.nav__link svg {
  width: 14px;
  height: 14px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------------------------------------------------------------
   layout
--------------------------------------------------------------- */
.main {
  flex: 1 0 auto;
  padding-bottom: 96px;
  animation: rise 0.5s var(--ease) both;
}

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

@media (prefers-reduced-motion: reduce) {
  .main { animation: none; }
  * { transition-duration: 0.01ms !important; }
}

.section { margin-top: 64px; }

.section__label {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-muted);
  margin: 0 0 20px;
}

/* ---------------------------------------------------------------
   bio / hero
--------------------------------------------------------------- */
.hero {
  margin-top: 40px;
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 40px;
  align-items: start;
}

.hero__title {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.9px;
  line-height: 1.15;
  margin: 0 0 16px;
}

.hero__body {
  margin: 0;
  color: var(--text-muted);
  font-size: 16px;
}

.hero__body strong {
  color: var(--text);
  font-weight: 500;
}

.hero__portrait {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  aspect-ratio: 3 / 4;
  object-fit: cover;
  width: 100%;
}

.hero__caption {
  margin: 10px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}

.hero.is-textonly { grid-template-columns: 1fr; }
.hero.is-textonly .hero__figure { display: none; }

@media (max-width: 640px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .hero__figure { order: -1; max-width: 200px; }
  .hero__title { font-size: 30px; }
}

/* ---------------------------------------------------------------
   links / buttons
--------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 8px 20px;
  font-size: 14px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.btn:hover {
  background: var(--bg-hover);
  border-color: rgba(255, 255, 255, 0.14);
}

.btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* "see my work" + the link icons, side by side on one line */
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.actions .btn { margin-top: 0; }

/* social icon row */
.socials {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: transparent;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease),
              border-color 0.15s var(--ease), transform 0.15s var(--ease);
}

.social:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.social svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.social--stroke svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------------------------------------------------------------
   film cards
--------------------------------------------------------------- */
.films {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 640px) {
  .films { grid-template-columns: 1fr; }
}

.film {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 12px;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.film:hover {
  background: var(--bg-hover);
  border-color: rgba(255, 255, 255, 0.14);
}

/* a film with no link yet — shown, but not clickable */
.film--nolink { cursor: default; }

.film--nolink:hover {
  background: var(--bg-card);
  border-color: var(--border);
}

.film--nolink .film__thumb img { transform: none; }

.film__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: linear-gradient(140deg, #34343b, #232327);
}

.film__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease), opacity 0.2s var(--ease);
}

.film:hover .film__thumb img { transform: scale(1.03); }

.film__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  background: rgba(20, 20, 24, 0.35);
  transition: opacity 0.2s var(--ease);
}

.film:hover .film__play { opacity: 1; }

.film__play svg {
  width: 34px;
  height: 34px;
  fill: var(--text);
}

.film__meta { padding: 12px 4px 4px; }

.film__title {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.1px;
}

.film__sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------------------------------------------------------------
   photo grid
--------------------------------------------------------------- */
.photos {
  columns: 2;
  column-gap: 16px;
}

@media (max-width: 640px) {
  .photos { columns: 1; }
}

.photo {
  display: block;
  width: 100%;
  margin: 0 0 16px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(140deg, #34343b, #232327);
  cursor: zoom-in;
  break-inside: avoid;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease);
}

.photo:hover {
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

.photo img {
  width: 100%;
  height: auto;
  transition: opacity 0.3s var(--ease);
}

/* fallback tile shown when an image file isn't there yet */
.photo.is-empty,
.film__thumb.is-empty {
  position: relative;
  min-height: 180px;
}

.photo.is-empty img,
.film__thumb.is-empty img { display: none; }

.photo.is-empty::after,
.film__thumb.is-empty::after {
  content: attr(data-empty);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ---------------------------------------------------------------
   lightbox
--------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgba(15, 15, 18, 0.92);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s var(--ease), visibility 0.2s var(--ease);
}

.lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox img {
  max-width: 100%;
  max-height: 84vh;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.lightbox__caption {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.lightbox__close {
  position: absolute;
  top: 20px;
  right: 22px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.lightbox__close:hover { background: var(--bg-hover); color: var(--text); }

.lightbox__close svg {
  width: 15px; height: 15px;
  stroke: currentColor; fill: none;
  stroke-width: 1.6; stroke-linecap: round;
}

/* ---------------------------------------------------------------
   clock (bio page, bottom-left)
--------------------------------------------------------------- */
.clock {
  position: fixed;
  left: 24px;
  bottom: 20px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font-size: 12.5px;
  color: var(--text-muted);
  background: rgba(43, 43, 48, 0.72);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  user-select: none;
  animation: rise 0.6s 0.2s var(--ease) both;
}

.clock__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.7;
  animation: tick 2s ease-in-out infinite;
}

@keyframes tick {
  0%, 100% { opacity: 0.25; }
  50%      { opacity: 0.9; }
}

.clock__time {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
  color: var(--text);
}

.clock__zone {
  color: var(--text-dim);
  font-size: 11.5px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

@media (max-width: 640px) {
  .clock { left: 16px; bottom: 14px; }
}

/* ---------------------------------------------------------------
   footer
--------------------------------------------------------------- */
.footer {
  flex: none;
  padding: 24px 0 28px;
  border-top: 1px solid var(--border-soft);
  font-size: 13px;
  color: var(--text-dim);
}

/* bio page: clear a strip at the bottom for the fixed clock */
.footer--bio { padding-bottom: 64px; }

.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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