/* Archive-style layout inspired by the provided reference.
   Minimal, typographic, white background, dense index on the left, viewer on the right. */

:root{
  --bg: #ffffff;
  --text: #0b0b0b;
  --muted: #6a6a6a;
  --line: rgba(0,0,0,0.12);
  --soft: rgba(0,0,0,0.06);
  --focus: rgba(0,0,0,0.30);
  --radius: 10px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 18px 18px 14px;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 14px;
}

.brand-row{
  display:flex;
  align-items:flex-end;
  gap: 18px;
  flex-wrap: wrap;
}

.brand-left{
  display:flex;
  align-items:flex-end;
  gap: 12px;
}

.logo{
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 6px;
}

.brand-title{
  margin:0;
  font-size: 34px;
  line-height: 0.95;
  font-weight: 500;
  letter-spacing: 0.2px;
  /* cursive-ish fallback without loading external fonts */
  font-family: "Times New Roman", Georgia, serif;
  font-style: italic;
}

.brand-archive{
  font-size: 22px;
  letter-spacing: 0.35em;
  text-transform: lowercase;
  padding-bottom: 2px;
  white-space: nowrap;
}

.top-actions{
  display:flex;
  align-items:center;
  gap: 10px;
  padding-bottom: 4px;
}

.search-wrap{
  display:flex;
  align-items:center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  min-width: min(380px, 56vw);
}

.search-icon{
  color: var(--muted);
  font-size: 18px;
}

.search{
  border: none;
  outline: none;
  width: 100%;
  font-size: 16px;
  background: transparent;
  color: var(--text);
}

.ghost-btn{
  border: 1px solid var(--line);
  background: transparent;
  padding: 7px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
}
.ghost-btn:hover{ background: rgba(0,0,0,0.03); }
.ghost-btn:active{ transform: translateY(1px); }

.layout{
  display:grid;
  grid-template-columns: 1.05fr 1.25fr;
  gap: 0;
  height: calc(100vh - 78px);
}

.index{
  border-right: 1px solid var(--line);
  overflow: hidden;
}
.index-inner{
  height: 100%;
  overflow: auto;
  padding: 18px;
}

.index-grid{
  /* Dense multi-column number list like the reference */
  column-count: 8;
  column-gap: 18px;
  padding-bottom: 20px;
}

@media (max-width: 1300px){
  .index-grid{ column-count: 6; }
}
@media (max-width: 1100px){
  .search-wrap{ min-width: min(320px, 54vw); }
  .index-grid{ column-count: 5; }
}
@media (max-width: 900px){
  .layout{ grid-template-columns: 1fr; height: auto; }
  .index{ border-right: none; border-top: 1px solid var(--line); }
  .index-grid{ column-count: 6; }
  .viewer{ min-height: 60vh; }
}
@media (max-width: 520px){
  .brand-title{ font-size: 28px; }
  .brand-archive{ font-size: 18px; }
  .search-wrap{ min-width: 60vw; }
  .index-grid{ column-count: 4; }
}

.index-item{
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  display: inline-block;
  width: 100%;
  margin: 0 0 6px 0;
}

.num-btn{
  display:inline-block;
  width: 100%;
  text-align:left;
  border: none;
  background: transparent;
  padding: 1px 4px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.15;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.num-btn:hover{ background: rgba(0,0,0,0.035); }
.num-btn:focus-visible{
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.num-btn[data-active="true"]{
  background: rgba(0,0,0,0.10);
  font-weight: 600;
}

/* Viewer */
.viewer{
  overflow: hidden;
  display:flex;
  flex-direction: column;
  padding: 18px 18px 14px;
}

.viewer-head{
  display:flex;
  align-items:center;
  justify-content: center;
  gap: 14px;
  padding: 8px 0 12px;
}

.viewer-number{
  font-size: 44px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.nav-btn{
  border: none;
  background: transparent;
  cursor:pointer;
  font-size: 46px;
  line-height: 1;
  padding: 0 10px;
  color: var(--text);
  opacity: 0.75;
}
.nav-btn:hover{ opacity: 1; }
.nav-btn:active{ transform: translateY(1px); }

.viewer-frame{
  flex: 1;
  border: 1px solid var(--line);
  background: #f5f5f5;
  border-radius: 0; /* reference is very flat */
  display:flex;
  align-items:center;
  justify-content:center;
  overflow: hidden;
  min-height: 50vh;
  position: relative;
}

.lost-placeholder{
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.55);
}

.lost-placeholder[data-show="true"]{ display: flex; }


.viewer-img{
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display:block;
}

.viewer-foot{
  display:flex;
  align-items:flex-end;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  font-size: 13px;
}

.muted{ color: var(--muted); }
.sep{ color: var(--muted); padding: 0 6px; }

.link{
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,0,0.25);
}
.link:hover{ border-bottom-color: rgba(0,0,0,0.55); }

.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}


/* Splash */
.splash{
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg);
  display: grid;
  place-items: center;
  padding: 18px;
  transition: opacity 260ms ease, transform 260ms ease;
}

.splash[data-hidden="true"]{
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

/* No borders, no card — only the SVG centered */
.splash-btn{
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.splash-btn:focus-visible{
  outline: 2px solid rgba(0,0,0,0.35);
  outline-offset: 8px;
  border-radius: 20px;
}

/* SVG/Logo base size */
.splash-logo{
  width: 240px;
  height: 240px;
  display: block;
  transform: scale(1) rotate(0deg);
  transform-origin: 50% 50%;
  transition: transform 420ms cubic-bezier(.2,.9,.2,1);
}

/* Click 1: grow */
.splash[data-stage="1"] .splash-logo{
  transform: scale(1.35) rotate(0deg);
}

/* Click 2: grow more and spin */
@media (prefers-reduced-motion: no-preference){
  .splash[data-stage="2"] .splash-logo{
    animation: splashSpinZoom 780ms cubic-bezier(.2,.9,.2,1) forwards;
  }
  @keyframes splashSpinZoom{
    0%   { transform: scale(1.35) rotate(0deg); }
    60%  { transform: scale(1.85) rotate(260deg); }
    100% { transform: scale(2.05) rotate(360deg); }
  }
}
@media (prefers-reduced-motion: reduce){
  .splash[data-stage="2"] .splash-logo{
    transform: scale(2.05) rotate(0deg);
  }
}

/* Responsive */
@media (max-width: 520px){
  .splash-logo{ width: 190px; height: 190px; }
}
