/* My Apps — P·Double Learning. Editorial Field Notes brand in three dimensions:
   an ink sky where the mark floats in real depth, then a desk of filed paper
   tools that lift out of the drawer as you scroll. */

*, *::before, *::after { box-sizing: border-box; }
body.pd { margin: 0; }

/* ── Hero: full-bleed ink, the two P's split into depth ───────────────── */
.hero {
  background: var(--ink);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(244, 236, 220, 0.055) 1px, transparent 0),
    radial-gradient(1100px 700px at 82% 18%, rgba(216, 67, 31, 0.16), transparent 62%),
    radial-gradient(800px 620px at -6% 108%, rgba(79, 107, 77, 0.12), transparent 60%);
  background-size: 26px 26px, 100% 100%, 100% 100%;
  min-height: clamp(560px, 92vh, 860px);
  display: grid;
  align-items: center;
  overflow: hidden;
}
.hero-inner {
  width: 100%; max-width: 1180px; margin: 0 auto;
  padding: clamp(64px, 11vh, 130px) clamp(22px, 5vw, 60px);
  display: grid; grid-template-columns: 1.12fr 0.88fr;
  gap: clamp(28px, 5vw, 72px); align-items: center;
}
.hero-kicker { color: var(--persimmon); }
.hero-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.5rem, 5.6vw, 4.7rem);
  line-height: 1.04; letter-spacing: -0.015em;
  color: var(--paper); margin: 18px 0 22px;
  text-wrap: balance;
}
.hero-title em { font-style: italic; font-weight: 600; color: var(--persimmon); }
.hero-sub {
  color: #cfc3ae; font-size: clamp(15.5px, 1.5vw, 17.5px); line-height: 1.72;
  max-width: 56ch; margin: 0 0 16px;
}
.hero-fine {
  color: #9b8d76; font-size: 13px; line-height: 1.7; max-width: 52ch; margin: 0;
}
.hero-cue {
  display: inline-block; margin-top: 36px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--persimmon); text-decoration: none;
  border-bottom: 1.5px solid var(--persimmon); padding-bottom: 4px;
}
.hero-cue:hover { color: var(--paper); border-color: var(--paper); }
.hero-cue:focus-visible { outline: 2px solid var(--persimmon); outline-offset: 3px; }

/* The mark, staged in true 3D. Two SVG layers share one perspective scene;
   idle it breathes on a slow float, on pointer move it turns to face you. */
.hero-logo { perspective: 950px; display: grid; place-items: center; }
.logo-stage {
  position: relative;
  width: min(330px, 58vw);
  aspect-ratio: 60 / 82;
  transform-style: preserve-3d;
  animation: logoFloat 8s ease-in-out infinite alternate;
}
.logo-stage.live { animation: none; transition: transform 0.22s ease-out; }
.pp { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pp-back {
  transform: translate3d(8%, 7%, -80px);
  filter: drop-shadow(0 34px 44px rgba(0, 0, 0, 0.55));
}
.pp-front {
  transform: translateZ(55px);
  filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.6));
}
@keyframes logoFloat {
  from { transform: rotateX(7deg) rotateY(-14deg); }
  to   { transform: rotateX(-5deg) rotateY(12deg); }
}

/* ── The desk: seven tools filed as dimensional ledger cards ──────────── */
.desk {
  max-width: 1180px; margin: 0 auto;
  padding: clamp(60px, 10vh, 120px) clamp(22px, 5vw, 60px) 30px;
}
.desk-head {
  display: flex; align-items: baseline; gap: 10px 26px; flex-wrap: wrap;
  margin-bottom: clamp(40px, 7vh, 72px);
}
.desk-lead { font-size: 15px; color: var(--ink-soft); margin: 0; }
.desk-lead a { color: var(--persimmon); text-underline-offset: 3px; }
.desk-lead a:hover { color: var(--persimmon-deep); }

.cards {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 2vw, 26px);
  perspective: 1500px;
}

/* Compact launcher rows: the badge is the identity, the text is the pitch */
.card {
  position: relative;
  display: grid; grid-template-columns: 62px 1fr;
  gap: 4px 18px; align-items: start;
  background: var(--paper-3);
  border: 2px solid var(--ink); border-radius: 5px;
  padding: 18px 20px 14px;
  box-shadow: 4px 5px 0 var(--line-strong);
  transform-style: preserve-3d;
  opacity: 0;
  transform: translate3d(0, 60px, -120px) rotateX(14deg);
  transition:
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1) calc(var(--i) * 60ms),
    opacity 0.5s ease calc(var(--i) * 60ms),
    box-shadow 0.25s ease;
}
.card.in { opacity: 1; transform: none; }
.card.tilt { transition: transform 0.09s linear, box-shadow 0.25s ease; }
.card:hover { box-shadow: 8px 9px 0 var(--persimmon); }

/* papers on a desk, not pixels on a grid */
.card:nth-child(odd) { rotate: -0.35deg; }
.card:nth-child(even) { rotate: 0.3deg; }

.card-num {
  position: absolute; top: -16px; left: -9px;
  font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1;
  color: var(--line-strong);
  transition: color 0.25s, text-shadow 0.25s;
  transform: translateZ(30px);
}
.card:hover .card-num {
  color: var(--ink);
  text-shadow: 2px 2px 0 rgba(216, 67, 31, 0.85);
}

.card-badge { transform: translateZ(18px); padding-top: 2px; }
.card-badge .badge {
  display: block; width: 62px; height: 62px;
  filter: drop-shadow(3px 3px 0 var(--line-strong));
  transition: filter 0.2s;
}
.card:hover .card-badge .badge { filter: drop-shadow(3px 3px 0 var(--persimmon)); }

.card-body { min-width: 0; }
.card-name {
  font-family: var(--font-display); font-weight: 600; font-size: 19px;
  line-height: 1.15; margin: 0 0 5px; color: var(--ink);
  transform: translateZ(10px);
}
.card-line { font-size: 13px; line-height: 1.58; color: var(--ink-soft); margin: 0 0 12px; }
.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-top: 1px solid var(--line); padding-top: 10px;
}
.card-tag {
  font-family: var(--font-mono); font-size: 9px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 7px;
}
.card-tag::before { content: ""; width: 6px; height: 6px; background: var(--persimmon); }
.card-open {
  font: 600 12.5px var(--font-ui); text-decoration: none;
  background: var(--ink); color: var(--paper);
  padding: 6px 12px; border-radius: 3px;
  box-shadow: 3px 3px 0 var(--persimmon);
  transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
  transform: translateZ(22px);
  white-space: nowrap;
}
.card-open:hover { background: var(--persimmon); box-shadow: 3px 3px 0 var(--ink); transform: translateZ(22px) translate(-1px, -1px); }
.card-open:focus-visible { outline: 2px solid var(--persimmon); outline-offset: 3px; }

/* The seventh file sits alone on the last row, same size as the others */
.card:nth-child(7) { grid-column: 1; }

/* ── Footer ───────────────────────────────────────────────────────────── */
.foot {
  max-width: 1180px; margin: clamp(50px, 8vh, 90px) auto 0;
  padding: 44px clamp(22px, 5vw, 60px) 76px;
  border-top: 1px solid var(--line-strong);
  text-align: center;
}
.foot-lockup { height: 30px; margin-bottom: 16px; }
.foot-line { font-size: 14px; color: var(--ink-soft); margin: 0 0 10px; }
.foot-mono {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.3em;
  color: var(--persimmon); margin: 0;
}
.foot-shelf {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em;
  color: var(--ink-soft); text-decoration: underline; text-underline-offset: 4px;
  text-decoration-color: var(--persimmon);
}
.foot-shelf:hover { color: var(--persimmon); }

/* ── Small screens ────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; padding-top: 72px; }
  .hero-logo { order: -1; }
  .logo-stage { width: min(200px, 44vw); }
  .cards { grid-template-columns: 1fr; }
  .card { grid-template-columns: 52px 1fr; gap: 4px 14px; padding: 16px 16px 12px; }
  .card-badge .badge { width: 52px; height: 52px; }
  .card-num { font-size: 30px; top: -14px; }
}

/* ── The Shelf (/all): the complete inventory, one line per tool ───────── */
.shelf-head {
  background: var(--ink);
  background-image: radial-gradient(circle at 1px 1px, rgba(244, 236, 220, 0.05) 1px, transparent 0);
  background-size: 26px 26px;
  padding: clamp(40px, 7vh, 72px) clamp(22px, 5vw, 60px) clamp(34px, 5vh, 54px);
}
.shelf-head-inner {
  max-width: 940px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto;
  gap: clamp(20px, 4vw, 56px); align-items: center;
}
.shelf-logo { perspective: 700px; }
.shelf-logo .logo-stage { width: clamp(110px, 13vw, 170px); }
@media (max-width: 700px) {
  .shelf-head-inner { grid-template-columns: 1fr; }
  .shelf-logo { display: none; }
}
.shelf-back {
  display: inline-block; margin-bottom: 22px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: #9b8d76; text-decoration: none;
}
.shelf-back:hover { color: var(--persimmon); }
.shelf-head .pd-kicker { color: var(--persimmon); }
.shelf-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.08;
  color: var(--paper); margin: 14px 0 12px;
}
.shelf-title em { font-style: italic; color: var(--persimmon); }
.shelf-sub { color: #cfc3ae; font-size: 15px; line-height: 1.7; max-width: 58ch; margin: 0; }

.shelf { max-width: 940px; margin: 0 auto; padding: clamp(36px, 6vh, 60px) clamp(22px, 5vw, 60px) 20px; }
.shelf-group { margin-bottom: clamp(34px, 5vh, 52px); }
.shelf-cap {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink);
  margin: 0 0 4px; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
}
.shelf-cap span {
  font-family: var(--font-ui); font-size: 12.5px; font-weight: 400;
  letter-spacing: 0; text-transform: none; font-style: italic; color: var(--ink-soft);
}
.shelf-list { list-style: none; margin: 10px 0 0; padding: 0; counter-reset: shelf; }
.shelf-list li {
  counter-increment: shelf;
  display: grid; grid-template-columns: 30px 78px 210px 1fr auto;
  gap: 12px; align-items: baseline;
  border-top: 1px solid var(--line);
  padding: 9px 0;
}
.shelf-list li::before {
  content: counter(shelf, decimal-leading-zero);
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  color: var(--line-strong);
}
.shelf-list a, .shelf-list b {
  font-family: var(--font-display); font-weight: 600; font-size: 16.5px;
  color: var(--ink); text-decoration: none;
}
.shelf-list a:hover { color: var(--persimmon); text-decoration: underline; text-underline-offset: 3px; }
.shelf-list a:focus-visible { outline: 2px solid var(--persimmon); outline-offset: 2px; }
.shelf-list em { font-style: normal; font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
.shelf-list code {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em;
  color: var(--ink-faint); background: none;
}
.tag {
  font-family: var(--font-mono); font-size: 8.5px; font-weight: 700;
  letter-spacing: 0.14em; text-align: center;
  border: 1.5px solid currentColor; border-radius: 999px;
  padding: 2px 0; align-self: center;
}
.tag.live  { color: var(--sage); }
.tag.wip   { color: var(--amber-deep, #8a5a0e); }
.tag.priv  { color: var(--persimmon-deep); }
.tag.local { color: var(--ink); }
.tag.util  { color: var(--ink-soft); }
.tag.dead  { color: var(--ink-faint); }
.shelf-list.retired li { opacity: 0.72; }
.shelf-page .foot { margin-top: 20px; }

@media (max-width: 760px) {
  .shelf-list li { grid-template-columns: 26px 64px 1fr; grid-template-rows: auto auto; row-gap: 2px; }
  .shelf-list em { grid-column: 3; }
  .shelf-list code { grid-column: 3; }
}

/* ── Reduced motion: everything arrives settled ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .card { opacity: 1; transform: none; transition: box-shadow 0.25s ease; }
  .logo-stage { animation: none; transform: rotateX(4deg) rotateY(-8deg); }
}
