/* ============================================================================
   Isaac Lee — the projects folder (folder.js builds it).

   A manila folder under the Projects heading, holding one sheet per entry
   below. It is a stationery object, so it keeps the page's materials: paper
   tones and hairlines, square corners, no shadow, no gradient. The one
   accent is the sienna dot on the tab (the One Warm Thing Rule: a mark).

   Layers stack by z-index, as in the original: the folder's back at 4, the
   sheets at 10, the flap at 40. Positions and sizes are set by folder.js
   from the column's width; this file only dresses them.

   Type is set at real size and never scaled down, so the Floor Rule holds
   on a phone: the sheets are measured around their text.
   ========================================================================== */

/* The manila is three tones of one card stock: the flap, the darker back
   wall behind the sheets, and its edge. Declared in all three palette
   blocks (the Twin Palette Rule). In the dark theme it is the same stock
   under a low lamp: lighter than the paper, so the folder still reads as an
   object on the desk. */
:root {
  --manila: #eee5cc;
  --manila-deep: #e4d9b9;
  --manila-rule: #cbbe98;
}
:root[data-theme="dark"] {
  --manila: #332d21;
  --manila-deep: #2a2519;
  --manila-rule: #4f4635;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --manila: #332d21;
    --manila-deep: #2a2519;
    --manila-rule: #4f4635;
  }
}

.folder {
  position: relative;
  margin-bottom: 2.25rem;
}

.folder__stage {
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.folder__back, .folder__flap, .folder__item {
  position: absolute;
  top: 0;
  left: 0;
}

/* The back wall and its tab, one outline. */
.folder__back { z-index: 4; cursor: pointer; }
.folder__back svg { display: block; overflow: visible; }
.folder__back path {
  fill: var(--manila-deep);
  stroke: var(--manila-rule);
  stroke-width: 1;
}
.folder__tab {
  position: absolute;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: .75rem;
  line-height: 1;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
}
.folder__tab-label { display: inline-flex; align-items: center; gap: .5em; }
.folder__tab i {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* The flap is the button. It tips about its bottom edge. The page's own
   :focus-visible ring follows it, so the ring shows on the flap at any
   angle. */
.folder__flap {
  z-index: 40;
  display: block;
  margin: 0;
  padding: 0;
  background: var(--manila);
  border: 1px solid var(--manila-rule);
  border-radius: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transform-origin: 50% 100%;
}

/* The list only groups the sheets: with no position of its own, each sheet
   stacks against the back and the flap directly. */
.folder__sheets { margin: 0; padding: 0; list-style: none; }

.folder__item { z-index: 10; transform-origin: 50% 50%; }
.folder__item[data-lead] { z-index: 11; }

/* A sheet reads like its entry: serif title, italic muted role, mono date,
   here in that order down the page, with the date at the foot. */
.folder__sheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: .55rem .65rem .6rem;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
  transition: border-color .3s var(--ease-out);
}
@media (hover: hover) {
  .folder__sheet:hover { border-color: var(--accent); }
}
.folder__title {
  display: block;
  font-size: .875rem;
  line-height: 1.22;
  letter-spacing: -.005em;
  overflow-wrap: break-word;
}
.folder__title::after {
  content: "";
  display: block;
  width: 1.5rem;
  height: 1px;
  margin: .45rem 0 .4rem;
  background: var(--rule);
}
.folder__role {
  display: block;
  font-size: .8125rem;
  font-style: italic;
  line-height: 1.3;
  color: var(--muted);
}
.folder__date {
  display: block;
  margin-top: auto;
  padding-top: .35rem;
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .03em;
  line-height: 1.4;
  color: var(--muted);
}

/* Two rows on a phone: the sheets give up their small rule and some padding
   rather than any type size, so the fan stays near the wide column's height. */
.folder[data-narrow] .folder__sheet { padding: .45rem .55rem .5rem; }
.folder[data-narrow] .folder__title::after { display: none; }
.folder[data-narrow] .folder__role { margin-top: .2rem; }

@media (prefers-reduced-motion: reduce) {
  .folder__sheet { transition: none; }
}

/* On paper the entries themselves are the index. */
@media print {
  .folder { display: none; }
}

/* On a phone four sheets can only overlap and cut each other's words off,
   and the same four entries start right below; the list is the better page
   there, so the folder steps aside. */
@media (max-width: 40rem) {
  .folder { display: none; }
}
