:root {
  --wall: #e1d4c4;
  --ink: #1c1916;
  --cream: #fbf7f0;
  --tab-h: 44px;
  --tuck: 14px;
  --stack: 540px;
  --closed: 108px;
  --rust: 360px;
  --ease: cubic-bezier(0.22, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  overflow-x: clip;
}

.wall {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  pointer-events: none;
}

.mast {
  padding: 52px 24px 0;
}

.mast-row {
  max-width: var(--stack);
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

h1 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(56px, 11vw, 88px);
  letter-spacing: -0.045em;
  line-height: 0.82;
  color: #2a241c;
}

.portrait {
  width: 92px;
  height: 112px;
  object-fit: cover;
  object-position: center 20%;
  flex: none;
  box-shadow: 0 8px 18px rgba(62, 40, 24, 0.18);
}

main {
  padding: 36px 24px 0;
}

.stack {
  width: min(var(--stack), 100%);
  margin: 0 auto;
  padding-top: var(--tab-h);
  filter:
    drop-shadow(-12px 6px 10px rgba(68, 44, 28, 0.1))
    drop-shadow(0 18px 22px rgba(68, 44, 28, 0.16));
}

.folder {
  position: relative;
  cursor: pointer;
}

.folder:nth-child(1) { z-index: 1; }
.folder:nth-child(2) { z-index: 2; }
.folder:nth-child(3) { z-index: 3; }
.folder:nth-child(4) { z-index: 4; }

.folder + .folder {
  margin-top: calc(var(--tuck) * -1);
}

.sheet {
  position: relative;
  overflow: hidden;
  border-radius: 6px 6px 12px 12px;
  background: var(--swatch);
  box-shadow: 0 -9px 14px rgba(52, 32, 18, 0.12);
}

.folder:first-child .sheet {
  box-shadow: none;
}

.face {
  position: relative;
  z-index: 1;
  min-height: var(--closed);
}

.folder-rust .face {
  min-height: var(--rust);
}

.felt {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--sheet-w, 100%);
  height: auto;
  max-width: none;
  pointer-events: none;
  user-select: none;
}

.sheet > .felt {
  top: calc(var(--tab-h) * -1);
  z-index: 0;
}

.tab {
  position: absolute;
  top: calc(var(--tab-h) * -1);
  height: calc(var(--tab-h) + 2px);
  margin: 0;
  padding: 0 14px 2px;
  border: 0;
  border-radius: 13px 13px 0 0;
  background: var(--swatch);
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  touch-action: manipulation;
}

.tab .felt {
  top: 0;
  left: calc(var(--tab-left, 0px) * -1);
}

.tab span {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

.tab:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.folder-olive {
  --swatch: #57634d;
  color: var(--cream);
}
.folder-olive .tab { left: 7%; }

.folder-ivory {
  --swatch: #f9eddb;
  color: var(--ink);
}
.folder-ivory .tab { right: 9%; left: auto; }

.folder-blue {
  --swatch: #c5d5d4;
  color: var(--ink);
}
.folder-blue .tab { left: 50%; transform: translateX(-50%); }

.folder-rust {
  --swatch: #9e5a3b;
  color: var(--cream);
}
.folder-rust .tab { left: 16%; }

.panel {
  display: grid;
  grid-template-rows: 0fr;
  pointer-events: none;
  transition: grid-template-rows 460ms var(--ease);
}

.folder.is-open .panel {
  grid-template-rows: 1fr;
  pointer-events: auto;
}

.panel-clip {
  overflow: hidden;
  min-height: 0;
}

.panel-inner {
  padding: 22px 28px 84px;
}

.folder-rust .panel-inner {
  padding: 262px 30px 36px;
}

.panel p {
  margin: 0 0 14px;
  font-size: 15.5px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
}

.panel .linkline {
  margin: 0;
}

.panel a {
  color: inherit;
  font-weight: 700;
  text-underline-offset: 3px;
}

.panel a:hover {
  text-decoration-thickness: 2px;
}

.colophon {
  max-width: var(--stack);
  margin: 26px auto 0;
  padding: 0 24px 48px;
  display: flex;
  justify-content: center;
  gap: 22px;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.colophon a {
  color: #5c4a3c;
  text-decoration: none;
}

.colophon a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.colophon a:focus-visible {
  outline: 2px solid #2a241c;
  outline-offset: 3px;
}

@media (max-width: 640px) {
  :root {
    --rust: 240px;
    --tab-h: 40px;
    --closed: 96px;
  }

  .mast { padding: 32px 18px 0; }
  main { padding: 28px 18px 0; }

  .portrait {
    width: 72px;
    height: 88px;
  }

  .tab span {
    font-size: 10px;
    letter-spacing: 0.12em;
  }

  .panel-inner { padding: 18px 18px 74px; }
  .folder-rust .panel-inner { padding: 168px 18px 28px; }
  .panel p { font-size: 15px; }
  .colophon { padding-bottom: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .panel { transition: none; }
}
