/* Self-hosted serif: Source Serif 4 (OFL), for the About text and the other serif text. Mono and sans stay the system stacks (SF Mono / Helvetica Neue first). */
@font-face { font-family: "Source Serif 4"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/source-serif-4-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Source Serif 4"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/source-serif-4-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Source Serif 4"; font-weight: 400; font-style: italic; font-display: swap; src: url("/fonts/source-serif-4-latin-400-italic.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Source Serif 4"; font-weight: 400; font-style: italic; font-display: swap; src: url("/fonts/source-serif-4-latin-ext-400-italic.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  --bg: #080706;
  --ink: #d3cabe;
  --cream: #efe0ca;
  --mute: #a0978c;
  --safelight: 255, 38, 18;
  --amber: 255, 150, 70;
  --film: #dba35e;
  --paper: #e6dac6;
  --fs: 12px;
  --head: 44px;
  --sans: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
@media (max-width: 700px) { :root { --fs: 13px; --head: 104px; } }
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--ink); overflow: hidden; overscroll-behavior: none; }
body { font-family: var(--sans); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; }

#stage { position: fixed; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overflow: hidden; }
#stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ================= Header: film edge, blurred glass ================= */
/* Only the blur: no lines, no edges. Whatever lies behind reads as a soft, blurred picture. A little grain sits in the glass itself. */
#top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 6; pointer-events: none;
  padding-top: env(safe-area-inset-top); font-size: var(--fs); font-family: var(--mono);
  background: rgba(14, 11, 8, .16);
  -webkit-backdrop-filter: blur(26px) saturate(1.6); backdrop-filter: blur(26px) saturate(1.6);
  text-shadow: 0 1px 10px rgba(0, 0, 0, .55);
}
#top::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .2; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .95  0 0 0 0 .9  0 0 0 0 .85  0 0 0 .75 -.18'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
#top a, #top button { pointer-events: auto; text-decoration: none; cursor: pointer; }
.film {
  display: flex; align-items: center; gap: 30px; height: 44px; padding: 0 max(20px, env(safe-area-inset-left));
  letter-spacing: .16em; text-transform: uppercase; color: var(--film); white-space: nowrap; overflow: hidden;
}
.film .f2 { margin: 0; font: inherit; letter-spacing: .22em; }
.film .f2 a { color: #ecc48f; }
.film .f2 a:hover, .film .f2 a:focus-visible { color: var(--cream); outline: none; }
.film .f3 { color: var(--cream); letter-spacing: .14em; overflow: hidden; text-overflow: ellipsis; }
/* Shuffle, Grid and About: in the film edge, to the right, same type */
.ctl { position: absolute; top: env(safe-area-inset-top); right: max(12px, env(safe-area-inset-right)); height: 44px; display: flex; align-items: center; gap: 14px; }
.ctl button, .ctl a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; background: none; border: 0; color: var(--film); opacity: .92; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap;
  transition: opacity .5s ease, color .5s ease;
}
.ctl button:hover, .ctl button:focus-visible, .ctl a:hover, .ctl a:focus-visible { opacity: 1; color: var(--cream); outline: none; }
.ctl [aria-pressed="true"] { opacity: 1; color: var(--cream); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }

/* ================= Footer ================= */
footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; pointer-events: none;
  display: flex; justify-content: flex-end; align-items: center;
  padding: 0 max(20px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
 
}
button.close {
  pointer-events: auto; min-height: 44px; padding: 0 10px 0 0; background: none; border: 0; font-size: var(--fs); letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink); opacity: .85; transition: opacity .5s ease, color .5s ease; cursor: pointer;
}
button.close:hover, button.close:focus-visible { opacity: 1; color: var(--cream); outline: none; }
#timer {
  display: flex; align-items: center; gap: 7px; height: 44px;
  color: rgb(255, 50, 28); filter: drop-shadow(0 0 3px rgba(255, 40, 20, .55)) drop-shadow(0 1px 5px rgba(0, 0, 0, .85));
}
#timer .grp { display: flex; gap: 3px; }
#timer .slash { font: 300 14px/1 var(--sans); opacity: .55; transform: translateY(-1px); }
.seg { height: 16px; width: auto; aspect-ratio: 10 / 18; overflow: visible; }
.seg polygon { fill: currentColor; opacity: .07; transition: opacity .35s ease; }
.seg polygon.on { opacity: .92; }

/* ================= About, a layer over the table (and the page /about/) ================= */
#layer {
  position: fixed; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center;
  background: rgba(8, 7, 6, .84); padding: calc(var(--head, 120px) + 8px) 24px 84px;
}
#layer[hidden] { display: none; }
.sheet { max-width: 32rem; width: 100%; max-height: 100%; overflow-y: auto; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.sheet::-webkit-scrollbar { display: none; }
#layer-body { font: 400 clamp(1.05rem, 2.2vw, 1.25rem)/1.55 var(--serif); color: #e2d7c8; }
#layer-body h1 { font: 400 var(--fs) var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--mute); margin-bottom: 1.4rem; }
#layer-body h2 { font: 400 var(--fs) var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--mute); margin: 1.8rem 0 .5rem; }
#layer-body p + p, #layer-body li + li { margin-top: .5em; }
#layer-body ul { list-style: none; }
#layer-body a { color: var(--cream); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
#layer-body .availability { margin-top: 2rem; color: var(--cream); }
.close { display: inline-block; margin: 1.6rem 0 .4rem; min-height: 44px; line-height: 44px; font-size: var(--fs); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); opacity: .85; text-decoration: none; transition: opacity .5s ease, color .5s ease; }
.close:hover, .close:focus-visible { opacity: 1; color: var(--cream); outline: none; }
/* a quiet line at the foot of every page (always visible), in the type of the film edge */
.contact-line {
  position: fixed; z-index: 8; left: 0; right: 0; bottom: max(14px, env(safe-area-inset-bottom)); display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 0 max(120px, 16px); font: 400 var(--fs) var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--film); pointer-events: none;
}
.contact-line { text-shadow: 0 0 6px rgba(0,0,0,.85), 0 0 14px rgba(0,0,0,.6); }
.contact-line a { pointer-events: auto; color: var(--film); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; transition: color .5s ease; }
.contact-line a:hover, .contact-line a:focus-visible { color: var(--cream); outline: none; }

/* ================= Cursor (fine pointers only) ================= */
/* a grain focuser in the darkroom: a thin amber ring with a dot, over the soft red safelight. Over a print the ring tightens and gets
   four sighting ticks; in the corner zone of a print it becomes an open arc with an arrow (turn and scale); while dragging it fills faintly. */
#cursor, #cdot { display: none; }
@media (hover: hover) and (pointer: fine) {
  html.has-cursor, html.has-cursor * { cursor: none !important; }
  html.has-cursor #cursor {
    display: block; position: fixed; left: 0; top: 0; z-index: 20; width: 64px; height: 64px; margin: -32px 0 0 -32px;
    pointer-events: none; mix-blend-mode: screen; will-change: transform, opacity; opacity: 0; --rot: 0deg; --gs: 1;
  }
  #cursor i { position: absolute; inset: 0; border-radius: 50%; transform: scale(var(--gs)); }
  #cursor i:nth-child(1) { background: radial-gradient(circle, rgba(var(--safelight), .62) 0%, rgba(var(--safelight), .28) 34%, rgba(var(--safelight), 0) 70%); }
  #cursor i:nth-child(2) { background: radial-gradient(circle, rgba(var(--amber), .55) 0%, rgba(var(--amber), .22) 36%, rgba(var(--amber), 0) 70%); opacity: var(--warm, 0); }
  #cursor svg { position: absolute; left: 12px; top: 12px; overflow: visible; fill: none; stroke: #dba35e; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; }
  #cursor svg * { vector-effect: non-scaling-stroke; }
  #cursor .ring, #cursor .fill { transform-origin: 0 0; transition: transform .15s ease, opacity .15s ease; }
  #cursor .fill { stroke: none; fill: rgba(219, 163, 94, .16); opacity: 0; }
  #cursor .ticks { opacity: 0; transition: opacity .15s ease; }
  #cursor .arcg { opacity: 0; transition: opacity .15s ease; transform: rotate(var(--rot)); }
  #cursor.over .ring, #cursor.over .fill { transform: scale(.727); }
  #cursor.over .ticks { opacity: 1; }
  #cursor.corner .ring, #cursor.corner .ticks { opacity: 0; }
  #cursor.corner .arcg { opacity: 1; }
  #cursor.corner .fill { transform: scale(.86); }
  #cursor.drag .fill { opacity: 1; }
  html.has-cursor #cdot {
    display: block; position: fixed; left: 0; top: 0; z-index: 21; width: 3px; height: 3px; margin: -1.5px 0 0 -1.5px; border-radius: 50%;
    background: #dba35e; pointer-events: none; opacity: 0; transition: opacity .15s ease;
  }
}

/* ================= No-WebGL fallback: same page, simple CSS ================= */
.fallback #stage {
  background:
    radial-gradient(circle 230px at var(--mx, -999px) var(--my, -999px), rgba(var(--safelight), .07), transparent 70%),
    var(--bg);
}
.fallback #stage::before, .fallback #stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='420' height='420'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='.9 .09' numOctaves='3' seed='4'/><feColorMatrix values='0 0 0 0 .9  0 0 0 0 .85  0 0 0 0 .8  0 0 0 .9 -.3'/></filter><rect width='100%' height='100%' filter='url(%23f)'/></svg>");
}
.fallback #stage::before { opacity: .05; }
.fallback #stage::after {
  opacity: .5; mix-blend-mode: soft-light;
  -webkit-mask-image: radial-gradient(circle 190px at var(--mx, -999px) var(--my, -999px), #000, transparent 100%);
  mask-image: radial-gradient(circle 190px at var(--mx, -999px) var(--my, -999px), #000, transparent 100%);
}

.card { position: absolute; left: 0; top: 0; pointer-events: none; will-change: transform; transform-origin: 50% 50%; }
.card .print {
  position: absolute; inset: 0; --rest: 0; background-size: cover; background-position: center;
  translate: 0 0; scale: 1;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .45), 0 10px 26px rgba(0, 0, 0, .35);
  transition: translate .6s ease, scale .6s ease, box-shadow .9s ease;
}
.card img { display: block; width: 100%; height: 100%; object-fit: cover;
  filter: contrast(calc(.6 + .4 * var(--rest))) brightness(calc(.84 + .16 * var(--rest))) saturate(calc(.42 + .58 * var(--rest)));
  transition: opacity 1.1s ease;
}
.card .print.loading img { opacity: 0; }
.card .print::after {
  content: ""; position: absolute; inset: 0; background: rgb(var(--safelight)); mix-blend-mode: multiply;
  opacity: calc(.46 * (1 - var(--rest)));
}
.card .print.loading::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(0,0,0,0) 0 16.66%, rgba(0,0,0,.14) 0 33.33%, rgba(0,0,0,.3) 0 50%, rgba(0,0,0,.46) 0 66.66%, rgba(0,0,0,.62) 0 83.33%, rgba(0,0,0,.78) 0 100%);
}
.card.hot .print { translate: 0 -4px; scale: 1.012; box-shadow: 0 8px 14px rgba(0, 0, 0, .5), 0 24px 54px rgba(0, 0, 0, .55); }
.card.hot img { filter: none; }
/* a cut-out object: no rectangle, no frame, no shadow of its own (it is in the picture) */
.card.cut .print, .card.cut.hot .print { box-shadow: none; background: none !important; }
.card.cut .print::after, .card.cut .print.loading::before { display: none; }
.hero.cut, .work-hero.cut { box-shadow: none; }
.hero.cut::after { display: none; }
.card.hot .print::after { opacity: .14; }

/* ================= The page before the table: real HTML, then WebGL over it ================= */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
#content { position: relative; z-index: 1; }
/* the first image of the home page lies where the top print of the table will lie, in the same safelight */
.hero { position: fixed; z-index: 1; left: 50%; top: calc(50% + 22px); transform: translate(-50%, -50%) rotate(-1.2deg); --L: min(30vw, 55vh); pointer-events: none; transition: opacity .9s ease; }
.hero.land { width: var(--L); }
.hero.port { width: calc(var(--L) * var(--r)); }
.hero picture, .hero img { display: block; width: 100%; height: auto; }
.hero { box-shadow: 0 3px 8px rgba(0, 0, 0, .45), 0 10px 26px rgba(0, 0, 0, .35); }
/* a work: the print in plain light, the words beneath */
.work-hero { position: fixed; z-index: 1; left: 50%; top: calc(var(--head, 88px) + 12px); transform: translateX(-50%); transition: opacity .9s ease; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.work-hero img { display: block; height: auto; width: min(92vw, calc((100vh - var(--head, 88px) - 215px) * var(--r))); }
.work-text { position: fixed; z-index: 1; left: 0; right: 0; bottom: 0; padding: 0 20px 56px; text-align: center; transition: opacity .9s ease; text-shadow: 0 1px 10px rgba(0, 0, 0, .6); }
.work-text h1 { font: 400 clamp(20px, 2.4vw, 24px)/1.2 var(--serif); color: #eadfcd; }
.work-text .meta { margin-top: 4px; font-size: calc(var(--fs) + 1px); color: var(--mute); letter-spacing: .06em; }
.work-text p { max-width: 36rem; margin: 6px auto 0; font-size: calc(var(--fs) + 1px); line-height: 1.5; color: #bdb3a6; }
.work-text a, .page a { color: var(--cream); }
.app-ready .hero, .app-ready .work-hero, .app-ready .work-text { opacity: 0; pointer-events: none; transition-duration: .3s; }
/* About as a page: the layer is open from the start */
.page-about #layer, .page-bryllup #layer { display: flex; }
.page-about #layer[hidden], .page-bryllup #layer[hidden] { display: none; }

/* pages without the table: not found */
html.static, html.static body { overflow: auto; height: auto; min-height: 100%; overscroll-behavior: auto; }
html.static #top { position: sticky; }
html.static .ctl { position: absolute; }
html.static .film { height: 44px; }
.page-404 #content { max-width: 60rem; margin: 0 auto; padding: 56px max(20px, env(safe-area-inset-left)) 96px; font: 400 clamp(1.05rem, 2.2vw, 1.2rem)/1.55 var(--serif); color: #e2d7c8; }
.page-404 h1 { font: 400 clamp(26px, 4vw, 40px)/1.15 var(--serif); color: #eadfcd; }
.page-404 p { margin-top: 2.4rem; font-size: var(--fs); letter-spacing: .14em; text-transform: uppercase; font-family: var(--sans); }
.page-404 a { display: inline-flex; align-items: center; min-height: 44px; }

/* ================= Narrow screens ================= */
@media (max-width: 700px) {
  /* the film edge in two lines: frame and name, then the title and year of the print that is active */
  .film { height: auto; flex-wrap: wrap; gap: 0 14px; padding: 9px max(14px, env(safe-area-inset-right)) 7px max(14px, env(safe-area-inset-left)); letter-spacing: .1em; }
  .film .f2 { flex: 1; text-align: right; letter-spacing: .12em; }
  .film .f3 { order: 3; flex: 0 0 100%; margin-top: 3px; }
  .film .f3:empty { display: none; }
  .ctl { position: static; height: auto; justify-content: space-between; padding: 0 max(8px, env(safe-area-inset-right)) 0 max(6px, env(safe-area-inset-left)); }
  footer { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .contact-line { flex-direction: column; gap: 0; bottom: calc(env(safe-area-inset-bottom) + 50px); padding: 0 16px; letter-spacing: .1em; }
  .contact-line span { display: none; }
  .contact-line a { min-height: 32px; }
  #layer { padding: calc(var(--head) + 8px) 18px 130px; }
  .work-text { padding-bottom: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  .fallback #stage::before { animation: none; opacity: .05; }
  .seg polygon, .ctl button, .ctl a, .fit img, .fit::before, .hero, .work-hero, .work-text { transition-duration: .01s; }
}

/* with JavaScript the table is the first thing seen: the static first image stays in the page for search engines, no-JS and screen readers */
.js .hero, .js .work-hero, .js .work-text { opacity: 0; pointer-events: none; transition: none; }
/* if the table could not be started at all, the page's own pictures are shown again */
.app-failed .hero, .app-failed .work-hero, .app-failed .work-text { opacity: 1; pointer-events: auto; }

/* About: books and stockists */
#layer-body h3 { font: 400 1em/1.4 var(--serif); color: var(--cream); margin-bottom: .2em; }
#layer-body .stockists { font-size: .86em; }
#layer-body .stockists p { color: #cfc4b4; }
#layer-body .stockists .sep { color: var(--mute); }
.sheet { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { .sheet { scroll-behavior: auto; } }


/* About: books in small blocks, ISBN and status small and quiet under the title */
#layer-body .book { margin-top: 1.3rem; scroll-margin-top: 1rem; font-size: 1em; color: #e2d7c8; }
#layer-body .book span { display: block; }
#layer-body .book .bm { font-size: .78em; line-height: 1.5; color: var(--mute); letter-spacing: .02em; }

/* "Tilt the table": a quiet switch at the foot of About, in the type of the contact line */
#layer-body .tilt { margin-top: 1.8rem; }
.tilt button { -webkit-appearance: none; appearance: none; font: 400 var(--fs) var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--film); background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; margin: 0; min-height: 44px; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: color .5s ease; }
.tilt button::after { content: " · off"; opacity: .6; }
.tilt button[aria-pressed="true"]::after { content: " · on"; }
.tilt button:hover, .tilt button:focus-visible { color: var(--cream); outline: none; }

/* /bryllup/: the text over the dimmed table. Package and price clear, the description dimmed beneath, air between the packages */
#layer-body .lead { font-size: 1em; color: #e2d7c8; margin-bottom: .4rem; }
#layer-body .pkg { margin-top: 2.1rem; }
#layer-body .pkg h2 { margin: 0 0 .15rem; font: 400 1.12em/1.3 var(--serif); letter-spacing: 0; text-transform: none; color: var(--cream); }
#layer-body .price { font: 400 var(--fs) var(--mono); letter-spacing: .08em; color: var(--cream); margin: 0 0 .5rem; }
#layer-body .pd { font-size: .86em; line-height: 1.5; color: var(--mute); margin: 0; }
#layer-body .pkg .pd + .pd { margin-top: .25em; }
#layer-body .delivery { margin-top: 2.4rem; font-size: .92em; color: #cfc4b4; }
#layer-body .extras { margin-top: .9rem; font-size: .92em; color: #cfc4b4; }
#layer-body .ask { margin-top: 2.4rem; font-size: 1.1em; }
#layer-body .hint { margin-top: .3rem; font-size: .78em; color: var(--mute); letter-spacing: .02em; }
.page-bryllup .close { margin-top: 1.8rem; }

.tilt button:active, .tilt button:focus { background: none; }
