/* ═══════════════════════════════════════════════════════════════════════════
   SHARED PORTFOLIO STYLES

   Unified CSS for multi-page portfolio structure:
   - Category listing pages (web.html, print.html, video.html)
   - Project detail pages
   - About page
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══ RESET & VARIABLES ═══ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --white: #ffffff;
  --off: #f7f7f5;
  --ink: #111111;
  --mid: #888888;
  --pale: #e0e0dc;
  --header-h: 56px;
  --tr: 240ms cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'EB Garamond', Georgia, serif;
  background: var(--white);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  animation: pageIn 0.5s ease forwards;
}

@keyframes pageIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}


/* ═══ HEADER ═══ */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--pale);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 100;
}

.logo {
  font-family: 'EB Garamond', serif;
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--ink);
  text-decoration: none;
  transition: opacity var(--tr);
}

.logo:hover {
  opacity: 0.6;
}

nav.top-nav {
  display: flex;
  gap: 36px;
  align-items: center;
}

nav.top-nav a {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mid);
  text-decoration: none;
  transition: color var(--tr);
  position: relative;
  padding-bottom: 2px;
}

nav.top-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--ink);
  transition: width var(--tr);
}

nav.top-nav a:hover,
nav.top-nav a.active {
  color: var(--ink);
}

nav.top-nav a:hover::after,
nav.top-nav a.active::after {
  width: 100%;
}


/* ═══ LAYOUT (Sidebar + Main) ═══ */
:root {
  --nav-w: 25vw;
}

.layout {
  display: flex;
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* LEFT NAV */
aside.left-nav {
  width: var(--nav-w);
  min-width: 240px;
  max-width: 320px;
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  border-right: 1px solid var(--pale);
  padding: 40px 0 60px;
  background: var(--white);
}

aside.left-nav::-webkit-scrollbar { width: 3px; }
aside.left-nav::-webkit-scrollbar-thumb { background: var(--pale); }

.nav-section-label {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid);
  padding: 0 36px 16px;
  display: block;
}

.nav-list {
  list-style: none;
}

.nav-list li {
  border-top: 1px solid var(--pale);
}

.nav-list li:last-child {
  border-bottom: 1px solid var(--pale);
}

.nav-list a {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 36px;
  text-decoration: none;
  color: var(--ink);
  transition: background var(--tr);
  cursor: pointer;
}

.nav-list a:hover,
.nav-list a.active-item {
  background: var(--off);
}

.nav-num {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  color: var(--mid);
  padding-top: 4px;
  flex-shrink: 0;
  width: 20px;
}

.nav-info .nav-title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.3;
  margin-bottom: 3px;
}

.nav-info .nav-sub {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  color: var(--mid);
  letter-spacing: 0.08em;
}

/* MAIN CONTENT (right of sidebar) */
main {
  margin-left: var(--nav-w);
  flex: 1;
  padding: 60px 64px 100px;
  min-height: calc(100vh - var(--header-h));
}

/* Standalone main (no sidebar, e.g. detail pages) */
main.standalone {
  margin-left: 0;
  padding: var(--header-h) 64px 100px;
}

.page-wrapper {
  max-width: 1400px;
  margin: 0 auto;
}

.page-content {
  max-width: 1200px;
  margin: 0 auto;
}


/* ═══ BREADCRUMB / BACK NAVIGATION ═══ */
.breadcrumb {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 48px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: color var(--tr);
}

.breadcrumb a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  transition: opacity var(--tr);
}

.breadcrumb a:hover {
  opacity: 0.6;
}

.breadcrumb-arrow {
  color: var(--mid);
  font-size: 10px;
}


/* ═══ LISTING PAGE HEADER ═══ */
.project-header {
  margin-bottom: 52px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--pale);
}

.project-category {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 12px;
  display: block;
}

.project-heading {
  font-size: clamp(28px, 3.5vw, 46px);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.01em;
  line-height: 1.1;
}


/* ═══ GRID & CARDS (Listing Pages) ═══ */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px 32px;
}

.card {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.5s forwards;
  transition: transform 0.3s var(--tr);
}

.card:nth-child(1) {
  animation-delay: 0.05s;
}

.card:nth-child(2) {
  animation-delay: 0.10s;
}

.card:nth-child(3) {
  animation-delay: 0.15s;
}

.card:nth-child(4) {
  animation-delay: 0.20s;
}

.card:nth-child(5) {
  animation-delay: 0.25s;
}

.card:nth-child(6) {
  animation-delay: 0.30s;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card:hover {
  transform: translateY(-2px);
}

/* Card image */
.card-img {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--off);
  margin-bottom: 16px;
  position: relative;
  border-radius: 2px;
}

.card-img.wide {
  aspect-ratio: 16/9;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.card-img::after {
  content: 'View Project';
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 17, 17, 0);
  transition: background 0.3s ease;
  pointer-events: none;
}

.card:hover .card-img::after {
  background: rgba(17, 17, 17, 0.22);
}

/* Card image placeholder */
.card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--pale);
  text-transform: uppercase;
  user-select: none;
}

.ph-1 {
  background: #f0efed;
}

.ph-2 {
  background: #ebebeb;
}

.ph-3 {
  background: #eeecea;
}

.ph-4 {
  background: #f2f1ef;
}

.ph-5 {
  background: #ededed;
}

.ph-6 {
  background: #f0efec;
}

/* Card metadata */
.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.card-title {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.card-year {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--mid);
  flex-shrink: 0;
  padding-top: 3px;
}

.card-desc {
  font-size: 13px;
  color: var(--mid);
  line-height: 1.65;
  font-style: italic;
  margin-bottom: 10px;
}

/* Tags */
.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
  border: 1px solid var(--pale);
  padding: 3px 8px;
  border-radius: 2px;
}


/* ═══ PROJECT DETAIL PAGE LAYOUT ═══ */
.detail-layout {
  display: flex;
  gap: 0;
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* Scrollable image slides column (left) */
.detail-slides {
  flex: 1;
  overflow-y: auto;
  padding: 80px 0 96px;
  scrollbar-width: thin;
  scrollbar-color: var(--pale) transparent;
}

.detail-slides::-webkit-scrollbar {
  width: 3px;
}

.detail-slides::-webkit-scrollbar-thumb {
  background: var(--pale);
}

/* Individual slide */
.detail-slide {
  width: 100%;
  position: relative;
  margin-bottom: 3px;
}

.slide-ph {
  width: 100%;
  position: relative;
  background: var(--off);
  overflow: hidden;
}

.slide-ph img {
  width: 100%;
  height: auto;
  display: block;
}

/* placeholder-only slides keep fixed ratio */
.slide-ph:not(:has(img)) {
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-ph.wide:not(:has(img)):not(:has(iframe)) {
  aspect-ratio: 16/9;
}

/* YouTube embed */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  overflow: hidden;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Detail meta list */
.detail-meta-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.detail-meta-list li {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--pale);
  padding: 6px 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  gap: 12px;
}

.detail-meta-list li strong {
  color: var(--ink);
  min-width: 80px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
}

.slide-label {
  position: absolute;
  bottom: 14px;
  right: 18px;
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: rgba(17, 17, 17, 0.3);
  text-transform: uppercase;
  pointer-events: none;
}

.slide-counter {
  position: absolute;
  bottom: 14px;
  left: 18px;
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: rgba(17, 17, 17, 0.22);
  pointer-events: none;
}

/* Fixed info sidebar (right) */
.detail-info {
  width: 35%;
  flex-shrink: 0;
  border-left: 1px solid var(--pale);
  padding: 80px 44px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  position: sticky;
  top: 0;
  background: var(--white);
}

.detail-info::-webkit-scrollbar {
  width: 3px;
}

.detail-info::-webkit-scrollbar-thumb {
  background: var(--pale);
}

.detail-cat {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 16px;
}

.detail-title {
  font-size: 22px;
  font-weight: 500;
  font-style: italic;
  line-height: 1.2;
  margin-bottom: 6px;
}

.detail-year {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--mid);
  margin-bottom: 28px;
}

.detail-divider,
.detail-rule {
  width: 20px;
  height: 1px;
  background: var(--pale);
  margin-bottom: 24px;
}

.detail-desc {
  font-size: 13.5px;
  line-height: 1.78;
  color: #444;
  flex: 1;
  margin-bottom: 28px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Project prev/next navigation */
.detail-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--pale);
}

.detail-nav-link {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--ink);
  transition: opacity var(--tr);
}

.detail-nav-link:hover {
  opacity: 0.5;
}

.detail-nav-link[href="javascript:void(0);"] {
  color: var(--pale);
  border-bottom-color: var(--pale);
  pointer-events: none;
}


/* ═══ ABOUT PAGE ═══ */
.about-wrap {
  max-width: 720px;
  opacity: 0;
  animation: fadeUp 0.5s 0.05s forwards;
}

.about-name {
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 400;
  font-style: italic;
  line-height: 1.05;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.about-tagline {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--mid);
  margin-bottom: 48px;
}

.about-section {
  margin-bottom: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--pale);
}

.about-competency-list {
  list-style: none;
}

.about-competency-list li {
  font-size: 14px;
  line-height: 1.8;
  color: #333;
  padding: 8px 0;
  border-bottom: 1px solid var(--pale);
  position: relative;
  padding-left: 16px;
}

.about-competency-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--mid);
}

.about-career-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.about-career-company {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.about-career-role {
  font-size: 12px;
  color: var(--mid);
}

.about-bio {
  font-size: 16px;
  line-height: 1.8;
  color: #333;
  margin-bottom: 48px;
}

.about-bio p + p {
  margin-top: 20px;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--pale);
}

.about-col-label {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 20px;
}

.about-list {
  list-style: none;
}

.about-list li {
  font-size: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--pale);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.about-list li span {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--mid);
}

.contact-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 48px;
}

.contact-link {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  transition: opacity var(--tr);
}

.contact-link:hover {
  opacity: 0.4;
}


/* ═══ PAGE BACK BUTTON ═══ */
.back-button {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
  padding: 8px 0;
  border-bottom: 1px solid var(--ink);
  transition: opacity var(--tr);
}

.back-button:hover {
  opacity: 0.6;
}

.back-icon {
  font-size: 10px;
}


/* ═══ RESPONSIVE STYLES ═══ */

/* Tablet and smaller */
@media (max-width: 900px) {
  :root { --nav-w: 0px; }

  aside.left-nav { display: none; }

  header {
    padding: 0 28px;
  }

  main {
    margin-left: 0;
    padding: 40px 28px 80px;
  }

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

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

  /* Detail page layout switches to single column on tablet */
  .detail-layout {
    flex-direction: column;
  }

  .detail-slides {
    width: 100%;
    padding: 40px 0 60px;
  }

  .detail-info {
    width: 100%;
    height: auto;
    position: relative;
    top: auto;
    border-left: none;
    border-top: 1px solid var(--pale);
    padding: 40px 28px 80px;
    max-width: 100%;
  }

  .slide-ph:not(:has(img)) {
    aspect-ratio: 4/3;
  }

  .slide-ph.wide:not(:has(img)) {
    aspect-ratio: 16/9;
  }
}

/* Mobile */
@media (max-width: 600px) {
  header {
    padding: 0 16px;
  }

  main {
    padding: var(--header-h) 16px 60px;
  }

  nav.top-nav {
    gap: 20px;
  }

  nav.top-nav a {
    font-size: 9px;
  }

  .project-heading {
    font-size: clamp(22px, 5vw, 32px);
  }

  .grid {
    gap: 24px 16px;
  }

  .card-img,
  .card-img.wide {
    aspect-ratio: 4/3;
    margin-bottom: 12px;
  }

  .card-title {
    font-size: 13px;
  }

  .card-desc {
    font-size: 12px;
  }

  .card-tags {
    gap: 4px;
  }

  .tag {
    font-size: 8px;
    padding: 2px 6px;
  }

  /* Detail page on mobile */
  .detail-slides {
    padding: 40px 0 40px;
  }

  .detail-info {
    padding: 40px 16px 60px;
  }

  .detail-title {
    font-size: 18px;
  }

  .detail-desc {
    font-size: 13px;
  }

  .about-wrap {
    width: 100%;
  }

  .about-name {
    font-size: clamp(24px, 6vw, 40px);
    margin-bottom: 30px;
  }

  .about-bio {
    font-size: 14px;
  }

  .about-grid {
    gap: 24px;
    padding-top: 24px;
  }

  .contact-row {
    flex-direction: column;
    gap: 16px;
  }

  .contact-link {
    font-size: 9px;
  }

  .breadcrumb {
    font-size: 10px;
    margin-bottom: 36px;
  }

  .back-button {
    font-size: 9px;
    margin-bottom: 36px;
  }
}

/* Small mobile */
@media (max-width: 400px) {
  main {
    padding: var(--header-h) 12px 40px;
  }

  nav.top-nav {
    gap: 12px;
  }

  nav.top-nav a {
    font-size: 8px;
  }

  .logo {
    font-size: 12px;
  }

  .project-heading {
    font-size: clamp(20px, 5vw, 28px);
  }

  .grid {
    gap: 16px 12px;
  }

  .card-year {
    font-size: 9px;
  }

  .detail-info {
    padding: 32px 12px 50px;
  }

  .about-name {
    font-size: clamp(20px, 6vw, 32px);
    margin-bottom: 24px;
  }

  .about-bio {
    font-size: 13px;
    line-height: 1.7;
  }

  .about-col-label {
    font-size: 8px;
    margin-bottom: 16px;
  }

  .about-list li {
    font-size: 12px;
    padding: 8px 0;
  }
}
