/* One sheet of paper with iron filings on it. Every product is a magnet on the
   sheet; field.js turns the filings. One visual world, so one theme. */
:root {
  color-scheme: light;
  --paper: #f5f0e6;
  --slip: #fffdf8;
  --ink: #2a2926;
  --ink-2: #6e6a61;
  --focus: #9a5543;
  --font:
    "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial,
    sans-serif;
  --gutter: clamp(16px, 4.5vw, 64px);
  /* The stage keeps 16:9 and always fits under the header on a desktop. */
  --stage: min(100%, 1500px, max(880px, calc((100dvh - 190px) * 16 / 9)));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  background: var(--paper);
}
body {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font: 400 1rem/1.55 var(--font);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  background:
    url("paper/washi-light.jpg") 0 0 / 512px repeat,
    var(--paper);
}
img {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}
p,
h1 {
  margin: 0;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
  border-radius: 8px;
}

.field {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.top,
.main,
.foot {
  position: relative;
  z-index: 1;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.wrap {
  width: var(--stage);
  margin-inline: auto;
}

/* Header */
.top {
  z-index: 2;
  padding-block: 20px;
}
.top-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.seal {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--slip);
  box-shadow:
    0 1px 1px rgb(40 28 14 / 0.2),
    3px 6px 10px -4px rgb(40 28 14 / 0.3);
}
.seal img {
  width: 30px;
  height: 30px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 0.9375rem;
  font-weight: 500;
}
.nav > a,
.signin > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding-inline: 14px;
  border-radius: 8px;
  color: var(--ink-2);
  text-decoration: none;
  cursor: pointer;
  transition:
    color 0.15s ease,
    background-color 0.15s ease;
}
.nav > a:hover,
.signin > summary:hover,
.signin[open] > summary {
  color: var(--ink);
  background: rgb(42 41 38 / 0.07);
}
.signin {
  position: relative;
}
.signin > summary {
  list-style: none;
}
.signin > summary::-webkit-details-marker {
  display: none;
}
.signin svg {
  width: 12px;
  height: 12px;
  transition: transform 0.15s ease;
}
.signin[open] svg {
  transform: rotate(180deg);
}
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  display: grid;
  min-width: 220px;
  padding: 6px;
  border-radius: 6px;
  background: var(--slip);
  box-shadow:
    0 1px 2px rgb(40 28 14 / 0.2),
    0 22px 44px -18px rgb(40 28 14 / 0.45);
}
.menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 6px 10px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
}
.menu a:hover {
  background: rgb(42 41 38 / 0.07);
}
.menu img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}
.skip {
  position: absolute;
  top: 0;
  left: 16px;
  z-index: 10;
  transform: translateY(-150%);
  padding: 12px;
  background: var(--ink);
  color: var(--paper);
}
.skip:focus {
  transform: translateY(0);
}

/* Footer */
.foot {
  padding-block: 14px 26px;
  font-size: 0.8125rem;
  color: var(--ink-2);
}
.foot-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 28px;
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
}
.foot a {
  text-decoration: none;
}
.foot a:hover,
.scatter:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.scatter {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
