*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --black: #111; --white: #fff; --gray: #999;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
  --pad: 40px; --header-h: 80px;
}
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); color: var(--black); background: var(--white); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { border: none; background: none; cursor: pointer; font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }

/* ===== Header ===== */
#header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h); padding: 0 var(--pad);
  display: flex; align-items: center; gap: 48px;
  background: var(--white); transition: background .3s;
}
.logo { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
nav { display: flex; gap: 24px; }
.nav-link { font-size: 12px; color: var(--gray); transition: color .2s; }
.nav-link:hover, .nav-link.active { color: var(--black); text-decoration: underline; text-underline-offset: 4px; }
body.on-home #header { background: transparent; }
body.on-home .logo, body.on-home .nav-link { color: var(--white); text-shadow: 0 1px 10px rgba(0,0,0,.18); }
body.on-home .logo { font-size: 20px; }
body.on-home .nav-link { font-size: 13px; }
body.on-home .nav-link:hover, body.on-home .nav-link.active { color: var(--white); opacity: .75; }

.view { min-height: 60vh; }
#view-project, #view-detail, #view-contact { padding-top: var(--header-h); }

/* ===== Home (desktop) ===== */
.landing { display: flex; height: 100vh; overflow: hidden; background: var(--black); }
.landing-hero { position: relative; flex: 0 0 60%; height: 100%; overflow: hidden; }
.landing.solo .landing-hero { flex-basis: 100%; }
.landing-hero img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }
.landing-carousel { position: relative; flex: 0 0 40%; height: 100%; overflow: hidden; }
.landing.solo .landing-carousel { display: none; }
.carousel-track { display: flex; flex-direction: column; will-change: transform; } /* moved by script (auto drift + mouse wheel) */
.carousel-card { position: relative; height: 85vh; flex-shrink: 0; overflow: hidden; cursor: pointer; display: block; }
.carousel-card img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }
/* ---- hover styles (chosen in admin: a / b / c) ---- */
.carousel-card img { transition: transform 1.2s cubic-bezier(.2,.7,.2,1), filter .6s ease, opacity .3s; }
.card-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 90px 28px 26px; background: linear-gradient(transparent, rgba(0,0,0,.55)); color: #fff; opacity: 0; transform: translateY(14px); transition: opacity .45s ease, transform .55s cubic-bezier(.2,.7,.2,1); pointer-events: none; }
.card-info .ci-brand { font-size: 22px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.card-info .ci-meta { margin-top: 4px; font-size: 13px; color: rgba(255,255,255,.9); }
.card-info .ci-go { display: inline-block; margin-top: 12px; font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; border-bottom: 1px solid rgba(255,255,255,.7); padding-bottom: 2px; }
.card-label { transition: opacity .4s ease, letter-spacing .6s ease, color .4s ease; }

/* carousel hover: focus-in + info slide-up */
body.hv-ab .carousel-card img { filter: brightness(.8) saturate(.85); }
body.hv-ab .carousel-card:hover img { filter: none; transform: scale(1.045); }
body.hv-ab .carousel-card:hover .card-label { letter-spacing: .18em; }
body.hv-ab .carousel-card:hover .card-info { opacity: 1; transform: none; }
body.hv-ab .card-info .ci-brand { display: none; }
body.hv-ab .card-info .ci-meta { margin-top: 0; font-size: 13px; color: #fff; }
.card-label {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  color: #fff; font-size: 24px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; white-space: nowrap; pointer-events: none; text-shadow: 0 1px 14px rgba(0,0,0,.28);
}


/* ===== Home (mobile) ===== */
.m-home { display: none; }

/* ===== Project list ===== */
.filters { display: flex; flex-wrap: wrap; gap: 24px; padding: 20px var(--pad) 0; margin-bottom: 40px; }
.filter { font-size: 13px; color: var(--gray); transition: color .2s; }
.filter:hover, .filter.active { color: var(--black); }
.filter.active { font-weight: 500; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px 28px; padding: 0 var(--pad) 80px; }
.card { display: block; }
.card-img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; background: #f3f3f3; transition: opacity .3s; }
.card:hover .card-img { opacity: .85; }
.card-meta { margin-top: 10px; font-size: 11px; color: var(--gray); letter-spacing: .02em; }
.card-title { margin-top: 3px; font-size: 13px; font-weight: 500; line-height: 1.4; }
.empty-note { padding: 40px var(--pad) 120px; font-size: 12px; color: var(--gray); }

/* ===== Detail ===== */
#view-detail { padding-left: var(--pad); padding-right: var(--pad); padding-bottom: 80px; }
.detail-header { padding: 20px 0 40px; }
.detail-brand { font-size: 11px; color: var(--gray); letter-spacing: .02em; }
.detail-title { margin-top: 4px; font-size: 15px; font-weight: 500; }
.detail-desc { margin-top: 4px; font-size: 11px; color: var(--gray); }
.detail-back { display: inline-block; margin-top: 18px; font-size: 12px; color: var(--gray); transition: color .2s; }
.detail-back:hover { color: var(--black); }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gallery-item { cursor: zoom-in; }
.gallery-item img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; background: #f3f3f3; transition: opacity .3s; }
.gallery-item:hover img { opacity: .85; }

/* ===== Lightbox ===== */
#lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(255,255,255,.98); display: flex; align-items: center; justify-content: center; touch-action: pan-y; }
#lightbox img { max-width: 90vw; max-height: 88vh; object-fit: contain; user-select: none; -webkit-user-drag: none; }
#lightbox button { position: absolute; padding: 20px; font-size: 32px; font-weight: 300; line-height: 1; color: var(--black); opacity: .6; transition: opacity .2s; }
#lightbox button:hover { opacity: 1; }
.lb-close { top: 12px; right: 20px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-counter { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--gray); }

/* ===== Contact ===== */
#view-contact { padding-left: var(--pad); padding-right: var(--pad); padding-bottom: 100px; }
.contact-inner { max-width: 600px; padding-top: 60px; }
.contact-name { font-size: 14px; font-weight: 600; letter-spacing: .04em; margin-bottom: 12px; }
.contact-desc { font-size: 14px; color: var(--gray); line-height: 1.7; margin-bottom: 28px; }
.contact-links { display: flex; flex-direction: column; gap: 8px; }
.contact-links a { font-size: 14px; transition: color .2s; }
.contact-links a:hover { color: var(--gray); }

/* ===== Footer ===== */
footer { display: flex; justify-content: space-between; gap: 16px; padding: 24px var(--pad); border-top: 1px solid #eee; }
footer span { font-size: 11px; color: var(--gray); }

/* ===== Tablet ===== */
@media (max-width: 1024px) {
  :root { --pad: 28px; }
  .grid { gap: 36px 20px; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  :root { --pad: 20px; --header-h: 56px; }
  #header { gap: 22px; }
  .logo { font-size: 13px; }
  nav { gap: 18px; }
  .nav-link { font-size: 11px; }

  .landing { display: none; }
  .m-home { display: block; position: relative; height: 100vh; height: 100svh; overflow: hidden; background: var(--black); }
  .m-slides { position: absolute; inset: 0; }
  .m-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.5s ease; display: block; }
  .m-slide.active { opacity: 1; z-index: 1; }
  .m-slide img { width: 100%; height: 100%; object-fit: cover; }
  .m-brand {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    color: rgba(255,255,255,.4); font-size: 14px; font-weight: 500; letter-spacing: .08em;
    text-transform: uppercase; white-space: nowrap; pointer-events: none; text-shadow: 0 1px 6px rgba(0,0,0,.12);
  }
  .m-overlay {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; pointer-events: none;
    padding: 56px var(--pad) calc(44px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0,0,0,.5));
  }
  .m-dots { position: absolute; left: 0; right: 0; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 3; display: flex; justify-content: center; gap: 6px; }
  .m-dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.35); }
  .m-dots i.active { background: #fff; }

  .filters { gap: 16px; margin-bottom: 28px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 28px 12px; padding-bottom: 60px; }
  .card-title { font-size: 12px; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  #view-detail { padding-bottom: 60px; }
  .detail-header { padding-bottom: 28px; }
  .contact-inner { padding-top: 32px; }
  .contact-name, .contact-desc, .contact-links a { font-size: 13px; }
  footer { padding: 18px var(--pad); }
  footer span { font-size: 10px; }
  #lightbox img { max-width: 100vw; max-height: 82vh; }
  #lightbox button { font-size: 26px; padding: 14px; }
  .lb-prev, .lb-next { display: none; }
}
/* home: footer sits over the hero photo (bottom-left, small white), no white strip */
body.on-home footer { position: fixed; left: 0; bottom: 0; width: 60%; z-index: 5; border-top: 0; padding: 0 var(--pad) 18px 0; background: none; pointer-events: none; justify-content: flex-end; gap: 14px; }
body.on-home .landing.solo ~ footer, body.on-home.solo-hero footer { width: 100%; }
@media (max-width: 768px) { body.on-home footer { width: 100%; } }
body.on-home footer span { font-size: 10px; color: rgba(255,255,255,.7); letter-spacing: .02em; }
@media (max-width: 768px) { body.on-home footer { padding-bottom: calc(14px + env(safe-area-inset-bottom)); } body.on-home .m-dots { bottom: calc(44px + env(safe-area-inset-bottom)); } }
