:root {
  font-family: "Akt", ui-sans-serif, system-ui, sans-serif;
  color: #1f1f1f;
  background: #fff;
  font-synthesis: none;
}

@view-transition { navigation: auto; }

* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; background: #fff; }
button, input { font: inherit; }
a { color: inherit; }

:focus-visible { outline: 3px solid #cc2941; outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header { position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 1px solid #efefed; }
.site-nav { min-height: 80px; padding: 0 16px; display: flex; align-items: center; gap: 16px; }
.brand { flex: none; font-size: 1.08rem; font-weight: 800; letter-spacing: -.04em; text-decoration: none; white-space: nowrap; }
.brand-short { display: none; }
.brand-dot { color: #c91c35; }
.nav-link { flex: none; padding: 13px 18px; border: 0; border-radius: 999px; color: #fff; background: #1f1f1f; font-size: .92rem; font-weight: 700; text-decoration: none; white-space: nowrap; cursor: pointer; }
.nav-link:hover { background: #333; }
.nav-link:active { transform: scale(.98); }
.nav-link:not(.active) { color: #4f4f4b; background: #efefed; }

.header-search { flex: 1; min-width: 120px; height: 48px; display: flex; align-items: center; gap: 8px; padding: 0 16px; border-radius: 999px; background: #efefed; }
.header-search:focus-within { box-shadow: 0 0 0 3px #e6a8b2; background: #e7e7e4; }
.search-icon { flex: none; color: #5f5f5b; font-size: 1.55rem; line-height: 1; transform: translateY(-1px); }
.header-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #1f1f1f; font-weight: 550; }
.header-search input::placeholder { color: #6d6d68; opacity: 1; }

.gallery-main { max-width: 1680px; margin: 0 auto; padding: 18px 16px 72px; }
.search-status { width: fit-content; min-height: 0; margin: 0 0 16px; color: #60605c; font-size: .92rem; font-weight: 600; }
.search-status:empty { display: none; }
.sphere-gallery { position: relative; width: min(100%, 1180px); height: clamp(440px, calc(100dvh - 210px), 820px); margin: 0 auto; }
.sphere { position: absolute; inset: 0; }
.sphere-tile { position: absolute; top: 50%; left: 50%; display: block; overflow: hidden; border-radius: 18px; background: #f1f1ef; box-shadow: 0 16px 38px rgb(31 31 31 / 14%); transition: filter .28s ease, box-shadow .28s ease; }
.sphere-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sphere-tile:hover { box-shadow: 0 24px 54px rgb(31 31 31 / 22%); }
.sphere-arrow { position: absolute; top: 50%; z-index: 2000; display: grid; width: 48px; height: 48px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgb(255 255 255 / 84%); color: #1f1f1f; box-shadow: 0 2px 14px rgb(31 31 31 / 10%); backdrop-filter: blur(8px); cursor: pointer; transform: translateY(-50%); transition: background .2s ease, color .2s ease, transform .2s ease; }
.sphere-arrow svg { width: 22px; height: 22px; }
.sphere-arrow:not(:disabled):hover { background: #1f1f1f; color: #fff; }
.sphere-arrow:not(:disabled):active { transform: translateY(-50%) scale(.94); }
.sphere-arrow:disabled { opacity: .3; cursor: default; }
.sphere-arrow-prev { left: clamp(4px, 2vw, 20px); }
.sphere-arrow-next { right: clamp(4px, 2vw, 20px); }


.detail-main { min-height: calc(100dvh - 80px); max-width: 1680px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); align-items: center; gap: clamp(32px, 6vw, 88px); margin: 0 auto; padding: 28px clamp(20px, 5vw, 72px) 48px; }
.detail-visual { position: relative; height: min(78dvh, 820px); min-height: 360px; display: grid; place-items: center; overflow: hidden; border-radius: 22px; background: #f1f1ef; }
.detail-visual img { display: block; width: 100%; height: 100%; object-fit: contain; }
.detail-back { position: absolute; top: 16px; left: 16px; z-index: 1; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid rgb(255 255 255 / 72%); border-radius: 999px; background: rgb(255 255 255 / 90%); color: #30302d; font-size: .82rem; font-weight: 700; text-decoration: none; box-shadow: 0 2px 12px rgb(0 0 0 / 8%); backdrop-filter: blur(10px); }
.detail-back:hover { background: #fff; }
.detail-back span { font-size: 1.1rem; line-height: .8; }
.detail-content { width: min(100%, 480px); justify-self: center; }
.detail-description { margin: 0; color: #666660; font-size: 1rem; line-height: 1.75; }
.detail-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.detail-copy { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 16px; border: 0; border-radius: 999px; background: #1f1f1f; color: #fff; font-size: .9rem; font-weight: 700; text-decoration: none; cursor: pointer; transition: background .2s ease; }
.detail-copy:hover { background: #393936; }
.detail-copy svg { width: 16px; height: 16px; }
.copy-status { color: #60605c; font-size: .84rem; }

.gallery-status { min-height: 24px; margin: 14px 0; color: #6d6d68; text-align: center; font-size: .9rem; }
.secondary-button { display: block; margin: 12px auto; padding: 11px 18px; border: 0; border-radius: 999px; background: #efefed; color: #1f1f1f; font-weight: 700; cursor: pointer; }
.secondary-button:hover { background: #e3e3df; }
.secondary-button:active { transform: scale(.98); }
.secondary-button[hidden] { display: none; }

#upload-dialog { width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 0; overflow: auto; border: 1px solid #e7e7e4; border-radius: 18px; background: #fff; color: #1f1f1f; box-shadow: 0 24px 72px rgb(31 31 31 / 18%); }
#upload-dialog::backdrop { background: rgb(31 31 31 / 52%); }
.upload-modal { position: relative; padding: 34px; }
.upload-modal h2 { margin: 0 42px 7px 0; font-size: 1.48rem; line-height: 1.2; letter-spacing: -.04em; }
.upload-intro { margin: 0 0 22px; color: #70706a; font-size: .9rem; }
.upload-close { position: absolute; top: 20px; right: 20px; display: grid; width: 38px; height: 38px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: #f1f1ef; color: #33332f; font-size: 1.45rem; line-height: 1; cursor: pointer; transition: background .2s, transform .2s; }
.upload-close:hover { background: #e3e3df; }
.upload-close:active { transform: scale(.98); }
.upload-drop-area { min-height: 250px; overflow: hidden; border: 1px dashed #c9c9c2; border-radius: 15px; background: #f8f8f6; transition: background .2s ease, border-color .2s ease, transform .2s ease; }
.upload-drop-area.dragover { transform: scale(1.01); border-color: #54544e; background: #f0f0ed; }
.upload-drop-area.has-preview { padding: 15px; }
.upload-dropzone { min-height: 248px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; padding: 25px; text-align: center; cursor: pointer; }
.upload-dropzone[hidden], .upload-preview[hidden] { display: none; }
.upload-icon { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 5px; border-radius: 50%; background: #fff; color: #484842; box-shadow: 0 2px 9px rgb(31 31 31 / 6%); }
.upload-icon svg { width: 25px; height: 25px; }
.upload-drop-title { color: #353530; font-size: .95rem; font-weight: 700; }
.upload-drop-copy { color: #777771; font-size: .86rem; }
.upload-drop-copy strong { color: #272723; text-decoration: underline; text-underline-offset: 3px; }
.upload-help { margin-top: 5px; color: #898982; font-size: .75rem; }
.upload-preview { display: grid; gap: 12px; }
.upload-preview img { width: 100%; height: 180px; display: block; border-radius: 10px; background: #fff; object-fit: contain; }
.upload-preview-info { display: flex; justify-content: space-between; gap: 12px; color: #5d5d57; font-size: .78rem; }
.upload-preview-info strong { overflow: hidden; color: #33332f; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.upload-preview-actions { display: flex; gap: 8px; }
.upload-text-button { padding: 7px 11px; border: 1px solid #deded8; border-radius: 999px; background: #fff; color: #383833; font-size: .78rem; font-weight: 700; cursor: pointer; }
.upload-text-button:hover { background: #f0f0ed; }
.upload-text-button.remove { color: #a62438; }
.upload-footer { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.upload-status { margin: 0; font-size: .8rem; line-height: 1.4; overflow-wrap: anywhere; }
.upload-status:empty { display: none; }
.upload-status[data-state="busy"] { color: #4f4f4b; }
.upload-status[data-state="success"] { color: #256044; }
.upload-status[data-state="error"] { color: #a62438; }
.upload-submit { min-height: 42px; flex: none; padding: 0 18px; border: 0; border-radius: 999px; background: #20201d; color: #fff; font-size: .84rem; font-weight: 700; cursor: pointer; transition: background .2s, opacity .2s; }
.upload-submit:hover:not(:disabled) { background: #3a3a36; }
.upload-submit:disabled, .upload-text-button:disabled { cursor: not-allowed; opacity: .45; }

@media (prefers-reduced-motion: reduce) {
  .sphere-tile, .sphere-arrow, .detail-copy, .upload-drop-area, .upload-close, .upload-submit { transition: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .01ms; }
}

@media (max-width: 640px) {
  .site-nav { min-height: 64px; padding: 0 10px; gap: 9px; }
  .brand { width: 34px; font-size: 1rem; }
  .brand-full { display: none; }
  .brand-short { display: inline; }
  .header-search { height: 44px; padding: 0 13px; }
  .search-icon { font-size: 1.35rem; }
  .nav-link { display: none; }
  #upload-images { display: block; padding: 11px 14px; }
  .gallery-main { padding: 12px 10px 56px; }
  .sphere-gallery { height: clamp(360px, 52dvh, 520px); }
  .sphere-tile { border-radius: 12px; }
  .sphere-arrow { width: 40px; height: 40px; }
  .sphere-arrow svg { width: 19px; height: 19px; }
  .sphere-arrow-prev { left: 0; }
  .sphere-arrow-next { right: 0; }
  .detail-main { min-height: auto; grid-template-columns: 1fr; gap: 26px; padding: 14px 10px 48px; }
  .detail-visual { height: min(68dvh, 680px); min-height: 320px; border-radius: 16px; }
  .detail-back { top: 12px; left: 12px; padding: 9px 12px; }
  .detail-content { width: 100%; padding: 2px 6px; }
  .detail-description { font-size: .94rem; }
  .upload-modal { padding: 26px 20px 20px; }
  .upload-close { top: 14px; right: 14px; }
  .upload-drop-area, .upload-dropzone { min-height: 220px; }
  .upload-footer { align-items: flex-end; }
}
