/* The Index / home.css — the one column of doors.
 * Shape taken from shahimim.com: 560px wide, square square / wide / square square.
 */

.page {
  width: var(--col-reading);
  margin: 0 auto;
  padding: 126px 0 80px;
}

.masthead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
}

.intro { margin: var(--s-5) 0 0; }
.intro h1 {
  margin: 0;
  font-size: 15px;
  line-height: 24px;
  font-weight: 500;
  letter-spacing: -.01em;
}
.intro .sub { margin: 0; color: var(--ink-muted); }

.bio { margin: var(--s-6) 0 0; }
.bio p { margin: 0 0 var(--s-5); color: var(--body); }
.bio p:last-child { margin-bottom: 0; }

.sep { margin: var(--s-6) 0; }
.cut { margin: calc(var(--s-6) - 22px) 0; }
.bio-more > div > p:first-child { margin-top: var(--s-5); }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
}

/* ---- Garden: a squared deck, three backs and one face ------------------
 * Not a fan. The reference stacks the cards straight and lets the three
 * behind show only as a stepped edge above the one you can read.
 */
.deck {
  position: absolute;
  left: 16px; right: 16px; bottom: 16px;
  height: 158px;
}
.deck > * {
  position: absolute;
  border: 1px solid var(--line);
  border-radius: var(--radius-media);
  background: var(--ground);
  box-shadow: var(--shadow-ticket);
}

/* The backs are full-height cards pushed up behind the face, so only their
   top edge is ever visible. Nothing is clipped, so nothing can mis-stack. */
.deck-back {
  left: var(--in);
  right: var(--in);
  bottom: 0;
  top: calc(0px - var(--dy));
  transition: top var(--dur-hover) var(--ease-glide),
              left var(--dur-hover) var(--ease-glide),
              right var(--dur-hover) var(--ease-glide);
}
.deck-back:nth-child(1) { --dy: 27px; --in: 21px; }
.deck-back:nth-child(2) { --dy: 19px; --in: 14px; }
.deck-back:nth-child(3) { --dy: 10px; --in:  7px; }

/* The deck opens a step further on hover. The tile itself never moves. */
.tile:hover .deck-back:nth-child(1) { --dy: 34px; --in: 25px; }
.tile:hover .deck-back:nth-child(2) { --dy: 24px; --in: 17px; }
.tile:hover .deck-back:nth-child(3) { --dy: 13px; --in:  8px; }

.deck-face {
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 14px;
}
/* The face deals: the top note lifts off and away, the next one rises out of
   the stack into its place. Only the card marked is-on is readable. */
.deck-face:not(.is-on) { opacity: 0; transform: translateY(14px) scale(.96); box-shadow: none; }
.deck-face {
  transition: opacity .55s var(--ease-glide), transform .7s cubic-bezier(.16, 1, .3, 1);
  will-change: transform, opacity;
}
.deck-face.is-out { opacity: 0; transform: translate(18px, -46px) rotate(5deg) scale(1.02); transition-duration: .45s, .6s; }
.deck[data-dealing="true"] .deck-back:nth-child(3) { --dy: 6px; --in: 5px; }
@media (prefers-reduced-motion: reduce) {
  .deck-face { transition: opacity .2s linear; }
  .deck-face:not(.is-on), .deck-face.is-out { transform: none; }
}
/* Memories in the deck. A video (the talk, a build) fills the whole card with
   only a small tag. A photo sits on the left with its kind, title and, where
   the garden has one, a line of context on the right. Same card size as a
   note. The tile still opens the garden page itself. */
.deck-face--video { padding: 0; overflow: hidden; background: #111; }
.deck-face--video video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
  border-radius: inherit;
}
.deck-tag {
  position: absolute; left: 10px; bottom: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px 4px 5px; border-radius: 999px;
  background: rgba(255, 255, 255, .94); color: #111;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  font-family: var(--font-mono); font-size: 9px; line-height: 12px; letter-spacing: .04em; text-transform: uppercase;
}
.deck-play { position: relative; width: 14px; height: 14px; border-radius: 50%; background: #111; flex: none; }
.deck-play::after {
  content: ""; position: absolute; left: 5px; top: 4px;
  border-left: 5px solid #fff; border-top: 3px solid transparent; border-bottom: 3px solid transparent;
}
.deck-face--media { flex-direction: row; gap: 12px; padding: 10px 14px 10px 10px; }
.deck-media {
  position: relative; flex: 0 0 auto;
  height: 100%; aspect-ratio: 3 / 4;
  border-radius: calc(var(--radius-media) - 3px); overflow: hidden;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}
.deck-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.deck-body { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; padding-top: 6px; }
.deck-face--media .deck-gloss { -webkit-line-clamp: 3; }
.deck-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 13px;
  letter-spacing: .04em;
  color: var(--ink-muted);
}
.deck-line b {
  font-weight: 500;
  color: var(--marker-text);
}
.deck-title {
  margin-top: 9px;
  font-size: 15px;
  line-height: 19px;
  font-weight: 600;
  letter-spacing: -.012em;
  color: var(--ink);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.deck-rule {
  height: 1px;
  margin: 10px 0 9px;
  background: repeating-linear-gradient(90deg, var(--line) 0 3px, transparent 3px 9px);
}
.deck-gloss {
  font-size: 11px;
  line-height: 15px;
  color: var(--ink-muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* ---- Interactions: one at a time ---------------------------------------
 * The reference's writing section shows a single piece and what it is, then
 * moves on. Four thumbnails at once reads as a contact sheet, which is the
 * opposite claim: it says "here is everything" instead of "look at this one".
 */
.tile--wide .reel {
  position: absolute;
  inset: 44px 16px 16px;
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  gap: 18px;
}
.reel-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-media);
  background: var(--ground);
}
/* Dotted line art, not a thumbnail. A frame of the interaction sitting still
   is the least informative frame of it, and the tile is 188px wide: the clip
   is unreadable at that size and the page pays for four videos to prove it.
   The dashes are the system's own 3 / 6 rule, so the art is made of the same
   line as the separators and the cut. */
.reel-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  color: var(--ink-soft);
  opacity: 0;
  transform: scale(.97);
  transition: opacity var(--dur-slow) ease, transform var(--dur-slow) var(--ease-glide);
}
.reel-art.is-on { opacity: .85; transform: none; }
video.reel-art { object-fit: cover; }
video.reel-art.is-on { opacity: 1; }
.tile:hover .reel-art.is-on { opacity: 1; }

.reel-read {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.reel-no {
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 13px;
  letter-spacing: .14em;
  color: var(--marker-text);
}
.reel-title {
  margin-top: 7px;
  font-size: 15px;
  line-height: 19px;
  font-weight: 600;
  letter-spacing: -.012em;
  color: var(--ink);
}
.reel-gloss {
  margin-top: 4px;
  font-size: 12px;
  line-height: 17px;
  color: var(--ink-muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
/* The words crossfade with the clip, so the pair never reads mismatched. */
.reel-no, .reel-title, .reel-gloss {
  transition: opacity var(--dur-hover) ease;
}
.reel[data-swapping="true"] :is(.reel-no, .reel-title, .reel-gloss) { opacity: 0; }

.reel-dots {
  display: flex;
  gap: 5px;
  margin-top: 14px;
}
.reel-dots i {
  width: 16px;
  height: 2px;
  border-radius: var(--radius-full);
  background: var(--line);
  transition: background-color var(--dur-hover) ease;
}
.reel-dots i.is-on { background: var(--marker); }

/* ---- Illustrations -----------------------------------------------------
 * Six cells, deliberately abstract. These are placeholders for drawn work
 * that is not in the repository yet, and they must not be mistaken for it.
 */
.swatches {
  position: absolute;
  inset: 52px 16px 44px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: var(--s-2);
}
/* Neutral on purpose. The tint palette carries meaning elsewhere in this
   system, so it is not spent on a placeholder. */
.swatches i {
  border-radius: var(--radius-media);
  border: 1px solid var(--line);
  background: var(--ground);
}
/* Real pieces now, cropped square. They lift one after another on hover. */
.swatches--art i { background-size: cover; background-position: center; transition: transform var(--dur-hover) var(--ease-glide); }
.tile:hover .swatches--art i { transform: translateY(-3px); }
.tile:hover .swatches--art i:nth-child(2), .tile:hover .swatches--art i:nth-child(5) { transition-delay: 40ms; }
.tile:hover .swatches--art i:nth-child(3), .tile:hover .swatches--art i:nth-child(6) { transition-delay: 80ms; }
@media (prefers-reduced-motion: reduce) { .swatches--art i { transition: none; } .tile:hover .swatches--art i { transform: none; } }

/* ---- Work with me: three numbered offerings, the shape of the reference -- */
.offers {
  position: absolute;
  left: 16px; right: 16px; bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-soft);
}
.offers span {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}
.offers b {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 18px;
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--marker-text);
}
.tile:hover .offers { color: var(--ink); }

/* ---- Colophon ----------------------------------------------------------- */
.colophon {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  margin-top: var(--s-6);
}
.colophon a { color: var(--ink-muted); text-decoration: none; }
.colophon a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: .22em; }

/* ---- Narrow ------------------------------------------------------------- */
@media (max-width: 620px) {
  .page { width: auto; padding: 56px var(--s-5) 64px; }
  .tile--wide { height: auto; aspect-ratio: 16 / 9; }
  .tile--wide .reel { grid-template-columns: 140px minmax(0, 1fr); gap: 14px; }
  .reel-title { font-size: 14px; }
}

/* One column below this. Two 137px tiles cannot hold a readable card or four
   lines of status, and the deck is taller than the tile it sits in. */
@media (max-width: 560px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .tile--wide { grid-column: auto; }
  .offers { position: static; padding: 44px 16px 16px; }
  .swatches { position: static; padding: 44px 16px 16px; height: 100%; }
  .deck { height: 170px; }
}
@media (max-width: 420px) {
  .tile--wide .reel { grid-template-columns: minmax(0, 1fr); }
  .reel-stage { display: none; }
}
