:root {
  --paper: #f7f6f4;
  --ink: #1c1916;
  --cream: #fbf7f0;
  --tab-h: 46px;
  --curve: 34px;
  --shoulder: 22px;
  --tuck: calc(var(--shoulder) * 2 + 4px);
  --closed: 196px;
  --rust: 420px;
  --ease: cubic-bezier(0.22, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Satoshi", Helvetica, "Helvetica Neue", Arial, sans-serif;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

.mast {
  padding: 56px 28px 0;
}

.mast-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

h1 {
  margin: 0;
  font-weight: 500;
  font-size: clamp(76px, 8.6vw, 132px);
  letter-spacing: -0.045em;
  line-height: 0.84;
  color: #161513;
}

.portrait {
  width: 200px;
  height: 134px;
  object-fit: cover;
  object-position: center 22%;
  flex: none;
  border-radius: 3px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 10px 22px rgba(22, 18, 14, 0.16);
}

main {
  padding: 42px 24px 64px;
}

.stack {
  width: 50vw;
  margin: 0 auto;
  padding-top: var(--tab-h);
  filter:
    drop-shadow(0 1px 1px rgba(22, 16, 12, 0.05))
    drop-shadow(0 22px 30px rgba(22, 16, 12, 0.1));
}

.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:nth-child(5) { z-index: 5; }

.folder + .folder {
  margin-top: calc(var(--tuck) * -1);
}

.sheet {
  position: relative;
  overflow: hidden;
  border-radius: var(--shoulder);
  background: var(--swatch);
  box-shadow:
    0 -1px 0 rgba(28, 18, 12, 0.16),
    0 -12px 18px rgba(28, 18, 12, 0.07);
}

.folder:first-child .sheet {
  box-shadow: 0 10px 18px rgba(28, 18, 12, 0.04);
}

.sheet::before,
.sheet::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 2;
}

.sheet::before {
  left: 0;
  right: 0;
  top: 0;
  height: 14px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent);
}

.folder-olive .sheet::before,
.folder-rust .sheet::before {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.14), transparent 80%);
}

.sheet::after {
  inset: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 10px 0 16px rgba(40, 22, 12, 0.05);
}

.face {
  position: relative;
  z-index: 1;
  min-height: var(--closed);
}

.folder-rust .face {
  min-height: 0;
}

.folder-rust {
  cursor: default;
}

.folder-rust .tab {
  cursor: default;
}

.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);
  right: 48px;
  left: auto;
  width: 200px;
  height: calc(var(--tab-h) + 2px);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  touch-action: manipulation;
  transform: none;
}

.tab-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 0;
  background: var(--swatch);
  z-index: 0;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 100'><path fill='black' d='M0 100C90 100 60 12 130 12H190C260 12 230 100 320 100Z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 100'><path fill='black' d='M0 100C90 100 60 12 130 12H190C260 12 230 100 320 100Z'/></svg>");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.tab-face .felt {
  top: 0;
  left: calc(var(--tab-left, 0px) * -1);
}

.shoulder {
  display: none;
}

.shoulder .felt {
  display: block;
  top: calc(var(--tab-h) * -1);
  width: var(--sheet-w, 100%);
}

.shoulder-l {
  left: calc(var(--curve) * -1 + 1px);
  -webkit-mask: radial-gradient(circle at 0 0, transparent calc(var(--curve) - 0.8px), #000 var(--curve));
  mask: radial-gradient(circle at 0 0, transparent calc(var(--curve) - 0.8px), #000 var(--curve));
}

.shoulder-r {
  right: calc(var(--curve) * -1 + 1px);
  -webkit-mask: radial-gradient(circle at 100% 0, transparent calc(var(--curve) - 0.8px), #000 var(--curve));
  mask: radial-gradient(circle at 100% 0, transparent calc(var(--curve) - 0.8px), #000 var(--curve));
}

.shoulder-l .felt {
  left: calc(var(--curve) - var(--tab-left, 0px) - 1px);
}

.shoulder-r .felt {
  left: calc(var(--tab-left, 0px) * -1 - var(--tab-w, 0px) + 1px);
}

.tab .chevron {
  position: relative;
  z-index: 2;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border: 0;
  border-radius: 0;
  background: none;
}

.tab:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.folder-olive {
  --swatch: #57634d;
  color: var(--cream);
}
.folder-ivory {
  --swatch: #f9eddb;
  color: var(--ink);
}

.folder-blue {
  --swatch: #c5d5d4;
  color: var(--ink);
}

.folder-rust {
  --swatch: #9e5a3b;
  color: var(--cream);
}

.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: 28px 40px calc(var(--tab-h) + var(--tuck) + 36px);
}

.folder-rust .panel-inner {
  padding: 8px 40px 48px;
}

.folder-title {
  position: relative;
  z-index: 3;
  margin: 0;
  padding: 28px 40px 6px;
  font-size: clamp(28px, 2.7vw, 40px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.chevron {
  display: grid;
  place-items: center;
  transition: transform 460ms var(--ease);
}

.chevron::before {
  content: "";
  width: 11px;
  height: 11px;
  margin-top: -5px;
  border-right: 2.5px solid currentColor;
  border-bottom: 2.5px solid currentColor;
  transform: rotate(45deg);
}

.folder.is-open .chevron {
  transform: rotate(180deg);
}

.folder-pink {
  cursor: default;
  --swatch: #f6d3f2;
}

.folder-pink .sheet > .felt {
  top: 0;
  height: 100%;
  object-fit: cover;
}

.folder-pink .felt-under { z-index: 0; }
.folder-pink .felt-cover { z-index: 1; }

.cuts {
  position: relative;
  z-index: 3;
  display: flex;
  gap: 16px;
  padding: 32px 28px 36px;
}

.cut {
  position: relative;
  flex: 1;
  min-height: 54px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cream);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow:
    inset 0 0 0 1.5px rgba(62, 24, 14, 0.4),
    inset 0 5px 9px rgba(36, 12, 6, 0.55),
    inset 0 -3px 6px rgba(255, 214, 186, 0.2);
}

.cut span {
  position: relative;
  z-index: 1;
}

.hole-felt {
  position: absolute;
  width: var(--sheet-w, 100%);
  height: auto;
  max-width: none;
  left: var(--hole-x, 0px);
  top: var(--hole-y, 0px);
  pointer-events: none;
}

.cut:hover { filter: brightness(1.08); }

.cut:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}

.folder-rust .cuts {
  padding-top: 14px;
}

.contact {
  position: relative;
  flex: 1;
  min-height: 54px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #c5d5d4;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow:
    inset 0 0 0 1px rgba(40, 55, 54, 0.18),
    inset 0 8px 12px rgba(40, 55, 54, 0.12);
}

.contact .felt {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contact span {
  position: relative;
  z-index: 1;
}

.contact:hover { filter: brightness(1.06); }

.contact:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}

.panel p {
  margin: 0 0 16px;
  max-width: 64ch;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.45;
}

.panel .linkline { margin: 0; }

.panel a {
  color: inherit;
  font-weight: 700;
  text-underline-offset: 3px;
}

.panel a:hover { text-decoration-thickness: 2px; }

@media (max-width: 900px) {
  .stack { width: min(86vw, 680px); }
}

@media (max-width: 700px) {
  :root {
    --tab-h: 40px;
    --curve: 22px;
    --shoulder: 16px;
    --closed: 0px;
  }

  .mast { padding: 24px 16px 0; }
  .mast-row { gap: 12px; }
  main { padding: 20px 16px calc(28px + env(safe-area-inset-bottom)); }

  h1 { font-size: clamp(48px, 13.5vw, 64px); }

  .portrait {
    width: 108px;
    height: 74px;
  }

  .stack { width: 100%; }

  .face { min-height: 0; }

  .tab { right: 16px; width: 128px; }

  .folder-title {
    padding: 18px 18px 4px;
    font-size: 22px;
    line-height: 1.16;
  }

  .folder:not(.is-open):not(.folder-rust) .folder-title {
    padding-bottom: calc(var(--tuck) + var(--tab-h) + 10px);
  }

  .panel-inner { padding: 8px 18px calc(var(--tuck) + var(--tab-h) + 16px); }
  .panel p {
    font-size: 16px;
    line-height: 1.5;
  }

  .cuts {
    flex-direction: column;
    gap: 12px;
    padding: 8px 16px 20px;
  }

  .cut,
  .contact { min-height: 48px; }
}

@media (max-width: 340px) {
  h1 { font-size: 40px; }
  .portrait { width: 84px; height: 56px; }
  .mast-row { gap: 8px; }
  .folder-title { font-size: 20px; }
  .tab { width: 112px; right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .panel { transition: none; }
}
