/* The coffee background with the steam the pointer swirls: the first screen of an invented coffee house. The photo is a
   plain <img>; over it a WebGL canvas draws only the steam, transparent everywhere else; then a shade for the words,
   a still grain, and the words themselves. Without WebGL the photo and its own faint steam stay. */
:root {
  --wall: #4c4544;          /* the wall behind the cup: the page under the photo */
  --wall-deep: #2a2423;     /* the corners, darker */
  --espresso: #1a1311;      /* the darkest brown: shade, words on the button */
  --steam: #f7efe6;         /* the colour of the steam */
  --crema: #e7ad74;         /* the accent: the light on the crema */
  --ink: #f6efe7;           /* the words */
  --ink-soft: #d6cabd;      /* the small words */
  --line: rgba(255, 244, 232, 0.16);
  --cta: #f6efe7;           /* the button */
  --serif: "Fraunces Variable", Georgia, serif;
  --sans: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  /* the photo: as wide as the page, but never shorter than 80 % of it, so on a tall screen the wall goes on above */
  --ph: max(66.667vw, 80vh);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--wall-deep);
  color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.stage {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 300px;
  overflow: hidden;
  isolation: isolate;
  touch-action: none;
  background: radial-gradient(120% 90% at 46% 30%, var(--wall) 0%, #3d3736 55%, var(--wall-deep) 100%);
}

/* bottom-anchored; when it is taller than the page it is cut 40 % above and 60 % below, so the cup stays low */
.photo {
  position: absolute;
  z-index: -4;
  height: var(--ph);
  width: calc(var(--ph) * 1.5);
  left: calc(50% - var(--ph) * 0.75);
  top: max(100vh - var(--ph), (100vh - var(--ph)) * 0.4);
  /* its top edge melts into the wall, so the page can be taller than the photo */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 16%);
}

.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: 46% 45%;
  /* the photo is matte: a little more depth and warmth, still */
  filter: contrast(1.12) saturate(1.12) brightness(0.86) sepia(0.08);
}

.steam {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
  display: block;
  pointer-events: none;
  opacity: 0;
}

/* dark at the top for the bar, dark at the bottom for the buttons, a soft vignette in the corners */
.shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(26, 19, 17, 0.55) 0%, rgba(26, 19, 17, 0) 22%),
    linear-gradient(to top, rgba(26, 19, 17, 0.82) 0%, rgba(26, 19, 17, 0.35) 18%, rgba(26, 19, 17, 0) 34%),
    radial-gradient(130% 100% at 50% 45%, transparent 55%, rgba(18, 13, 12, 0.55) 100%);
}

.grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------------------------------------------------------------- the bar on top */
.nav {
  position: absolute;
  top: clamp(10px, 2.6vh, 24px);
  left: clamp(14px, 4vw, 44px);
  right: clamp(14px, 4vw, 44px);
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: clamp(12px, 1.7vh, 14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}

.brand__mark {
  width: clamp(18px, 2.8vh, 22px);
  height: clamp(18px, 2.8vh, 22px);
  fill: none;
  stroke: var(--crema);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.brand__name {
  font-family: var(--serif);
  font-size: clamp(16px, 2.6vh, 20px);
  font-variation-settings: "opsz" 72, "SOFT" 100, "WONK" 0;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.links {
  display: flex;
  gap: clamp(14px, 2.4vw, 28px);
  color: var(--ink-soft);
}

.links a { transition: color 0.3s; }

@media (hover: hover) {
  .links a:hover { color: var(--crema); }
}

.order {
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 244, 232, 0.07);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-weight: 500;
  transition: background 0.3s;
}

@media (hover: hover) {
  .order:hover { background: rgba(255, 244, 232, 0.14); }
}

/* ---------------------------------------------------------------- the headline, above the cup */
.head {
  position: absolute;
  left: 50%;
  top: clamp(50px, 9vh, 88px);
  width: min(760px, 100% - 28px);
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(8px, 1.8vh, 18px);
  pointer-events: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 3px;
  border-radius: 999px;
  background: rgba(26, 19, 17, 0.42);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 8px 22px -12px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: clamp(11px, 1.6vh, 13px);
  color: var(--ink-soft);
  white-space: nowrap;
  max-width: 100%;
  pointer-events: auto;
}

.pill__text { overflow: hidden; text-overflow: ellipsis; }

.pill__tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--crema);
  color: var(--espresso);
  font-weight: 600;
}

.pill__arrow {
  flex: none;
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.title {
  font-family: var(--serif);
  font-size: clamp(30px, min(9vw, 7.8vh), 84px);
  line-height: 0.98;
  font-weight: 420;
  font-variation-settings: "opsz" 144, "SOFT" 60, "WONK" 0;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-shadow: 0 2px 28px rgba(26, 19, 17, 0.55), 0 0 1px rgba(26, 19, 17, 0.4);
}

.title em {
  font-style: italic;
  font-weight: 360;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  color: #f3cfa6;
}

/* ---------------------------------------------------------------- the line and the buttons, under the saucer */
.foot {
  position: absolute;
  left: clamp(14px, 4vw, 44px);
  right: clamp(14px, 4vw, 44px);
  bottom: clamp(12px, 3.4vh, 34px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.lede {
  max-width: 36ch;
  font-size: clamp(12px, 1.8vh, 15px);
  line-height: 1.5;
  color: var(--ink-soft);
  text-shadow: 0 1px 12px rgba(26, 19, 17, 0.9);
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

/* the site's elastic pill: the words widen on the wdth axis, the body swells with a bounce */
.cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: clamp(36px, 5.6vh, 46px);
  padding: 0 clamp(14px, 2.2vh, 20px);
  border: 0;
  background: none;
  color: var(--espresso);
  font: inherit;
  font-size: clamp(12px, 1.8vh, 15px);
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
}

.cta__fill {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 999px;
  background: linear-gradient(180deg, #fffaf4 0%, var(--cta) 55%, #eadccd 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(120, 80, 50, 0.18),
    0 1px 2px rgba(0, 0, 0, 0.3),
    0 12px 30px -12px rgba(231, 173, 116, 0.55);
}

.cta__label {
  font-stretch: 100%;
  transition: font-stretch 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (hover: hover) {
  .cta:hover .cta__label { font-stretch: 112%; }
}

.cta__arrow {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cta:focus-visible { outline: 2px solid var(--crema); outline-offset: 3px; border-radius: 999px; }

.ghost-btn {
  display: inline-flex;
  align-items: center;
  height: clamp(36px, 5.6vh, 46px);
  padding: 0 clamp(14px, 2.2vh, 20px);
  border-radius: 999px;
  background: rgba(255, 244, 232, 0.07);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: clamp(12px, 1.8vh, 15px);
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.3s;
}

@media (hover: hover) {
  .ghost-btn:hover { background: rgba(255, 244, 232, 0.14); }
}

/* the hint, at the side of the steam; it leaves at the first real touch */
.hint {
  position: absolute;
  right: clamp(14px, 4vw, 44px);
  top: 50%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(11px, 1.6vh, 13px);
  color: var(--ink-soft);
  text-shadow: 0 1px 10px rgba(26, 19, 17, 0.9);
  pointer-events: none;
}

.hint svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--crema);
  stroke-width: 1.4;
  stroke-linecap: round;
}

.ghost {
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  pointer-events: none;
  opacity: 0;
  fill: #fff;
  stroke: #000;
  stroke-width: 1;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
  z-index: 5;
}

/* narrow pages: the links and the line go, the buttons sit in the middle */
@media (max-width: 640px) {
  .links, .lede, .hint { display: none; }
  .foot { justify-content: center; }
}

@media (max-height: 460px) {
  .lede { display: none; }
  .foot { justify-content: center; }
}
