/* billjalouk.com Skills page. Plain CSS, no build step. Tokens and background are the homepage's (home.css).
   Decided by Bill on 2026-11-10: calm over dense. One pile of twelve slices, pinned, one slice per skill
   group, the names beside it. The slice of the group being read glows, the ones already read stay as
   outlines. A pyramid stands on the top slice (Management). The symbols of the group being read stand on
   its slice. Only transform and opacity move. Without JavaScript the page shows everything, finished. */

@font-face { font-family: "Fraunces"; src: url(/assets/fonts/fraunces-latin.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

/* ---------- tokens (home.css) ---------- */
:root {
  --bg: #0b0a12;
  --bg-2: #15132a;
  --ink: #f1eef9;
  --muted: rgba(241, 238, 249, 0.56);
  --faint: rgba(241, 238, 249, 0.5);   /* text: 4.8:1 on --bg, the minimum is 4.5:1 */
  --line: rgba(241, 238, 249, 0.1);
  --accent: #ff5c8a;
  --font: "Fraunces";
  --w-thin: 300;
  --w-black: 900;
  --track-tight: -0.02em;
  --pad: clamp(18px, 4vw, 56px);
  --radius: 5px;             /* the open language card (lang.css) */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --pin: 42svh;              /* phone: height of the pinned pile */
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100svh; color: var(--ink); background: var(--bg);
  font-family: var(--font), serif; font-weight: var(--w-thin); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  /* a phone held sideways: the content stays clear of the notch (viewport-fit=cover lets the page reach under it) */
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
main[tabindex="-1"]:focus { outline: none; }   /* the page itself takes the focus after skip: no ring around everything */

.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg::before {
  content: ""; position: absolute; inset: -10%;
  background:
    radial-gradient(55% 45% at 22% 28%, color-mix(in oklab, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(45% 55% at 84% 78%, color-mix(in oklab, var(--accent) 9%, transparent), transparent 70%),
    radial-gradient(120% 90% at 50% 110%, rgba(0, 0, 0, 0.55), transparent 60%),
    linear-gradient(170deg, var(--bg-2), var(--bg) 70%);
}
.bg::after {
  content: ""; position: absolute; inset: 0; opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}

/* home link, top left (cv.css) */
.home {
  position: fixed; top: 8px; left: calc(var(--pad) - 10px + env(safe-area-inset-left, 0px)); z-index: 30;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px;
  font-weight: var(--w-black); font-size: 15px; letter-spacing: var(--track-tight);
  color: var(--muted); transition: color 0.2s;
}
.home:hover, .home:focus-visible { color: var(--ink); }

/* ---------- the text ---------- */
.head { padding: 0; }
.title {
  margin: 0; font-weight: var(--w-black); font-size: clamp(42px, 6vw, 92px); line-height: 0.95;
  letter-spacing: var(--track-tight); text-wrap: balance; max-width: 12ch;
}
.intro { margin: 18px 0 0; max-width: 52ch; color: var(--muted); font-size: clamp(16px, 1.25vw, 19px); line-height: 1.55; }

.blocks { display: grid; gap: clamp(56px, 12vh, 140px); }
.block { max-width: 620px; }
.group-name { margin: 0; font-weight: var(--w-black); font-size: clamp(26px, 2.6vw, 40px); line-height: 1.05; letter-spacing: var(--track-tight); }
.tools { margin: 16px 0 0; padding: 0; list-style: none; columns: 150px 2; column-gap: 28px; max-width: 500px; }
.tool { padding: 4px 0; font-size: 15px; line-height: 1.4; break-inside: avoid; color: color-mix(in oklab, var(--ink) 84%, transparent); }
.note { display: block; font-size: 13px; line-height: 1.35; color: var(--muted); }
.proof {
  margin: 20px 0 0; padding-left: 14px; border-left: 2px solid var(--accent); max-width: 60ch;
  font-size: 16px; line-height: 1.55; color: color-mix(in oklab, var(--ink) 88%, transparent);
}
.where { color: var(--muted); font-size: 14px; }
.back { display: inline-flex; align-items: center; min-height: 44px; margin: 48px 0; color: var(--accent); border-bottom: 1px solid currentColor; }
.back:hover { color: var(--ink); }

/* the group being read at full strength, the others step back (skills.js sets .tracking and .now). They step back
   to 88 percent (Bill, 2026-11-20, look B of four): at 60 the grey notes fell to 2.75:1, now the weakest is 4.7:1. */
.tracking .block { opacity: 0.88; transition: opacity 0.5s var(--ease-out); }
.tracking .block.now { opacity: 1; }

/* ---------- the pile ---------- */
.skills { position: relative; }
.stack-pin {
  position: sticky; top: 0; z-index: 10; height: max(var(--pin), 300px);
  display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  padding: 48px var(--pad) 6px; background: var(--bg);
}
.stack-pin::after { content: ""; position: absolute; left: 0; right: 0; bottom: -28px; height: 28px; pointer-events: none; background: linear-gradient(180deg, var(--bg), transparent); }
.stage-box { container-type: size; width: 100%; height: 100%; max-width: 640px; justify-self: center; display: grid; place-items: center; }

/* geometry: --s is the side of a slice, --step the distance between two slices. Drawn, a slice is 1.4 s wide
   and 0.66 s high, and every slice sits 0.883 step above the one below. No perspective, so the names beside
   the pile are placed with plain arithmetic. Twelve slices: eleven steps, plus the pyramid (0.24 s). */
.stage {
  --step: 6.4cqh; --s: min(32cqw, 30cqh); --fall: 260px; --name-size: 12.5px; --names-w: 150px;
  --mark: calc(var(--s) * 0.19); --mark-gap: calc(var(--s) * 0.04);
  position: relative; width: min(100%, calc(var(--s) * 1.4 + 8px + var(--names-w)));
  height: calc(var(--step) * 9.713 + var(--s) * 0.94 + 16px);
}
.pile {
  position: absolute; left: calc(var(--s) * 0.2 + 4px); bottom: calc(var(--s) * -0.1725 + 6px); width: var(--s); height: var(--s);
  transform-style: preserve-3d; transform: rotateX(62deg) rotateZ(-36deg);
}
/* the first slice in the HTML is the top one */
.layer:nth-child(1), .name:nth-child(1) { --i: 11; }
.layer:nth-child(2), .name:nth-child(2) { --i: 10; }
.layer:nth-child(3), .name:nth-child(3) { --i: 9; }
.layer:nth-child(4), .name:nth-child(4) { --i: 8; }
.layer:nth-child(5), .name:nth-child(5) { --i: 7; }
.layer:nth-child(6), .name:nth-child(6) { --i: 6; }
.layer:nth-child(7), .name:nth-child(7) { --i: 5; }
.layer:nth-child(8), .name:nth-child(8) { --i: 4; }
.layer:nth-child(9), .name:nth-child(9) { --i: 3; }
.layer:nth-child(10), .name:nth-child(10) { --i: 2; }
.layer:nth-child(11), .name:nth-child(11) { --i: 1; }
.layer:nth-child(12), .name:nth-child(12) { --i: 0; }

.layer { position: absolute; inset: 0; transform-style: preserve-3d; transform: translateZ(calc(var(--i) * var(--step))); }
.layer::before {                 /* the body of the slice: a solid sheet just beneath the face */
  content: ""; position: absolute; inset: -1px; border-radius: 3px; transform: translateZ(calc(var(--step) * -0.28));
  background: color-mix(in oklab, var(--bg) 91%, var(--accent) 9%); border: 1px solid rgba(241, 238, 249, 0.14);
  transition: opacity 0.6s var(--ease-out);
}
.edge {                          /* the face of the slice */
  position: absolute; inset: 0; border: 1px solid rgba(241, 238, 249, 0.32); border-radius: 3px;
  background: linear-gradient(135deg, rgba(241, 238, 249, 0.08), rgba(241, 238, 249, 0.02));
  transition: opacity 0.6s var(--ease-out);
}
.layer::after {                  /* the glow of the slice being read */
  content: ""; position: absolute; inset: -1px; border-radius: 3px; opacity: 0; transform: translateZ(0.5px); transition: opacity 0.5s var(--ease-out);
  background: color-mix(in oklab, var(--accent) 24%, transparent);
  box-shadow: 0 0 calc(var(--s) * 0.14) color-mix(in oklab, var(--accent) 45%, transparent), inset 0 0 0 1px var(--accent);
}
.layer.lit::after { opacity: 1; }
.layer.read::before { opacity: 0; }          /* already read: the slice stays where it is, as an outline */
.layer.read .edge { opacity: 0.4; }

/* the pyramid on the top slice: four equal triangles, each hinged on one edge and tipped in by 51.12 degrees
   (0.62 s high). Lit from the right: side 1 is the front right face, side 2 the front left, 3 and 4 the back. */
.peak, .peak-side { position: absolute; inset: 0; transform-style: preserve-3d; pointer-events: none; }
.peak-side:nth-child(2) { transform: rotateZ(90deg); }
.peak-side:nth-child(3) { transform: rotateZ(180deg); }
.peak-side:nth-child(4) { transform: rotateZ(270deg); }
.peak-face {
  position: absolute; left: 0; bottom: 0; width: 100%; height: calc(var(--s) * 0.7965); overflow: visible;
  transform-origin: 50% 100%; transform: rotateX(calc(var(--fold, 1) * -51.12deg));
}
.peak-face path { vector-effect: non-scaling-stroke; stroke-width: 1; stroke-linejoin: round; transition: opacity 0.5s var(--ease-out); }
.pf-base { fill: rgba(241, 238, 249, 0.05); stroke: rgba(241, 238, 249, 0.36); }
.pf-lit { fill: color-mix(in oklab, var(--accent) 16%, transparent); stroke: var(--accent); opacity: 0; }
.peak-side:nth-child(1) .pf-base { fill: rgba(241, 238, 249, 0.07); }
.peak-side:nth-child(1) .pf-lit { fill: color-mix(in oklab, var(--accent) 30%, transparent); }
.peak-side:nth-child(n+3) .pf-base { fill: none; stroke: rgba(241, 238, 249, 0.2); }
.peak-side:nth-child(n+3) .pf-lit { fill: color-mix(in oklab, var(--accent) 6%, transparent); }
.layer.lit .pf-lit { opacity: 1; }
.layer.read .pf-base { opacity: 0.42; }

/* the symbols of the group being read. One colour, never more than five. The row is turned back by 36 degrees
   inside the slice, so it runs level across its widest part. Each symbol is tipped back by the 62 degrees of
   the pile, so it stands on the slice and faces the reader. */
.marks { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; transform: rotateZ(36deg) translateZ(2px); pointer-events: none; }
.marks-row { position: absolute; left: 0; top: 0; display: flex; gap: var(--mark-gap); transform: translate(-50%, -100%); transform-style: preserve-3d; }
.mark {
  flex: none; display: block; width: var(--mark); height: var(--mark); fill: var(--ink);
  transform-origin: 50% 100%; transform: rotateX(-62deg); opacity: 0; transition: opacity 0.5s var(--ease-out);
}
.layer.lit .mark { opacity: 1; }

/* the twelve names, flat, each at the right corner of its slice */
.names { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; }
.name {
  position: absolute; left: calc(var(--s) * 1.4 + 6px); bottom: calc(6px + var(--s) * 0.2755 + var(--i) * var(--step) * 0.883);
  display: flex; align-items: center; gap: 8px; height: 0; white-space: nowrap;
  font-size: var(--name-size); line-height: 1; color: var(--ink); opacity: 0.5; transition: opacity 0.5s var(--ease-out);
}
.name::before { content: ""; flex: none; width: 14px; height: 1px; background: currentColor; opacity: 0.6; transition: opacity 0.5s var(--ease-out); }
.name.lit { opacity: 1; }
.name.lit::before { height: 2px; background: var(--accent); opacity: 1; }
.name.read { opacity: 0.3; }
.n-short { display: none; }
@container (max-width: 470px) { .n-long { display: none; } .n-short { display: inline; } }

/* ---------- layout ---------- */
@media (max-width: 1023px) {     /* phones and tablets: title, then the pile pins, the groups run under it */
  .skills { display: flex; flex-direction: column; }
  .stack-col, .text-col { display: contents; }
  .head { order: 1; position: relative; z-index: 11; padding: 72px var(--pad) 12px; }
  .stack-pin { order: 2; margin-top: -30px; }
  .blocks { order: 3; padding: 28px var(--pad) 0; }
  .back { order: 4; align-self: flex-start; margin: 48px var(--pad); }
  .block { scroll-margin-top: calc(max(var(--pin), 300px) + 16px); }
}
/* a short screen, a phone held sideways or a page zoomed in: the pile stays at the top and scrolls away
   with the page, so the text keeps the screen (WCAG 1.4.10) */
@media (max-width: 1023px) and (max-height: 500px) {
  .stack-pin { position: relative; }
  .block { scroll-margin-top: 16px; }
  .home { position: absolute; }   /* with no pile behind it, the name scrolls away like the switch, not over the text */
}
@media (min-width: 1024px) {
  .skills { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); align-items: stretch; }
  .stack-pin { height: 100svh; padding: clamp(32px, 7vh, 80px) clamp(16px, 2vw, 40px) clamp(32px, 7vh, 80px) var(--pad); background: transparent; }
  .stack-pin::after { display: none; }
  .text-col { padding: 16svh clamp(32px, 6vw, 120px) 12vh 0; max-width: 720px; }
  .blocks { margin-top: clamp(40px, 8vh, 80px); }
  .block { scroll-margin-top: 14svh; }
  .stage {
    --step: clamp(22px, 4.6cqh, 38px); --s: min(36cqw, 34cqh); --name-size: 15px; --names-w: 240px;
    --mark: calc(var(--s) * 0.15); --mark-gap: calc(var(--s) * 0.055);
  }
}
@media (min-width: 1600px) { .skills { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .text-col { padding-left: clamp(0px, 2vw, 40px); } }

/* ---------- arrival: the agents drop the slices in, bottom first, each name appears as its slice lands,
   the pyramid folds up last (skills.js drives --drop and --fold). Only where scripts run and motion is wanted. */
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  html:not(.arrived) .layer { transform: translateZ(calc(var(--i) * var(--step) + (1 - var(--drop, 0)) * var(--fall))); opacity: var(--drop, 0); }
  html:not(.arrived) .name { opacity: calc(var(--drop, 0) * 0.5); transition: none; }
}

/* agents (home.css) */
.agents { position: fixed; inset: 0; z-index: 20; pointer-events: none; overflow: hidden; }
.agent { position: absolute; left: 0; top: 0; will-change: transform; }
.agent::before {
  content: ""; position: absolute; left: -16px; top: -16px; width: 58px; height: 58px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in oklab, var(--accent) 42%, transparent), color-mix(in oklab, var(--accent) 10%, transparent) 45%, transparent 70%);
}
.agent svg {
  position: relative; display: block; width: 26px; height: 26px; overflow: visible;
  filter: drop-shadow(0 0 5px color-mix(in oklab, var(--accent) 85%, transparent)) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
}
.agent-cursor { fill: var(--ink); stroke: var(--accent); stroke-width: 1.4; stroke-linejoin: round; }
.agent-label {
  position: absolute; left: 22px; top: 22px; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; line-height: 1.4; white-space: nowrap; font-weight: 600;
  color: var(--bg); background: var(--accent);
  box-shadow: 0 0 14px color-mix(in oklab, var(--accent) 55%, transparent), 0 2px 8px rgba(0, 0, 0, 0.5);
}
.agent-2 .agent-label { background: var(--ink); box-shadow: 0 0 14px rgba(241, 238, 249, 0.35), 0 2px 8px rgba(0, 0, 0, 0.5); }
.skip {
  position: fixed; right: calc(6px + env(safe-area-inset-right, 0px)); bottom: calc(6px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  min-width: 44px; min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 12px; letter-spacing: 0.08em; opacity: 0.18; cursor: pointer; transition: opacity 0.2s;
}
.skip:hover, .skip:focus-visible { opacity: 0.8; }
html.arrived .skip { display: none; }
@media (scripting: none) { .skip { display: none; } }

@media (prefers-reduced-motion: reduce) {    /* nothing moves and nothing fades */
  html { scroll-behavior: auto; }
  .skip { display: none; }
  .layer::before, .layer::after, .edge, .peak-face path, .mark, .name, .name::before, .tracking .block { transition: none !important; }
}
