/* The cat under the blanket: one screen covered by a wool blanket drawn on a canvas.
   The brand, the links and the captions are small sewn-on tags in ordinary HTML, flat on top of it. */
:root {
  --camel: #b98a5a;
  --cream: #efe3cc;
  --ink: #2a1a12;
  --edge: clamp(16px, 4.4vw, 64px);   /* the margin of the tags */
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--camel);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.bed {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

/* a finger on the blanket moves what is under it, in any direction; pinching still zooms */
.bed__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: pinch-zoom;
}

/* ---------------------------------------------------------------- the tags: brand, links, captions */
.bar,
.foot {
  position: absolute;
  left: var(--edge);
  right: var(--edge);
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}
.bar {
  top: clamp(16px, 4vh, 40px);
}
.foot {
  bottom: clamp(16px, 4vh, 40px);
  align-items: flex-end;
}
/* a woven label: cream cloth, a line of stitches just inside the edge */
.tag {
  margin: 0;
  padding: 9px 13px 8px;
  border-radius: 3px;
  background: var(--cream);
  outline: 1px dashed rgba(42, 26, 18, 0.42);
  outline-offset: -4px;
  box-shadow: 0 1px 0 rgba(42, 26, 18, 0.28), 0 6px 14px rgba(42, 26, 18, 0.16);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  animation: sewn 0.7s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.bar__nav {
  animation-delay: 0.08s;
}
.foot .tag:first-child {
  animation-delay: 0.16s;
}
.foot .tag:last-child {
  animation-delay: 0.24s;
}
@keyframes sewn {
  from {
    opacity: 0;
    transform: translateY(10px) rotate(-2deg);
  }
}
.brand {
  font-family: 'Fraunces Variable', Georgia, serif;
  font-size: 17px;
  font-weight: 640;
  letter-spacing: 0;
  text-transform: none;
}
.bar__nav {
  display: flex;
  gap: 16px;
  pointer-events: auto;
}
.bar__nav a {
  position: relative;
  color: inherit;
  text-decoration: none;
  transition: color 0.25s ease-out;
  -webkit-tap-highlight-color: transparent;
}
.bar__nav a::before {
  content: '';
  position: absolute;
  inset: -12px -8px;
}
.bar__nav a:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}
@media (hover: hover) {
  .bar__nav a:hover {
    color: #a8432a;
  }
}

/* ---------------------------------------------------------------- the words: for readers only while the canvas paints them */
.words {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- without WebGL: a flat check in CSS, and the words as HTML */
.is-flat .bed__canvas {
  display: none;
}
.is-flat {
  background:
    repeating-linear-gradient(90deg, rgba(168, 67, 42, 0.55) 0 32px, transparent 32px 96px, rgba(239, 227, 204, 0.6) 96px 104px, transparent 104px 256px),
    repeating-linear-gradient(0deg, rgba(168, 67, 42, 0.55) 0 32px, transparent 32px 96px, rgba(239, 227, 204, 0.6) 96px 104px, transparent 104px 256px),
    var(--camel);
}
.is-flat .words {
  left: var(--edge);
  right: var(--edge);
  bottom: 22%;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip-path: none;
  white-space: normal;
}
.is-flat .words__title {
  max-width: 11em;
  margin: 0 0 0.3em;
  font-family: 'Fraunces Variable', Georgia, serif;
  font-size: clamp(40px, 7.8vw, 118px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.03em;
}
.is-flat .words__line {
  max-width: 30em;
  margin: 0;
  font-family: 'Fraunces Variable', Georgia, serif;
  font-size: clamp(16px, 1.7vw, 24px);
  font-style: italic;
}

@media (prefers-reduced-motion: reduce) {
  .tag {
    animation: none;
  }
}

/* ---------------------------------------------------------------- phone */
@media (max-width: 650px) {
  .bar__nav {
    gap: 11px;
  }
  .foot .tag:last-child {
    display: none;
  }
}
