/* Order and Light.
   Every piece of the collage is placed by four numbers: x, y, angle, and size.
   x and y are in px on a 1921 x 1822 stage (Figma group 9:174).
   A piece inside .tilt, .borders or .wedges is placed relative to that group,
   and the group's own angle turns everything in it.
   Angles turn clockwise about the piece's top-left corner, as in Figma. */

:root {
  /* colours */
  --cream: #ffefe2;
  --ink: #000;
  --paper: var(--cream);  /* the page behind the collage */

  /* fonts. Germanika is the human's file (personal-use licence, see readme); UnifrakturMaguntia (OFL) is its fallback. Kelmscott is not in the repo. */
  --title-font: 'Germanika', 'UnifrakturMaguntia', serif;
  --title-size: 106.9px;    /* 3 times Figma's 35.64 px */
  --link-font: 'Kelmscott', 'IM Fell English', serif;  /* Kelmscott takes once _/fonts/Kelmscott.woff2 or .ttf exists */
  --link-size: 43.7px;      /* 3 times Figma's 14.56 px */
  --title-word-gap: 0;        /* with UnifrakturMaguntia the title was letter-spaced and pulled in by -0.16em to reach Figma's 193 px; Germanika is Figma's face and needs neither */

  /* the stage is 1921 px wide. Nothing is drawn above 244 px or below 1556 px, so the frame shows only that band */
  --stage-top: 244px;
  --stage-h: 1312px;

  /* left cream block (Figma 9:175) */
  --block-left-x: 0px;      --block-left-y: 705px;    --block-left-angle: 0deg;
  --block-left-w: 1334px;   --block-left-h: 850px;

  /* the tilted group (9:194) */
  --tilt-x: 902px;          --tilt-y: 0px;            --tilt-angle: 18deg;

  /* stained glass, inside tilt. glass_large is the Figma image (9:195) extended to twice its width and height,
     shown at 2.4 times Figma's box, on the same center. Figma's box was x 746.8, y 311.6, 524.3 x 712.2.
     glass_outpainted is glass_large painted outward to 3 times its width and height, with glass_large unchanged in the middle.
     It is shown so that middle third sits where glass_large sat (1258.3 x 1709.3 at x 818.4, y -303.3). */
  --glass-x: 1063.8px;      --glass-y: -2411.7px;     --glass-angle: 43deg;
  --glass-w: 3774.9px;      --glass-h: 5127.9px;
  /* the glass shows only inside this triangle: the rider's hand, the far end of the upper border,
     the far end of the lower border. Points are in the tilt group's coordinates.
     The two far points sit six times the border length out along each border, so the beam runs off any screen. */
  --beam: polygon(416px 995px, 4868px -5011px, 7118px -2299px);

  /* upper cream block (9:196), inside tilt */
  --block-upper-x: 128.1px; --block-upper-y: 1133.8px; --block-upper-angle: -26.3deg;
  --block-upper-w: 1374px;  --block-upper-h: 312.7px;

  /* upper ornamental border, three copies of border.svg (9:197), inside tilt */
  --borders-x: 860.3px;     --borders-y: 110.2px;     --borders-angle: 26.5deg;
  --border-angle: -52.68deg;
  --border-w: 411.1px;      --border-h: 23.9px;
  --border-1-x: 0px;        --border-1-y: 978.1px;
  --border-2-x: 248.3px;    --border-2-y: 652.4px;
  --border-3-x: 495.9px;    --border-3-y: 326.9px;
  /* copies 4 to 8 carry the border on, one step further each, past the screen */
  --border-4-x: 743.7px;  --border-4-y: 1.3px;
  --border-5-x: 991.5px;  --border-5-y: -324.3px;
  --border-6-x: 1239.3px;  --border-6-y: -649.9px;
  --border-7-x: 1487.1px;  --border-7-y: -975.5px;
  --border-8-x: 1734.9px;  --border-8-y: -1301.1px;

  /* big background cream block (9:212), inside tilt */
  --block-back-x: 0px;      --block-back-y: 1020.4px; --block-back-angle: -53deg;
  --block-back-w: 1266.6px; --block-back-h: 321px;

  /* lower ornamental border, three copies of wedge.svg (9:213), inside tilt */
  --wedges-x: 408.8px;      --wedges-y: 0px;          --wedges-angle: 0deg;
  --wedge-angle: -53.09deg;
  --wedge-w: 408.7px;       --wedge-h: 23.7px;
  --wedge-1-x: 0px;         --wedge-1-y: 976.4px;
  --wedge-2-x: 244.7px;     --wedge-2-y: 651.9px;
  --wedge-3-x: 488.1px;     --wedge-3-y: 326.8px;
  /* copies 4 to 8 carry the border on, one step further each, past the screen */
  --wedge-4-x: 731.8px;  --wedge-4-y: 2.0px;
  --wedge-5-x: 975.5px;  --wedge-5-y: -322.8px;
  --wedge-6-x: 1219.2px;  --wedge-6-y: -647.6px;
  --wedge-7-x: 1462.9px;  --wedge-7-y: -972.4px;
  --wedge-8-x: 1706.6px;  --wedge-8-y: -1297.2px;

  /* rider on the horse (9:232), inside tilt. 3 times Figma's 223 x 323, grown about the hand at the beam's point,
     so the hand stays at the beam. Figma's box was x 267.9, y 989.6. */
  --rider-x: -28.3px;       --rider-y: 978.8px;       --rider-angle: -10deg;
  --rider-w: 669px;         --rider-h: 969px;

  /* title and links (9:229, 9:420, 9:417, 9:418) */
  /* moved up from Figma's y 773 so the text sits at the top left of the crop */
  --title-x: 149px;         --title-y: 360px;
  --link-x: 152px;
  --link-1-y: 530.7px;      --link-2-y: 611.7px;      --link-3-y: 692.7px;      --link-4-y: 773.7px;

  /* text pages (shop, about, contact, policies) */
  --text-font: 'IM Fell English', serif;
  --text-size: 22px;
  --page-w: 760px;          /* measure of a text column */
  --page-pad: 24px;
  --head-title-size: clamp(44px, 6vw, 72px);
  --price-font: 'Libre Caslon Text', serif;  /* lining figures; IM Fell's are old-style */
  --ph-edge: #b0532a;       /* dashed box round a placeholder */

  /* the crop: the part of the stage the screen shows. It holds the whole rider and the start of the beam.
     The crop is scaled to fit the screen and pinned to the top left. */
  --crop-x: 40px;           --crop-y: 320px;
  --crop-w: 1880px;         --crop-h: 1620px;

  /* loose shapes over the group: cream strips (9:425, 11:2) and black hairlines (9:426, 11:4) */
  --strip-w: 18.9px;        --strip-h: 634.1px;
  --strip-1-x: 1483.7px;    --strip-1-y: 663px;       --strip-1-angle: 52deg;
  --strip-2-x: 1631.4px;    --strip-2-y: 998px;       --strip-2-angle: 83deg;
  --hairline-h: 0.85px;
  --hairline-1-x: 997px;    --hairline-1-y: 1066.8px; --hairline-1-angle: -38deg;  --hairline-1-w: 288px;
  --hairline-2-x: 1002px;    --hairline-2-y: 1075.1px; --hairline-2-angle: -7deg;   --hairline-2-w: 709.8px;
}

@font-face {
  font-family: 'Germanika';
  src: url(/_/fonts/Germanika.woff2) format('woff2');
}
@font-face {
  font-family: 'UnifrakturMaguntia';
  src: url(/_/fonts/UnifrakturMaguntia.woff2) format('woff2');
}
@font-face {
  font-family: 'IM Fell English';
  src: url(/_/fonts/IMFellEnglish.woff2) format('woff2');
}
@font-face {
  font-family: 'Libre Caslon Text';
  src: url(/_/fonts/LibreCaslonText.woff2) format('woff2');
}
@font-face {
  font-family: 'Kelmscott';
  src: url(/_/fonts/Kelmscott.woff2) format('woff2'), url(/_/fonts/Kelmscott.ttf) format('truetype');
}

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: normal var(--text-size)/1.5 var(--text-font);
}

/* The collage fills the screen. */
.frame { position: relative; height: 100vh; height: 100dvh; overflow: hidden; }
.stage {
  position: absolute;
  left: var(--stage-x, 0);
  top: var(--stage-y, calc(-1 * var(--stage-top)));
  width: 1921px;
  height: 1822px;
  transform: scale(var(--scale, 1));
  transform-origin: 0 0;
}

.piece {
  position: absolute; left: 0; top: 0; margin: 0; display: block;
  width: var(--w, auto); height: var(--h, auto);
  transform: translate(var(--x, 0), var(--y, 0)) rotate(var(--angle, 0deg));
  transform-origin: 0 0;
}

.block-left  { --x: var(--block-left-x);  --y: var(--block-left-y);  --angle: var(--block-left-angle);  --w: var(--block-left-w);  --h: var(--block-left-h);  background: var(--cream); }
.tilt        { --x: var(--tilt-x);        --y: var(--tilt-y);        --angle: var(--tilt-angle); }
.beam        { position: absolute; inset: 0; width: 1921px; height: 1822px; clip-path: var(--beam); }
.glass       { --x: var(--glass-x);       --y: var(--glass-y);       --angle: var(--glass-angle);       --w: var(--glass-w);       --h: var(--glass-h);       object-fit: cover; }
.block-upper { --x: var(--block-upper-x); --y: var(--block-upper-y); --angle: var(--block-upper-angle); --w: var(--block-upper-w); --h: var(--block-upper-h); background: var(--cream); }
.borders     { --x: var(--borders-x);     --y: var(--borders-y);     --angle: var(--borders-angle); }
.borders img { --angle: var(--border-angle); --w: var(--border-w); --h: var(--border-h); }
.border-1    { --x: var(--border-1-x);    --y: var(--border-1-y); }
.border-2    { --x: var(--border-2-x);    --y: var(--border-2-y); }
.border-3    { --x: var(--border-3-x);    --y: var(--border-3-y); }
.border-4    { --x: var(--border-4-x);    --y: var(--border-4-y); }
.border-5    { --x: var(--border-5-x);    --y: var(--border-5-y); }
.border-6    { --x: var(--border-6-x);    --y: var(--border-6-y); }
.border-7    { --x: var(--border-7-x);    --y: var(--border-7-y); }
.border-8    { --x: var(--border-8-x);    --y: var(--border-8-y); }
.block-back  { --x: var(--block-back-x);  --y: var(--block-back-y);  --angle: var(--block-back-angle);  --w: var(--block-back-w);  --h: var(--block-back-h);  background: var(--cream); }
.wedges      { --x: var(--wedges-x);      --y: var(--wedges-y);      --angle: var(--wedges-angle); }
.wedges img  { --angle: var(--wedge-angle); --w: var(--wedge-w); --h: var(--wedge-h); }
.wedge-1     { --x: var(--wedge-1-x);     --y: var(--wedge-1-y); }
.wedge-2     { --x: var(--wedge-2-x);     --y: var(--wedge-2-y); }
.wedge-3     { --x: var(--wedge-3-x);     --y: var(--wedge-3-y); }
.wedge-4     { --x: var(--wedge-4-x);     --y: var(--wedge-4-y); }
.wedge-5     { --x: var(--wedge-5-x);     --y: var(--wedge-5-y); }
.wedge-6     { --x: var(--wedge-6-x);     --y: var(--wedge-6-y); }
.wedge-7     { --x: var(--wedge-7-x);     --y: var(--wedge-7-y); }
.wedge-8     { --x: var(--wedge-8-x);     --y: var(--wedge-8-y); }
.rider       { --x: var(--rider-x);       --y: var(--rider-y);       --angle: var(--rider-angle);       --w: var(--rider-w);       --h: var(--rider-h); }

.title {
  --x: var(--title-x); --y: var(--title-y);
  font: normal var(--title-size)/1 var(--title-font); color: var(--ink); white-space: pre; word-spacing: var(--title-word-gap);
}
.stage nav a {
  --x: var(--link-x);
  font: normal var(--link-size)/1.1 var(--link-font); color: var(--ink);
  text-decoration: underline; text-underline-offset: 2px;
}
.link-1 { --y: var(--link-1-y); }
.link-2 { --y: var(--link-2-y); }
.link-3 { --y: var(--link-3-y); }
.link-4 { --y: var(--link-4-y); }


.strip-1    { --x: var(--strip-1-x);    --y: var(--strip-1-y);    --angle: var(--strip-1-angle);    --w: var(--strip-w); --h: var(--strip-h); background: var(--cream); }
.strip-2    { --x: var(--strip-2-x);    --y: var(--strip-2-y);    --angle: var(--strip-2-angle);    --w: var(--strip-w); --h: var(--strip-h); background: var(--cream); }
.hairline-1 { --x: var(--hairline-1-x); --y: var(--hairline-1-y); --angle: var(--hairline-1-angle); --w: var(--hairline-1-w); --h: var(--hairline-h); background: var(--ink); }
.hairline-2 { --x: var(--hairline-2-x); --y: var(--hairline-2-y); --angle: var(--hairline-2-angle); --w: var(--hairline-2-w); --h: var(--hairline-h); background: var(--ink); }

/* ---- text pages ---- */

.ph { border: 1.5px dashed var(--ph-edge); color: var(--ph-edge); padding: 0 .3em; white-space: nowrap; }

.page { box-sizing: border-box; width: 100%; max-width: calc(var(--page-w) + 2 * var(--page-pad)); margin: 0 auto; padding: 0 var(--page-pad); }
.page .about-name { margin-top: 0; }

.head { max-width: calc(var(--page-w) + 2 * var(--page-pad)); margin: 0 auto; padding: 120px var(--page-pad) 0; }  /* was 40px; the human asked for three times */
.head-title { display: block; font: normal var(--head-title-size)/1 var(--title-font); color: var(--ink); text-decoration: none; letter-spacing: .06em; }
.head-nav { margin-top: 20px; display: flex; gap: 1.2em; flex-wrap: wrap; }
.head-nav a { font: normal .77em/1.2 var(--link-font);  /* was 1.1em; the human asked for 30 percent smaller */ color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

.page { padding-top: 40px; padding-bottom: 48px; }
.page h1 { font: normal 1.9em/1.1 var(--title-font); margin: 0 0 .6em; }
.page h2 { font: normal 1.25em/1.2 var(--link-font); margin: 1.6em 0 .4em; scroll-margin-top: 24px; }
.page p { margin: 0 0 1em; }
.page a { color: var(--ink); }

.products { list-style: none; margin: 1.5em 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; align-items: stretch; }
.product { display: flex; flex-direction: column; height: 100%; }  /* the buy button sits at the card's foot (margin-top: auto), so the row of buttons aligns */
.product-image, .product-panel { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; }
.product-panel { display: flex; align-items: center; justify-content: center; font: normal 2em/1 var(--title-font); border: 1px solid var(--ink); box-sizing: border-box; }
.product-name { font: normal 1.1em/1.2 var(--link-font); margin: .8em 0 .3em; }
.page .product-name { margin: .8em 0 .3em; }
.product-text { font-size: .9em; margin: 0 0 .4em; }
.product-price { margin: 0 0 .8em; }
.price { font-family: var(--price-font); font-size: var(--text-size); }  /* every price line and figure: a face with lining figures */
.product .ph { white-space: normal; }
.buy { margin-top: auto; align-self: flex-start; font: normal 1em/1.2 var(--link-font); color: var(--paper); background: var(--ink); border: 0; padding: .5em 1.1em; cursor: default; }
.buy:disabled { opacity: 1; }

@media (max-width: 600px) {
  :root { --text-size: 18px; --page-pad: 18px; }
  .head { padding-top: 84px; }  /* was 28px */
  .products { grid-template-columns: 1fr; gap: 40px; }
  .ph { white-space: normal; }
}
