/* ============================================================
   CONNIE QIAN — PORTFOLIO SITE
   Palette: black/white minimal, hover accent #A95440
   Type: system-ui stack — clean, editorial
   ============================================================ */

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

:root {
  --accent: #A95440;
  --black: #111111;
  --white: #ffffff;
  --gray: #888888;
  --gap: 5px;
  --sidebar-width: 260px;
  --font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-size: 15px;
  --line-height: 1.6;
}

html, body {
  min-height: 100%;
  background: var(--white);
  color: var(--black);
  font-family: var(--font);
  font-size: var(--font-size);
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
}

body {
  position: relative;
}

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

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

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

/* ============================================================
   LOADING SCREEN
   ============================================================ */

#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#loading-screen img {
  width: 250px;
  height: auto;
}

/* ============================================================
   SIDEBAR / COLUMN 1
   ============================================================ */

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.sidebar-logo {
  display: block;
  margin-bottom: 32px;
  cursor: pointer;
}

.sidebar-logo img {
  width: 212px;
  object-fit: cover;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}

.sidebar-nav li a {
  font-size: 16px;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.sidebar-nav li a.active {
  text-decoration: underline;
}

.sidebar-instagram {
  margin-top: 16px;
  display: flex;
  align-items: center;
}

.sidebar-instagram a {
  display: flex;
  align-items: center;
}

.sidebar-instagram a:hover svg path,
.sidebar-instagram a:hover svg rect,
.sidebar-instagram a:hover svg circle {
  stroke: var(--accent);
}

.sidebar-copyright {
  margin-top: 16px;
  font-size: 11px;
  color: var(--gray);
  line-height: 1.4;
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */

.page-layout {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   WORK INDEX — masonry columns
   ============================================================ */

.works-grid {
  flex: 1;
  display: block;
  column-count: 3;
  column-gap: var(--gap);
  padding: var(--gap);
}

/* ============================================================
   WORK TILE — static images keep natural height, slideshows stay square
   ============================================================ */

.work-tile {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: block;
  width: 100%;
  margin-bottom: var(--gap);
  break-inside: avoid;
}

.work-tile img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.35s ease;
}

.work-tile[data-slides] {
  aspect-ratio: 1 / 1;
}

.work-tile[data-slides] img {
  height: 100%;
  object-fit: cover;
}

.work-tile:hover img {
  transform: scale(1.05);
}

.work-tile-overlay {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.45);
  display: flex;
  align-items: flex-end;
  padding: 12px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.work-tile:hover .work-tile-overlay {
  opacity: 1;
}

.work-tile-title {
  color: var(--white);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */

.about-content {
  flex: 1;
  display: flex;
  gap: 40px;
  padding: 20px 30px;
}

.about-photo {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.about-photo img {
  width: 300px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.about-bio {
  max-width: 420px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--black);
  padding-top: 4px;
}

.about-bio h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* ============================================================
   INDIVIDUAL WORK PAGE
   ============================================================ */

.work-detail-layout {
  display: flex;
  min-height: 100vh;
}

.work-detail-main {
  display: flex;
  flex: 1;
}

.work-detail-sticky {
  flex: 1;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  padding: 20px;
}

.work-detail-sticky img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.work-detail-info {
  width: 340px;
  flex-shrink: 0;
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  height: 100vh;
}

.work-detail-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: capitalize;
}

.work-detail-description {
  font-size: 13px;
  line-height: 1.75;
  color: #444;
}

.work-thumbnails {
  column-count: 2;
  column-gap: var(--gap);
}

.work-thumb {
  overflow: hidden;
  cursor: pointer;
  position: relative;
  width: 100%;
  margin-bottom: var(--gap);
  break-inside: avoid;
}

.work-thumb img {
  width: 100%;
  height: auto;
  transition: transform 0.3s ease;
  display: block;
}

.work-thumb:hover img {
  transform: scale(1.04);
}

.work-thumb.active {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 768px) {
  .page-layout {
    flex-direction: column;
    padding-bottom: 34px;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    width: 100%;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 14px 16px;
    gap: 12px;
    border-bottom: 1px solid #e8e8e8;
    overflow: visible;
  }

  .sidebar-logo {
    width: 100%;
    margin-bottom: 0;
  }

  .sidebar-logo img {
    width: 200px;
    max-width: calc(100vw - 32px);
    height: auto;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px 16px;
    flex: 1;
  }

  .sidebar-nav li a {
    font-size: 13px;
  }

  .sidebar-instagram {
    margin-top: 0;
  }

  .sidebar-copyright {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10px;
    transform: none;
    width: 100vw;
    margin-top: 0;
    font-size: 9px;
    text-align: center;
    z-index: 10;
  }

  .works-grid {
    column-count: 1;
  }

  .about-content {
    flex-direction: column;
    padding: 16px;
    gap: 24px;
    align-items: center;
  }

  .about-photo img {
    width: 300px;
    max-width: 100%;
  }

  .work-detail-main {
    flex-direction: column;
  }

  .work-detail-sticky {
    position: static;
    height: 50vw;
    min-height: 220px;
  }

  .work-detail-info {
    width: 100%;
    height: auto;
    overflow-y: visible;
  }
}

@media (prefers-reduced-motion: reduce) {
  .work-tile img,
  .work-thumb img {
    transition: none;
  }
}
