:root {
  --text: #111111;
  --muted: #747474;
  --line: #e9e9e9;
  --blue-cover: rgba(0, 112, 255, 0.5);
  --page-gutter: clamp(18px, 4vw, 56px);
  --card-border: #000000;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #ffffff;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  transition: background-color 220ms ease, color 220ms ease;
}

body.art-mode {
  --text: #ffffff;
  --muted: #bdbdbd;
  --line: #2b2b2b;
  --card-border: #ffffff;
  background: #000000;
  color: var(--text);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 var(--page-gutter);
  background: #ffffff;
  transition: background-color 220ms ease, color 220ms ease;
}

.art-mode .site-header {
  background: #000000;
}

.brand {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(18px, 3vw, 38px);
}

.site-nav a {
  font-size: 15px;
  line-height: 1;
  transition: color 180ms ease;
}

.site-nav a:hover {
  color: #0070ff;
}

.hero-section {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(420px, 58vw, 700px);
  padding: clamp(34px, 7vw, 84px) var(--page-gutter) clamp(28px, 6vw, 72px);
  overflow: hidden;
}

.hero-background {
  position: absolute;
  inset: clamp(18px, 4vw, 44px) var(--page-gutter);
  z-index: 0;
  background: #ffffff;
  background-image: none;
  background-position: center;
  background-size: cover;
}

.art-mode .hero-background {
  background: #000000;
}

.id-card-stack {
  --card-width: min(520px, 58vw);
  --card-overlap: calc(var(--card-width) * 0.5);
  --card-offset-y: clamp(34px, 5vw, 74px);
  position: relative;
  z-index: 1;
  width: calc((var(--card-width) * 2) - var(--card-overlap));
  max-width: 90vw;
  height: calc((var(--card-width) * 0.7) + var(--card-offset-y));
}

.id-card {
  position: absolute;
  top: 0;
  width: var(--card-width);
  max-width: calc(90vw * 0.666);
  aspect-ratio: 10 / 7;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 240ms ease, filter 240ms ease;
}

.id-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 22px 42px rgba(0, 0, 0, 0.18));
}

.id-card:hover,
.id-card:focus-visible {
  transform: translateY(-8px);
}

.id-card-design {
  left: 0;
  z-index: 2;
}

.id-card-art {
  right: 0;
  top: var(--card-offset-y);
  z-index: 1;
}

.art-mode .id-card-design {
  z-index: 1;
}

.art-mode .id-card-art {
  z-index: 2;
}

.all-works-mode .id-card-design {
  z-index: 2;
}

.all-works-mode .id-card-art {
  z-index: 1;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(34px, 5vw, 64px) clamp(26px, 4vw, 48px);
  padding: 28px var(--page-gutter) 72px;
}

.project-card {
  display: block;
  min-width: 0;
}

.project-card[hidden] {
  display: none;
}

.design-mode .project-card[data-group="art"],
.art-mode .project-card[data-group="design"] {
  display: none;
}

.all-works-mode .project-card {
  display: block;
}

.image-wrap {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 0;
  background: #f4f4f4;
  transform: translateZ(0);
  transition: transform 220ms ease, box-shadow 220ms ease;
  border: 2px solid var(--card-border);
}

.art-mode .image-wrap {
  background: #151515;
}

.image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hover-cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 18px;
  background: var(--blue-cover);
  color: #ffffff;
  opacity: 0;
  transition: opacity 220ms ease;
}

.hover-cover span {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  font-size: 15px;
  line-height: 1.2;
  text-align: center;
}

.project-card:hover .image-wrap,
.project-card:focus-visible .image-wrap {
  transform: scale(1.035);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.14);
}

.project-card:hover .hover-cover,
.project-card:focus-visible .hover-cover {
  opacity: 1;
}

.project-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-top: 12px;
}

.project-title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}

.project-keyword {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.project-page {
  padding: 28px var(--page-gutter) 72px;
}

.project-heading {
  max-width: 980px;
  margin: 0 auto 28px;
}

.project-heading h1 {
  margin: 0 0 10px;
  font-size: clamp(34px, 6vw, 72px);
  font-weight: 700;
  line-height: 0.98;
}

.project-heading p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.video-frame {
  max-width: 980px;
  margin: 0 auto 30px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 0;
  background: #ffffff;
}

.video-frame iframe,
.pdf-viewer iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.pdf-viewer {
  /* max-width: 980px; */
  width: 100%;
  height: min(82vh, 920px);
  margin: 0 auto;
  border: 1px solid var(--line);
  background: #ffffff;
}

.split-project {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 1.2fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
  max-width: 1180px;
  margin: 24px auto 0;
}

.project-copy h1 {
  margin: 0 0 18px;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 0.98;
}

.project-copy p {
  margin: 0 0 18px;
  color: #333333;
  font-size: 18px;
  line-height: 1.65;
}

.project-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 14px;
  background: #f4f4f4;
}

.project-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.simple-page {
  max-width: 760px;
  padding: 52px var(--page-gutter);
}

.simple-page h1 {
  margin: 0 0 18px;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 1;
}

.simple-page p {
  color: #333333;
  font-size: 18px;
  line-height: 1.65;
}

.cv-page {
  max-width: none;
  padding: 0;
}

.cv-page h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.cv-pdf {
  width: 100%;
  max-width: none;
  height: calc(100dvh - 72px);
  margin: 0;
  border: 0;
}

@media (min-width: 960px) {
  .works-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-header {
    min-height: 64px;
  }

  .brand {
    font-size: 14px;
  }

  .site-nav {
    gap: 16px;
  }

  .site-nav a {
    font-size: 14px;
  }

  .hero-section {
    min-height: 360px;
  }

  .id-card-stack {
    --card-width: min(320px, 68vw);
    --card-offset-y: 34px;
  }

  .id-card {
    max-width: none;
  }

  .works-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    padding-top: 16px;
  }

  .project-meta {
    display: block;
  }

  .project-keyword {
    display: block;
    margin-top: 3px;
  }

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

  .pdf-viewer {
    height: 70vh;
  }

  .cv-pdf {
    height: calc(100dvh - 64px);
  }
}


/* ===== Updated hero + accordion portfolio layout ===== */

.hero-section {
  min-height: calc(100dvh - 72px);
  height: calc(100dvh - 72px);
  padding: clamp(18px, 4vw, 44px) var(--page-gutter);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(1180px, 100%);
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 4vh, 36px);
}

.hero-intro {
  text-align: center;
  font-family: Arial, Helvetica, sans-serif;
}

.hero-intro h1 {
  margin: 0;
  font-size: clamp(20px, 3vw, 60px);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.hero-intro p {
  margin: clamp(8px, 1.6vh, 18px) 0 0;
  color: var(--muted);
  font-size: clamp(18px, 2.2vw, 28px);
  line-height: 1.2;
}

.id-card-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: clamp(28px, 7vw, 96px);
  width: min(1080px, 100%);
  align-items: start;
}

.id-card-item {
  min-width: 0;
  text-align: center;
}

.id-card {
  position: static;
  display: block;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  aspect-ratio: 10 / 7;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 240ms ease, filter 240ms ease, opacity 240ms ease;
}

.id-card.is-active img {
  filter: drop-shadow(0 24px 44px rgba(0, 0, 0, 0.2));
}

.art-mode .id-card.is-active img {
  filter: drop-shadow(0 24px 44px rgba(255, 255, 255, 0.12));
}

.id-card:not(.is-active) {
  opacity: 0.72;
}

.card-hint {
  margin: clamp(8px, 1.8vh, 16px) 0 0;
  color: var(--muted);
  font-size: clamp(13px, 1.4vw, 15px);
  line-height: 1.35;
}

.works-section {
  padding: 28px var(--page-gutter) 84px;
}

.work-accordion {
  max-width: 1180px;
  margin: 0 auto 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.work-accordion + .work-accordion {
  margin-top: 24px;
}

.work-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 0;
  cursor: pointer;
  list-style: none;
  font-family: Anonymous Pro, monospace;
  font-size: clamp(18px, 3vw, 36px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
}

.work-accordion summary::-webkit-details-marker {
  display: none;
}

.work-accordion summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.72em;
  line-height: 1;
}

.work-accordion[open] summary::after {
  content: "–";
}

.work-accordion .works-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(56px, 8vw, 104px) clamp(42px, 9vw, 128px);
  padding: 8px 0 42px;
}

/* Override the old body-mode filtering because each accordion now owns its own project set. */
.works-section .project-card,
.design-mode .works-section .project-card[data-group="art"],
.art-mode .works-section .project-card[data-group="design"],
.all-works-mode .works-section .project-card {
  display: block;
}

.works-section .image-wrap,
.project-image {
  border-radius: 16px;
}

@media (min-width: 960px) {
  .work-accordion .works-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .hero-section {
    min-height: auto;
    height: auto;
    padding-top: 30px;
    padding-bottom: 42px;
  }

  .hero-content {
    justify-content: flex-start;
  }

  .id-card-row {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .id-card {
    max-width: 360px;
  }

  .work-accordion .works-grid {
    grid-template-columns: 1fr;
    gap: 42px;
  }
}
