/* ── reset ── */
*,*::before,*::after { box-sizing: border-box; border: 0 solid #e5e7eb; }
html { line-height: 1.3; -webkit-text-size-adjust: 100%; }
:root {
  font-family: Inter, sans-serif;
  font-feature-settings: 'liga' 1, 'calt' 1;
}
@supports (font-variation-settings: normal) {
  :root { font-family: InterVariable, sans-serif; }
}
body { margin: 0; line-height: inherit; background-color: #fafafa; }
a { color: inherit; text-decoration: inherit; }
img, video { display: block; max-width: 100%; height: auto; }
p, span, a { margin: 0; letter-spacing: -0.2px; font-size: 10.5pt; font-weight: 420; }
button { background: none; border: none; padding: 0; cursor: pointer; }

/* ── scrollbar hidden ── */
::-webkit-scrollbar { display: none; }
* { -ms-overflow-style: none; scrollbar-width: none; }

/* ── pulse ── */
@keyframes pulse { 0%,100%{opacity:0} 50%{opacity:1} }
.pulse { animation: pulse 1s step-end infinite; }

/* ── view dot ── */
.dot { display: inline-block; width: 5px; height: 5px; background: black; border-radius: 9999px; margin-right: 4px; }
.dot.hidden { display: none; }

/* ── FIXED HEADER ── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 8px 16px 16px;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  pointer-events: none;
  align-items: start;
}

.site-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 34px;
  background: #fafafa;
  z-index: -1;
}

body.dark .site-header::before {
  background: #0d0d0d;
}

.header-name {
  grid-column: span 3;
  pointer-events: none;
}

.header-toggle {
  grid-column-start: 4;
  display: flex;
  flex-direction: column;
  gap: 0;
  pointer-events: none;
  justify-self: end;
}

.toggle-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: all;
  cursor: pointer;
}

/* ── MAIN CONTENT ── */
.page-wrapper {
  padding-top: 5vh;
  overflow-x: hidden;
  transition: opacity 0.78s ease;
}

.page-wrapper.dimmed {
  opacity: 0.5;
}

.site-header {
  transition: opacity 0.78s ease;
}

.site-header.dimmed {
  opacity: 0.5;
}

#portrait-btn, #name-badge {
  transition: opacity 0.5s ease;
}
#portrait-btn.dimmed {
  opacity: 0.5;
}
#name-badge.dimmed {
  opacity: 0;
}

/* ── GALLERY WRAPPER ── */
.gallery-wrapper {
  padding: 16px;
  padding-top: 26px;
}

/* ── OUTER GRID ── */
.outer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

/* ── INNER GRID ── */
.inner-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: start;
}

/* ── PROJECT CARD ── */
.grid-img { cursor: none; }

.card-thumb {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  display: block;
}

.card-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease;
}

.thumb-hover { opacity: 0; }
.grid-img:hover .thumb-main { opacity: 0; }
.grid-img:hover .thumb-hover { opacity: 1; }

.card-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 6px;
  row-gap: 4px;
  margin-top: 6px;
  margin-left: -3px;
}

.card-title-text {
  color: #111;
  margin-left: 3px;
}

.card-tag {
  font-size: 8.5pt;
  font-weight: 420;
  letter-spacing: -0.1px;
  color: #999;
  border: 1px solid #ddd;
  border-radius: 100px;
  padding: 1px 7px;
  line-height: 1.5;
  white-space: nowrap;
}

.grid-img:hover .card-title-text {
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.dark .card-title-text { color: #e8e8e8; }
body.dark .card-tag { color: #555; border-color: #333; }

/* ── HEADER MAILTO ── */
.header-mailto {
  font-size: 10.5pt;
  font-weight: 420;
  letter-spacing: -0.2px;
  line-height: 1.3;
  color: #999;
  pointer-events: all;
  text-decoration: none;
  transition: color 0.15s;
}
.header-mailto:hover { color: #111; }
body.dark .header-mailto { color: #555; }
body.dark .header-mailto:hover { color: #e8e8e8; }

/* ── DARK MODE ── */
body.dark { background-color: #0d0d0d; color: #e8e8e8; }
body.dark p, body.dark span, body.dark a { color: #e8e8e8; }
body.dark .grid-img .index-label { color: #e8e8e8; }
body.dark .header-name p { color: #e8e8e8; }
body.dark .header-toggle p { color: #e8e8e8; }
body.dark .dot { background: #e8e8e8; }
body.dark img { filter: brightness(0.9); }




/* ── NAME BADGE ── */
.name-badge {
  position: fixed;
  top: 7px;
  left: 16px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: default;
  user-select: none;
}

.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  background: #bced88;
  flex-shrink: 0;
}

.name-short {
  display: flex;
  align-items: center;
  font-size: 10.5pt;
  font-weight: 420;
  letter-spacing: -0.2px;
  color: #111;
  transition: opacity 0.15s;
}

.name-gap {
  display: inline-block;
  width: 54px;
}

.name-full {
  display: none;
  font-size: 10.5pt;
  font-weight: 420;
  letter-spacing: -0.2px;
  color: #111;
}

.name-badge:hover .name-short { display: none; }
.name-badge:hover .name-full  { display: inline; }

body.dark .name-short,
body.dark .name-full { color: #e8e8e8; }

/* ── PORTRAIT BUTTON ── */
.portrait-btn {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 200;
  width: calc((100vw - 32px - 7 * 32px) / 8);
  height: auto;
  border: none;
  padding: 0;
  cursor: none;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: opacity 0.15s;
}

.portrait-btn:hover { opacity: 0.8; }

.portrait-label {
  font-size: 10.5pt;
  font-weight: 420;
  line-height: 1.3;
  letter-spacing: -0.2px;
  color: #999;
  text-align: left;
  user-select: none;
  transition: color 0.15s;
}
.portrait-btn:hover .portrait-label { color: #111; }
body.dark .portrait-label { color: #555; }
body.dark .portrait-btn:hover .portrait-label { color: #e8e8e8; }

.portrait-img-wrap {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: 2px;
  overflow: hidden;
}

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


/* ── THEME TOGGLE ── */
.theme-toggle {
  position: fixed;
  top: 7px;
  right: 16px;
  z-index: 200;
  background: none;
  border: none;
  padding: 0;
  font-size: 10.5pt;
  font-weight: 420;
  line-height: 1.3;
  letter-spacing: -0.2px;
  color: #999;
  cursor: pointer;
  pointer-events: all;
  user-select: none;
  transition: color 0.15s;
}

.theme-toggle:hover { color: #111; }
body.dark .theme-toggle { color: #555; }
body.dark .theme-toggle:hover { color: #e8e8e8; }

/* ── RESPONSIVE ── */
@media (max-width: 767px) {
  .theme-toggle { display: none; }
  .portrait-btn {
    position: static;
    width: calc((100vw - 32px) / 3);
    margin: 16px;
    cursor: pointer;
  }
}

@media (min-width: 768px) {
  .site-header {
    grid-template-columns: repeat(8, 1fr);
    gap: 32px;
  }
  .header-name {
    grid-column: span 2;
    margin-top: calc(20vh + 18px);
  }
  .header-toggle {
    grid-column: 3 / -1;
    justify-self: start;
  }
  .outer-grid {
    grid-template-columns: repeat(8, 1fr);
    gap: 32px;
  }
  .inner-grid {
    grid-column: 3 / -1;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 32px;
    row-gap: 84px;
    align-items: start;
  }

}
