/* The background of sunset light through linen curtains: the hero of a linen house on a plaster wall at the end of
   the day. The WebGL canvas fills the stage and draws the wall, the low sun through the curtains, the weave, the gap
   with the window bars and the beams in the air; a second canvas carries the dust that glints in the beams. The words
   sit on the left, in the shade, and cast a faint shadow turned by the sun. Without WebGL a CSS patch of light remains. */
:root {
  --shade: #c7ad9d;         /* the wall in the shade, a dusky plaster */
  --sun: #ffdcae;           /* the low sun on the wall */
  --dusk: #ff9a63;          /* the warmer, rosier sun as it sinks */
  --linen: #f3dcc0;         /* the tint the light takes through the linen */
  --cool: #a99aa0;          /* the cool tint inside the shadows */
  --ink: #2b1d17;           /* the heading */
  --muted: #6b5146;         /* the small words */
  --line: rgba(43, 29, 23, 0.14); /* thin edges */
  --clay: #7c3a22;          /* the button, a burnt clay */
  --clay-ink: #fbefe3;      /* the words on the button */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  background: var(--shade);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stage {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 320px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  isolation: isolate;
  background: var(--shade);
  --sx: -3px;
  --sy: 3px;
}

.wall,
.dust {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.wall {
  z-index: 0;
}

.dust {
  z-index: 1;
}

/* the light without WebGL: soft bands like folds */
.patch {
  position: absolute;
  inset: 4% 2% 10% 30%;
  z-index: 0;
  display: none;
  background:
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(120, 80, 60, 0.16) 34px, transparent 48px),
    linear-gradient(100deg, transparent 0 6%, color-mix(in srgb, var(--sun) 78%, transparent) 14% 88%, transparent 96%);
  transform: skewX(18deg);
  filter: blur(5px);
}

.no-gl .patch {
  display: block;
}

.bar,
.hero,
.hint {
  position: relative;
  z-index: 2;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(12px, 3vh, 22px) clamp(16px, 4vw, 44px) 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'Newsreader Variable', Georgia, serif;
  font-size: 20px;
  font-weight: 460;
  font-variation-settings: 'opsz' 36;
  letter-spacing: -0.01em;
}

.brand__mark {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--clay);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s, background-color 0.3s;
}

.nav__link--pill {
  color: var(--ink);
  background: rgba(255, 246, 236, 0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

@media (hover: hover) {
  .nav__link:hover {
    color: var(--ink);
  }
  .nav__link--pill:hover {
    background: rgba(255, 246, 236, 0.7);
  }
}

/* the words sit on the left, in the shade of the room, so the light has the right of the wall to itself */
.hero {
  align-self: center;
  width: min(100%, 640px);
  padding: 0 clamp(16px, 4vw, 44px);
  margin-left: clamp(0px, 4vw, 60px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  background: rgba(255, 246, 236, 0.42);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 6px 18px -10px rgba(70, 40, 25, 0.35);
  transition: color 0.3s;
}

.chip__new {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 620;
  letter-spacing: 0.02em;
  color: var(--clay-ink);
  background: var(--clay);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.chip__arrow {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (hover: hover) {
  .chip:hover {
    color: var(--ink);
  }
  .chip:hover .chip__arrow {
    transform: translateX(2px);
  }
}

/* the heading: Newsreader at a large optical size; its faint shadow turns with the sun (--sx, --sy from the script) */
.title {
  margin: clamp(10px, 2.6vh, 20px) 0 0;
  font-family: 'Newsreader Variable', Georgia, serif;
  font-size: clamp(30px, min(8.6vw, 9.4vh), 82px);
  line-height: 1.02;
  font-weight: 360;
  font-variation-settings: 'opsz' 72;
  letter-spacing: -0.025em;
  text-shadow: var(--sx) var(--sy) 8px rgba(80, 40, 20, 0.16);
}

.title__line {
  display: inline-block;
}

.title__line:last-child {
  font-style: italic;
  font-weight: 330;
}

.lede {
  margin: clamp(10px, 2.2vh, 16px) 0 0;
  max-width: 38ch;
  font-size: clamp(13px, min(3.6vw, 2.2vh), 16px);
  line-height: 1.5;
  color: var(--muted);
}

.actions {
  margin-top: clamp(14px, 3.4vh, 26px);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  position: relative;
  height: clamp(42px, 7vh, 52px);
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--clay-ink);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* the face: burnt clay with a lit top edge and a two-layer shadow cast away from the sun */
.btn__face {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 100%;
  padding: 0 clamp(16px, 4.4vw, 22px);
  border-radius: inherit;
  overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--clay) 84%, #ffd9b0), var(--clay) 58%, color-mix(in srgb, var(--clay) 86%, #000));
  box-shadow:
    inset 0 1px 0 rgba(255, 228, 200, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 1px 2px rgba(50, 20, 10, 0.25),
    calc(var(--sx) * 2) calc(var(--sy) * 2.4) 22px -8px rgba(70, 30, 15, 0.5);
}

/* a soft band of sunset that slides across the face when it is pressed */
.btn__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 210, 160, 0.32) 48%, transparent 66%);
  transform: translateX(-110%);
  pointer-events: none;
}

.btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.btn__words {
  position: relative;
  font-size: 14.5px;
  font-weight: 600;
  font-variation-settings: 'wdth' 100;
  white-space: nowrap;
  transition: font-variation-settings 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (hover: hover) {
  .btn:hover .btn__words {
    font-variation-settings: 'wdth' 110;
  }
}

.btn__icon {
  position: relative;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.btn__check {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.ghost {
  height: clamp(42px, 7vh, 52px);
  display: inline-flex;
  align-items: center;
  padding: 0 clamp(14px, 4vw, 20px);
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 540;
  color: var(--ink);
  text-decoration: none;
  background: rgba(255, 246, 236, 0.34);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: background-color 0.3s, box-shadow 0.3s;
}

@media (hover: hover) {
  .ghost:hover {
    background: rgba(255, 246, 236, 0.65);
    box-shadow: inset 0 0 0 1px rgba(43, 29, 23, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  }
}

/* the note: four little linen swatches that lift one by one when the swatches are ordered */
.note {
  margin: clamp(10px, 2vh, 14px) 0 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  color: color-mix(in srgb, var(--muted) 88%, transparent);
  letter-spacing: 0.01em;
}

.swatches {
  display: inline-flex;
  gap: 3px;
}

.swatches span {
  width: 11px;
  height: 14px;
  border-radius: 2.5px;
  box-shadow: inset 0 0 0 1px rgba(43, 29, 23, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 2px 4px -2px rgba(60, 30, 15, 0.4);
  background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.06) 0 1px, transparent 1px 2px);
}

.swatches span:nth-child(1) { background-color: #efe3d1; }
.swatches span:nth-child(2) { background-color: #c9a26b; }
.swatches span:nth-child(3) { background-color: #b5653c; }
.swatches span:nth-child(4) { background-color: #7d806a; }

.hint {
  margin: 0;
  padding: 0 16px clamp(10px, 3vh, 22px);
  text-align: center;
  font-size: 11.5px;
  color: color-mix(in srgb, var(--muted) 75%, transparent);
  letter-spacing: 0.01em;
}

@media (max-height: 480px) {
  .hint {
    display: none;
  }
}

@media (max-height: 420px) {
  .note {
    display: none;
  }
}

@media (max-width: 520px) {
  .nav__link--wide {
    display: none;
  }
}

[data-in],
.title__line {
  opacity: 0;
}
