/* Weather in a teacup — the teacup on the Slopwright's shelf, between commissions, with a small storm over the rim.
   The cup and saucer are gradients and border-radius; the cloud drifts on a transform; the rain is a repeating
   gradient on a tall layer that slides down inside a clipped box; a small bolt flashes by opacity now and then (two
   flicks every seven seconds, never more than three a second); steam curls up from the rim. A registered angle turns
   the cloud's inner swirl. Reduced motion clears the weather: a still cup on a still shelf.
   Designed by machine for the Slopwright. */
@font-face { font-family: "Archivo Black"; src: url(/fonts/archivo-black-latin.woff2) format("woff2"); font-weight: 400 1000; font-display: swap; }
@property --swirl { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
:root {
  color-scheme: light;
  --wall: #dfe6e8;
  --paper: #fffdf7;
  --ink: #1d2328;
  --dim: #4d5862;
  --china: #f7f4ee;
  --blue: #2d5f8f;
  --accent: #23517c;
  --focus: #b8461b;
  --head: "Archivo Black", "Arial Black", Arial, sans-serif;
  /* where the cup stands */
  --cx: 76vw;
}
* { box-sizing: border-box; }
html { overflow-x: clip; background: var(--wall); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  min-width: 320px; margin: 0; color: var(--ink); font: 17px/1.65 Georgia, "Iowan Old Style", serif;
  background:
    repeating-linear-gradient(90deg, rgb(255 255 255 / .22) 0 2px, transparent 2px 46px) fixed,
    linear-gradient(#cfd8dc, #e6ebec 60%, #d7dee0) fixed;
}
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--ink); }
:where(a, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: 3px; }
img { max-width: 100%; height: auto; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 50; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; font: 700 15px Arial, sans-serif; text-decoration: none; }
.skip:focus { top: 12px; }
.main:focus { outline: none; }

/* ---------------------------------------------------------------- the scene */
.extra { position: fixed; z-index: 0; pointer-events: none; }
/* 1. the shelf, the saucer and the cup (the handle is ::after) */
.extra-1 {
  left: 0; right: 0; bottom: 0; height: 30vh;
  background:
    /* the cup: a bowl of china, a blue band, the rim's shadow */
    radial-gradient(ellipse 110px 14px at var(--cx) calc(100% - 160px), #a9b4bb 0 70%, transparent 74%),
    radial-gradient(ellipse 112px 16px at var(--cx) calc(100% - 160px), var(--china) 0 88%, transparent 92%),
    /* the saucer */
    radial-gradient(ellipse 170px 22px at var(--cx) calc(100% - 52px), #fff 0 55%, #d8d3c8 70%, #b9b3a7 86%, transparent 90%),
    /* the shelf: an edge, and the board */
    linear-gradient(#8b6b4a, #8b6b4a) 0 calc(100% - 40px) / 100% 6px no-repeat,
    linear-gradient(#b48a5e, #9a7249 50%, #7d5b39) 0 100% / 100% 40px no-repeat;
}
.extra-1::before { /* the bowl of the cup, a half-ellipse with a blue band */
  content: ""; position: absolute; left: calc(var(--cx) - 108px); bottom: 58px; width: 216px; height: 104px;
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  background:
    linear-gradient(90deg, rgb(0 0 0 / .12), transparent 30%, rgb(255 255 255 / .5) 45%, transparent 60%, rgb(0 0 0 / .14)),
    linear-gradient(transparent 22%, var(--blue) 22% 30%, transparent 30%),
    var(--china);
  box-shadow: 0 6px 10px rgb(0 0 0 / .18);
}
.extra-1::after { /* the handle */
  content: ""; position: absolute; left: calc(var(--cx) + 92px); bottom: 92px; width: 52px; height: 52px;
  border: 12px solid var(--china); border-radius: 50%;
  box-shadow: inset 0 0 0 1px #c9c3b7, 0 0 0 1px #c9c3b7;
  clip-path: inset(0 0 0 45%);
}
/* 2. the cloud, drifting over the rim, with a swirl inside it from a registered angle */
.extra-2 {
  left: calc(var(--cx) - 150px); bottom: calc(30vh + 70px); width: 300px; height: 120px;
  background:
    radial-gradient(circle at 30% 60%, #8d99a6 0 34px, transparent 35px),
    radial-gradient(circle at 50% 42%, #9aa6b2 0 48px, transparent 49px),
    radial-gradient(circle at 70% 58%, #8a96a2 0 38px, transparent 39px),
    radial-gradient(ellipse 120px 34px at 50% 76%, #7b8794 0 98%, transparent 100%);
  filter: drop-shadow(0 6px 10px rgb(40 50 60 / .25));
  animation: drift 13s ease-in-out infinite alternate;
}
.extra-2::before { /* the swirl: a conic gradient turned by --swirl */
  content: ""; position: absolute; left: 112px; top: 26px; width: 76px; height: 76px; border-radius: 50%;
  background: conic-gradient(from var(--swirl), rgb(255 255 255 / .28), transparent 25%, rgb(255 255 255 / .2) 50%, transparent 75%, rgb(255 255 255 / .28));
  animation: swirl 9s linear infinite;
}
.extra-2::after { /* steam from the rim, under the cloud */
  content: ""; position: absolute; left: 92px; top: 112px; width: 120px; height: 70px;
  background:
    radial-gradient(ellipse 10px 30px at 30% 60%, rgb(255 255 255 / .55), transparent 70%),
    radial-gradient(ellipse 9px 26px at 62% 50%, rgb(255 255 255 / .45), transparent 70%);
  animation: steam 4.5s ease-in-out infinite alternate;
}
/* 3. the rain, in a box under the cloud: a tall striped layer sliding down */
.extra-3 { left: calc(var(--cx) - 90px); bottom: calc(30vh - 66px); width: 180px; height: 140px; overflow: hidden; -webkit-mask: linear-gradient(#000 60%, transparent); mask: linear-gradient(#000 60%, transparent); }
.extra-3::before {
  content: ""; position: absolute; left: 0; right: 0; top: -110px; height: 220px;
  background: repeating-linear-gradient(105deg, transparent 0 9px, rgb(70 100 140 / .55) 9px 10.5px, transparent 10.5px 19px);
  background-size: 100% 110px;
  will-change: transform;
  animation: rain .6s linear infinite;
}
/* 4. the lightning: a small bolt, cut with clip-path, that flicks on twice every seven seconds */
.extra-4 {
  left: calc(var(--cx) - 20px); bottom: calc(30vh - 10px); width: 34px; height: 76px; opacity: 0;
  background: linear-gradient(#fffbe0, #ffe46b);
  clip-path: polygon(55% 0, 15% 52%, 45% 52%, 25% 100%, 85% 40%, 52% 40%, 75% 0);
  filter: drop-shadow(0 0 6px rgb(255 240 150 / .9));
  animation: bolt 7s linear infinite;
}
@keyframes drift { from { transform: translateX(-26px); } to { transform: translateX(26px); } }
@keyframes swirl { to { --swirl: 360deg; } }
@keyframes steam { from { transform: translateY(6px) scaleY(.9); opacity: .5; } to { transform: translateY(-8px) scaleY(1.1); opacity: .9; } }
@keyframes rain { to { transform: translateY(110px); } }
/* two flicks, 0.6 s apart, then six seconds of nothing */
@keyframes bolt { 0%, 80% { opacity: 0; } 81%, 82.5% { opacity: 1; } 83.5%, 89% { opacity: 0; } 90%, 91% { opacity: .85; } 92%, 100% { opacity: 0; } }

/* reduced motion: clear weather, a still cup */
@media (prefers-reduced-motion: reduce) {
  .extra-2, .extra-2::before, .extra-2::after, .extra-3::before, .extra-4 { animation: none; }
  .extra-3, .extra-4 { display: none; }
  .extra-2 { opacity: .55; }
}

/* ---------------------------------------------------------------- the manual: cards propped against the wall */
.page { position: relative; z-index: 1; max-width: 760px; margin: 0 0 0 max(16px, 6vw); padding: 0 0 34vh; }
.site-head, .title-block, .contents, .chapter, .outfits, .site-foot {
  position: relative; margin: 20px 0 0; padding: 22px 26px; border-radius: 6px;
  background: var(--paper); border: 1px solid #c9d1d5;
  box-shadow: 0 14px 30px rgb(30 45 60 / .18);
}
.site-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 18px; padding: 10px 18px; }
.masthead { display: flex; align-items: center; }
.masthead .brand { display: flex; align-items: center; min-height: 42px; }
.masthead .brand img { display: block; width: auto; height: 26px; }
.site-name { display: inline-flex; align-items: center; min-height: 42px; margin-left: 14px; padding-left: 14px; border-left: 1px solid #c9d1d5; color: var(--ink); font: 700 16px Arial, sans-serif; text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0 16px; font: 14px Arial, sans-serif; }
.site-nav a { display: inline-flex; align-items: center; min-height: 42px; color: var(--ink); text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }

.title-block { padding: 36px 28px 30px; border-top: 8px solid var(--blue); }
.edition { margin: 0; color: var(--blue); font: 700 12px Arial, sans-serif; letter-spacing: .2em; text-transform: uppercase; }
h1, h2 { margin: 0; font-family: var(--head); font-weight: 1000; font-synthesis: none; line-height: 1.04; letter-spacing: -.02em; }
.title { margin-top: 10px; font-size: clamp(42px, 7vw, 84px); color: #1b2f45; }
.subtitle { margin: 14px 0 0; max-width: 36ch; color: var(--dim); font-size: 20px; }

.contents-title { color: var(--dim); font: 700 12px Arial, sans-serif; letter-spacing: .2em; text-transform: uppercase; }
.contents-list { margin: 8px 0 0; padding-left: 1.4em; columns: 2 220px; }
.contents-list a { display: inline-block; padding: 3px 0; }

.chapter { padding-top: 28px; }
.chapter-title { font-size: clamp(26px, 3.2vw, 36px); color: #1b2f45; }
.chapter-num { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; margin-right: 8px; border: 2px solid var(--blue); border-radius: 50%; color: var(--blue); font-size: .62em; vertical-align: .14em; }
.chapter-body > :first-child { margin-top: 14px; }
.first { font-size: 19px; }
.plate { margin: 20px 0 6px; }
.plate img { display: block; width: 100%; border-radius: 4px; }
.plate figcaption { margin-top: 6px; color: var(--dim); font-style: italic; font-size: 14px; }
.tools { padding-left: 1.1em; }
.tools li { margin: 6px 0; }
.note { margin: 18px 0; padding: 14px 18px; border-left: 5px solid var(--blue); background: #eaf1f6; }
.note p { margin: 0; }
.rules { padding-left: 1.4em; }
.rules li { margin: 8px 0; }
.saying { margin: 22px 0 0; padding-left: 18px; border-left: 3px solid var(--blue); }
.saying p { margin: 0; font-size: 22px; font-style: italic; }
.saying footer { color: var(--dim); font: 14px Arial, sans-serif; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
caption { padding-bottom: 6px; color: var(--dim); font-style: italic; text-align: left; }
th, td { padding: 8px 10px 8px 0; border-bottom: 1px solid #d3dade; text-align: left; vertical-align: top; }
thead th { border-bottom: 2px solid var(--blue); font: 700 13px Arial, sans-serif; }
.hazards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 0; }
.hazard { padding: 12px 14px; border-radius: 6px; background: #f3f6f8; border: 1px solid #d3dade; }
.hazard dt { font-weight: 700; }
.hazard dd { margin: 2px 0 0; }
.glossary dt { margin-top: 10px; font-weight: 700; }
.glossary dd { margin: 0; }
.sign-off { font-style: italic; }

.outfits-title { font-size: clamp(28px, 3.4vw, 40px); color: #1b2f45; }
.outfits-lede { color: var(--dim); }
.outfit-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.outfit { padding: 8px 12px; border-radius: 6px; background: #f3f6f8; border: 1px solid #d3dade; font-size: 14px; }
.outfit-link { display: inline-block; padding: 2px 0; font-weight: 700; }
.outfit-by, .outfit-note, .outfit-technique { display: none; }
#th-teacup { background: #1b2f45; border-color: #1b2f45; }
#th-teacup .outfit-link { color: #fff; }
#th-teacup .outfit-link::after { content: " · in the cup now"; color: #d6e2ee; font-weight: 400; }

.site-foot { color: var(--dim); font-size: 14px; }
.site-foot p { margin: 4px 0; }

@media (max-width: 1100px) { :root { --cx: 82vw; } }
@media (max-width: 720px) {
  :root { --cx: 50vw; }
  .page { margin: 0 12px; padding-bottom: 36vh; }
  .site-head, .title-block, .contents, .chapter, .outfits, .site-foot { padding: 18px 16px; }
  .extra-1 { height: 24vh; }
  .extra-2 { bottom: calc(24vh + 70px); }
  .extra-3 { bottom: calc(24vh - 66px); }
  .extra-4 { bottom: calc(24vh - 10px); }
}

/* moving between outfits: a cross-document view transition where the browser has them (Chromium did, Firefox did not, when check.mjs last ran), with the
   masthead and the title carried across; an ordinary page load elsewhere, and under reduced motion */
@view-transition { navigation: auto; }
.masthead { view-transition-name: masthead; }
.title { view-transition-name: manual-title; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
