/* Case pages: a folder "cover" (tab + window), the hub sections,
   and the drawer of all projects at the bottom. Every folder is the same light-blue card stock,
   shaded by its place in the drawer; every title uses the same Inter Tight lettering. */

/* ---------- folder stock and title fonts ---------- */
:root { --lip-w: 332px; /* every folder lip as wide as the widest (was Vietnam Cyber Watch) */ --fold: #E1E8F8; --fold-line: #4C5A86; --fold-dim: #E7E7EB; --fold-dim-ink: #9A9DAA; --fold-dim-line: #BDC0CA; }
[data-theme] { --t-font: var(--f-display); --t-case: none; --t-track: -0.03em; --t-weight: 800; }

/* ---------- folder cover ---------- */
.case { padding-top: 40px; }
.cover { position: relative; margin-bottom: 64px; }
.cover__tab {
  position: relative; top: var(--bw); z-index: 1;
  display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; width: var(--lip-w); max-width: 100%; height: 46px; padding: 0 18px;
  background: var(--shade); color: var(--ink);
  border: var(--bw) solid var(--ink); border-bottom: 0; border-radius: var(--r) var(--r) 0 0;
}
.cover__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--t-font); font-weight: var(--t-weight); font-size: 23px; letter-spacing: var(--t-track); text-transform: var(--t-case); }
.cover__kind { font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); }
.cover__win { border-top-left-radius: 0; background: var(--shade); box-shadow: 8px 8px 0 var(--cobalt); }
/* the title and its line sit at the top of the box; the live-site button sits at the foot of that
   column, level with the bottom of the facts box (Jo's pick, 2026-11-16), so a short line leaves no gap */
.cover__in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 440px); gap: 40px; align-items: stretch; padding: 30px 36px 36px; }
.cover__main { min-width: 0; display: flex; flex-direction: column; }
.cover__main .case__cta { margin-top: auto; }
.case__h1 { margin: 0 0 16px; font-family: var(--t-font); font-weight: var(--t-weight); font-size: clamp(48px, 6.4vw, 88px); line-height: 0.98; letter-spacing: calc(var(--t-track) * 1.4); text-transform: var(--t-case); overflow-wrap: anywhere; }
.case__line { margin: 0 0 28px; max-width: 620px; font-size: 21px; line-height: 1.4; color: var(--ink-2); }
.case__cta { display: flex; flex-wrap: wrap; gap: 14px; }

.facts dl { margin: 0; padding: 4px 20px; }
.fact { display: grid; grid-template-columns: 76px minmax(0, 1fr); column-gap: 16px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.fact:last-child { border-bottom: 0; }
.facts dt { font-family: var(--f-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.facts dd { margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink); }

/* ---------- hub sections ---------- */
.case__mock { margin: 0 0 72px; box-shadow: 8px 8px 0 var(--cobalt); }
.case__mock .mk { display: block; }
.case__cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: 48px; margin-bottom: 72px; align-items: start; }
.case__h2 { margin: 0 0 18px; font-family: var(--f-display); font-weight: 800; font-size: 40px; line-height: 1.05; letter-spacing: -0.03em; }
.case__short p { margin: 0 0 16px; font-size: 18px; color: var(--ink-2); }
.stack__in { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.stack__g { margin: 0 0 8px; font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chips li { padding: 5px 9px; border: 1px solid rgba(10, 18, 54, 0.2); border-radius: var(--r-sm); background: #fff; font: 500 13px/1.2 var(--f-mono); }

.corp { margin-bottom: 104px; box-shadow: 6px 6px 0 var(--cobalt); }
.win__bar--theme { background: var(--cobalt); color: #fff; letter-spacing: 0.08em; text-transform: uppercase; }
.corp__in { padding: 28px 28px 32px; }
.corp__h { margin: 0 0 24px; font-family: var(--f-display); font-weight: 800; font-size: 30px; letter-spacing: -0.025em; }
.corp__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.corp__pt { border-top: 3px solid var(--cobalt); padding-top: 14px; }
.corp__pt h3 { margin: 0 0 6px; font-family: var(--f-display); font-weight: 800; font-size: 20px; letter-spacing: -0.01em; }
.corp__pt p { margin: 0; color: var(--ink-2); font-size: 16px; }

.case__credit { margin: 4px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-3); } /* who built what */

/* ---------- the drawer: folders stacked tight, tabs stepping left to right ----------
   Each folder sits one tab-height lower than the one behind it, so at rest you see a staircase
   of tabs from left to right and nothing else. Hover (or focus) pushes the folders in front
   down, opening a gap where that folder's description shows. */
.cabinet { margin-bottom: 104px; scroll-margin-top: calc(var(--header-h) + 24px); }
.cabinet--home { margin: 72px 0 0; } /* homepage: under the Selected work cards, the section ends it */
.cabinet__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.drawer {
  --tab-w: var(--lip-w); --tab-h: 46px; --step: calc(var(--tab-h) - 4px); --lift: 88px; /* each folder overlaps the one behind it a little */
  --body-h: calc(var(--step) + var(--lift) + 24px); /* always runs on under the folders in front, even when a hover pushes them down */
  position: relative; padding: 8px 0 var(--lift);
  transition: padding-bottom .34s cubic-bezier(.3, .7, .2, 1);
}
.folder {
  position: relative; display: block; color: var(--ink);
  margin-top: calc(var(--step) - var(--tab-h) - var(--body-h)); /* the next folder sits one step lower */
  transform: translateY(calc(var(--a, 0px) + var(--b, 0px) + var(--c, 0px)));
  transition: transform .34s cubic-bezier(.3, .7, .2, 1);
}
.folder:first-child { margin-top: 0; }
.folder:first-child .folder__body { border-top-left-radius: 0; } /* its lip sits flush on the left edge: no notch */
/* each folder's shade: deeper blue at the back of the drawer, lighter toward the front.
   The cover on a case page uses its project's shade, so the folder you open keeps its colour. */
.folder, .cover { --shade: var(--fold); }
@supports (background: color-mix(in srgb, red 50%, blue)) {
  .folder, .cover { --shade: color-mix(in srgb, #CCD8F2, #F2F5FC calc(var(--i) * 10%)); }
}
.folder__tab {
  position: relative; top: var(--bw); z-index: 1;
  display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; width: var(--tab-w); max-width: 100%; height: var(--tab-h); padding: 0 18px;
  margin-left: calc((100% - var(--tab-w)) * var(--i) / var(--n)); /* each lip one step further right */
  background: var(--shade); color: var(--ink); /* the folder's own shade; the opened page uses the same */
  border: var(--bw) solid var(--fold-line); border-bottom: 0; border-radius: var(--r) var(--r) 0 0;
  white-space: nowrap; transition: background-color .3s ease;
}
/* the lip runs on a little over the box's top border (the folder and the cover), so no hairline
   shows between them while the folder moves or grows on sub-pixel positions */
.folder__tab::after, .cover__tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 4px; background: inherit; pointer-events: none; }
.folder__name { font-family: var(--t-font); font-weight: var(--t-weight); font-size: 23px; letter-spacing: var(--t-track); text-transform: var(--t-case); overflow: hidden; text-overflow: ellipsis; }
.folder__kind { font-family: var(--f-mono); font-size: 11px; color: var(--ink-2); flex: none; }
.folder__body {
  display: block;
  height: var(--body-h); overflow: hidden; padding: 0 20px;
  background: var(--shade); color: var(--ink-2);
  border: var(--bw) solid var(--fold-line); border-radius: var(--r);
  transition: box-shadow .3s ease;
}
/* the front folder: nothing covers it, so its text sits at the top; it must still reach as low
   as the folder behind it, or that one shows underneath like a second box */
.folder:last-child .folder__body { height: auto; min-height: calc(var(--body-h) - var(--step) + 8px); display: flex; align-items: center; }
/* what a folder says when it opens: the line and an Open button, centred in the band the folders in
   front uncover (step + lift - tab height), and hidden at rest so nothing peeks beside the next lip */
.folder__peek { display: flex; align-items: center; justify-content: space-between; gap: 32px; height: calc(var(--step) + var(--lift) - var(--tab-h)); opacity: 0; transition: opacity .25s ease; }
.folder:hover .folder__peek, .folder:focus-visible .folder__peek, .folder:last-child .folder__peek { opacity: 1; }
.folder.is-here:not(:last-child) .folder__peek { opacity: 0; }
.folder:last-child .folder__peek { flex: 1; height: auto; padding: 22px 0; }
.folder__line { max-width: 90ch; font-size: 17px; line-height: 1.45; color: var(--ink-2); }
.folder__go { flex: none; min-height: 40px; font-size: 14px; }
.folder__here { flex: none; font: 500 12px var(--f-mono); color: var(--cobalt); }
/* the Open button: liquid glass (after a React "LiquidButton"): clear, with a bevel of soft inner
   shadows and the folder behind it bent through an SVG displacement filter (#container-glass, written
   once under the drawer); browsers without url() backdrop filters get a light blur. Square corners
   kept, no pill. It swells a little when its folder opens. */
.glass-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.glass-btn { position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; height: 42px; padding: 0 22px; border-radius: var(--r); background: rgba(255, 255, 255, .18); color: var(--ink); font: 600 14px/1 var(--f-body); white-space: nowrap; transition: transform .3s ease; }
.glass-btn::before { content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 6px rgba(10, 18, 54, .03), 0 2px 6px rgba(10, 18, 54, .08),
    inset 3px 3px .5px -3px rgba(10, 18, 54, .9), inset -3px -3px .5px -3px rgba(10, 18, 54, .85),
    inset 1px 1px 1px -.5px rgba(10, 18, 54, .6), inset -1px -1px 1px -.5px rgba(10, 18, 54, .6),
    inset 0 0 6px 6px rgba(10, 18, 54, .12), inset 0 0 2px 2px rgba(10, 18, 54, .06), 0 0 12px rgba(255, 255, 255, .15); }
.glass-btn::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; overflow: hidden;
  -webkit-backdrop-filter: blur(3px) saturate(1.4); backdrop-filter: blur(3px) saturate(1.4); backdrop-filter: url(#container-glass); }
.glass-btn__in { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; pointer-events: none; }
.glass-btn svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s ease; }
.folder:hover .glass-btn, .folder:focus-visible .glass-btn { transform: scale(1.05); }
.folder:hover .glass-btn svg, .folder:focus-visible .glass-btn svg { transform: translateX(3px); }
.folder:hover .folder__body, .folder:focus-visible .folder__body { box-shadow: 0 -10px 24px -14px rgba(10, 18, 54, 0.45); }
.folder:focus-visible { outline: none; }
.folder:focus-visible .folder__tab { outline: 2px solid var(--cobalt); outline-offset: 3px; }

/* hovering a folder pushes the ones in front of it down, so its description shows in the gap */
.folder:hover ~ .folder, .folder:focus-visible ~ .folder { --b: var(--lift); }
.folder:hover, .folder:focus-visible { --c: -4px; }
.drawer.is-leaving .folder { --b: 0px; --c: 0px; }

/* the project you are on: its folder is "checked out" (you are reading it), so the drawer shows
   its empty slot: a dashed blue outline on a near-white fill, blue lettering; it does not open */
.folder.is-here { --shade: #F6F8FF; cursor: default; }
.folder.is-here .folder__tab, .folder.is-here .folder__body { border-style: dashed; border-color: var(--cobalt); color: var(--cobalt); }
.folder.is-here .folder__kind { color: var(--cobalt); opacity: 1; }
.folder.is-here:hover, .folder.is-here:focus-visible { --c: 0px; }
.folder.is-here:hover ~ .folder, .folder.is-here:focus-visible ~ .folder { --b: 0px; }

.case__end { margin-bottom: 96px; }

/* ---------- opening: the folder you picked opens downward on arrival ---------- */
html.is-opening .opening { clip-path: inset(0 0 calc(100% - var(--open-from, 120px)) 0); }
/* arriving from the drawer: the cover is already there (the folder grew into it); only what lies below unrolls */
html.is-opening.is-opening-full .opening { clip-path: none; }
html.is-opening.is-opening-full .case__body { clip-path: inset(0 0 100% 0); }
html.is-opening .opening .case__body { transform: translateY(-18px); } /* the cover itself is filled in by the agent cursors */
.opening .case__body { transition: transform .9s cubic-bezier(.22, 1, .36, 1); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .cover__in { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .case__cols { grid-template-columns: minmax(0, 1fr); }
  .corp__grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 760px) {
  .case { padding-top: 24px; }
  .cover__in { padding: 26px 20px 28px; gap: 28px; }
  .case__line { font-size: 18px; }
  .case__h2 { font-size: 32px; }
  .corp__in { padding: 22px 20px 24px; }
  :root { --lip-w: 260px; }
  .drawer { --tab-h: 44px; --step: calc(var(--tab-h) - 4px); --body-h: 150px; --lift: 0px; padding-top: 8px; }
  .folder__tab { margin-left: calc(var(--i) * 2.2%); max-width: calc(100% - 22%); }
  .folder__name { font-size: 19px; }
  .folder__kind { display: none; }
  .folder__peek { flex-direction: column; align-items: flex-start; gap: 14px; }
  .cover__tab { max-width: 100%; }
  .cover__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 19px; }
  .cover__kind { display: none; }
}

/* a stack group still in progress: one dashed, hatched line instead of chips (Sesame's hardware key) */
.stack__wip .wip { display: inline-block; margin-left: 6px; padding: 1px 6px; border: 1px dashed var(--cobalt); border-radius: var(--r-sm); color: var(--cobalt); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; vertical-align: 1px; }
.wip__line { margin: 0; padding: 10px 12px; border: 1px dashed rgba(10, 18, 54, 0.38); border-radius: var(--r-sm); background: repeating-linear-gradient(135deg, rgba(31, 79, 255, 0.07) 0 7px, transparent 7px 14px), #fff; color: var(--ink-2); font: 500 13px/1.45 var(--f-mono); }
