:root {
  --bg: #121212;
  --fg: #f2f2f2;
  --muted: #8a8a8a;
  --accent: #ff6d2c;
  --gap: 26px;
  --bar-h: 68px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Pretendard Variable', 'Pretendard', 'Inter', -apple-system, BlinkMacSystemFont,
    'Apple SD Gothic Neo', 'Malgun Gothic', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button {
  font-family: inherit;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

/* ---------- Bottom bar ---------- */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: transparent;
  z-index: 100;
  pointer-events: none;
}

.bottom-bar .bar-link,
.bottom-bar .bar-left {
  pointer-events: auto;
}

.bar-link {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: #ffffff;
  padding: 6px 0;
  position: relative;
  font-weight: 500;
  transition: color 0.2s ease;
}

.bar-link.active {
  color: var(--accent);
}

.bar-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--accent);
}

#homeBtn {
  letter-spacing: 0.1em;
}

.bar-left {
  display: flex;
  align-items: center;
  gap: 22px;
}

/* ---------- Hero intro slideshow ---------- */
.hero-view {
  min-height: 100vh;
}

.hero {
  position: relative;
  width: 100%;
  height: 100svh;
  overflow: hidden;
  background: #000;
  cursor: pointer;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(1.025);
  transition: opacity 0.15s ease-out, transform 0.15s ease-out;
  will-change: opacity, transform;
}

.hero-img.show {
  opacity: 1;
  transform: scale(1);
}

/* ---------- Grid (row-aligned, fixed column tracks) ---------- */
main {
  min-height: 100vh;
}

.grid {
  --cols: 10;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding: 48px 40px calc(var(--bar-h) + 40px);
}

.grid-row {
  display: flex;
  align-items: flex-start;
  gap: var(--gap);
}

@media (max-width: 1700px) {
  .grid { --cols: 8; --gap: 22px; }
}

@media (max-width: 1400px) {
  .grid { --cols: 7; --gap: 20px; }
}

@media (max-width: 1100px) {
  .grid { --cols: 6; --gap: 18px; padding: 36px 28px calc(var(--bar-h) + 32px); }
}

@media (max-width: 860px) {
  .grid { --cols: 5; --gap: 16px; }
}

@media (max-width: 680px) {
  .grid { --cols: 4; --gap: 14px; padding: 24px 16px calc(var(--bar-h) + 24px); }
}

@media (max-width: 520px) {
  .grid { --cols: 3; --gap: 12px; padding: 16px 10px calc(var(--bar-h) + 20px); }
}

@media (max-width: 340px) {
  .grid { --cols: 2; --gap: 9px; }
}

.grid-item {
  flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
  max-width: calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
  overflow: hidden;
  cursor: zoom-in;
  background: #1c1c1c;
  position: relative;
}

.grid-item.landscape {
  align-self: center;
}

/* spans the width of 2 normal slots + the gap between them, for a wide shot
   that would otherwise look cramped at a single column's width */
.grid-item.wide-2 {
  flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols) * 2 + var(--gap));
  max-width: calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols) * 2 + var(--gap));
  align-self: flex-start;
}

.grid-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.5s ease;
}

.grid-item img[data-loaded="false"] {
  opacity: 0;
}
.grid-item img[data-loaded="true"] {
  opacity: 1;
}

/* ---------- Info / Contact view ---------- */
.info-view {
  min-height: calc(100vh - var(--bar-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
}

/* [hidden] must always win over the display:flex rules above/below —
   otherwise hidden sections still render and add to page scroll height. */
.grid[hidden],
.info-view[hidden],
.hero-view[hidden] {
  display: none;
}

.info-inner {
  max-width: 460px;
  text-align: center;
}

.info-inner h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin: 0 0 6px;
}

.info-role {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 28px;
}

.info-label {
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin: 0 0 10px;
}

.info-contact {
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0.01em;
}

.info-contact a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid rgba(242,242,242,0.4);
}

.info-contact a:hover {
  border-bottom-color: var(--fg);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(6,6,6,0.98);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.lightbox.open {
  display: flex;
  opacity: 1;
}

.lb-stage {
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-stage img {
  max-width: 92vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 10px 60px rgba(0,0,0,0.6);
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.lb-stage img.show {
  opacity: 1;
  transform: scale(1);
}

.lb-close,
.lb-prev,
.lb-next {
  position: absolute;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  padding: 12px 16px;
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

.lb-close:hover,
.lb-prev:hover,
.lb-next:hover {
  opacity: 1;
}

.lb-close {
  top: 14px;
  right: 14px;
  font-size: 30px;
  font-weight: 300;
}

.lb-prev {
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
}

.lb-next {
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
}

.lb-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.55);
  font-size: 12px;
  letter-spacing: 0.1em;
}

@media (max-width: 640px) {
  .lb-prev, .lb-next { font-size: 30px; padding: 8px 10px; }
  .bottom-bar { padding: 0 16px; }
  .bar-link { font-size: 11px; }
}
