/* design.design — CVI tokens (Light mode) */
:root {
  --canvas:   #ECECEC;  /* primary background */
  --graphite: #F7F7F7;  /* raised surfaces, folders, the paper behind the window */
  --ash:      #D4D4D4;  /* lines, folder edges */
  --smoke:    #8C8C8C;  /* secondary text, labels */
  --fog:      #3A3A3A;  /* body text */
  --paper:    #111111;  /* primary text and logo */

  --display: "Figtree", system-ui, sans-serif;
  --data: "Inter", system-ui, sans-serif;

  /* Set by script.js on resize */
  --win-w: 600px;
  --win-h: 480px;
  --win-x: 0px;
  --win-y: 0px;
  --logo-size: 160px;
  --blur: 18px;
  --folder-fs: 1px;   /* 1 folder unit; a folder is 360 x 270 units */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* The page itself never scrolls: script.js turns each scroll gesture into one step
   along the track (logo → folders → ending), so every move lands on a stop. */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }

body {
  background: var(--canvas);
  color: var(--paper);
  font-family: var(--display);
  -webkit-font-smoothing: antialiased;
}

/* ---------- stage ---------- */

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  overflow: clip;                /* clip, not hidden: focus can never scroll it */
  z-index: 1;
}


/* The moving content. Positions are in viewport coordinates at scroll 0;
   both copies (surface and window) share them and move together. */
.track {
  position: absolute;
  inset: 0;
  will-change: transform;
}

/* Outside the window: out of focus */
.surface {
  position: absolute;
  inset: 0;
  filter: blur(var(--blur));   /* matches the master logo; no extra fading */
  pointer-events: none;
}

/* ---------- the window ---------- */

.window {
  position: absolute;
  left: var(--win-x);
  top: var(--win-y);
  width: var(--win-w);
  height: var(--win-h);
  overflow: hidden;
  overflow: clip;                /* clip, not hidden: focusing something inside must not scroll the window */
  background: #F9F9F9;           /* a separate sheet behind the cut */
  z-index: 1;
}

/* Shadow from the cut edge, falling over the paper and its print */
.window::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  /* A crisp cut: a sharp dark line on the top/left edge with a short, tight shadow
     beneath it, and a sharp light line on the bottom/right edge. */
  box-shadow:
    inset 1px 1px 0 rgba(0, 0, 0, 0.22),
    inset 3px 4px 4px -1px rgba(0, 0, 0, 0.14),
    inset -1px -1px 0 rgba(255, 255, 255, 0.95);
}

/* Everything that sits under the window is cut out of the blurred surface before it
   is blurred, so nothing hidden behind the window can haze out past its edge. */
.surface-clip { position: absolute; inset: 0; }

/* The view inside the window is the full viewport, shifted so it lines up
   exactly with the surface behind it. */
.window-view {
  position: absolute;
  left: calc(var(--win-x) * -1);
  top: calc(var(--win-y) * -1);
  width: 100vw;
  height: 100vh;
}

/* ---------- logo ---------- */

.logo {
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--logo-size);
  letter-spacing: -0.04em;
  line-height: 1;
  white-space: nowrap;
  transform: translateY(-50%);
}
/* A little air between "design." and "design", so the window's edge cuts less of the blurred word */
.logo .w2 { margin-left: 0.1em; }

/* ---------- folder (CVI 07 — 01 Frosted) ---------- */

.folder {
  position: absolute;
  top: 0;
  left: 0;
  width: 360em;
  height: 270em;
  font-size: var(--folder-fs);
  transform: translate(-50%, -50%);
  cursor: pointer;
  outline: none;
}

.folder .back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.folder .back path {
  fill: var(--graphite);
  stroke: var(--ash);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.folder .sheet,
.folder .work {
  position: absolute;
  left: 20em;
  width: 320em;
  height: 210em;
  top: 36em;
  border-radius: 2em;
  transition: transform 0.6s cubic-bezier(.2, .7, .2, 1);
}
.folder .sheet { box-shadow: 0 2em 6em rgba(0, 0, 0, 0.10); }
.folder .sheet.s2 { top: 30em; }
.folder .sheet.s3 { top: 24em; }

.folder .work {
  overflow: hidden;
  box-shadow: 0 4em 10em rgba(0, 0, 0, 0.16), 0 1em 2em rgba(0, 0, 0, 0.08);
}

/* Frosted front */
.folder .front {
  position: absolute;
  left: 0;
  right: 0;
  top: 80em;
  bottom: 0;
  background: rgba(247, 247, 247, 0.22);
  -webkit-backdrop-filter: blur(22em);
  backdrop-filter: blur(22em);
  border: 1px solid var(--ash);
  transition: transform 0.6s cubic-bezier(.2, .7, .2, 1),
              backdrop-filter 0.6s ease, -webkit-backdrop-filter 0.6s ease,
              background-color 0.6s ease;
}

/* Label positions use folder units (var(--folder-fs)), not the label's own font size */
.folder .label {
  position: absolute;
  bottom: calc(18 * var(--folder-fs));
  font: 400 max(9px, calc(11 * var(--folder-fs)))/1 var(--data);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
}
.folder .label.no { left: calc(16 * var(--folder-fs)); }
.folder .label.client { right: calc(16 * var(--folder-fs)); opacity: 0.55; }

/* Hover / focus: the front drops, the glass clears, the work rises into focus */
.window .folder:hover .front,
.window .folder:focus-visible .front {
  transform: translateY(46em);
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  background-color: rgba(247, 247, 247, 0.06);
}
.window .folder:hover .work,
.window .folder:focus-visible .work { transform: translateY(-14em); }
.window .folder:hover .s2,
.window .folder:focus-visible .s2 { transform: translateY(-9em); }
.window .folder:hover .s3,
.window .folder:focus-visible .s3 { transform: translateY(-5em); }

/* Closing the open folder: the sheets slide back in behind a copy of the frosted front that lies on
   top of them (see closeFolder in script.js); meanwhile the real front lends it its tint and labels */
.frost-ghost {
  position: fixed;
  transform: none;
  font-size: var(--folder-fs);
  z-index: 0;                     /* under the sheet at first; script.js lifts it on top once the sheet is clear */
  pointer-events: none;
}
.folder.is-taking .front { background-color: transparent; border-color: transparent; transition: none; }
.folder.is-taking .label { visibility: hidden; }

/* Client work: Blomst */
/* The work is the folder's first sheet (01 Logo), full width and from the top — exactly as the closing
   pile lands on it — on the sheet's own linen, so the folder runs on past the picture without a seam */
.work.blomst { background: #EFE6D6; }  /* Blomst · Hør / Linen */
.work.blomst img { width: 100%; height: auto; display: block; }
.sheet.blomst-heather { background-color: #C7A1A6; }  /* Blomst · Lyng / Heather */
.sheet.blomst-rosehip { background-color: #8A3A2C; }  /* Blomst · Hyben / Rosehip */
.sheet.has-img { background-size: 140em auto; background-position: 0 0; background-repeat: repeat; }

.folder:not(.can-open) { cursor: default; }

/* ---------- ending: studio + contact (sizes scale with the window via --u) ---------- */

.ending {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(480 * var(--u, 1px));
  transform: translate(-50%, -50%);
}
.ending .mark {
  display: flex;
  align-items: center;
  gap: calc(12 * var(--u, 1px));
  font: 400 max(10px, calc(12 * var(--u, 1px)))/1 var(--data);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ending .mark i {
  display: block;
  width: calc(9 * var(--u, 1px));
  height: calc(13 * var(--u, 1px));
  background: var(--paper);
}
.ending h2 {
  margin-top: calc(22 * var(--u, 1px));
  font: 700 calc(48 * var(--u, 1px))/1.02 var(--display);
  letter-spacing: -0.04em;
}
.ending dl {
  margin-top: calc(28 * var(--u, 1px));
  padding-top: calc(16 * var(--u, 1px));
  border-top: 1px solid var(--ash);
  display: grid;
  grid-template-columns: max(84px, calc(110 * var(--u, 1px))) 1fr;
  row-gap: calc(8 * var(--u, 1px));
  font: 400 max(10px, calc(12 * var(--u, 1px)))/1.3 var(--data);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ending dt { color: var(--smoke); }
.ending dd { color: var(--fog); }
.ending a {
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid transparent;   /* no line at rest */
  transition: border-color 0.2s ease;
}
.ending a:hover, .ending a:focus-visible { border-bottom-color: currentColor; outline: none; }

/* ---------- contact button (bottom right, mirrors the caption's corner; on phones top right at a case) ---------- */

.to-contact {
  position: fixed;
  right: clamp(20px, 5vw, 80px);
  bottom: clamp(24px, 7vh, 80px);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 10px 10px;     /* a larger hit area without moving the type */
  margin: -10px 0;
  background: none;
  border: 0;
  color: var(--paper);
  font: 400 11px/1 var(--data);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.to-contact i {
  display: block;
  width: 9px;
  height: 13px;
  background: var(--paper);
}
/* Soft at rest; comes into full focus on hover and keyboard focus (no line) */
.to-contact { opacity: 0.55; }
.to-contact:hover,
.to-contact:focus-visible { opacity: 1; outline: none; }
.to-contact.is-hidden {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}
/* Changing places (see script.js): fades out, moves, fades back in */
.to-contact.is-moving { opacity: 0; pointer-events: none; }
/* Phones, while a case is in the window: the top right corner, so it doesn't crowd the project caption
   below. Same margins as the open folder's header, so it sits where "Close" appears when you open it */
@media (max-width: 719px) {
  .to-contact.is-case {
    top: clamp(18px, 4vh, 40px);
    bottom: auto;
  }
}

/* ---------- "Swipe for cases" hint: first stop only, centred under the window (bottom left on phones), level with Contact ---------- */

.to-cases {
  position: fixed;
  left: 50%;
  bottom: clamp(24px, 7vh, 80px);
  z-index: 4;
  padding: 10px;                  /* a larger hit area without moving the type */
  margin: -10px 0;
  background: none;
  border: 0;
  color: var(--smoke);
  font: 400 11px/13px var(--data);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transform: translate(-50%, 0);
  transition: opacity 0.35s ease, transform 0.35s ease, color 0.2s ease;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.to-cases:hover, .to-cases:focus-visible { color: var(--paper); outline: none; }
.to-cases:not(.is-visible) {
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
}
/* Phones: in the bottom-left corner (the caption's margin), Contact in the right one */
@media (max-width: 719px) {
  .to-cases { left: clamp(20px, 5vw, 80px); margin-left: -10px; transform: none; }
  .to-cases:not(.is-visible) { transform: translateY(8px); }
}

/* ---------- caption (CVI 06 — Project caption) ---------- */

.caption {
  position: absolute;
  left: clamp(20px, 5vw, 80px);
  bottom: clamp(24px, 7vh, 80px);
  z-index: 3;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
  max-width: calc(100vw - 40px);
}
.caption.is-visible { opacity: 1; transform: none; }

.caption .mark {
  display: flex;
  align-items: center;
  gap: 12px;
  font: 400 11px/1 var(--data);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.caption .mark i {
  display: block;
  width: 9px;
  height: 13px;
  background: var(--paper);
}
.caption .dates {
  margin-top: 14px;
  font: 400 11px/1 var(--data);
  letter-spacing: 0.08em;
  color: var(--smoke);
  text-transform: uppercase;
}
.caption h2 {
  margin-top: 14px;
  font: 600 30px/1.1 var(--display);
  letter-spacing: -0.02em;
}
.caption dl {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 100px auto;
  row-gap: 6px;
  font: 400 11px/1.3 var(--data);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
/* Links in a caption (e.g. a project's live site): clickable only while the caption is shown */
.caption a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;   /* line on hover only, like the email */
  transition: border-color 0.2s ease;
  pointer-events: auto;
}
.caption:not(.is-visible) a { pointer-events: none; visibility: hidden; }
.caption a:hover, .caption a:focus-visible { border-bottom-color: currentColor; outline: none; }
.caption dt { color: var(--smoke); }
.caption dd { color: var(--fog); }


/* ---------- open folder (viewer) ---------- */

html.is-open { overflow: hidden; }

.viewer {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: minmax(0, 1fr);   /* the strip is the screen's width, never the rail's */
  background: rgba(236, 236, 236, 0);
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  transition: background-color 0.45s ease, backdrop-filter 0.45s ease, -webkit-backdrop-filter 0.45s ease;
}
.viewer[hidden] { display: none; }
/* The page behind goes out of focus — the folder's contents are now what you see */
.viewer.is-in {
  background: rgba(236, 236, 236, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
/* Closing: the sheets fly back into the folder while the page behind comes back into focus */
.viewer.is-closing {
  pointer-events: none;
  background: rgba(236, 236, 236, 0);
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  transition-duration: 0.4s;
}
.viewer.is-in.is-closing .viewer-head,
.viewer.is-in.is-closing .viewer-foot { opacity: 0; transition-duration: 0.2s; }

.viewer-head,
.viewer-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(18px, 4vh, 40px) clamp(20px, 5vw, 80px);
  font: 400 11px/1 var(--data);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.4s ease 0.1s;
}
.viewer.is-in .viewer-head,
.viewer.is-in .viewer-foot { opacity: 1; }

.viewer .mark { display: flex; align-items: center; gap: 12px; }
.viewer .mark i { display: block; width: 9px; height: 13px; background: var(--paper); }

.viewer-close {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--paper);
  background: none;
  border: 0;
  border-bottom: 1px solid currentColor;
  padding: 4px 0;
  cursor: pointer;
}
.viewer-close:hover, .viewer-close:focus-visible { border-bottom-color: transparent; outline: none; }
.viewer-foot { color: var(--smoke); }
.viewer-hint { transition: opacity 0.3s ease; }
.viewer-hint.is-done { opacity: 0; }   /* the last sheet: nothing more to swipe to */

.viewer-strip {
  position: relative;
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  overflow: hidden;
  overflow: clip;                 /* the rail is moved by script, never scrolled */
  touch-action: none;             /* swipes are ours: one swipe, one sheet */
  outline: none;
}
.viewer-rail {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: clamp(28px, 4vw, 64px);
  will-change: transform;
}

.v-card {
  position: relative;             /* sheet positions are measured from their card */
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* sheets slide in from the right, one after another */
  opacity: 0;
  transform: translateX(14vw);
  transition: opacity 0.5s ease, transform 0.7s cubic-bezier(.2, .7, .2, 1);
  transition-delay: calc(var(--i) * 0.06s + 0.08s);
}
.viewer.is-in .v-card { opacity: 1; transform: none; }

/* The sheet in the centre is in focus; the ones beside it rest softly out of focus */
.v-card > * { transition: opacity 0.5s ease, filter 0.5s ease; }
.v-card:not(.is-current) > * { opacity: 0.45; filter: blur(2px); }
/* The card names beside it only fade: blurring small text makes some browsers (Safari) draw a stray
   coloured line along the edge of the blur, right around the name */
.v-card figcaption { transition: opacity 0.5s ease; }
.v-card:not(.is-current) > figcaption { opacity: 0.35; filter: none; }
.v-card:not(.is-current) .v-sheet { cursor: pointer; }

/* Each element is a sheet of paper with the same shadow as the item in the folder */
.v-sheet {
  /* Both sides set outright (not left to aspect-ratio): Safari otherwise lets a picture's own pixel
     size stretch the sheet, so a 1200px image made a sheet 1200px wide and cropped it to a sliver */
  height: min(58vh, calc(84vw / var(--ar)));
  width: min(calc(58vh * var(--ar)), 84vw);
  min-width: 0;
  min-height: 0;
  background: #fff;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14), 0 1px 3px rgba(0, 0, 0, 0.08);
}
.v-sheet img { display: block; width: 100%; height: 100%; min-width: 0; object-fit: cover; }

/* 05 Embroidery: the Blomst flower stitched into heavy wool (see embroidery.js).
   Sized in container units so the tilted cloth fits the sheet at any size. */
.v-sheet.v-emb {
  position: relative;
  container-type: size;
  background: #3E2619;
  isolation: isolate;
}
.emb-view { position: absolute; inset: 0; overflow: hidden; perspective-origin: 50% 35%; }
.emb-plane {
  position: absolute; left: -110%; right: -110%; top: -130%; bottom: -130%;
  transform: rotateX(58deg) rotateZ(-17deg);
}
.emb-wool, .emb-light, .emb-rake { position: absolute; inset: 0; pointer-events: none; }
.emb-wool { background-color: #3E2619; }
.emb-light { background: linear-gradient(to bottom, rgba(12,6,3,.6), rgba(12,6,3,.15) 40%, rgba(255,236,214,.05) 62%, rgba(12,6,3,.25)); }
.emb-rake { background: linear-gradient(118deg, rgba(255,236,214,.14) 0%, rgba(255,236,214,0) 38%, rgba(6,3,1,.28) 70%, rgba(6,3,1,.5) 100%); }
.emb-w {
  position: absolute; left: 50%; top: 50%;
  height: min(96cqh, 128cqw); aspect-ratio: 178 / 240;
  transform: translate(-50%, -50%) rotateX(58deg) rotateZ(-17deg) translateY(-14.4cqh);
}
.emb-svg, .emb-c { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.emb-fog { position: absolute; inset: 0 0 auto; height: 30%; pointer-events: none; background: linear-gradient(#3E2619, rgba(62,38,25,0)); }
.emb-shade { position: absolute; inset: 0; pointer-events: none; background:
  radial-gradient(120% 90% at 50% 45%, transparent 45%, rgba(16,8,4,.55) 100%),
  linear-gradient(160deg, rgba(255,236,214,.07), transparent 45%); }
.emb-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; }

/* 07 Seed to flower: the opening scene of the Blomst website (see growth.js).
   Oat paper, the name on the left, the little diorama on the right. 1cqw = 1/100 of the sheet. */
.v-sheet.v-grow {
  position: relative;
  container-type: size;
  background: #E7DCCA;
  color: #3B2418;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4cqw;
  padding: 0 8cqw;
}
.gr-text h3 {
  margin: 0;
  font-family: "Young Serif", Georgia, serif;
  font-weight: 400;
  font-size: 4.4cqw;
  line-height: 1.12;
  letter-spacing: -0.02em;
  max-width: 11ch;
  text-wrap: balance;
}
.gr-text p {
  margin: 2.2cqw 0 0;
  font-family: "Instrument Sans", sans-serif;
  font-size: max(7px, 1.55cqw);
  line-height: 1.6;
  max-width: 34ch;
  opacity: 0.72;
}
.gr-text p.gr-kids { margin-top: 1.2cqw; }
.gr-plant { display: flex; flex-direction: column; align-items: center; gap: 2.6cqh; }
.gr-cam { perspective-origin: 50% 30%; }
.gr-dio {
  --h: 66cqh; --u: calc(var(--h) / 320);
  position: relative; width: calc(var(--u) * 200); height: var(--h);
  transform-style: preserve-3d; transform: rotateX(-16deg);
}
.gr-face { position: absolute; left: 0; top: calc(var(--u) * 260); }
.gr-ground {
  left: -40%; width: 180%; height: calc(var(--u) * 200);
  transform-origin: 50% 0; transform: rotateX(-90deg);
  background: radial-gradient(34% 34% at 50% 12%, rgba(44,26,16,.16), rgba(44,26,16,0) 70%);
  opacity: 0;
}
.gr-shadow {
  position: absolute; left: 22.22%; width: 55.56%;
  height: calc(var(--u) * 260); top: calc(var(--u) * -260);
  transform-origin: 50% 100%; transform: scaleY(-.5) skewX(16deg);
  opacity: .26; filter: brightness(0) blur(1.2px); overflow: visible;
}
.gr-shadowc { position: absolute; left: 10.25%; top: 23.08%; width: 69%; height: 76.92%; }
.gr-base {
  position: absolute; left: 50%; top: 0; width: calc(var(--u) * 46); height: calc(var(--u) * 22);
  transform: translate(-50%, -30%); border-radius: 50%;
  background: radial-gradient(rgba(44,26,16,.35), rgba(44,26,16,0) 70%);
}
.gr-svg { color: #8A3A2C; position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transform: translateZ(1px); }
.gr-growc { position: absolute; left: 10.25%; top: 18.75%; width: 69%; height: 62.5%; transform: translateZ(1.5px); pointer-events: none; }
.gr-steps { display: flex; gap: 2.4cqw; font-family: "Instrument Sans", sans-serif; font-size: max(8px, 1.15cqw); white-space: nowrap; }
.gr-steps span { opacity: .28; transition: opacity .8s ease; }
.gr-steps span.on { opacity: 1; }
.gr-steps b { font-family: "Young Serif", Georgia, serif; font-weight: 400; font-size: 1.45em; margin-right: .4em; }

/* Phones: 07 turns into a tall card — the text on top, the flower growing underneath —
   so the text can be read at a proper size. */
@media (max-width: 719px) {
  .v-card:has(.v-grow) { --ar: 0.62 !important; }
  .v-sheet.v-grow {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    align-items: start;
    gap: 0;
    padding: 8cqw 8cqw 6cqw;
  }
  .gr-text h3 { font-size: 8.6cqw; max-width: 12ch; }
  .gr-text p { font-size: 4.5cqw; margin-top: 4cqw; line-height: 1.5; }
  .gr-text p.gr-kids { margin-top: 2cqw; }
  .gr-plant { align-self: end; gap: 2cqh; }
  .gr-dio { --h: 44cqh; }
  .gr-steps { font-size: 3.6cqw; gap: 4cqw; }
}

/* 02 Wordmark: the name alone on Hør */
.v-sheet.v-mark { background: #EFE6D6; display: grid; place-items: center; }
.v-sheet.v-mark img { width: 46%; height: auto; object-fit: contain; }

/* 04 Typography: three type specimens on Havre, each with its use and settings (no font names).
   1u = 1/1200 of the sheet. */
.v-sheet.v-type {
  --u: calc(100cqw / 1200);
  container-type: size;
  position: relative;
  background: #E2D3BC;
  color: #3B2418;
  display: grid;
  grid-template-rows: 368fr 216fr 136fr;
}
.ty-row {
  display: grid;
  grid-template-columns: calc(350 * var(--u)) 1fr;
  padding: calc(34 * var(--u)) calc(48 * var(--u));
  min-height: 0;
}
.ty-row + .ty-row { border-top: max(1px, var(--u)) solid rgba(59, 36, 24, 0.14); }
.ty-spec {
  display: flex; flex-direction: column; gap: calc(8 * var(--u));
  font-family: "Instrument Sans", sans-serif; font-weight: 500; color: #7A5634;
  padding-right: calc(40 * var(--u));
}
.ty-use { font-size: max(7px, calc(17 * var(--u))); line-height: 1.2; }
.ty-meta { font-size: max(6px, calc(12 * var(--u))); letter-spacing: .04em; text-transform: uppercase; line-height: 1.45; }
.ty-sample { margin: 0; }
@media (max-width: 719px) {
  /* small labels have a minimum size on phones; give them a little more room */
  .ty-row { padding: calc(22 * var(--u)) calc(40 * var(--u)); }
  .ty-spec { gap: calc(4 * var(--u)); }
}
.ty-display .ty-sample {
  margin-top: calc(-6 * var(--u));
  font-family: "Young Serif", Georgia, serif; font-weight: 400;
  font-size: calc(96 * var(--u)); line-height: 1.04; letter-spacing: -0.03em;
}
.ty-body .ty-sample {
  font-family: "Instrument Sans", sans-serif; font-weight: 400;
  font-size: calc(30 * var(--u)); line-height: 1.65; max-width: 30em;
}
.ty-caps .ty-sample {
  font-family: "Instrument Sans", sans-serif; font-weight: 500;
  font-size: calc(26 * var(--u)); letter-spacing: 0.2em; text-transform: uppercase; line-height: 1.3;
}

/* A grouped sheet: labelled rows with no paper behind them, so the swatches flow on the page.
   1u = 1/1200 of the sheet width (matches GROUP in script.js). */
.v-sheet.v-group {
  container-type: inline-size;
  background: none;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
  /* same width as a normal sheet; the height follows the content, so labels
     can keep a readable minimum size on small screens */
  width: calc(min(58vh, 84vw / var(--ar)) * var(--ar));
  height: auto;
  aspect-ratio: auto;
}
.v-group-in {
  --u: calc(100cqw / 1200);
  display: flex;
  flex-direction: column;
  gap: calc(44 * var(--u));
}
.v-group-in.is-stack { gap: calc(20 * var(--u)); }   /* matches GROUP.STACK in script.js */
.v-part { display: flex; flex-direction: column; gap: calc(18 * var(--u)); }
.v-label {
  display: block;
  font: 400 max(8px, calc(15 * var(--u)))/1 var(--data);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
}
.v-group img { display: block; width: 100%; height: auto; }

/* Live colour swatches (Blomst's own type). 1u = 1/1200 of the sheet width. */
.v-swatches {
  display: flex;
  gap: calc(24 * var(--u));
  width: 100%;
}
.v-swatch {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: calc(6 * var(--u));
  padding: calc(28 * var(--u));
  background: var(--bg);
  color: var(--ink);
  border-radius: calc(4 * var(--u));
  box-shadow: inset 0 0 0 max(1px, var(--u)) var(--line);
}
.sw-role {
  font: 500 max(7px, calc(11 * var(--u)))/1.2 "Instrument Sans", var(--data);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.sw-name { font: 400 max(12px, calc(30 * var(--u)))/1.2 "Young Serif", Georgia, serif; }
.sw-en { font: italic 400 max(8px, calc(17 * var(--u)))/1.25 "Instrument Sans", var(--data); }

.v-card figcaption {
  width: 0;
  min-width: 100%;                /* the caption never makes a card wider than its sheet */
  display: flex;
  flex-wrap: wrap;
  row-gap: 6px;
  gap: 14px;
  font: 400 11px/1.3 var(--data);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.v-no { color: var(--smoke); }
.v-kind { color: var(--paper); min-width: 96px; }
.v-title { color: var(--fog); }

@media (prefers-reduced-motion: reduce) {
  .folder .front, .folder .work, .folder .sheet, .caption, .viewer, .v-card { transition: none; }
}

/* Clicking and swiping between sheets must never select (highlight) the card names or the page behind */
.viewer, .surface, .window, .to-contact {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.caption a, .ending a { -webkit-user-select: text; user-select: text; }
