/* ============================================================
   home: Work (a carousel of collage cards) and About (one board)
   The look and the numbers come from the approved prototype; see
   docs/superpowers/specs/2026-11-28-carousel-home-design.md.
   ============================================================ */
:root {
  --paper: #FBFAF6;
  --hand: 'Caveat', 'Comic Sans MS', cursive;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .16 0 0 0 0 .1 .9 0 0 0 -.3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- header: name, tabs, elsewhere ---------- */
.site-head {
  position: relative; z-index: 10;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  padding: 20px 24px;
}
.site-head .brand { justify-self: start; }
.site-head .toplinks { justify-self: end; }

.tabs {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  padding: 3px; border-radius: 99px;
  background: rgba(30, 27, 22, .06);
  box-shadow: inset 0 1px 2px rgba(30, 27, 22, .06);
}
.tabs a {
  position: relative; z-index: 1;
  padding: 6px 20px; border-radius: 99px; text-align: center;
  font: 13px var(--mono); color: var(--muted); text-decoration: none;
  transition: color .3s;
}
.tabs a[aria-selected="true"] { color: var(--fg); }
.tab-pill {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px);
  border-radius: 99px; background: var(--paper);
  box-shadow: 0 1px 3px rgba(40, 30, 20, .14), inset 0 0 0 1px rgba(255, 255, 255, .8);
  transition: transform .5s var(--ease);
}
html[data-tab="about"] .tab-pill { transform: translateX(100%); }
html:not(.js) .tabs { visibility: hidden; }

/* ---------- the deck (cards are laid out by assets/deck.js) ---------- */
.deck { position: relative; }
.deck-ring { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; padding: 16px; }

.deck-card {
  --tint: var(--paper);
  position: relative; flex: none;
  width: 340px; height: 380px;
  color: var(--fg); text-decoration: none;
  -webkit-user-drag: none;
}
.deck-card * { -webkit-user-drag: none; }
.deck-card img { display: block; pointer-events: none; }
.deck-card:focus-visible { outline: none; }
.deck-card:focus-visible .deck-face { outline: 2px solid var(--accent); outline-offset: 4px; }

.deck-face {
  position: absolute; inset: 0; border-radius: 14px;
  background: var(--tint);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7), 0 1px 2px rgba(40, 30, 20, .08);
}
.deck-face::after {            /* a whisper of paper texture */
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--grain); opacity: .09;
}
/* Everything that changes while the deck moves is its own layer and only
   ever moves or fades, so nothing is repainted mid-motion. */
.deck-board, .deck-drop, .deck-dim { position: absolute; pointer-events: none; will-change: transform, opacity; }
.deck-board { inset: 0; border-radius: 14px; background: #D2CABA; }   /* the edge you see as it turns */
.deck-drop {                                                            /* soft shadow on the "table" */
  left: 8%; right: 8%; bottom: -16px; height: 40px;
  background: radial-gradient(closest-side, rgba(40, 30, 20, .22), transparent);
}
.deck-dim { inset: 0; border-radius: 14px; background: #1A1510; opacity: 0; z-index: 60; }

/* Things on a card float at their own height --z; deck.js slides them as the
   card turns. Real 3D layers would do it for free but make browsers drop the
   vellum blur, so cards stay flat. */
.obj {
  position: absolute;
  transform: rotate(var(--r, 0deg));
  will-change: transform;
  box-shadow:
    0 1px 1px rgba(40, 30, 20, .08),
    0 calc(var(--z, 0px) * .5 + 2px) calc(var(--z, 0px) * .9 + 4px) -4px rgba(40, 30, 20, .22);
}

/* ---------- materials ---------- */
.vellum {
  background:
    linear-gradient(170deg, rgba(255, 255, 255, .32), rgba(255, 255, 255, 0) 45%),
    rgba(249, 248, 244, .5);
  -webkit-backdrop-filter: blur(4px) saturate(.85) brightness(1.06);
  backdrop-filter: blur(4px) saturate(.85) brightness(1.06);
  border: 1px solid rgba(255, 255, 255, .8);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .vellum { background-color: rgba(249, 248, 244, .82); }
}
.vellum svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.flap { clip-path: polygon(0 100%, 50% 0, 100% 100%); box-shadow: none; }

.flash {
  background:
    linear-gradient(#E05A4F, #E05A4F) 0 34px / 100% 1.5px no-repeat,
    repeating-linear-gradient(transparent 0 55px, rgba(70, 110, 180, .3) 55px 56px, transparent 56px 76px),
    #FFFEFA;
  padding: 4px 16px;
  font: 700 32px/1 var(--hand); color: #26407A;
}
.flash small { display: block; margin-top: 18px; font: 11px var(--mono); color: #6B7A99; letter-spacing: .04em; }

.print { background: #FFFEFA; padding: 8px 8px 22px; }
.print img { width: 236px; height: auto; }

.folder { background: #DDBF85; border-radius: 3px 6px 4px 4px; }
.folder.back::before {
  content: ""; position: absolute; left: 0; top: -18px; width: 96px; height: 20px;
  background: #DDBF85; border-radius: 6px 10px 0 0;
}
.folder.front { background: #E8CD95; }
.folder .label {
  position: absolute; left: 18px; top: 20px;
  background: #FFFEFA; padding: 6px 12px;
  font: 500 11px/1.4 var(--mono); letter-spacing: .1em; color: #3A352D;
}
.timeline { background: #FFFEFA; padding: 16px; font: 9px/1 var(--mono); color: #6B6255; }
.timeline .row { display: flex; align-items: center; gap: 6px; margin-bottom: 9px; }
.timeline .row span:first-child { width: 50px; }
.timeline .dots { flex: 1; height: 8px; background-image: radial-gradient(circle, #6B6255 0 2.3px, transparent 2.8px); background-size: 14px 8px; }
.timeline .dots.hot { background-image: radial-gradient(circle, #C2402F 0 2.6px, transparent 3px); }

.phone { background: #2A2A2E; border-radius: 18px; }
.phone::before { content: ""; position: absolute; inset: 7px; border-radius: 12px; background: linear-gradient(160deg, #7C9CC4, #3C5170); }
.bag-fold { position: absolute; left: 0; right: 0; top: 16px; height: 1px; background: rgba(255, 255, 255, .95); box-shadow: 0 1px 0 rgba(0, 0, 0, .05); }
.price {
  background: #FFFEFA; padding: 7px 12px 7px 24px; border-radius: 4px;
  font: 700 24px/1 var(--hand); color: #2A2A2A; white-space: nowrap;
}
.price::before { content: ""; position: absolute; left: 9px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .2); }

/* ---------- caption and ticks under the deck ---------- */
.deck-foot { padding: 0 24px 26px; text-align: center; }
.deck-caption h2 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.deck-caption p { margin: 6px 0 0; font: 12px var(--mono); color: var(--muted); min-height: 1.4em; }
.deck-ticks { display: flex; justify-content: center; gap: 7px; margin-top: 18px; height: 16px; align-items: center; }
.deck-ticks button { width: 14px; height: 16px; border: 0; padding: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.deck-ticks button::before { content: ""; width: 1.5px; height: 8px; background: var(--muted); opacity: .45; transition: height .25s, opacity .25s, background .25s; }
.deck-ticks button[aria-selected="true"]::before { height: 16px; opacity: 1; background: var(--fg); }
html:not(.js) .deck-foot { display: none; }

/* ---------- with scripts: one screen, the deck in the middle ---------- */
html.js, html.js body { height: 100%; }
html.js body { display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
html.js .work { display: grid; grid-template-rows: 1fr auto; min-height: 0; user-select: none; -webkit-user-select: none; }
/* clip sideways only, so shadows below the cards are not cut into a line */
html.js .deck { min-height: 0; overflow-x: clip; overflow-y: visible; touch-action: pan-y; cursor: grab; }
html.js .deck.dragging, html.js .deck.dragging .deck-card { cursor: grabbing; }
html.js .deck-ring {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0; padding: 0;
  display: block; perspective: 1500px;
  transform: scale(var(--sc, 1));
}
html.js .deck-card { position: absolute; left: 0; top: 0; cursor: pointer; will-change: transform; }

/* ---------- switching: Work steps back, About comes up ---------- */
html.js .work, html.js .about { transition: opacity .45s ease, transform .6s var(--ease), visibility 0s; }
html.js[data-tab="about"] .work {
  opacity: 0; transform: translateY(24px) scale(.96); pointer-events: none; visibility: hidden;
  transition-delay: 0s, 0s, .6s;
}
html.js .about {
  position: fixed; left: 0; right: 0; top: 70px; bottom: 0;
  display: grid; place-items: center;
  padding: 24px 24px 56px; overflow: auto;
  perspective: 1400px;
  opacity: 0; transform: translateY(36px); pointer-events: none; visibility: hidden;
  transition-delay: 0s, 0s, .6s;
}
html.js[data-tab="about"] .about {
  opacity: 1; transform: none; pointer-events: auto; visibility: visible;
  transition-delay: .12s, .12s, 0s;
}
html:not(.js) .about { display: grid; place-items: center; padding: 40px 16px 64px; }

/* ---------- the About board ---------- */
.aboard {
  --rx: 0deg; --ry: 0deg;
  position: relative; width: min(760px, 100%);
  background: var(--paper); border-radius: 16px;
  padding: 44px 48px 40px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7), 0 1px 2px rgba(40, 30, 20, .08), 0 26px 44px -30px rgba(40, 30, 20, .4);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .6s var(--ease);
}
.aboard::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--grain); opacity: .09; pointer-events: none; }
.a-top { display: grid; grid-template-columns: 120px 1fr; gap: 34px; align-items: center; }
.patch {
  width: 112px; height: 112px; border-radius: 50%; display: block;
  background: var(--patch); padding: 6px;
  outline: 1.5px dashed rgba(30, 27, 22, .3); outline-offset: 4px;
  transform: rotate(-6deg);
  box-shadow: 0 6px 14px -6px rgba(40, 30, 20, .3);
}
.patch img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.kicker { margin: 0 0 6px; font: 12px var(--mono); color: var(--muted); letter-spacing: .04em; }
.hero-name {
  --name-size: clamp(48px, 8.5vw, 80px);
  margin: 0; font-size: var(--name-size); font-weight: 900; line-height: 1; letter-spacing: -.025em;
}
.a-name .words { justify-content: flex-start; }
.a-intro .letter-controls { margin-top: 6px; font: 12px var(--mono); }
.intro { margin: 14px 0 0; font-size: 17px; line-height: 1.6; max-width: 36ch; }
.a-row {
  display: grid; grid-template-columns: 120px 1fr; gap: 34px; align-items: baseline;
  margin-top: 26px; padding-top: 22px;
  border-top: 1.5px dashed rgba(30, 27, 22, .22);
}
.a-label { font: 11px var(--mono); color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.labels { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.labels li {
  font: 12px var(--mono); color: #3A352D;
  padding: 7px 12px; border-radius: 4px; background: #EFE9DD;
  outline: 1px dashed rgba(30, 27, 22, .22); outline-offset: -4px;
}
.a-links { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: baseline; }
.a-links a { font: 13px var(--mono); text-underline-offset: 4px; text-decoration-style: dashed; }
.a-links a.mail { font: 500 19px var(--serif); text-decoration: none; }
.a-links a:hover { text-decoration: underline dashed; }
.slip {
  position: absolute; right: -18px; top: -22px; z-index: 2;
  padding: 14px 18px; transform: rotate(6deg);
  font: 700 24px/1 var(--hand); color: #2D4F38;
  box-shadow: 0 6px 14px -8px rgba(40, 30, 20, .35);
}

/* ---------- phones ---------- */
/* Too narrow for name, tabs and links in one row: the links stay on About. */
@media (max-width: 360px) {
  .site-head .toplinks { display: none; }
}
@media (max-width: 600px) {
  .site-head { padding: 16px; }
  .tabs a { padding: 6px 10px; }
  .deck-foot { padding: 0 16px 22px; }
  .deck-caption h2 { font-size: 22px; }
  html.js .about { top: 62px; padding: 16px 16px 40px; place-items: start center; }
  .aboard { padding: 30px 22px 26px; }
  .a-top, .a-row { grid-template-columns: 1fr; gap: 14px; }
  .patch { width: 84px; height: 84px; }
  .slip { right: 10px; top: -14px; font-size: 20px; }
}
